mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-02-06 23:24:57 +00:00
SeedDMS_Core_Document::checkForDueRevisionWorkflow() also checks if there are any waiting or pending revisions at all
This commit is contained in:
parent
6aee48fc08
commit
37e03e2e9e
|
@ -706,6 +706,9 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
* The method will update the document status log database table
|
* The method will update the document status log database table
|
||||||
* if needed.
|
* if needed.
|
||||||
*
|
*
|
||||||
|
* FIXME: This method does not check if there are any revisors left. Even
|
||||||
|
* if all revisors have been removed, it will still start the revision workflow!
|
||||||
|
*
|
||||||
* @param object $user user requesting the possible automatic change
|
* @param object $user user requesting the possible automatic change
|
||||||
* @param string $next next date for review
|
* @param string $next next date for review
|
||||||
* @return boolean true if status has changed
|
* @return boolean true if status has changed
|
||||||
|
@ -716,6 +719,22 @@ class SeedDMS_Core_Document extends SeedDMS_Core_Object { /* {{{ */
|
||||||
$st=$lc->getStatus();
|
$st=$lc->getStatus();
|
||||||
|
|
||||||
if($st["status"] == S_RELEASED) {
|
if($st["status"] == S_RELEASED) {
|
||||||
|
/* First check if there are any revisors left who need to revise */
|
||||||
|
$pendingRevision=false;
|
||||||
|
unset($this->_revisionStatus); // force to be reloaded from DB
|
||||||
|
$revisionStatus=$lc->getRevisionStatus();
|
||||||
|
if (is_array($revisionStatus) && count($revisionStatus)>0) {
|
||||||
|
foreach ($revisionStatus as $a){
|
||||||
|
if ($a["status"]==S_LOG_SLEEPING || $a["status"]==S_LOG_SLEEPING){
|
||||||
|
$pendingRevision=true;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if(!$pendingRevision)
|
||||||
|
return false;
|
||||||
|
|
||||||
|
/* Second check if revision is already due */
|
||||||
if($lc->getRevisionDate() && $lc->getRevisionDate() <= date('Y-m-d 00:00:00')) {
|
if($lc->getRevisionDate() && $lc->getRevisionDate() <= date('Y-m-d 00:00:00')) {
|
||||||
if($lc->startRevision($user, 'Automatic start of revision workflow')) {
|
if($lc->startRevision($user, 'Automatic start of revision workflow')) {
|
||||||
if($next) {
|
if($next) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user