mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-09 10:32:40 +00:00
nicer layout for list of revisors and recepients
This commit is contained in:
parent
467e76b5b0
commit
dfad2e581b
|
@ -851,6 +851,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 = '';
|
||||
|
@ -890,7 +899,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
break;
|
||||
}
|
||||
if($user->isAdmin() || $r["status"] > -2) {
|
||||
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 */
|
||||
|
@ -904,17 +913,20 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
}
|
||||
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($accessobject->mayReview($latestContent->getDocument())) {
|
||||
if ($is_reviewer) {
|
||||
if ($r["status"]==0) {
|
||||
print "<li>".$this->html_link('ReviewDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'reviewid'=>$r['reviewID']), array('class'=>'btn btn-mini'), getMLText("add_review"), false, true)."</li>";
|
||||
print "<li>".$this->html_link('ReviewDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'reviewid'=>$r['reviewID']), array('class'=>'btn btn-mini btn-primary'), getMLText("add_review"), false, true)."</li>";
|
||||
} elseif ($accessobject->mayUpdateReview($latestContent->getDocument(), $updateUser) && (($r["status"]==1)||($r["status"]==-1))){
|
||||
print "<li>".$this->html_link('ReviewDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'reviewid'=>$r['reviewID']), array('class'=>'btn btn-mini'), getMLText("edit"), false, true)."</li>";
|
||||
print "<li>".$this->html_link('ReviewDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'reviewid'=>$r['reviewID']), array('class'=>'btn btn-mini btn-primary'), getMLText("edit"), false, true)."</li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -943,6 +955,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 = '';
|
||||
|
@ -982,7 +1003,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
break;
|
||||
}
|
||||
if($user->isAdmin() || $a["status"] > -2) {
|
||||
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><ul class=\"unstyled\"><li>".$a["date"]."</li>";
|
||||
/* $updateUser is the user who has done the approval */
|
||||
|
@ -996,17 +1017,20 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
}
|
||||
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($accessobject->mayApprove($latestContent->getDocument())) {
|
||||
if ($is_approver) {
|
||||
if ($a['status'] == 0) {
|
||||
print "<li>".$this->html_link('ApproveDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'approveid'=>$a['approveID']), array('class'=>'btn btn-mini'), getMLText("add_approval"), false, true)."</li>";
|
||||
print "<li>".$this->html_link('ApproveDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'approveid'=>$a['approveID']), array('class'=>'btn btn-mini btn-primary'), getMLText("add_approval"), false, true)."</li>";
|
||||
} elseif ($accessobject->mayUpdateApproval($latestContent->getDocument(), $updateUser) && (($a["status"]==1)||($a["status"]==-1))){
|
||||
print "<li>".$this->html_link('ApproveDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'approveid'=>$a['approveID']), array('class'=>'btn btn-mini'), getMLText("edit"), false, true)."</li>";
|
||||
print "<li>".$this->html_link('ApproveDocument', array('documentid'=>$latestContent->getDocument()->getId(), 'version'=>$latestContent->getVersion(), 'approveid'=>$a['approveID']), array('class'=>'btn btn-mini btn-primary'), getMLText("edit"), false, true)."</li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1270,12 +1294,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
<?php
|
||||
if($status["status"]!=S_RELEASED)
|
||||
echo "<div class=\"alert alert-warning\">".getMLText('info_recipients_tab_not_released')."</div>";
|
||||
$this->contentContainerStart();
|
||||
print "<table class=\"table-condensed\">\n";
|
||||
|
||||
print "<tr><td colspan=5>\n";
|
||||
$this->contentSubHeading(getMLText("recipients"));
|
||||
print "</tr>";
|
||||
// $this->contentContainerStart();
|
||||
print "<table class=\"table table-condensed\">\n";
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
|
||||
|
@ -1329,6 +1349,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
* unless admin is logged in.
|
||||
*/
|
||||
if($user->isAdmin() || $r["status"] > -2) {
|
||||
$class = '';
|
||||
switch($r['status']) {
|
||||
case '-1':
|
||||
$class = 'error';
|
||||
break;
|
||||
case '1':
|
||||
$class = 'success';
|
||||
break;
|
||||
}
|
||||
print "<tr>\n";
|
||||
print "<td>".$reqName."</td>\n";
|
||||
print "<td><ul class=\"unstyled\"><li>".$r["date"]."</li>";
|
||||
|
@ -1336,16 +1365,19 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
$updateUser = $dms->getUser($r["userID"]);
|
||||
print "<li>".(is_object($updateUser) ? htmlspecialchars($updateUser->getFullName()." (".$updateUser->getLogin().")") : "unknown user id '".$r["userID"]."'")."</li></ul></td>";
|
||||
print "<td>".htmlspecialchars($r["comment"])."</td>\n";
|
||||
print "<td>".getReceiptStatusText($r["status"])."</td>\n";
|
||||
print "<td>";
|
||||
if($class)
|
||||
echo "<i class=\"fa fa-circle text-".$class."\"></i> ";
|
||||
print getReceiptStatusText($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($accessobject->mayReceipt($document)) {
|
||||
if ($is_recipient) {
|
||||
if($r["status"]==0) {
|
||||
print "<li>".$this->html_link('ReceiptDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'receiptid'=>$r['receiptID']), array('class'=>'btn btn-mini'), getMLText("add_receipt"), false, true)."</li>";
|
||||
print "<li>".$this->html_link('ReceiptDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'receiptid'=>$r['receiptID']), array('class'=>'btn btn-mini btn-primary'), getMLText("add_receipt"), false, true)."</li>";
|
||||
} elseif ($accessobject->mayUpdateReceipt($document, $updateUser) && (($r["status"]==1 && $enablereceiptreject)||($r["status"]==-1))) {
|
||||
print "<li>".$this->html_link('ReceiptDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'receiptid'=>$r['receiptID']), array('class'=>'btn btn-mini'), getMLText("edit"), false, true)."</li>";
|
||||
print "<li>".$this->html_link('ReceiptDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'receiptid'=>$r['receiptID']), array('class'=>'btn btn-mini btn-primary'), getMLText("edit"), false, true)."</li>";
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -1357,7 +1389,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
?>
|
||||
</table>
|
||||
<?php
|
||||
$this->contentContainerEnd();
|
||||
// $this->contentContainerEnd();
|
||||
if($accessobject->check_view_access('ViewDocument', array('action'=>'receptionBar'))/* $user->isAdmin() || $user->getId() == $document->getOwner()->getId()*/) {
|
||||
/* Do not count entries '-2' as they are removed userѕ */
|
||||
$totalreceipts = $stat['-1'] + $stat['0'] + $stat['1'];
|
||||
|
@ -1403,12 +1435,8 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
<div class="alert alert-info"><?= getMLText('no_revision_planed') ?></div>
|
||||
<?php
|
||||
} */
|
||||
$this->contentContainerStart();
|
||||
print "<table class=\"table-condensed\">\n";
|
||||
|
||||
print "<tr><td colspan=5>\n";
|
||||
$this->contentSubHeading(getMLText("revisors"));
|
||||
print "</tr>";
|
||||
// $this->contentContainerStart();
|
||||
print "<table class=\"table table-condensed\">\n";
|
||||
|
||||
print "<tr>\n";
|
||||
print "<td width='20%'><b>".getMLText("name")."</b></td>\n";
|
||||
|
@ -1419,6 +1447,15 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "</tr>\n";
|
||||
|
||||
foreach ($revisionStatus as $r) {
|
||||
$class = '';
|
||||
switch($r['status']) {
|
||||
case '-1':
|
||||
$class = 'error';
|
||||
break;
|
||||
case '1':
|
||||
$class = 'success';
|
||||
break;
|
||||
}
|
||||
$required = null;
|
||||
$is_recipient = false;
|
||||
$accesserr = '';
|
||||
|
@ -1462,15 +1499,18 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
print "</ul></td>";
|
||||
print "<td>".htmlspecialchars($r["comment"])."</td>\n";
|
||||
print "<td>".getRevisionStatusText($r["status"])."</td>\n";
|
||||
print "<td>";
|
||||
if($class)
|
||||
echo "<i class=\"fa fa-circle text-".$class."\"></i> ";
|
||||
print getRevisionStatusText($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($accessobject->mayRevise($document)) {
|
||||
if ($is_recipient && $r["status"]==0) {
|
||||
print "<li>".$this->html_link('ReviseDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'revisionid'=>$r['revisionID']), array('class'=>'btn btn-mini'), getMLText("add_revision"), false, true)."</li>";
|
||||
print "<li>".$this->html_link('ReviseDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'revisionid'=>$r['revisionID']), array('class'=>'btn btn-mini btn-primary'), getMLText("add_revision"), false, true)."</li>";
|
||||
} elseif (($updateUser==$user)&&(($r["status"]==1)||($r["status"]==-1))&&(!$document->hasExpired())){
|
||||
print "<li>".$this->html_link('ReviseDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'revisionid'=>$r['revisionID']), array('class'=>'btn btn-mini'), getMLText("edit"), false, true)."</li>";
|
||||
print "<li>".$this->html_link('ReviseDocument', array('documentid'=>$documentid, 'version'=>$latestContent->getVersion(), 'revisionid'=>$r['revisionID']), array('class'=>'btn btn-mini btn-primary'), getMLText("edit"), false, true)."</li>";
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1481,7 +1521,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
?>
|
||||
</table>
|
||||
<?php
|
||||
$this->contentContainerEnd();
|
||||
// $this->contentContainerEnd();
|
||||
if($user->isAdmin() || $user->getId() == $document->getOwner()->getId()) {
|
||||
?>
|
||||
<div class="row-fluid">
|
||||
|
|
Loading…
Reference in New Issue
Block a user