mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 15:14:58 +00:00
initial version of removeProcessWithoutUserGroup()
This commit is contained in:
parent
0e6bd00f96
commit
c5a67c2aeb
|
@ -2219,6 +2219,41 @@ class SeedDMS_Core_DMS {
|
|||
return $this->db->getResultArray($queryStr);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Removes all reviews, approvals which are not linked
|
||||
* to a user, group anymore
|
||||
*
|
||||
* This method is for removing all reviews or approvals whose user
|
||||
* or group was deleted and not just removed from the process.
|
||||
* If the optional parameter $id is set, only this user/group id is removed.
|
||||
*/
|
||||
function removeProcessWithoutUserGroup($process, $usergroup, $id=0) { /* {{{ */
|
||||
switch($process) {
|
||||
case 'review':
|
||||
$queryStr = "DELETE FROM tblDocumentReviewers";
|
||||
break;
|
||||
case 'approval':
|
||||
$queryStr = "DELETE FROM tblDocumentApprovers";
|
||||
break;
|
||||
}
|
||||
$queryStr .= " WHERE";
|
||||
switch($usergroup) {
|
||||
case 'user':
|
||||
$queryStr .= " type=0 AND";
|
||||
if($id)
|
||||
$queryStr .= " required=".((int) $id)." AND";
|
||||
$queryStr .= " required NOT IN (SELECT id FROM tblUsers)";
|
||||
break;
|
||||
case 'group':
|
||||
$queryStr .= " type=1 AND";
|
||||
if($id)
|
||||
$queryStr .= " required=".((int) $id)." AND";
|
||||
$queryStr .= " required NOT IN (SELECT id FROM tblGroups)";
|
||||
break;
|
||||
}
|
||||
return $this->db->getResultArray($queryStr);
|
||||
} /* }}} */
|
||||
|
||||
/**
|
||||
* Returns statitical information
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue
Block a user