mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-31 05:11:27 +00:00 
			
		
		
		
	sync with layout of ViewDocument
This commit is contained in:
		
							parent
							
								
									9132e28052
								
							
						
					
					
						commit
						6f8f56ad4b
					
				|  | @ -46,6 +46,41 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style { | |||
| <?php | ||||
| 	} /* }}} */ | ||||
| 
 | ||||
| 	/* This is a copy from ViewDocuments */ | ||||
| 	protected function showActions($items) { /* {{{ */ | ||||
| 		print "<ul class=\"action-list nav nav-pills mb-4\">"; | ||||
| 		foreach($items as $item) { | ||||
| 			if(is_string($item)) | ||||
| 				echo "<li class=\"nav-item\">".$item."</li>"; | ||||
| 			elseif(is_array($item)) { | ||||
| 				echo "<li class=\"nav-item m-1\"><a class=\"_nav-link btn btn-mini btn-outline-primary btn-sm".(!empty($item['class']) ? ' '. $item['class'] : '')."\"".(isset($item['link']) ? " href=\"".$item['link']."\"" : '').(!empty($item['target']) ? ' target="'.$item['target'].'"' : '').(!empty($item['title']) ? ' title="'.getMLText($item['title']).'"' : ''); | ||||
| 				if(!empty($item['attributes'])) { | ||||
| 					foreach($item['attributes'] as $attr) { | ||||
| 						echo ' '.$attr[0].'="'.$attr[1].'"'; | ||||
| 					} | ||||
| 				} | ||||
| 				echo ">".(!empty($item['icon']) ? "<i class=\"fa fa-".$item['icon']."\"></i> " : "").'<span class="d-none d-lg-inline">'.getMLText($item['label'])."</span></a></li>"; | ||||
| 			} | ||||
| 		} | ||||
| 		print "</ul>"; | ||||
| 		return; | ||||
| 		print "<ul class=\"unstyled actions\">"; | ||||
| 		foreach($items as $item) { | ||||
| 			if(is_string($item)) | ||||
| 				echo "<li>".$item."</li>"; | ||||
| 			elseif(is_array($item)) { | ||||
| 				echo "<li><a href=\"".$item['link']."\"".(!empty($item['target']) ? ' target="'.$item['target'].'"' : ''); | ||||
| 				if(!empty($item['attributes'])) { | ||||
| 					foreach($item['attributes'] as $attr) { | ||||
| 						echo ' '.$attr[0].'="'.$attr[1].'"'; | ||||
| 					} | ||||
| 				} | ||||
| 				echo ">".(!empty($item['icon']) ? "<i class=\"fa fa-".$item['icon']."\"></i>" : "").getMLText($item['label'])."</a></li>"; | ||||
| 			} | ||||
| 		} | ||||
| 		print "</ul>"; | ||||
| 	} /* }}} */ | ||||
| 
 | ||||
