mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-14 21:51:32 +00:00
- added methods mayReview() and mayApprove()
This commit is contained in:
parent
d76d71893a
commit
7d59ae97a8
|
@ -110,15 +110,15 @@ class LetoDMS_AccessOperation {
|
||||||
*
|
*
|
||||||
* This check can only be done for documents. Setting the documents
|
* This check can only be done for documents. Setting the documents
|
||||||
* expiration date is only allowed if version modification is turned on in
|
* expiration date is only allowed if version modification is turned on in
|
||||||
* the settings and the document is in 'draft review', 'draft approval', or
|
* the settings and the document has not been obsoleted.
|
||||||
* 'expired' status. The admin may set the expiration date even if is
|
* The admin may set the expiration date even if is
|
||||||
* disallowed in the settings.
|
* disallowed in the settings.
|
||||||
*/
|
*/
|
||||||
function maySetExpires() { /* {{{ */
|
function maySetExpires() { /* {{{ */
|
||||||
if(get_class($this->obj) == 'LetoDMS_Core_Document') {
|
if(get_class($this->obj) == 'LetoDMS_Core_Document') {
|
||||||
$latestContent = $this->obj->getLatestContent();
|
$latestContent = $this->obj->getLatestContent();
|
||||||
$status = $latestContent->getStatus();
|
$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 || $status["status"]==S_EXPIRED)) {
|
if ((($this->settings->_enableVersionModification && ($this->obj->getAccessMode($this->user) == M_ALL)) || $this->user->isAdmin()) && ($status["status"]!=S_OBSOLETE)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -164,5 +164,41 @@ class LetoDMS_AccessOperation {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
} /* }}} */
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if document content may be reviewed
|
||||||
|
*
|
||||||
|
* Reviewing a document content is only allowed if the document was not
|
||||||
|
* obsoleted. There are other requirements which are not taken into
|
||||||
|
* account here.
|
||||||
|
*/
|
||||||
|
function mayReview() { /* {{{ */
|
||||||
|
if(get_class($this->obj) == 'LetoDMS_Core_Document') {
|
||||||
|
$latestContent = $this->obj->getLatestContent();
|
||||||
|
$status = $latestContent->getStatus();
|
||||||
|
if ($status["status"]!=S_OBSOLETE) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} /* }}} */
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check if document content may be approved
|
||||||
|
*
|
||||||
|
* Approving a document content is only allowed if the document was not
|
||||||
|
* obsoleted. There are other requirements which are not taken into
|
||||||
|
* account here.
|
||||||
|
*/
|
||||||
|
function mayApprove() { /* {{{ */
|
||||||
|
if(get_class($this->obj) == 'LetoDMS_Core_Document') {
|
||||||
|
$latestContent = $this->obj->getLatestContent();
|
||||||
|
$status = $latestContent->getStatus();
|
||||||
|
if ($status["status"]!=S_OBSOLETE) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
} /* }}} */
|
||||||
}
|
}
|
||||||
?>
|
?>
|
||||||
|
|
Loading…
Reference in New Issue
Block a user