From aa9600453d285766cdb915f3776e01e5f2c65088 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sun, 12 Nov 2023 17:36:01 +0100 Subject: [PATCH 1/2] show logs of finished worflows --- views/bootstrap/class.Bootstrap.php | 17 ++++++++++ .../bootstrap/class.DocumentVersionDetail.php | 29 +++++++---------- views/bootstrap/class.ViewDocument.php | 32 ++++++++++--------- views/bootstrap4/class.Bootstrap4.php | 17 ++++++++++ 4 files changed, 62 insertions(+), 33 deletions(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index f69ec0da9..824d6f9e6 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -3727,6 +3727,23 @@ $(document).ready(function() { "; + echo "".getMLText('workflow')."".getMLText('date')."".getMLText('action')."".getMLText('user')."".getMLText('comment')."\n"; + echo ""; + foreach($wkflogs as $wkflog) { + echo ""; + echo "".htmlspecialchars($wkflog->getWorkflow()->getName()).""; + echo "".getLongReadableDate($wkflog->getDate()).""; + echo "".htmlspecialchars(getMLText('action_'.strtolower($wkflog->getTransition()->getAction()->getName()), array(), $wkflog->getTransition()->getAction()->getName())).""; + $loguser = $wkflog->getUser(); + echo "".htmlspecialchars($loguser->getFullName()).""; + echo "".htmlspecialchars($wkflog->getComment()).""; + echo ""; + } + print "\n\n"; + } /* }}} */ + /** * Show progressbar * diff --git a/views/bootstrap/class.DocumentVersionDetail.php b/views/bootstrap/class.DocumentVersionDetail.php index 9ea58444e..4d751bff9 100644 --- a/views/bootstrap/class.DocumentVersionDetail.php +++ b/views/bootstrap/class.DocumentVersionDetail.php @@ -554,7 +554,7 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style { $this->contentContainerEnd(); } /* }}} */ - if($user->isAdmin()) { + if($accessop->check_view_access($this, array('action'=>'statuslog'))) { $this->contentHeading(getMLText("status")); $this->contentContainerStart(); $statuslog = $version->getStatusLog(); @@ -570,26 +570,19 @@ class SeedDMS_View_DocumentVersionDetail extends SeedDMS_Theme_Style { } print "\n\n"; $this->contentContainerEnd(); + } - $wkflogs = $version->getWorkflowLog(); - if($wkflogs) { - $this->contentHeading(getMLText("workflow_summary")); - $this->contentContainerStart(); - echo ""; - echo "\n"; - echo ""; - foreach($wkflogs as $wkflog) { - echo ""; - echo ""; - echo ""; - $loguser = $wkflog->getUser(); - echo ""; - echo ""; - echo ""; + if($accessop->check_view_access($this, array('action'=>'finished_workflowlog'))) { + $wkfalllogs = $version->getWorkflowLog(); + if($wkfalllogs) { + $this->contentHeading(getMLText("finished_workflow_log")); + foreach($wkfalllogs as $wkflogs) { + $this->printWorkflowLog($wkflogs); } - print "\n
".getMLText('date')."".getMLText('action')."".getMLText('user')."".getMLText('comment')."
".$wkflog->getDate()."".$wkflog->getTransition()->getAction()->getName()."".$loguser->getFullName()."".$wkflog->getComment()."
\n"; - $this->contentContainerEnd(); } + } + + if($user->isAdmin() || $user->getId() == $document->getOwner()->getId()) { $this->rowStart(); /* Check for an existing review log, even if the workflowmode * is set to traditional_only_approval. There may be old documents diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 1b63523a4..580f12aa5 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -1039,6 +1039,22 @@ $(document).ready( function() { print "\n\n"; $this->contentContainerEnd(); } + + if(!$workflow) { + if($accessobject->check_view_access($this, array('action'=>'finished_workflowlog'))) { + $wkfalllogs = $latestContent->getWorkflowLog(); + if($wkfalllogs) { + $this->contentHeading(getMLText("finished_workflow_log")); + foreach($wkfalllogs as $wkflogs) { + $this->rowStart(); + $this->columnStart(12); + $this->printWorkflowLog($wkflogs); + $this->columnEnd(); + $this->rowEnd(); + } + } + } + } ?> rowStart(); $this->columnStart(12); $this->contentHeading(getMLText("workflow_log")); - $this->contentContainerStart(); - echo ""; - echo "\n"; - echo ""; - foreach($wkflogs as $wkflog) { - echo ""; - echo ""; - echo ""; - $loguser = $wkflog->getUser(); - echo ""; - echo ""; - echo ""; - } - print "\n
".getMLText('date')."".getMLText('action')."".getMLText('user')."".getMLText('comment')."
".getLongReadableDate($wkflog->getDate())."".htmlspecialchars(getMLText('action_'.strtolower($wkflog->getTransition()->getAction()->getName()), array(), $wkflog->getTransition()->getAction()->getName()))."".htmlspecialchars($loguser->getFullName())."".htmlspecialchars($wkflog->getComment())."
\n"; - $this->contentContainerEnd(); + $this->printWorkflowLog($wkflogs); $this->columnEnd(); $this->rowEnd(); } diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 01830c2e6..b47340aee 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -3809,6 +3809,23 @@ $(document).ready(function() { "; + echo "".getMLText('workflow')."".getMLText('date')."".getMLText('action')."".getMLText('user')."".getMLText('comment')."\n"; + echo ""; + foreach($wkflogs as $wkflog) { + echo ""; + echo "".htmlspecialchars($wkflog->getWorkflow()->getName()).""; + echo "".getLongReadableDate($wkflog->getDate()).""; + echo "".htmlspecialchars(getMLText('action_'.strtolower($wkflog->getTransition()->getAction()->getName()), array(), $wkflog->getTransition()->getAction()->getName())).""; + $loguser = $wkflog->getUser(); + echo "".htmlspecialchars($loguser->getFullName()).""; + echo "".htmlspecialchars($wkflog->getComment()).""; + echo ""; + } + print "\n\n"; + } /* }}} */ + /** * Show progressbar * From 9132e2805234a5a2f83eed7219e38fb31a5359ab Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Sun, 12 Nov 2023 17:36:44 +0100 Subject: [PATCH 2/2] add changes for 5.1.33 --- CHANGELOG | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG b/CHANGELOG index ff83c6928..2134d49ee 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -16,6 +16,7 @@ - set max file size for indexing when updating a document - nicer output on info page - do not show filter for categories in database search if they don't exist +- show logs of finished worflows -------------------------------------------------------------------------------- Changes in version 5.1.32