Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2017-07-28 18:25:49 +02:00
commit a2802f124d
3 changed files with 55 additions and 0 deletions

View File

@ -1712,6 +1712,52 @@ class SeedDMS_Core_User { /* {{{ */
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
* A user which isn't trusted completely may have assigned mandatory

View File

@ -1505,6 +1505,7 @@ if the owner tries to access them
- SeedDMS_Core_Document::getNotifyList() and SeedDMS_Core_Folder::getNotifyList()
returns just users which are not disabled
- add new methods removeFromProcesses(), getWorkflowsInvolved(), getKeywordCategories() to SeedDMS_Core_User
- add methods isMandatoryReviewerOf() and isMandatoryApproverOf()
</notes>
</release>
<release>

View File

@ -134,6 +134,14 @@ $(document).ready( function() {
}
echo "<tr><td>".getMLText('pending_approvals')."</td><td>".count($tasks['approval'])."</td></tr>\n";
}
$resArr = $seluser->isMandatoryReviewerOf();
if($resArr) {
echo "<tr><td>".getMLText('mandatory_reviewers')."</td><td>".count($resArr)."</td></tr>\n";
}
$resArr = $seluser->isMandatoryApproverOf();
if($resArr) {
echo "<tr><td>".getMLText('mandatory_approvers')."</td><td>".count($resArr)."</td></tr>\n";
}
}
$resArr = $dms->getDocumentList('ReceiptByMe', $seluser);
if($resArr) {