mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 12:41:30 +00:00
add methods isMandatoryReviewerOf() and isMandatoryApproverOf()
This commit is contained in:
parent
df0069024f
commit
a0600573dc
|
@ -1209,6 +1209,52 @@ class SeedDMS_Core_User { /* {{{ */
|
||||||
return $resArr;
|
return $resArr;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of users this user is a mandatory reviewer of
|
||||||
|
*
|
||||||
|
* This method is the reverse function of getMandatoryReviewers(). It returns
|
||||||
|
* those user where the current user is a mandatory reviewer.
|
||||||
|
*
|
||||||
|
* @return array list of users where this user is a mandatory reviewer.
|
||||||
|
*/
|
||||||
|
function isMandatoryReviewerOf() { /* {{{ */
|
||||||
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
$queryStr = "SELECT * FROM `tblMandatoryReviewers` WHERE `reviewerUserID` = " . $this->_id;
|
||||||
|
$resArr = $db->getResultArray($queryStr);
|
||||||
|
if (is_bool($resArr) && !$resArr) return false;
|
||||||
|
|
||||||
|
$users = array();
|
||||||
|
foreach($resArr as $res) {
|
||||||
|
$users[] = self::getInstance($res['userID'], $this->_dms);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $users;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get a list of users this user is a mandatory approver of
|
||||||
|
*
|
||||||
|
* This method is the reverse function of getMandatoryApprovers(). It returns
|
||||||
|
* those user where the current user is a mandatory approver.
|
||||||
|
*
|
||||||
|
* @return array list of users where this user is a mandatory approver.
|
||||||
|
*/
|
||||||
|
function isMandatoryApproverOf() { /* {{{ */
|
||||||
|
$db = $this->_dms->getDB();
|
||||||
|
|
||||||
|
$queryStr = "SELECT * FROM `tblMandatoryApprovers` WHERE `approverUserID` = " . $this->_id;
|
||||||
|
$resArr = $db->getResultArray($queryStr);
|
||||||
|
if (is_bool($resArr) && !$resArr) return false;
|
||||||
|
|
||||||
|
$users = array();
|
||||||
|
foreach($resArr as $res) {
|
||||||
|
$users[] = self::getInstance($res['userID'], $this->_dms);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $users;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get the mandatory workflow
|
* Get the mandatory workflow
|
||||||
* A user which isn't trusted completely may have assigned mandatory
|
* A user which isn't trusted completely may have assigned mandatory
|
||||||
|
|
Loading…
Reference in New Issue
Block a user