correct processing of return value of getWorkflowLog()

This commit is contained in:
Uwe Steinmann 2021-08-20 08:46:18 +02:00
parent f19ed34d25
commit 7b807f8d67
4 changed files with 17 additions and 11 deletions

View File

@ -46,7 +46,8 @@ class SeedDMS_View_RemoveWorkflowFromDocument extends SeedDMS_Theme_Style {
$this->contentHeading(getMLText("rm_workflow"));
$currentstate = $latestContent->getWorkflowState();
$wkflog = $latestContent->getWorkflowLog();
$wkflogs = $latestContent->getWorkflowLog();
$wkflog = array_shift($wkflogs);
$workflow = $latestContent->getWorkflow();
if($currentstate) {
@ -58,8 +59,10 @@ class SeedDMS_View_RemoveWorkflowFromDocument extends SeedDMS_Theme_Style {
$enterts = makeTsFromLongDate($enterdate);
}
}
$msg .= "The state was entered at ".$enterdate." which was ";
$msg .= getReadableDuration((time()-$enterts))." ago.<br />";
if(!empty($enterdate)) {
$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 {
@ -96,12 +99,12 @@ class SeedDMS_View_RemoveWorkflowFromDocument extends SeedDMS_Theme_Style {
echo "<tr><th>".getMLText('action')."</th><th>Start state</th><th>End state</th><th>".getMLText('date')."</th><th>".getMLText('user')."</th><th>".getMLText('comment')."</th></tr>";
foreach($wkflog as $entry) {
echo "<tr>";
echo "<td>".getMLText('action_'.$entry->getTransition()->getAction()->getName())."</td>";
echo "<td>".$entry->getTransition()->getState()->getName()."</td>";
echo "<td>".$entry->getTransition()->getNextState()->getName()."</td>";
echo "<td>".htmlspecialchars(getMLText('action_'.$entry->getTransition()->getAction()->getName()))."</td>";
echo "<td>".htmlspecialchars($entry->getTransition()->getState()->getName())."</td>";
echo "<td>".htmlspecialchars($entry->getTransition()->getNextState()->getName())."</td>";
echo "<td>".$entry->getDate()."</td>";
echo "<td>".$entry->getUser()->getFullname()."</td>";
echo "<td>".$entry->getComment()."</td>";
echo "<td>".htmlspecialchars($entry->getUser()->getFullname())."</td>";
echo "<td>".htmlspecialchars($entry->getComment())."</td>";
echo "</tr>";
}
echo "</table>\n";

View File

@ -77,7 +77,8 @@ $(document).ready(function() {
$this->contentHeading(getMLText("return_from_subworkflow"));
$currentstate = $latestContent->getWorkflowState();
$wkflog = $latestContent->getWorkflowLog();
$wkflogs = $latestContent->getWorkflowLog();
$wkflog = array_shift($wkflogs);
$workflow = $latestContent->getWorkflow();
$parentworkflow = $latestContent->getParentWorkflow();

View File

@ -46,7 +46,8 @@ class SeedDMS_View_RewindWorkflow extends SeedDMS_Theme_Style {
$this->contentHeading(getMLText("rewind_workflow"));
$currentstate = $latestContent->getWorkflowState();
$wkflog = array_pop($latestContent->getWorkflowLog());
$wkflogs = $latestContent->getWorkflowLog();
$wkflog = array_shift($wkflogs);
$workflow = $latestContent->getWorkflow();
if($currentstate) {

View File

@ -47,7 +47,8 @@ class SeedDMS_View_RunSubWorkflow extends SeedDMS_Theme_Style {
$this->contentHeading(getMLText("run_subworkflow"));
$currentstate = $latestContent->getWorkflowState();
$wkflog = $latestContent->getWorkflowLog();
$wkflogs = $latestContent->getWorkflowLog();
$wkflog = array_shift($wkflogs);
$workflow = $latestContent->getWorkflow();
$msg = "The document is currently in state: ".$currentstate->getName()."<br />";