2017-07-28 10:35:18 +00:00
|
|
|
<?php
|
|
|
|
/**
|
|
|
|
* Implementation of RemoveUserFromProcesses view
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @license GPL 2
|
|
|
|
* @version @version@
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2017 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Include parent class
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
//require_once("class.Bootstrap.php");
|
2017-07-28 10:35:18 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Class which outputs the html page for RemoveUserFromProcesses view
|
|
|
|
*
|
|
|
|
* @category DMS
|
|
|
|
* @package SeedDMS
|
|
|
|
* @author Uwe Steinmann <uwe@steinmann.cx>
|
|
|
|
* @copyright Copyright (C) 2017 Uwe Steinmann
|
|
|
|
* @version Release: @package_version@
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
class SeedDMS_View_RemoveUserFromProcesses extends SeedDMS_Theme_Style {
|
2017-07-28 10:35:18 +00:00
|
|
|
|
2021-04-27 17:36:12 +00:00
|
|
|
public function js() { /* {{{ */
|
|
|
|
header('Content-Type: application/javascript; charset=UTF-8');
|
2021-04-27 19:00:26 +00:00
|
|
|
parent::jsTranslations(array('cancel', 'splash_move_document', 'confirm_move_document', 'move_document', 'confirm_transfer_link_document', 'transfer_content', 'link_document', 'splash_move_folder', 'confirm_move_folder', 'move_folder'));
|
|
|
|
$this->printDeleteDocumentButtonJs();
|
|
|
|
/* Add js for catching click on document in one page mode */
|
|
|
|
$this->printClickDocumentJs();
|
2021-04-27 17:36:12 +00:00
|
|
|
?>
|
|
|
|
$(document).ready( function() {
|
|
|
|
$('body').on('click', 'label.checkbox', function(ev){
|
|
|
|
ev.preventDefault();
|
|
|
|
$('#kkkk.ajax').data('action', $(this).data('action'));
|
|
|
|
$('#kkkk.ajax').trigger('update', {userid: $(this).data('userid'), task: $(this). data('task')});
|
|
|
|
});
|
|
|
|
});
|
|
|
|
<?php
|
|
|
|
} /* }}} */
|
|
|
|
|
|
|
|
function printList() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
|
|
|
$settings = $this->params['settings'];
|
|
|
|
$cachedir = $this->params['cachedir'];
|
|
|
|
$rootfolder = $this->params['rootfolder'];
|
|
|
|
$previewwidth = $this->params['previewWidthList'];
|
|
|
|
$previewconverters = $this->params['previewconverters'];
|
|
|
|
$timeout = $this->params['timeout'];
|
|
|
|
$rmuser = $this->params['rmuser'];
|
|
|
|
$task = $this->params['task'];
|
|
|
|
|
|
|
|
if(!$task)
|
|
|
|
return;
|
|
|
|
|
|
|
|
$previewer = new SeedDMS_Preview_Previewer($cachedir, $previewwidth, $timeout);
|
|
|
|
$previewer->setConverters($previewconverters);
|
|
|
|
|
|
|
|
$docs = array();
|
|
|
|
switch($task) {
|
|
|
|
case "reviews_not_touched":
|
|
|
|
$reviewStatus = $rmuser->getReviewStatus();
|
|
|
|
foreach($reviewStatus['indstatus'] as $ri) {
|
|
|
|
$document = $dms->getDocument($ri['documentID']);
|
|
|
|
$ri['latest'] = $document->getLatestContent()->getVersion();
|
|
|
|
if($ri['latest'] == $ri['version']) {
|
|
|
|
if($ri['status'] == 0) {
|
|
|
|
$document->verifyLastestContentExpriry();
|
|
|
|
$lc = $document->getLatestContent();
|
|
|
|
if($document->getAccessMode($user) >= M_READ && $lc) {
|
|
|
|
$docs[] = $document;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "reviews_accepted":
|
|
|
|
$reviewStatus = $rmuser->getReviewStatus();
|
|
|
|
foreach($reviewStatus['indstatus'] as $ri) {
|
|
|
|
$document = $dms->getDocument($ri['documentID']);
|
|
|
|
$ri['latest'] = $document->getLatestContent()->getVersion();
|
|
|
|
if($ri['latest'] == $ri['version']) {
|
|
|
|
if($ri['status'] == 1) {
|
|
|
|
$document->verifyLastestContentExpriry();
|
|
|
|
$lc = $document->getLatestContent();
|
|
|
|
if($document->getAccessMode($user) >= M_READ && $lc) {
|
|
|
|
$docs[] = $document;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "reviews_rejected":
|
|
|
|
$reviewStatus = $rmuser->getReviewStatus();
|
|
|
|
foreach($reviewStatus['indstatus'] as $ri) {
|
|
|
|
$document = $dms->getDocument($ri['documentID']);
|
|
|
|
$ri['latest'] = $document->getLatestContent()->getVersion();
|
|
|
|
if($ri['latest'] == $ri['version']) {
|
|
|
|
if($ri['status'] == -1) {
|
|
|
|
$docs[] = $document;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "approvals_not_touched":
|
|
|
|
$approvalStatus = $rmuser->getApprovalStatus();
|
|
|
|
foreach($approvalStatus['indstatus'] as $ai) {
|
|
|
|
$document = $dms->getDocument($ai['documentID']);
|
|
|
|
$ai['latest'] = $document->getLatestContent()->getVersion();
|
|
|
|
if($ai['latest'] == $ai['version']) {
|
|
|
|
if($ai['status'] == 0) {
|
|
|
|
$docs[] = $document;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "approvals_accepted":
|
|
|
|
$approvalStatus = $rmuser->getApprovalStatus();
|
|
|
|
foreach($approvalStatus['indstatus'] as $ai) {
|
|
|
|
$document = $dms->getDocument($ai['documentID']);
|
|
|
|
$ai['latest'] = $document->getLatestContent()->getVersion();
|
|
|
|
if($ai['latest'] == $ai['version']) {
|
|
|
|
if($ai['status'] == 1) {
|
|
|
|
$docs[] = $document;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
case "approvals_rejected":
|
|
|
|
$approvalStatus = $rmuser->getApprovalStatus();
|
|
|
|
foreach($approvalStatus['indstatus'] as $ai) {
|
|
|
|
$document = $dms->getDocument($ai['documentID']);
|
|
|
|
$ai['latest'] = $document->getLatestContent()->getVersion();
|
|
|
|
if($ai['latest'] == $ai['version']) {
|
|
|
|
if($ai['status'] == -1) {
|
|
|
|
$docs[] = $document;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
if($docs) {
|
|
|
|
print "<table class=\"table table-condensed table-sm\">";
|
|
|
|
print "<thead>\n<tr>\n";
|
|
|
|
print "<th></th>\n";
|
|
|
|
print "<th>".getMLText("name")."</th>\n";
|
|
|
|
print "<th>".getMLText("status")."</th>\n";
|
|
|
|
print "<th>".getMLText("action")."</th>\n";
|
|
|
|
print "</tr>\n</thead>\n<tbody>\n";
|
|
|
|
foreach($docs as $document) {
|
|
|
|
$document->verifyLastestContentExpriry();
|
|
|
|
$lc = $document->getLatestContent();
|
|
|
|
if($document->getAccessMode($user) >= M_READ && $lc) {
|
|
|
|
$txt = $this->callHook('documentListItem', $document, $previewer, false);
|
|
|
|
if(is_string($txt))
|
|
|
|
echo $txt;
|
|
|
|
else {
|
|
|
|
$extracontent = array();
|
|
|
|
$extracontent['below_title'] = $this->getListRowPath($document);
|
|
|
|
echo $this->documentListRowStart($document);
|
|
|
|
echo $this->documentListRow($document, $previewer, true, 0, $extracontent);
|
|
|
|
echo $this->documentListRowEnd($document);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
echo "</tbody>\n</table>";
|
|
|
|
}
|
|
|
|
} /* }}} */
|
|
|
|
|
2017-07-28 10:35:18 +00:00
|
|
|
function show() { /* {{{ */
|
|
|
|
$dms = $this->params['dms'];
|
|
|
|
$user = $this->params['user'];
|
|
|
|
$rmuser = $this->params['rmuser'];
|
|
|
|
|
|
|
|
$this->htmlStartPage(getMLText("admin_tools"));
|
|
|
|
$this->globalNavigation();
|
|
|
|
$this->contentStart();
|
|
|
|
$this->pageNavigation(getMLText("admin_tools"), "admin_tools");
|
2017-07-31 09:29:24 +00:00
|
|
|
$this->contentHeading(getMLText("rm_user_from_processes"));
|
2017-07-28 10:35:18 +00:00
|
|
|
|
2021-04-18 05:08:00 +00:00
|
|
|
$this->warningMsg(getMLText("confirm_rm_user_from_processes", array ("username" => htmlspecialchars($rmuser->getFullName()))));
|
2021-04-27 15:10:42 +00:00
|
|
|
$this->rowStart();
|
|
|
|
$this->columnStart(4);
|
2017-07-28 10:35:18 +00:00
|
|
|
?>
|
2017-07-31 09:29:24 +00:00
|
|
|
<form class="form-horizontal" action="../op/op.UsrMgr.php" name="form1" method="post">
|
2017-07-28 10:35:18 +00:00
|
|
|
<input type="hidden" name="userid" value="<?php print $rmuser->getID();?>">
|
|
|
|
<input type="hidden" name="action" value="removefromprocesses">
|
|
|
|
<?php echo createHiddenFieldWithKey('removefromprocesses'); ?>
|
|
|
|
|
2017-07-28 12:57:17 +00:00
|
|
|
<?php
|
2021-04-18 05:08:00 +00:00
|
|
|
$this->contentContainerStart();
|
2017-07-28 12:57:17 +00:00
|
|
|
$reviewStatus = $rmuser->getReviewStatus();
|
|
|
|
$tmpr = array();
|
2019-11-19 08:34:41 +00:00
|
|
|
$cr = array("-2"=>0, '-1'=>0, '0'=>0, '1'=>0);
|
2017-07-28 12:57:17 +00:00
|
|
|
foreach($reviewStatus['indstatus'] as $ri) {
|
2019-11-19 06:25:53 +00:00
|
|
|
$doc = $dms->getDocument($ri['documentID']);
|
|
|
|
$ri['latest'] = $doc->getLatestContent()->getVersion();
|
2019-11-19 08:34:41 +00:00
|
|
|
if($ri['latest'] == $ri['version'])
|
|
|
|
$cr[$ri['status']]++;
|
2017-07-28 12:57:17 +00:00
|
|
|
if(isset($tmpr[$ri['status']]))
|
|
|
|
$tmpr[$ri['status']][] = $ri;
|
|
|
|
else
|
|
|
|
$tmpr[$ri['status']] = array($ri);
|
|
|
|
}
|
|
|
|
|
|
|
|
$approvalStatus = $rmuser->getApprovalStatus();
|
|
|
|
$tmpa = array();
|
2019-11-19 08:34:41 +00:00
|
|
|
$ca = array("-2"=>0, '-1'=>0, '0'=>0, '1'=>0);
|
2017-07-28 12:57:17 +00:00
|
|
|
foreach($approvalStatus['indstatus'] as $ai) {
|
2019-11-19 09:04:49 +00:00
|
|
|
$doc = $dms->getDocument($ai['documentID']);
|
2019-11-19 06:25:53 +00:00
|
|
|
$ai['latest'] = $doc->getLatestContent()->getVersion();
|
2019-11-19 08:34:41 +00:00
|
|
|
if($ai['latest'] == $ai['version'])
|
|
|
|
$ca[$ai['status']]++;
|
2017-07-28 12:57:17 +00:00
|
|
|
if(isset($tmpa[$ai['status']]))
|
|
|
|
$tmpa[$ai['status']][] = $ai;
|
|
|
|
else
|
|
|
|
$tmpa[$ai['status']] = array($ai);
|
|
|
|
}
|
|
|
|
?>
|
2017-07-31 11:21:56 +00:00
|
|
|
<?php if(isset($tmpr["0"])) { ?>
|
2019-11-19 17:21:34 +00:00
|
|
|
<?php
|
|
|
|
$this->formField(
|
|
|
|
getMLText('reviews_not_touched', array('no_reviews' => count($tmpr["0"]))),
|
|
|
|
array(
|
|
|
|
'element'=>'input',
|
|
|
|
'type'=>'checkbox',
|
|
|
|
'name'=>'status[review][]',
|
|
|
|
'value'=>'0',
|
|
|
|
'checked'=>true
|
|
|
|
),
|
|
|
|
array(
|
2021-04-27 17:36:12 +00:00
|
|
|
'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>")
|
2019-11-19 17:21:34 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
2017-07-28 12:57:17 +00:00
|
|
|
<?php } ?>
|
2017-07-31 11:21:56 +00:00
|
|
|
<?php if(isset($tmpr["1"])) { ?>
|
2019-11-19 17:21:34 +00:00
|
|
|
<?php
|
|
|
|
$this->formField(
|
|
|
|
getMLText('reviews_accepted', array('no_reviews' => count($tmpr["1"]))),
|
|
|
|
array(
|
|
|
|
'element'=>'input',
|
|
|
|
'type'=>'checkbox',
|
|
|
|
'name'=>'status[approval][]',
|
|
|
|
'value'=>'1',
|
|
|
|
'checked'=>true
|
|
|
|
),
|
|
|
|
array(
|
2021-04-27 17:36:12 +00:00
|
|
|
'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>")
|
2019-11-19 17:21:34 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
2017-07-28 12:57:17 +00:00
|
|
|
<?php } ?>
|
2017-07-31 11:21:56 +00:00
|
|
|
<?php if(isset($tmpr["-1"])) { ?>
|
2019-11-19 17:21:34 +00:00
|
|
|
<?php
|
|
|
|
$this->formField(
|
|
|
|
getMLText('reviews_rejected', array('no_reviews' => count($tmpr["-1"]))),
|
|
|
|
array(
|
|
|
|
'element'=>'input',
|
|
|
|
'type'=>'checkbox',
|
|
|
|
'name'=>'status[approval][]',
|
|
|
|
'value'=>'-1',
|
|
|
|
'checked'=>true
|
|
|
|
),
|
|
|
|
array(
|
2021-04-27 17:36:12 +00:00
|
|
|
'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>")
|
2019-11-19 17:21:34 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
2017-07-31 11:21:56 +00:00
|
|
|
<?php } ?>
|
|
|
|
|
|
|
|
<?php if(isset($tmpa["0"])) { ?>
|
2019-11-19 17:21:34 +00:00
|
|
|
<?php
|
|
|
|
$this->formField(
|
|
|
|
getMLText('approvals_not_touched', array('no_approvals' => count($tmpa["0"]))),
|
|
|
|
array(
|
|
|
|
'element'=>'input',
|
|
|
|
'type'=>'checkbox',
|
|
|
|
'name'=>'status[approval][]',
|
|
|
|
'value'=>'0',
|
|
|
|
'checked'=>true
|
|
|
|
),
|
|
|
|
array(
|
2021-04-27 17:36:12 +00:00
|
|
|
'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>")
|
2019-11-19 17:21:34 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
2017-07-31 11:21:56 +00:00
|
|
|
<?php } ?>
|
|
|
|
<?php if(isset($tmpa["1"])) { ?>
|
2019-11-19 17:21:34 +00:00
|
|
|
<?php
|
|
|
|
$this->formField(
|
|
|
|
getMLText('approvals_accepted', array('no_approvals' => count($tmpa["1"]))),
|
|
|
|
array(
|
|
|
|
'element'=>'input',
|
|
|
|
'type'=>'checkbox',
|
|
|
|
'name'=>'status[approval][]',
|
|
|
|
'value'=>'1',
|
|
|
|
'checked'=>true
|
|
|
|
),
|
|
|
|
array(
|
2021-04-27 17:36:12 +00:00
|
|
|
'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>")
|
2019-11-19 17:21:34 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
2017-07-31 11:21:56 +00:00
|
|
|
<?php } ?>
|
|
|
|
<?php if(isset($tmpa["-1"])) { ?>
|
2019-11-19 17:21:34 +00:00
|
|
|
<?php
|
|
|
|
$this->formField(
|
|
|
|
getMLText('approvals_rejected', array('no_approvals' => count($tmpa["-1"]))),
|
|
|
|
array(
|
|
|
|
'element'=>'input',
|
|
|
|
'type'=>'checkbox',
|
|
|
|
'name'=>'status[approval][]',
|
|
|
|
'value'=>'-1',
|
|
|
|
'checked'=>true
|
|
|
|
),
|
|
|
|
array(
|
2021-04-27 17:36:12 +00:00
|
|
|
'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>")
|
2019-11-19 17:21:34 +00:00
|
|
|
)
|
|
|
|
);
|
|
|
|
?>
|
2017-07-28 12:57:17 +00:00
|
|
|
<?php } ?>
|
2019-11-19 17:21:34 +00:00
|
|
|
<?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()))));
|
|
|
|
}
|
|
|
|
$this->formField(
|
|
|
|
getMLText("user"),
|
|
|
|
array(
|
|
|
|
'element'=>'select',
|
|
|
|
'id'=>'newuser',
|
|
|
|
'name'=>'newuserid',
|
|
|
|
'class'=>'chzn-select',
|
|
|
|
'options'=>$options
|
|
|
|
)
|
|
|
|
);
|
|
|
|
*/
|
2021-04-18 05:08:00 +00:00
|
|
|
$this->contentContainerEnd();
|
2020-08-27 05:52:52 +00:00
|
|
|
$this->formSubmit("<i class=\"fa fa-remove\"></i> ".getMLText('rm_user_from_processes'));
|
2019-11-19 17:21:34 +00:00
|
|
|
?>
|
2017-07-28 10:35:18 +00:00
|
|
|
|
|
|
|
</form>
|
|
|
|
<?php
|
2021-04-27 15:10:42 +00:00
|
|
|
$this->columnEnd();
|
|
|
|
$this->columnStart(8);
|
2021-04-27 17:36:12 +00:00
|
|
|
echo '<div id="kkkk" class="ajax" data-view="RemoveUserFromProcesses" data-action="printList" data-query="userid='.$rmuser->getId().'"></div>';
|
|
|
|
$this->columnEnd();
|
2021-04-27 15:10:42 +00:00
|
|
|
$this->rowEnd();
|
2017-07-28 10:35:18 +00:00
|
|
|
$this->contentEnd();
|
|
|
|
$this->htmlEndPage();
|
|
|
|
} /* }}} */
|
|
|
|
}
|
|
|
|
?>
|