- better error checking in verifyLastestContentExpriry() just in case the

latest content could not be found
This commit is contained in:
steinm 2011-07-20 07:14:55 +00:00
parent 4bfcad0784
commit 44278d35be

View File

@ -464,15 +464,17 @@ class LetoDMS_Core_Document { /* {{{ */
// return true if status has changed (to reload page)
function verifyLastestContentExpriry(){ /* {{{ */
$lc=$this->getLatestContent();
$st=$lc->getStatus();
if($lc) {
$st=$lc->getStatus();
if (($st["status"]==S_DRAFT_REV || $st["status"]==S_DRAFT_APP) && $this->hasExpired()){
$lc->setStatus(S_EXPIRED,"");
return true;
}
else if ($st["status"]==S_EXPIRED && !$this->hasExpired() ){
$lc->verifyStatus(true);
return true;
if (($st["status"]==S_DRAFT_REV || $st["status"]==S_DRAFT_APP) && $this->hasExpired()){
$lc->setStatus(S_EXPIRED,"");
return true;
}
else if ($st["status"]==S_EXPIRED && !$this->hasExpired() ){
$lc->verifyStatus(true);
return true;
}
}
return false;
} /* }}} */