mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-10-10 11:02:41 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
6fd868c5a7
|
@ -974,10 +974,11 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
* @param array $states remove user only from reviews/approvals in one of the states
|
* @param array $states remove user only from reviews/approvals in one of the states
|
||||||
* e.g. if passing array('review'=>array(0)), the method will operate on
|
* e.g. if passing array('review'=>array(0)), the method will operate on
|
||||||
* reviews which has not been touched yet.
|
* reviews which has not been touched yet.
|
||||||
* @param object user who takes over the processes
|
* @param object $newuser user who takes over the processes
|
||||||
|
* @param array $docs remove only processes from docs with the given document ids
|
||||||
* @return boolean true on success or false in case of an error
|
* @return boolean true on success or false in case of an error
|
||||||
*/
|
*/
|
||||||
private function __removeFromProcesses($user, $states = array(), $newuser=null) { /* {{{ */
|
private function __removeFromProcesses($user, $states = array(), $newuser=null, $docs=null) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
/* Get a list of all reviews, even those of older document versions */
|
/* Get a list of all reviews, even those of older document versions */
|
||||||
|
@ -986,6 +987,12 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
foreach ($reviewStatus["indstatus"] as $ri) {
|
foreach ($reviewStatus["indstatus"] as $ri) {
|
||||||
if(!($doc = $this->_dms->getDocument($ri['documentID'])))
|
if(!($doc = $this->_dms->getDocument($ri['documentID'])))
|
||||||
continue;
|
continue;
|
||||||
|
if($docs) {
|
||||||
|
if(!in_array($doc->getID(), $docs))
|
||||||
|
continue;
|
||||||
|
if(!$doc->isLatestContent($ri['version']))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
||||||
continue;
|
continue;
|
||||||
if($ri['status'] != -2 && (!isset($states['review']) || in_array($ri['status'], $states['review']))) {
|
if($ri['status'] != -2 && (!isset($states['review']) || in_array($ri['status'], $states['review']))) {
|
||||||
|
@ -998,7 +1005,6 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
}
|
}
|
||||||
/* Only reviews not done already can be transferred to a new user */
|
/* Only reviews not done already can be transferred to a new user */
|
||||||
if($newuser && $ri['status'] == 0) {
|
if($newuser && $ri['status'] == 0) {
|
||||||
if($doc = $this->_dms->getDocument($ri['documentID'])) {
|
|
||||||
if($version = $doc->getContentByVersion($ri['version'])) {
|
if($version = $doc->getContentByVersion($ri['version'])) {
|
||||||
$ret = $version->addIndReviewer($newuser, $user);
|
$ret = $version->addIndReviewer($newuser, $user);
|
||||||
/* returns -3 if the user is already a reviewer */
|
/* returns -3 if the user is already a reviewer */
|
||||||
|
@ -1010,7 +1016,6 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$db->commitTransaction();
|
$db->commitTransaction();
|
||||||
|
|
||||||
/* Get a list of all approvals, even those of older document versions */
|
/* Get a list of all approvals, even those of older document versions */
|
||||||
|
@ -1019,6 +1024,12 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
foreach ($approvalStatus["indstatus"] as $ai) {
|
foreach ($approvalStatus["indstatus"] as $ai) {
|
||||||
if(!($doc = $this->_dms->getDocument($ai['documentID'])))
|
if(!($doc = $this->_dms->getDocument($ai['documentID'])))
|
||||||
continue;
|
continue;
|
||||||
|
if($docs) {
|
||||||
|
if(!in_array($doc->getID(), $docs))
|
||||||
|
continue;
|
||||||
|
if(!$doc->isLatestContent($ai['version']))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
||||||
continue;
|
continue;
|
||||||
if($ai['status'] != -2 && (!isset($states['approval']) || in_array($ai['status'], $states['approval']))) {
|
if($ai['status'] != -2 && (!isset($states['approval']) || in_array($ai['status'], $states['approval']))) {
|
||||||
|
@ -1031,7 +1042,6 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
}
|
}
|
||||||
/* Only approvals not done already can be transferred to a new user */
|
/* Only approvals not done already can be transferred to a new user */
|
||||||
if($newuser && $ai['status'] == 0) {
|
if($newuser && $ai['status'] == 0) {
|
||||||
if($doc = $this->_dms->getDocument($ai['documentID'])) {
|
|
||||||
if($version = $doc->getContentByVersion($ai['version'])) {
|
if($version = $doc->getContentByVersion($ai['version'])) {
|
||||||
$ret = $version->addIndReviewer($newuser, $user);
|
$ret = $version->addIndReviewer($newuser, $user);
|
||||||
/* returns -3 if the user is already a reviewer */
|
/* returns -3 if the user is already a reviewer */
|
||||||
|
@ -1043,7 +1053,6 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
$db->commitTransaction();
|
$db->commitTransaction();
|
||||||
|
|
||||||
/* Get a list of all receptions, even those of older document versions */
|
/* Get a list of all receptions, even those of older document versions */
|
||||||
|
@ -1052,6 +1061,12 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
foreach ($receiptStatus["indstatus"] as $ri) {
|
foreach ($receiptStatus["indstatus"] as $ri) {
|
||||||
if(!($doc = $this->_dms->getDocument($ri['documentID'])))
|
if(!($doc = $this->_dms->getDocument($ri['documentID'])))
|
||||||
continue;
|
continue;
|
||||||
|
if($docs) {
|
||||||
|
if(!in_array($doc->getID(), $docs))
|
||||||
|
continue;
|
||||||
|
if(!$doc->isLatestContent($ri['version']))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
||||||
continue;
|
continue;
|
||||||
if($ri['status'] != -2 && (!isset($states['receipt']) || in_array($ri['status'], $states['receipt']))) {
|
if($ri['status'] != -2 && (!isset($states['receipt']) || in_array($ri['status'], $states['receipt']))) {
|
||||||
|
@ -1085,6 +1100,12 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
foreach ($revisionStatus["indstatus"] as $ri) {
|
foreach ($revisionStatus["indstatus"] as $ri) {
|
||||||
if(!($doc = $this->_dms->getDocument($ri['documentID'])))
|
if(!($doc = $this->_dms->getDocument($ri['documentID'])))
|
||||||
continue;
|
continue;
|
||||||
|
if($docs) {
|
||||||
|
if(!in_array($doc->getID(), $docs))
|
||||||
|
continue;
|
||||||
|
if(!$doc->isLatestContent($ri['version']))
|
||||||
|
continue;
|
||||||
|
}
|
||||||
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
if($newuser && $doc->getAccessMode($newuser) < M_READ)
|
||||||
continue;
|
continue;
|
||||||
if($ri['status'] != -2 && (!isset($states['revision']) || in_array($ri['status'], $states['revision']))) {
|
if($ri['status'] != -2 && (!isset($states['revision']) || in_array($ri['status'], $states['revision']))) {
|
||||||
|
@ -1123,14 +1144,14 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
* @param object $user the user doing the removal (needed for entry in
|
* @param object $user the user doing the removal (needed for entry in
|
||||||
* review and approve log).
|
* review and approve log).
|
||||||
* @param array $states remove user only from reviews/approvals in one of the states
|
* @param array $states remove user only from reviews/approvals in one of the states
|
||||||
* @param object user who takes over the processes
|
* @param object $newuser user who takes over the processes
|
||||||
* @return boolean true on success or false in case of an error
|
* @return boolean true on success or false in case of an error
|
||||||
*/
|
*/
|
||||||
public function removeFromProcesses($user, $states=array(), $newuser=null) { /* {{{ */
|
public function removeFromProcesses($user, $states=array(), $newuser=null, $docs=null) { /* {{{ */
|
||||||
$db = $this->_dms->getDB();
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
$db->startTransaction();
|
$db->startTransaction();
|
||||||
if(!$this->__removeFromProcesses($user, $states, $newuser)) {
|
if(!$this->__removeFromProcesses($user, $states, $newuser, $docs)) {
|
||||||
$db->rollbackTransaction();
|
$db->rollbackTransaction();
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
|
@ -240,14 +240,16 @@ else if ($action == "removefromprocesses") {
|
||||||
$_POST["status"]["receipt"] = array();
|
$_POST["status"]["receipt"] = array();
|
||||||
if(!isset($_POST["status"]["revision"]))
|
if(!isset($_POST["status"]["revision"]))
|
||||||
$_POST["status"]["revision"] = array();
|
$_POST["status"]["revision"] = array();
|
||||||
if (!$userToRemove->removeFromProcesses($user, $_POST['status'], $userToAssign)) {
|
if(!empty($_POST['needsdocs']) && empty($_POST['docs'])) {
|
||||||
UI::exitError(getMLText("admin_tools"),getMLText("error_occured"));
|
$session->setSplashMsg(array('type'=>'error', 'msg'=>getMLText('error_rm_user_processes_no_docs')));
|
||||||
|
} else {
|
||||||
|
if (!$userToRemove->removeFromProcesses($user, $_POST['status'], $userToAssign, $_POST['docs'])) {
|
||||||
|
UI::exitError(getMLText("admin_tools"),getMLText("error_rm_user_processes"));
|
||||||
}
|
}
|
||||||
|
|
||||||
add_log_line(".php&action=removefromprocesses&userid=".$userid);
|
add_log_line(".php&action=removefromprocesses&userid=".$userid);
|
||||||
|
|
||||||
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_user_processes')));
|
$session->setSplashMsg(array('type'=>'success', 'msg'=>getMLText('splash_rm_user_processes')));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// transfer all objects from one user to another one
|
// transfer all objects from one user to another one
|
||||||
|
|
|
@ -53,6 +53,11 @@ if (isset($_GET["task"])) {
|
||||||
$task = $_GET['task'];
|
$task = $_GET['task'];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$type = null;
|
||||||
|
if (isset($_GET["type"])) {
|
||||||
|
$type = $_GET['type'];
|
||||||
|
}
|
||||||
|
|
||||||
$allusers = $dms->getAllUsers($settings->_sortUsersInList);
|
$allusers = $dms->getAllUsers($settings->_sortUsersInList);
|
||||||
|
|
||||||
if($view) {
|
if($view) {
|
||||||
|
@ -60,6 +65,7 @@ if($view) {
|
||||||
$view->setParam('rmuser', $rmuser);
|
$view->setParam('rmuser', $rmuser);
|
||||||
$view->setParam('allusers', $allusers);
|
$view->setParam('allusers', $allusers);
|
||||||
$view->setParam('task', $task);
|
$view->setParam('task', $task);
|
||||||
|
$view->setParam('type', $type);
|
||||||
$view->setParam('cachedir', $settings->_cacheDir);
|
$view->setParam('cachedir', $settings->_cacheDir);
|
||||||
$view->setParam('rootfolder', $dms->getFolder($settings->_rootFolderID));
|
$view->setParam('rootfolder', $dms->getFolder($settings->_rootFolderID));
|
||||||
$view->setParam('conversionmgr', $conversionmgr);
|
$view->setParam('conversionmgr', $conversionmgr);
|
||||||
|
|
|
@ -43,7 +43,11 @@ $(document).ready( function() {
|
||||||
$('body').on('click', 'label.checkbox, td span', function(ev){
|
$('body').on('click', 'label.checkbox, td span', function(ev){
|
||||||
ev.preventDefault();
|
ev.preventDefault();
|
||||||
$('#kkkk.ajax').data('action', $(this).data('action'));
|
$('#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'), type: $(this).data('type')});
|
||||||
|
});
|
||||||
|
$('body').on('click', '#selectall', function(ev){
|
||||||
|
$("input.markforprocess").each(function () { this.checked = !this.checked; });
|
||||||
|
ev.preventDefault();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
<?php
|
<?php
|
||||||
|
@ -60,7 +64,9 @@ $(document).ready( function() {
|
||||||
$previewconverters = $this->params['previewconverters'];
|
$previewconverters = $this->params['previewconverters'];
|
||||||
$timeout = $this->params['timeout'];
|
$timeout = $this->params['timeout'];
|
||||||
$rmuser = $this->params['rmuser'];
|
$rmuser = $this->params['rmuser'];
|
||||||
|
$allusers = $this->params['allusers'];
|
||||||
$task = $this->params['task'];
|
$task = $this->params['task'];
|
||||||
|
$type = $this->params['type'];
|
||||||
|
|
||||||
if(!$task)
|
if(!$task)
|
||||||
return;
|
return;
|
||||||
|
@ -239,12 +245,23 @@ $(document).ready( function() {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if($docs) {
|
if($docs) {
|
||||||
|
echo '<form id="processform" action="../op/op.UsrMgr.php" method="post">';
|
||||||
|
echo '<input type="hidden" name="userid" value="'.$rmuser->getID().'">';
|
||||||
|
if($type) {
|
||||||
|
$kk = explode('_', $type, 2);
|
||||||
|
echo '<input type="hidden" name="status['.$kk[0].'][]" value="'.$kk[1].'">';
|
||||||
|
}
|
||||||
|
echo '<input type="hidden" name="task" value="'.$task.'">';
|
||||||
|
echo '<input type="hidden" name="action" value="removefromprocesses">';
|
||||||
|
echo '<input type="hidden" name="needsdocs" value="1">';
|
||||||
|
echo createHiddenFieldWithKey('removefromprocesses');
|
||||||
print "<table class=\"table table-condensed table-sm\">";
|
print "<table class=\"table table-condensed table-sm\">";
|
||||||
print "<thead>\n<tr>\n";
|
print "<thead>\n<tr>\n";
|
||||||
print "<th></th>\n";
|
print "<th></th>\n";
|
||||||
print "<th>".getMLText("name")."</th>\n";
|
print "<th>".getMLText("name")."</th>\n";
|
||||||
print "<th>".getMLText("status")."</th>\n";
|
print "<th>".getMLText("status")."</th>\n";
|
||||||
print "<th>".getMLText("action")."</th>\n";
|
print "<th>".getMLText("action")."</th>\n";
|
||||||
|
print "<th><span id=\"selectall\"><i class=\"fa fa-arrows-h\" title=\"".getMLText('object_cleaner_toggle_checkboxes')."\"></i></span></th>\n";
|
||||||
print "</tr>\n</thead>\n<tbody>\n";
|
print "</tr>\n</thead>\n<tbody>\n";
|
||||||
foreach($docs as $document) {
|
foreach($docs as $document) {
|
||||||
$document->verifyLastestContentExpriry();
|
$document->verifyLastestContentExpriry();
|
||||||
|
@ -258,11 +275,33 @@ $(document).ready( function() {
|
||||||
$extracontent['below_title'] = $this->getListRowPath($document);
|
$extracontent['below_title'] = $this->getListRowPath($document);
|
||||||
echo $this->documentListRowStart($document);
|
echo $this->documentListRowStart($document);
|
||||||
echo $this->documentListRow($document, $previewer, true, 0, $extracontent);
|
echo $this->documentListRow($document, $previewer, true, 0, $extracontent);
|
||||||
|
echo '<td>';
|
||||||
|
echo '<input type="checkbox" class="markforprocess" value="'.$document->getId().'" name="docs['.$document->getId().']">';
|
||||||
|
echo '</td>';
|
||||||
echo $this->documentListRowEnd($document);
|
echo $this->documentListRowEnd($document);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
echo "</tbody>\n</table>";
|
echo "</tbody>\n</table>";
|
||||||
|
$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
|
||||||
|
)
|
||||||
|
);
|
||||||
|
echo '<p><button type="submit" class="btn btn-primary"><i class="fa fa-remove"></i> '.getMLText('transfer').'</button>';
|
||||||
|
echo '</form>';
|
||||||
}
|
}
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
@ -467,7 +506,7 @@ $(document).ready( function() {
|
||||||
<?php
|
<?php
|
||||||
echo "<table class=\"table table-condensed table-sm\">";
|
echo "<table class=\"table table-condensed table-sm\">";
|
||||||
foreach($out as $o) {
|
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 "<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]."\" data-type=\"".$o[1]."_".$o[0]."\"><i class=\"fa fa-list\"></i></span></td></tr>";
|
||||||
}
|
}
|
||||||
echo "</table>";
|
echo "</table>";
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user