add method getProcessWithoutUserGroup()

checks for reviews/approvals which have lost its user or group
This commit is contained in:
Uwe Steinmann 2017-08-02 17:30:54 +02:00
parent 3406739f94
commit 098f15202c

View File

@ -2191,6 +2191,34 @@ class SeedDMS_Core_DMS {
} /* }}} */
/**
* Returns a list of reviews, approvals which are not linked
* to a user, group anymore
*
* This method is for finding reviews or approvals whose user
* or group was deleted and not just removed from the process.
*/
function getProcessWithoutUserGroup($process, $usergroup) { /* {{{ */
switch($process) {
case 'review':
$queryStr = "SELECT a.*, b.name FROM tblDocumentReviewers";
break;
case 'approval':
$queryStr = "SELECT a.*, b.name FROM tblDocumentApprovers";
break;
}
$queryStr .= " a LEFT JOIN tblDocuments b ON a.documentID=b.id where";
switch($usergroup) {
case 'user':
$queryStr .= " a.type=0 and a.required not in (select id from tblUsers) ORDER by b.id";
break;
case 'group':
$queryStr .= " a.type=1 and a.required not in (select id from tblGroups) ORDER by b.id";
break;
}
return $this->db->getResultArray($queryStr);
} /* }}} */
/**
* Returns statitical information
*