check for workflow state != null

This commit is contained in:
Uwe Steinmann 2021-06-01 10:52:00 +02:00
parent 6de32dcc2c
commit 3366d9a149

View File

@ -49,18 +49,22 @@ class SeedDMS_View_RemoveWorkflowFromDocument extends SeedDMS_Theme_Style {
$wkflog = $latestContent->getWorkflowLog();
$workflow = $latestContent->getWorkflow();
$msg = "The document is currently in state: ".$currentstate->getName()."<br />";
if($wkflog) {
foreach($wkflog as $entry) {
if($entry->getTransition()->getNextState()->getID() == $currentstate->getID()) {
$enterdate = $entry->getDate();
$enterts = makeTsFromLongDate($enterdate);
if($currentstate) {
$msg = "The document is currently in state: ".$currentstate->getName()."<br />";
if($wkflog) {
foreach($wkflog as $entry) {
if($entry->getTransition()->getNextState()->getID() == $currentstate->getID()) {
$enterdate = $entry->getDate();
$enterts = makeTsFromLongDate($enterdate);
}
}
$msg .= "The state was entered at ".$enterdate." which was ";
$msg .= getReadableDuration((time()-$enterts))." ago.<br />";
}
$msg .= "The state was entered at ".$enterdate." which was ";
$msg .= getReadableDuration((time()-$enterts))." ago.<br />";
$msg .= "The document may stay in this state for ".$currentstate->getMaxTime()." sec.";
} else {
$msg = getMLText('workflow_in_unknown_state');
}
$msg .= "The document may stay in this state for ".$currentstate->getMaxTime()." sec.";
$this->infoMsg($msg);
$this->contentContainerStart();