Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2021-04-28 18:49:17 +02:00
commit d8b2433edd
2 changed files with 147 additions and 263 deletions

View File

@ -946,7 +946,7 @@ class SeedDMS_Core_User { /* {{{ */
foreach ($reviewStatus["indstatus"] as $ri) {
if($ri['status'] != -2 && (!isset($states['review']) || in_array($ri['status'], $states['review']))) {
$queryStr = "INSERT INTO `tblDocumentReviewLog` (`reviewID`, `status`, `comment`, `date`, `userID`) ".
"VALUES ('". $ri["reviewID"] ."', '-2', '".($newuser ? 'Reviewer replaced by '.$newuser->getLogin() : 'Reviewer removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
"VALUES ('". $ri["reviewID"] ."', '-2', '".(($newuser && $ri['status'] == 0) ? 'Reviewer replaced by '.$newuser->getLogin() : 'Reviewer removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
$res=$db->getResult($queryStr);
if(!$res) {
$db->rollbackTransaction();
@ -975,7 +975,7 @@ class SeedDMS_Core_User { /* {{{ */
foreach ($approvalStatus["indstatus"] as $ai) {
if($ai['status'] != -2 && (!isset($states['approval']) || in_array($ai['status'], $states['approval']))) {
$queryStr = "INSERT INTO `tblDocumentApproveLog` (`approveID`, `status`, `comment`, `date`, `userID`) ".
"VALUES ('". $ai["approveID"] ."', '-2', '".($newuser ? 'Approver replaced by '.$newuser->getLogin() : 'Approver removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
"VALUES ('". $ai["approveID"] ."', '-2', '".(($newuser && $ai['status'] == 0)? 'Approver replaced by '.$newuser->getLogin() : 'Approver removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
$res=$db->getResult($queryStr);
if(!$res) {
$db->rollbackTransaction();
@ -1004,7 +1004,7 @@ class SeedDMS_Core_User { /* {{{ */
foreach ($receiptStatus["indstatus"] as $ri) {
if($ri['status'] != -2 && (!isset($states['receipt']) || in_array($ri['status'], $states['receipt']))) {
$queryStr = "INSERT INTO `tblDocumentReceiptLog` (`receiptID`, `status`, `comment`, `date`, `userID`) ".
"VALUES ('". $ri["receiptID"] ."', '-2', '".($newuser ? 'Recipient replaced by '.$newuser->getLogin() : 'Recipient removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
"VALUES ('". $ri["receiptID"] ."', '-2', '".(($newuser && $ri['status'] == 0) ? 'Recipient replaced by '.$newuser->getLogin() : 'Recipient removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
$res=$db->getResult($queryStr);
if(!$res) {
$db->rollbackTransaction();
@ -1033,7 +1033,7 @@ class SeedDMS_Core_User { /* {{{ */
foreach ($revisionStatus["indstatus"] as $ri) {
if($ri['status'] != -2 && (!isset($states['revision']) || in_array($ri['status'], $states['revision']))) {
$queryStr = "INSERT INTO `tblDocumentRevisionLog` (`revisionID`, `status`, `comment`, `date`, `userID`) ".
"VALUES ('". $ri["revisionID"] ."', '-2', '".($newuser ? 'Revisor replaced by '.$newuser->getLogin() : 'Revisor removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
"VALUES ('". $ri["revisionID"] ."', '-2', '".(($newuser && in_array($ri['status'], array(S_LOG_WAITING, S_LOG_SLEEPING))) ? 'Revisor replaced by '.$newuser->getLogin() : 'Revisor removed from process')."', ".$db->getCurrentDatetime().", '". $user->getID() ."')";
$res=$db->getResult($queryStr);
if(!$res) {
$db->rollbackTransaction();

View File

@ -35,10 +35,10 @@ class SeedDMS_View_RemoveUserFromProcesses extends SeedDMS_Theme_Style {
$this->printClickDocumentJs();
?>
$(document).ready( function() {
$('body').on('click', 'label.checkbox', function(ev){
// ev.preventDefault();
$('body').on('click', 'label.checkbox, td span', function(ev){
ev.preventDefault();
$('#kkkk.ajax').data('action', $(this).data('action'));
$('#kkkk.ajax').trigger('update', {userid: $(this).data('userid'), task: $(this). data('task')});
$('#kkkk.ajax').trigger('update', {userid: $(this).data('userid'), task: $(this).data('task')});
});
});
<?php
@ -272,31 +272,7 @@ $(document).ready( function() {
$this->warningMsg(getMLText("confirm_rm_user_from_processes", array ("username" => htmlspecialchars($rmuser->getFullName()))));
$this->rowStart();
$this->columnStart(4);
?>
<form class="form-horizontal" action="../op/op.UsrMgr.php" name="form1" method="post">
<input type="hidden" name="userid" value="<?php print $rmuser->getID();?>">
<input type="hidden" name="action" value="removefromprocesses">
<?php echo createHiddenFieldWithKey('removefromprocesses'); ?>
<?php
$this->contentContainerStart();
$options = array(array(0, getMLText('do_no_transfer_to_user')));
foreach ($allusers as $currUser) {
if ($currUser->isGuest() || ($currUser->getID() == $rmuser->getID()) )
continue;
if ($rmuser && $currUser->getID()==$rmuser->getID()) $selected=$count;
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()." - ".$currUser->getFullName()));
}
$this->formField(
getMLText("transfer_process_to_user"),
array(
'element'=>'select',
'name'=>'assignTo',
'class'=>'chzn-select',
'options'=>$options
)
);
$reviewStatus = $rmuser->getReviewStatus();
$tmpr = array();
$cr = array("-2"=>0, '-1'=>0, '0'=>0, '1'=>0);
@ -352,252 +328,160 @@ $(document).ready( function() {
else
$tmpc[$ai['status']] = array($ai);
}
?>
<?php if(isset($tmpr["0"])) { ?>
<?php
$this->formField(
getMLText('reviews_not_touched', array('no_reviews' => count($tmpr["0"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[review][]',
'value'=>'0',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="reviews_not_touched">', ' '.getMLText('reviews_not_touched_latest', array('no_reviews' => $cr["0"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpr["1"])) { ?>
<?php
$this->formField(
getMLText('reviews_accepted', array('no_reviews' => count($tmpr["1"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[approval][]',
'value'=>'1',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="reviews_accepted">', ' '.getMLText('reviews_accepted_latest', array('no_reviews' => $cr["1"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpr["-1"])) { ?>
<?php
$this->formField(
getMLText('reviews_rejected', array('no_reviews' => count($tmpr["-1"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[approval][]',
'value'=>'-1',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="reviews_rejected">', ' '.getMLText('reviews_rejected_latest', array('no_reviews' => $cr["-1"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpa["0"])) { ?>
<?php
$this->formField(
getMLText('approvals_not_touched', array('no_approvals' => count($tmpa["0"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[approval][]',
'value'=>'0',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="approvals_not_touched">', getMLText('approvals_not_touched_latest', array('no_approvals' => $ca["0"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpa["1"])) { ?>
<?php
$this->formField(
getMLText('approvals_accepted', array('no_approvals' => count($tmpa["1"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[approval][]',
'value'=>'1',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="approvals_accepted">',getMLText('approvals_accepted_latest', array('no_approvals' => $ca["1"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpa["-1"])) { ?>
<?php
$this->formField(
getMLText('approvals_rejected', array('no_approvals' => count($tmpa["-1"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[approval][]',
'value'=>'-1',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="approvals_rejected">', getMLText('approvals_rejected_latest', array('no_approvals' => $ca["-1"]))."</label>")
)
);
?>
<?php } ?>
$out = array();
if(isset($tmpr["0"])) {
$out[] = array(
'0',
'review',
'not_touched',
getMLText('reviews_not_touched', array('no_reviews' => count($tmpr["0"]))),
getMLText('reviews_not_touched_latest', array('no_reviews' => $cr["0"]))
);
}
if(isset($tmpr["1"])) {
$out[] = array(
'1',
'review',
'accepted',
getMLText('reviews_accepted', array('no_reviews' => count($tmpr["1"]))),
getMLText('reviews_accepted_latest', array('no_reviews' => $cr["1"]))
);
}
if(isset($tmpr["-1"])) {
$out[] = array(
'-1',
'review',
'rejected',
getMLText('reviews_rejected', array('no_reviews' => count($tmpr["-1"]))),
getMLText('reviews_rejected_latest', array('no_reviews' => $cr["-1"]))
);
}
if(isset($tmpa["0"])) {
$out[] = array(
'0',
'approval',
'not_touched',
getMLText('approvals_not_touched', array('no_approvals' => count($tmpa["0"]))),
getMLText('approvals_not_touched_latest', array('no_approvals' => $ca["0"]))
);
}
if(isset($tmpa["1"])) {
$out[] = array(
'1',
'approval',
'accepted',
getMLText('approvals_accepted', array('no_approvals' => count($tmpa["1"]))),
getMLText('approvals_accepted_latest', array('no_approvals' => $ca["1"]))
);
}
if(isset($tmpa["-1"])) {
$out[] = array(
'-1',
'approval',
'rejected',
getMLText('approvals_rejected', array('no_approvals' => count($tmpa["-1"]))),
getMLText('approvals_rejected_latest', array('no_approvals' => $ca["-1"]))
);
}
if(isset($tmpb["0"])) {
$out[] = array(
'0',
'receipt',
'not_touched',
getMLText('receipts_not_touched', array('no_receipts' => count($tmpb["0"]))),
getMLText('receipts_not_touched_latest', array('no_receipts' => $cb["0"]))
);
}
if(isset($tmpb["1"])) {
$out[] = array(
'1',
'receipt',
'accepted',
getMLText('receipts_accepted', array('no_receipts' => count($tmpb["1"]))),
getMLText('receipts_accepted_latest', array('no_receipts' => $cb["1"]))
);
}
if(isset($tmpb["-1"])) {
$out[] = array(
'-1',
'receipt',
'rejected',
getMLText('receipts_rejected', array('no_receipts' => count($tmpb["-1"]))),
getMLText('receipts_rejected_latest', array('no_receipts' => $cb["-1"]))
);
}
if(isset($tmpc["0"])) {
$out[] = array(
'0',
'revision',
'not_touched',
getMLText('revisions_not_touched', array('no_revisions' => count($tmpc["0"]))),
getMLText('revisions_not_touched_latest', array('no_revisions' => $cc["0"]))
);
}
if(isset($tmpc["1"])) {
$out[] = array(
'1',
'revision',
'accepted',
getMLText('revisions_accepted', array('no_revisions' => count($tmpc["1"]))),
getMLText('revisions_accepted_latest', array('no_revisions' => $cc["1"]))
);
}
if(isset($tmpc["-1"])) {
$out[] = array(
'-1',
'revision',
'rejected',
getMLText('revisions_rejected', array('no_revisions' => count($tmpc["-1"]))),
getMLText('revisions_rejected_latest', array('no_revisions' => $cc["-1"]))
);
}
if(isset($tmpc["-3"])) {
$out[] = array(
'-3',
'revision',
'pending',
getMLText('revisions_pending', array('no_revisions' => count($tmpc["-3"]))),
getMLText('revisions_pending_latest', array('no_revisions' => $cc["-3"]))
);
}
<?php if(isset($tmpb["0"])) { ?>
<?php
$this->formField(
getMLText('receipts_not_touched', array('no_receipts' => count($tmpb["0"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[receipt][]',
'value'=>'0',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="receipts_not_touched">', getMLText('receipts_not_touched_latest', array('no_receipts' => $cb["0"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpb["1"])) { ?>
<?php
$this->formField(
getMLText('receipts_accepted', array('no_receipts' => count($tmpb["1"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[receipt][]',
'value'=>'1',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="receipts_accepted">', getMLText('receipts_accepted_latest', array('no_receipts' => $cb["1"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpb["-1"])) { ?>
<?php
$this->formField(
getMLText('receipts_rejected', array('no_receipts' => count($tmpb["-1"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[receipt][]',
'value'=>'-1',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="receipts_rejected">', getMLText('receipts_rejected_latest', array('no_receipts' => $cb["-1"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpc["0"])) { ?>
<?php
$this->formField(
getMLText('revisions_not_touched', array('no_revisions' => count($tmpc["0"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[revision][]',
'value'=>'0',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="revisions_not_touched">', getMLText('revisions_not_touched_latest', array('no_revisions' => $cc["0"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpc["-3"])) { ?>
<?php
$this->formField(
getMLText('revisions_pending', array('no_revisions' => count($tmpc["-3"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[revision][]',
'value'=>'-3',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="revisions_pending">', getMLText('revisions_pending_latest', array('no_revisions' => $cc["-3"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpc["1"])) { ?>
<?php
$this->formField(
getMLText('revisions_accepted', array('no_revisions' => count($tmpc["1"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[revision][]',
'value'=>'1',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="revisions_accepted">', getMLText('revisions_accepted_latest', array('no_revisions' => $cc["1"]))."</label>")
)
);
?>
<?php } ?>
<?php if(isset($tmpc["-1"])) { ?>
<?php
$this->formField(
getMLText('revisions_rejected', array('no_revisions' => count($tmpc["-1"]))),
array(
'element'=>'input',
'type'=>'checkbox',
'name'=>'status[revision][]',
'value'=>'-1',
'checked'=>false
),
array(
'field_wrap' => array('<label class="checkbox" data-action="printList" data-userid="'.$rmuser->getId().'" data-task="revisions_rejected">', getMLText('revisions_rejected_latest', array('no_revisions' => $cc["-1"]))."</label>")
)
);
?>
<?php } ?>
<form class="form-horizontal" action="../op/op.UsrMgr.php" name="form1" method="post">
<input type="hidden" name="userid" value="<?php print $rmuser->getID();?>">
<input type="hidden" name="action" value="removefromprocesses">
<?php echo createHiddenFieldWithKey('removefromprocesses'); ?>
<?php
/*
$options = array();
$allUsers = $dms->getAllUsers($sortusersinlist);
foreach ($allUsers as $currUser) {
if (!$currUser->isGuest())
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()), ($currUser->getID()==$user->getID()), array(array('data-subtitle', htmlspecialchars($currUser->getFullName()))));
echo "<table class=\"table table-condensed table-sm\">";
foreach($out as $o) {
echo "<tr><td>".$o[3]."</td><td>".$o[4]."</td><td><input style=\"margin-top: 0px;\" type=\"checkbox\" name=\"status[".$o[1]."][]\" value=\"".$o[0]."\"></td><td><span data-action=\"printList\" data-userid=\"".$rmuser->getId()."\" data-task=\"".$o[1]."s_".$o[2]."\"><i class=\"fa fa-list\"></i></span></td></tr>";
}
echo "</table>";
$this->infoMsg(getMLText("info_rm_user_from_processes_user"));
$options = array(array(0, getMLText('do_no_transfer_to_user')));
foreach ($allusers as $currUser) {
if ($currUser->isGuest() || ($currUser->getID() == $rmuser->getID()) )
continue;
if ($rmuser && $currUser->getID()==$rmuser->getID()) $selected=$count;
$options[] = array($currUser->getID(), htmlspecialchars($currUser->getLogin()." - ".$currUser->getFullName()));
}
$this->formField(
getMLText("user"),
getMLText("transfer_process_to_user"),
array(
'element'=>'select',
'id'=>'newuser',
'name'=>'newuserid',
'name'=>'assignTo',
'class'=>'chzn-select',
'options'=>$options
)
);
*/
$this->contentContainerEnd();
$this->formSubmit("<i class=\"fa fa-remove\"></i> ".getMLText('rm_user_from_processes'));
?>