mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-11-01 05:37:37 +00:00
do not show users in list of recipients if they were deleted
only admin will see them
This commit is contained in:
parent
35e6625601
commit
efc11d4236
|
|
@ -1049,7 +1049,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "<td width='20%'></td>\n";
|
||||
print "</tr>\n";
|
||||
|
||||
$stat = array('-1'=>0, '0'=>0, '1'=>0, '2'=>0);
|
||||
$stat = array('-1'=>0, '0'=>0, '1'=>0, '-2'=>0);
|
||||
foreach ($receiptStatus as $r) {
|
||||
$required = null;
|
||||
$is_recipient = false;
|
||||
|
|
@ -1078,33 +1078,38 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
}
|
||||
break;
|
||||
}
|
||||
print "<tr>\n";
|
||||
print "<td>".$reqName."</td>\n";
|
||||
print "<td><ul class=\"unstyled\"><li>".$r["date"]."</li>";
|
||||
/* $updateUser is the user who has done the receipt */
|
||||
$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><ul class=\"unstyled\">";
|
||||
/* Do not list users that has been removed from the list of recipients
|
||||
* unless admin is logged in.
|
||||
*/
|
||||
if($user->isAdmin() || $r["status"] > -2) {
|
||||
print "<tr>\n";
|
||||
print "<td>".$reqName."</td>\n";
|
||||
print "<td><ul class=\"unstyled\"><li>".$r["date"]."</li>";
|
||||
/* $updateUser is the user who has done the receipt */
|
||||
$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><ul class=\"unstyled\">";
|
||||
|
||||
if($accessop->mayReceipt($document)) {
|
||||
if ($is_recipient && $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>";
|
||||
}else if (($updateUser==$user)&&(($r["status"]==1)||($r["status"]==-1))&&(!$document->hasExpired())){
|
||||
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>";
|
||||
if($accessop->mayReceipt($document)) {
|
||||
if ($is_recipient && $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>";
|
||||
}else if (($updateUser==$user)&&(($r["status"]==1)||($r["status"]==-1))&&(!$document->hasExpired())){
|
||||
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 "</ul></td>\n";
|
||||
print "</tr>\n";
|
||||
print "</ul></td>\n";
|
||||
print "</tr>\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
</table>
|
||||
<?php
|
||||
$this->contentContainerEnd();
|
||||
if($user->isAdmin()) {
|
||||
/* Do not count entries '2' as they are removed userѕ */
|
||||
/* Do not count entries '-2' as they are removed userѕ */
|
||||
$totalreceipts = $stat['-1'] + $stat['0'] + $stat['1'];
|
||||
?>
|
||||
<div class="row-fluid">
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user