| 	function preview() { /* {{{ */ | ||||
| 		$dms = $this->params['dms']; | ||||
| 		$document = $this->params['document']; | ||||
|  | @ -139,7 +174,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style { | |||
| 		$user = $this->params['user']; | ||||
| 		$folder = $this->params['folder']; | ||||
| 		$document = $this->params['document']; | ||||
| 		$accessop = $this->params['accessobject']; | ||||
| 		$accessobject = $this->params['accessobject']; | ||||
| 		$version = $this->params['version']; | ||||
| 		$viewonlinefiletypes = $this->params['viewonlinefiletypes']; | ||||
| 		$enableversionmodification = $this->params['enableversionmodification']; | ||||
|  | @ -249,18 +284,20 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style { | |||
| 		$file_exists=file_exists($dms->contentDir . $version->getPath()); | ||||
| 
 | ||||
| 		$this->contentHeading(getMLText("details_version", array ("version" => $version->getVersion()))); | ||||
| 		$this->contentContainerStart(); | ||||
| 		print "<table class=\"table table-condensed\">"; | ||||
| 		print "<thead>\n<tr>\n"; | ||||
| 		print "<th colspan=\"2\">".htmlspecialchars($version->getOriginalFileName())."</th>\n"; | ||||
| //		$this->contentContainerStart();
 | ||||
| //		print "<table class=\"table table-condensed\">";
 | ||||
| //		print "<thead>\n<tr>\n";
 | ||||
| //		print "<th colspan=\"2\">".htmlspecialchars($version->getOriginalFileName())."</th>\n";
 | ||||
| //		print "<th width='25%'>".getMLText("comment")."</th>\n";
 | ||||
| 		print "<th width='20%'>".getMLText("status")."</th>\n"; | ||||
| 		print "<th width='25%'></th>\n"; | ||||
| 		print "</tr>\n</thead>\n<tbody>\n"; | ||||
| 		print "<tr>\n"; | ||||
| 		print "<td><ul class=\"unstyled\">"; | ||||
| //		print "<th width='20%'>".getMLText("status")."</th>\n";
 | ||||
| //		print "<th width='25%'></th>\n";
 | ||||
| //		print "</tr>\n</thead>\n<tbody>\n";
 | ||||
| //		print "<tr>\n";
 | ||||
| //		print "<td><ul class=\"unstyled\">";
 | ||||
| 
 | ||||
| 		print "</ul>"; | ||||
| //		print "</ul>";
 | ||||
| 		$this->rowStart(); | ||||
| 		$this->columnStart(3); | ||||
| 		$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidthdetail, $timeout, $xsendfile); | ||||
| 		if($conversionmgr) | ||||
| 			$previewer->setConversionMgr($conversionmgr); | ||||
|  | @ -282,9 +319,12 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style { | |||
| 		if ($file_exists) { | ||||
| 			print "</a>"; | ||||
| 		} | ||||
| 		print "</td>\n"; | ||||
| //		print "</td>\n";
 | ||||
| 
 | ||||
| 		print "<td><ul class=\"unstyled\">\n"; | ||||
| //		print "<td>";
 | ||||
| 		$this->columnEnd(); | ||||
| 		$this->columnStart(5); | ||||
| 		print "<ul class=\"unstyled\">\n"; | ||||
| 		print "<li>".getMLText('version').": ".$version->getVersion()."</li>\n"; | ||||
| 
 | ||||
| 		if ($file_exists) | ||||
|  | @ -316,50 +356,51 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style { | |||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		print "</ul></td>\n"; | ||||
| 
 | ||||
| 		print "<td width='10%'>"; | ||||
| 		print getOverallStatusText($status["status"]); | ||||
| 		print "<li>".getMLText('status').": ".getOverallStatusText($status["status"]); | ||||
| 		if ( $status["status"]==S_DRAFT_REV || $status["status"]==S_DRAFT_APP || $status["status"]==S_IN_WORKFLOW || $status["status"]==S_EXPIRED ){ | ||||
| 			print "<br><span".($document->hasExpired()?" class=\"warning\" ":"").">".(!$document->getExpires() ? getMLText("does_not_expire") : getMLText("expires").": ".getReadableDate($document->getExpires()))."</span>"; | ||||
| 		} | ||||
| 		print "</td>"; | ||||
| 		print "</li>"; | ||||
| 		print "</ul>"; | ||||
| //		print "</td>\n";
 | ||||
| 
 | ||||
| 		print "<td>"; | ||||
| //		print "<td width='10%'>";
 | ||||
| 		$this->columnEnd(); | ||||
| 		$this->columnStart(4); | ||||
| //		print "</td>";
 | ||||
| 
 | ||||
| //		print "<td>";
 | ||||
| 
 | ||||
| 		//if (($document->getAccessMode($user) >= M_READWRITE)) {
 | ||||
| 		if ($file_exists){ | ||||
| 			print "<ul class=\"actions unstyled\">"; | ||||
| 			print "<li><a href=\"../op/op.Download.php?documentid=".$document->getID()."&version=".$version->getVersion()."\" title=\"".htmlspecialchars($version->getMimeType())."\"><i class=\"fa fa-download\"></i> ".getMLText("download")."</a>"; | ||||
| 			if ($viewonlinefiletypes && (in_array(strtolower($version->getFileType()), $viewonlinefiletypes) || in_array(strtolower($version->getMimeType()), $viewonlinefiletypes))) | ||||
| 				print "<li><a target=\"_blank\" href=\"../op/op.ViewOnline.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-star\"></i> " . getMLText("view_online") . "</a>"; | ||||
| 			print "</ul>"; | ||||
| 		} | ||||
| 
 | ||||
| 		print "<ul class=\"actions unstyled\">"; | ||||
| 		if ($file_exists){ | ||||
| 			if($accessop->mayEditVersion()) { | ||||
| 				print "<li><a href=\"../out/out.EditOnline.php?documentid=".$document->getId()."&version=".$version->getVersion()."\"><i class=\"fa fa-edit\"></i>".getMLText("edit_version")."</a></li>"; | ||||
| 			$items = array(); | ||||
| 			if($accessobject->check_controller_access('Download', array('action'=>'version'))) | ||||
| 				$items[] = array('link'=>$this->params['settings']->_httpRoot."op/op.Download.php?documentid=".$version->getDocument()->getId()."&version=".$version->getVersion(), 'icon'=>'download', 'label'=>'download'); | ||||
| 			if($accessobject->check_controller_access('ViewOnline', array('action'=>'run'))) | ||||
| 				if ($viewonlinefiletypes && (in_array(strtolower($version->getFileType()), $viewonlinefiletypes) || in_array(strtolower($version->getMimeType()), $viewonlinefiletypes))) | ||||
| 					$items[] = array('link'=>$this->params['settings']->_httpRoot."op/op.ViewOnline.php?documentid=".$version->getDocument()->getId()."&version=". $version->getVersion(), 'icon'=>'eye', 'label'=>'view_online', 'target'=>'_blank'); | ||||
| 			if($newitems = $this->callHook('extraVersionViews', $version)) | ||||
| 				$items = array_merge($items, $newitems); | ||||
|             if($items) { | ||||
| 				$this->showActions($items); | ||||
| 			} | ||||
| 		} | ||||
| 		if($accessop->mayRemoveVersion()) { | ||||
| 			print "<li><a href=\"out.RemoveVersion.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-remove\"></i> ".getMLText("rm_version")."</a></li>"; | ||||
| 		} | ||||
| 		if($accessop->mayOverwriteStatus()) { | ||||
| 			print "<li><a href='../out/out.OverrideContentStatus.php?documentid=".$document->getID()."&version=".$version->getVersion()."'><i class=\"fa fa-align-justify\"></i>".getMLText("change_status")."</a></li>"; | ||||
| 		} | ||||
| 		if($accessop->mayEditComment()) { | ||||
| 			print "<li><a href=\"out.EditComment.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-comment\"></i> ".getMLText("edit_comment")."</a></li>"; | ||||
| 		} | ||||
| 		if($accessop->mayEditAttributes()) { | ||||
| 			print "<li><a href=\"out.EditAttributes.php?documentid=".$document->getID()."&version=".$version->getVersion()."\"><i class=\"fa fa-edit\"></i> ".getMLText("edit_attributes")."</a></li>"; | ||||
| 		} | ||||
| 		print "</ul>"; | ||||
| 
 | ||||
| 		echo "</td>"; | ||||
| 		print "</tr></tbody>\n</table>\n"; | ||||
| 		$items = array(); | ||||
| 		if($accessobject->mayRemoveVersion()) { | ||||
| 			$items[] = array('link'=>$this->html_url('RemoveVersion', array('documentid'=>$version->getDocument()->getId(),'version'=>$version->getVersion())), 'icon'=>'remove', 'label'=>'rm_version'); | ||||
| 		} | ||||
| 
 | ||||
| 		$this->contentContainerEnd(); | ||||
| 		if($newitems = $this->callHook('extraVersionActions', $version)) | ||||
| 			$items = array_merge($items, $newitems); | ||||
| 		if($items) { | ||||
| 			$this->showActions($items); | ||||
| 		} | ||||
| //		echo "</td>";
 | ||||
| //		print "</tr></tbody>\n</table>\n";
 | ||||
| 
 | ||||
| 		$this->columnEnd(); | ||||
| 		$this->rowEnd(); | ||||
| //		$this->contentContainerEnd();
 | ||||
| 
 | ||||
| 		$this->rowStart(); | ||||
| 		$this->columnStart(6); | ||||
|  | @ -554,7 +595,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style { | |||
| 			$this->contentContainerEnd(); | ||||
| 		} /* }}} */ | ||||
| 
 | ||||
| 		if($accessop->check_view_access($this, array('action'=>'statuslog'))) { | ||||
| 		if($accessobject->check_view_access($this, array('action'=>'statuslog'))) { | ||||
| 			$this->contentHeading(getMLText("status")); | ||||
| 			$this->contentContainerStart(); | ||||
| 			$statuslog = $version->getStatusLog(); | ||||
|  | @ -572,7 +613,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style { | |||
| 			$this->contentContainerEnd(); | ||||
| 		} | ||||
| 
 | ||||
| 		if($accessop->check_view_access($this, array('action'=>'finished_workflowlog'))) { | ||||
| 		if($accessobject->check_view_access($this, array('action'=>'finished_workflowlog'))) { | ||||
| 			$wkfalllogs = $version->getWorkflowLog(); | ||||
| 			if($wkfalllogs) { | ||||
| 				$this->contentHeading(getMLText("finished_workflow_log")); | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann