mirror of
				https://git.code.sf.net/p/seeddms/code
				synced 2025-10-30 20:51:22 +00:00 
			
		
		
		
	backport printVersionAttributes(), nicer output of reviewers and approvers
This commit is contained in:
		
							parent
							
								
									fe4e0c644c
								
							
						
					
					
						commit
						ca1dce466d
					
				|  | @ -98,6 +98,23 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| <?php | ||||
| 	} /* }}} */ | ||||
| 
 | ||||
| 	protected function printVersionAttributes($folder, $version) { /* {{{ */ | ||||
| 			$attributes = $version->getAttributes(); | ||||
| 			if($attributes) { | ||||
| 				foreach($attributes as $attribute) { | ||||
| 					$arr = $this->callHook('showDocumentContentAttribute', $version, $attribute); | ||||
| 					if(is_array($arr)) { | ||||
| 						print "<li>".$arr[0].": ".$arr[1]."</li>\n"; | ||||
| 					} else { | ||||
| 						$attrdef = $attribute->getAttributeDefinition(); | ||||
| 						print "<li>".htmlspecialchars($attrdef->getName()).": "; | ||||
| 						$this->printAttributeValue($attribute); | ||||
| 						echo "</li>\n"; | ||||
| 					} | ||||
| 				} | ||||
| 			} | ||||
| 	} /* }}} */ | ||||
| 
 | ||||
| 	function documentListItem() { /* {{{ */ | ||||
| 		$dms = $this->params['dms']; | ||||
| 		$user = $this->params['user']; | ||||
|  | @ -623,18 +640,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 				print "<p style=\"font-style: italic;\">".htmlspecialchars($latestContent->getComment())."</p>"; | ||||
| 		} | ||||
| 		print "<ul class=\"actions unstyled\">\n"; | ||||
| 		$attributes = $latestContent->getAttributes(); | ||||
| 		if($attributes) { | ||||
| 			foreach($attributes as $attribute) { | ||||
| 				$arr = $this->callHook('showDocumentContentAttribute', $latestContent, $attribute); | ||||
| 				if(is_array($arr)) { | ||||
| 					print "<li>".$arr[0].": ".$arr[1]."</li>\n"; | ||||
| 				} else { | ||||
| 					$attrdef = $attribute->getAttributeDefinition(); | ||||
| 					print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n"; | ||||
| 				} | ||||
| 			} | ||||
| 		} | ||||
| 		$this->printVersionAttributes($folder, $latestContent); | ||||
| 		print "</ul></td>\n"; | ||||
| 
 | ||||
| 		print "<td width='10%'>"; | ||||
|  | @ -784,6 +790,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 			print "</tr>\n"; | ||||
| 
 | ||||
| 			foreach ($reviewStatus as $r) { | ||||
| 				$class = ''; | ||||
| 				switch($r['status']) { | ||||
| 				case '-1': | ||||
| 					$class = 'error'; | ||||
| 					break; | ||||
| 				case '1': | ||||
| 					$class = 'success'; | ||||
| 					break; | ||||
| 				} | ||||
| 				$required = null; | ||||
| 				$is_reviewer = false; | ||||
| 				$accesserr = ''; | ||||
|  | @ -822,7 +837,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 						} | ||||
| 						break; | ||||
| 				} | ||||
| 				print "<tr".($r['status'] == 1 ? ' class="success"' : ($r['status'] == -1 ? ' class="error"' : '')).">\n"; | ||||
| 				print "<tr>\n"; | ||||
| 				print "<td>".$reqName."</td>\n"; | ||||
| 				print "<td><i style=\"font-size: 80%;\">".$r["date"]." - "; | ||||
| 				/* $updateUser is the user who has done the review */ | ||||
|  | @ -834,10 +849,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 					echo "<a href=\"../op/op.Download.php?documentid=".$documentid."&reviewlogid=".$r['reviewLogID']."\" class=\"btn btn-mini\"><i class=\"fa fa-download\"></i> ".getMLText('download')."</a>"; | ||||
| 				} | ||||
| 				print "</td>\n"; | ||||
| 				print "<td>".getReviewStatusText($r["status"])."</td>\n"; | ||||
| 					print "<td>"; | ||||
| 					if($class) | ||||
| 						echo "<i class=\"fa fa-circle text-".$class."\"></i> "; | ||||
| 					print getReviewStatusText($r["status"])."</td>\n"; | ||||
| 				print "<td><ul class=\"unstyled\">"; | ||||
| 				if($accesserr) | ||||
| 					echo "<li><span class=\"alert alert-error\">".$accesserr."</span></li>"; | ||||
| 						echo "<li><span class=\"text-error\">".$accesserr."</span></li>"; | ||||
| 
 | ||||
