mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +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
|
<?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() { /* {{{ */
|
function documentListItem() { /* {{{ */
|
||||||
$dms = $this->params['dms'];
|
$dms = $this->params['dms'];
|
||||||
$user = $this->params['user'];
|
$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 "<p style=\"font-style: italic;\">".htmlspecialchars($latestContent->getComment())."</p>";
|
||||||
}
|
}
|
||||||
print "<ul class=\"actions unstyled\">\n";
|
print "<ul class=\"actions unstyled\">\n";
|
||||||
$attributes = $latestContent->getAttributes();
|
$this->printVersionAttributes($folder, $latestContent);
|
||||||
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";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</ul></td>\n";
|
print "</ul></td>\n";
|
||||||
|
|
||||||
print "<td width='10%'>";
|
print "<td width='10%'>";
|
||||||
|
@ -784,6 +790,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
foreach ($reviewStatus as $r) {
|
foreach ($reviewStatus as $r) {
|
||||||
|
$class = '';
|
||||||
|
switch($r['status']) {
|
||||||
|
case '-1':
|
||||||
|
$class = 'error';
|
||||||
|
break;
|
||||||
|
case '1':
|
||||||
|
$class = 'success';
|
||||||
|
break;
|
||||||
|
}
|
||||||
$required = null;
|
$required = null;
|
||||||
$is_reviewer = false;
|
$is_reviewer = false;
|
||||||
$accesserr = '';
|
$accesserr = '';
|
||||||
|
@ -822,7 +837,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
print "<tr".($r['status'] == 1 ? ' class="success"' : ($r['status'] == -1 ? ' class="error"' : '')).">\n";
|
print "<tr>\n";
|
||||||
print "<td>".$reqName."</td>\n";
|
print "<td>".$reqName."</td>\n";
|
||||||
print "<td><i style=\"font-size: 80%;\">".$r["date"]." - ";
|
print "<td><i style=\"font-size: 80%;\">".$r["date"]." - ";
|
||||||
/* $updateUser is the user who has done the review */
|
/* $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>";
|
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>\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\">";
|
print "<td><ul class=\"unstyled\">";
|
||||||
if($accesserr)
|
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($accessop->mayReview()) {
|
||||||
if ($is_reviewer) {
|
if ($is_reviewer) {
|
||||||
|
@ -872,6 +890,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
print "</tr>\n";
|
print "</tr>\n";
|
||||||
|
|
||||||
foreach ($approvalStatus as $a) {
|
foreach ($approvalStatus as $a) {
|
||||||
|
$class = '';
|
||||||
|
switch($a['status']) {
|
||||||
|
case '-1':
|
||||||
|
$class = 'error';
|
||||||
|
break;
|
||||||
|
case '1':
|
||||||
|
$class = 'success';
|
||||||
|
break;
|
||||||
|
}
|
||||||
$required = null;
|
$required = null;
|
||||||
$is_approver = false;
|
$is_approver = false;
|
||||||
$accesserr = '';
|
$accesserr = '';
|
||||||
|
@ -910,7 +937,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
break;
|
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>".$reqName."</td>\n";
|
||||||
print "<td><i style=\"font-size: 80%;\">".$a["date"]." - ";
|
print "<td><i style=\"font-size: 80%;\">".$a["date"]." - ";
|
||||||
/* $updateUser is the user who has done the approval */
|
/* $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 "<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";
|
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\">";
|
print "<td><ul class=\"unstyled\">";
|
||||||
if($accesserr)
|
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($accessop->mayApprove()) {
|
||||||
if ($is_approver) {
|
if ($is_approver) {
|
||||||
|
@ -938,7 +968,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
}
|
}
|
||||||
|
|
||||||
print "</ul>";
|
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>";
|
||||||
print "</div>";
|
print "</div>";
|
||||||
|
|
||||||
if($user->isAdmin()) {
|
if($user->isAdmin() || $user->getId() == $document->getOwner()->getId()) {
|
||||||
?>
|
?>
|
||||||
<div class="row-fluid">
|
<div class="row-fluid">
|
||||||
<?php
|
<?php
|
||||||
|
@ -1250,18 +1281,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
||||||
print "<p style=\"font-style: italic;\">".htmlspecialchars($version->getComment())."</p>";
|
print "<p style=\"font-style: italic;\">".htmlspecialchars($version->getComment())."</p>";
|
||||||
}
|
}
|
||||||
print "<ul class=\"actions unstyled\">\n";
|
print "<ul class=\"actions unstyled\">\n";
|
||||||
$attributes = $version->getAttributes();
|
$this->printVersionAttributes($folder, $version);
|
||||||
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";
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
print "</ul></td>\n";
|
print "</ul></td>\n";
|
||||||
// print "<td>".htmlspecialchars($version->getComment())."</td>";
|
// print "<td>".htmlspecialchars($version->getComment())."</td>";
|
||||||
print "<td>".getOverallStatusText($vstat["status"])."</td>";
|
print "<td>".getOverallStatusText($vstat["status"])."</td>";
|
||||||
|
|
Loading…
Reference in New Issue
Block a user