mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-03-12 00:45:34 +00:00
maySetReviewersApprovers() checks if review/approval has been done already
This commit is contained in:
parent
0c3355ed9d
commit
ea8a695551
|
@ -114,15 +114,28 @@ class SeedDMS_AccessOperation {
|
|||
*
|
||||
* This check can only be done for documents. Overwriting the document
|
||||
* reviewers/approvers is only allowed if version modification is turned on
|
||||
* in the settings and the document is in 'draft review' status. The
|
||||
* admin may even set reviewers/approvers if is disallowed in the
|
||||
* in the settings and the document has not been reviewed/approved by any
|
||||
* user/group already.
|
||||
* The admin may even set reviewers/approvers if is disallowed in the
|
||||
* settings.
|
||||
*/
|
||||
function maySetReviewersApprovers() { /* {{{ */
|
||||
if(get_class($this->obj) == 'SeedDMS_Core_Document') {
|
||||
$latestContent = $this->obj->getLatestContent();
|
||||
$status = $latestContent->getStatus();
|
||||
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && ($status["status"]==S_DRAFT_REV || $status["status"]==S_DRAFT_APP && $this->settings->_workflowMode == 'traditional_only_approval')) {
|
||||
$reviewstatus = $latestContent->getReviewStatus();
|
||||
$hasreview = false;
|
||||
foreach($reviewstatus as $r) {
|
||||
if($r['status'] == 1 || $r['status'] == -1)
|
||||
$hasreview = true;
|
||||
}
|
||||
$approvalstatus = $latestContent->getApprovalStatus();
|
||||
$hasapproval = false;
|
||||
foreach($approvalstatus as $r) {
|
||||
if($r['status'] == 1 || $r['status'] == -1)
|
||||
$hasapproval = true;
|
||||
}
|
||||
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && (($status["status"]==S_DRAFT_REV && !$hasreview) || ($status["status"]==S_DRAFT_APP && !$hasreview && !$hasapproval))) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user