| 				if($accessop->mayReview()) { | ||||
| 					if ($is_reviewer) { | ||||
|  | @ -872,6 +890,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 			print "</tr>\n"; | ||||
| 
 | ||||
| 			foreach ($approvalStatus as $a) { | ||||
| 				$class = ''; | ||||
| 				switch($a['status']) { | ||||
| 				case '-1': | ||||
| 					$class = 'error'; | ||||
| 					break; | ||||
| 				case '1': | ||||
| 					$class = 'success'; | ||||
| 					break; | ||||
| 				} | ||||
| 				$required = null; | ||||
| 				$is_approver = false; | ||||
| 				$accesserr = ''; | ||||
|  | @ -910,7 +937,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 						} | ||||
| 						break; | ||||
| 				} | ||||
| 				print "<tr".($a['status'] == 1 ? ' class="success"' : ($a['status'] == -1 ? ' class="error"' : ($a['status'] == -2 ? ' class=""' : ''))).">\n"; | ||||
| 				print "<tr>\n"; | ||||
| 				print "<td>".$reqName."</td>\n"; | ||||
| 				print "<td><i style=\"font-size: 80%;\">".$a["date"]." - "; | ||||
| 				/* $updateUser is the user who has done the approval */ | ||||
|  | @ -922,10 +949,13 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 					echo "<a href=\"../op/op.Download.php?documentid=".$documentid."&approvelogid=".$a['approveLogID']."\" class=\"btn btn-mini\"><i class=\"fa fa-download\"></i> ".getMLText('download')."</a>"; | ||||
| 				} | ||||
| 				echo "</td>\n"; | ||||
| 				print "<td>".getApprovalStatusText($a["status"])."</td>\n"; | ||||
| 					print "<td>"; | ||||
| 					if($class) | ||||
| 						echo "<i class=\"fa fa-circle text-".$class."\"></i> "; | ||||
| 					print getApprovalStatusText($a["status"])."</td>\n"; | ||||
| 				print "<td><ul class=\"unstyled\">"; | ||||
| 				if($accesserr) | ||||
| 					echo "<li><span class=\"alert alert-error\">".$accesserr."</span></li>"; | ||||
| 						echo "<li><span class=\"text-error\">".$accesserr."</span></li>"; | ||||
| 
 | ||||
| 				if($accessop->mayApprove()) { | ||||
| 					if ($is_approver) { | ||||
|  | @ -938,7 +968,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 				} | ||||
| 
 | ||||
| 				print "</ul>"; | ||||
| 				print "</td>\n</tr>\n"; | ||||
| 				print "</td>\n"; | ||||
| 				print "</tr>\n"; | ||||
| 			} | ||||
| 		} | ||||
| 
 | ||||
|  | @ -947,7 +978,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 		print "</div>"; | ||||
| 		print "</div>"; | ||||
| 
 | ||||
| 		if($user->isAdmin()) { | ||||
| 		if($user->isAdmin() || $user->getId() == $document->getOwner()->getId()) { | ||||
| ?>
 | ||||
| 			<div class="row-fluid"> | ||||
| <?php | ||||
|  | @ -1250,18 +1281,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { | |||
| 						print "<p style=\"font-style: italic;\">".htmlspecialchars($version->getComment())."</p>"; | ||||
| 				} | ||||
| 				print "<ul class=\"actions unstyled\">\n"; | ||||
| 				$attributes = $version->getAttributes(); | ||||
| 				if($attributes) { | ||||
| 					foreach($attributes as $attribute) { | ||||
| 						$arr = $this->callHook('showDocumentContentAttribute', $version, $attribute); | ||||
| 						if(is_array($arr)) { | ||||
| 							print "<li>".$arr[0].": ".$arr[1]."</li>\n"; | ||||
| 						} else { | ||||
| 							$attrdef = $attribute->getAttributeDefinition(); | ||||
| 							print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n"; | ||||
| 						} | ||||
| 					} | ||||
| 				} | ||||
| 				$this->printVersionAttributes($folder, $version); | ||||
| 				print "</ul></td>\n"; | ||||
| //				print "<td>".htmlspecialchars($version->getComment())."</td>";
 | ||||
| 				print "<td>".getOverallStatusText($vstat["status"])."</td>"; | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user
	 Uwe Steinmann
						Uwe Steinmann