From fd4131497b77a8ef274a93e951e66a187823b5f9 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 20 Aug 2021 09:42:27 +0200 Subject: [PATCH 1/9] escape special chars in missing translation form --- views/bootstrap/class.Bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 849faef0a..f5cc53db3 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -245,7 +245,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; echo ""; echo "\n"; foreach($MISSING_LANG as $key=>$lang) { - echo ""; + echo ""; } echo "
Keyengl. TextYour translation
".$key."".(isset($LANG['en_GB'][$key]) ? $LANG['en_GB'][$key] : '')."
".htmlspecialchars($key)."".(isset($LANG['en_GB'][$key]) ? $LANG['en_GB'][$key] : '')."
"; echo "
There are missing translations on this page!
Please check the bottom of the page.
\n"; From 588369b64d22480a5d99ccada16b8d2e5ee00154 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 20 Aug 2021 09:43:09 +0200 Subject: [PATCH 2/9] fix table class --- views/bootstrap/class.Bootstrap.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index f5cc53db3..d79de307b 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -3340,7 +3340,7 @@ $(document).ready(function() { $accessop = $this->params['accessobject']; ?> - +
Date: Fri, 20 Aug 2021 09:44:02 +0200 Subject: [PATCH 3/9] show translated action name in workflow log --- views/bootstrap/class.ViewDocument.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index bae1729f9..36f160e0d 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -940,7 +940,7 @@ $(document).ready( function() { $wkflogs = $latestContent->getWorkflowLog(); if($wkflogs) { - $this->contentHeading(getMLText("workflow_summary")); + $this->contentHeading(getMLText("workflow_log")); $this->contentContainerStart(); echo "
,
"; echo "\n"; @@ -948,7 +948,7 @@ $(document).ready( function() { foreach($wkflogs as $wkflog) { echo ""; echo ""; - echo ""; + echo ""; $loguser = $wkflog->getUser(); echo ""; echo ""; From ee654df47536d8aa5dd91df7199dedba658b6044 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 20 Aug 2021 09:44:30 +0200 Subject: [PATCH 4/9] fix css to mostly prevent scroll bars --- views/bootstrap/class.WorkflowGraph.php | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/views/bootstrap/class.WorkflowGraph.php b/views/bootstrap/class.WorkflowGraph.php index 7e6f761e5..ba579020e 100644 --- a/views/bootstrap/class.WorkflowGraph.php +++ b/views/bootstrap/class.WorkflowGraph.php @@ -324,15 +324,15 @@ div.buttons button {margin: 3px; _float: right;} div.buttons #zoom {margin: 3px; _float: right;} #legend {display: inline-block; margin-left: 10px;} #preview {height: 122px; background: #f5f5f5; border-top: 1px solid #e3e3e3;} -#preview img {float: left;border: 1px solid #bbb; background: #fff; min-height: 115px; height: 115px; _width: 100px; padding: 3px; margin: 3px;} +#preview img {float: left;border: 1px solid #bbb; background: #fff; min-height: 18vh; height: 18vh; _width: 100px; padding: 3px; margin: 3px;} ', 'css'); $this->htmlStartPage(getMLText("admin_tools")); // $this->contentContainerStart(); ?> -
-
+
+

From f18ab76b63605523edffea621b5e0a0609030808 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 20 Aug 2021 09:45:35 +0200 Subject: [PATCH 5/9] escape special chars in translation form --- views/bootstrap4/class.Bootstrap4.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 2104311d2..55d5ab6fc 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -245,7 +245,7 @@ background-image: linear-gradient(to bottom, #882222, #111111);; echo "
".getMLText('date')."".getMLText('action')."".getMLText('user')."".getMLText('comment')."
".$wkflog->getDate()."".htmlspecialchars($wkflog->getTransition()->getAction()->getName())."".htmlspecialchars(getMLText('action_'.strtolower($wkflog->getTransition()->getAction()->getName()), array(), $wkflog->getTransition()->getAction()->getName()))."".htmlspecialchars($loguser->getFullName())."".htmlspecialchars($wkflog->getComment())."
"; echo "\n"; foreach($MISSING_LANG as $key=>$lang) { - echo ""; + echo ""; } echo "
Keyengl. TextYour translation
".$key."".(isset($LANG['en_GB'][$key]) ? $LANG['en_GB'][$key] : '')."
".htmlspecialchars($key)."".(isset($LANG['en_GB'][$key]) ? $LANG['en_GB'][$key] : '')."
"; echo "
There are missing translations on this page!
Please check the bottom of the page.
\n"; From 3a26fc3e2a6d84ed6e1fcd0dfe2c6678e6dcaaa8 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 20 Aug 2021 09:45:58 +0200 Subject: [PATCH 6/9] use a unified layout --- .../class.RemoveWorkflowFromDocument.php | 32 ++++++++++--------- views/bootstrap/class.RewindWorkflow.php | 23 +++++++------ views/bootstrap/class.RunSubWorkflow.php | 30 ++++++++--------- views/bootstrap/class.TriggerWorkflow.php | 29 +++++++++-------- 4 files changed, 60 insertions(+), 54 deletions(-) diff --git a/views/bootstrap/class.RemoveWorkflowFromDocument.php b/views/bootstrap/class.RemoveWorkflowFromDocument.php index 98fa89fac..c53617df5 100644 --- a/views/bootstrap/class.RemoveWorkflowFromDocument.php +++ b/views/bootstrap/class.RemoveWorkflowFromDocument.php @@ -58,21 +58,23 @@ 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.
"; + if(!empty($enterdate)) { + $msg .= "The state was entered at ".$enterdate." which was "; + $msg .= getReadableDuration((time()-$enterts))." ago.
"; + } } $msg .= "The document may stay in this state for ".$currentstate->getMaxTime()." sec."; } else { $msg = getMLText('workflow_in_unknown_state'); } - $this->infoMsg($msg); - - $this->contentContainerStart(); + //$this->contentContainerStart(); // Display the Workflow form. $this->rowStart(); $this->columnStart(4); + $this->infoMsg($msg); + + $this->warningMsg(getMLText('rm_workflow_warning')); ?> -

@@ -88,24 +90,24 @@ class SeedDMS_View_RemoveWorkflowFromDocument extends SeedDMS_Theme_Style { columnEnd(); - $this->contentContainerEnd(); + $this->rowEnd(); + //$this->contentContainerEnd(); if($wkflog) { - $this->contentContainerStart(); - echo ""; + $this->contentHeading(getMLText("workflow_log")); + echo "
"; echo ""; foreach($wkflog as $entry) { echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } echo "
".getMLText('action')."Start stateEnd state".getMLText('date')."".getMLText('user')."".getMLText('comment')."
".getMLText('action_'.$entry->getTransition()->getAction()->getName())."".$entry->getTransition()->getState()->getName()."".$entry->getTransition()->getNextState()->getName()."".htmlspecialchars(getMLText('action_'.$entry->getTransition()->getAction()->getName()))."".htmlspecialchars($entry->getTransition()->getState()->getName())."".htmlspecialchars($entry->getTransition()->getNextState()->getName())."".$entry->getDate()."".$entry->getUser()->getFullname()."".$entry->getComment()."".htmlspecialchars($entry->getUser()->getFullname())."".htmlspecialchars($entry->getComment())."
\n"; - $this->contentContainerEnd(); } $this->rowEnd(); diff --git a/views/bootstrap/class.RewindWorkflow.php b/views/bootstrap/class.RewindWorkflow.php index 09b142c69..5315b75ac 100644 --- a/views/bootstrap/class.RewindWorkflow.php +++ b/views/bootstrap/class.RewindWorkflow.php @@ -58,20 +58,22 @@ class SeedDMS_View_RewindWorkflow extends SeedDMS_Theme_Style { $enterts = makeTsFromLongDate($enterdate); } } - $msg .= "The state was entered at ".$enterdate." which was "; - $msg .= getReadableDuration((time()-$enterts))." ago.
"; + if(!empty($enterdate)) { + $msg .= "The state was entered at ".$enterdate." which was "; + $msg .= getReadableDuration((time()-$enterts))." ago.
"; + } } $msg .= "The document may stay in this state for ".$currentstate->getMaxTime()." sec."; } else { $msg = getMLText('workflow_in_unknown_state'); } - $this->infoMsg($msg); // Display the Workflow form. $this->rowStart(); $this->columnStart(4); + $this->infoMsg($msg); + $this->warningMsg(getMLText("rewind_workflow_warning")); ?> - warningMsg(getMLText("rewind_workflow_warning")); ?> @@ -83,23 +85,24 @@ class SeedDMS_View_RewindWorkflow extends SeedDMS_Theme_Style { $this->columnStart(8); ?>
- +
columnEnd(); $this->rowEnd(); if($wkflog) { + $this->contentHeading(getMLText("workflow_log")); echo ""; echo ""; foreach($wkflog as $entry) { echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } echo "
".getMLText('action')."Start stateEnd state".getMLText('date')."".getMLText('user')."".getMLText('comment')."
".getMLText('action_'.$entry->getTransition()->getAction()->getName())."".$entry->getTransition()->getState()->getName()."".$entry->getTransition()->getNextState()->getName()."".htmlspecialchars(getMLText('action_'.$entry->getTransition()->getAction()->getName()))."".htmlspecialchars($entry->getTransition()->getState()->getName())."".htmlspecialchars($entry->getTransition()->getNextState()->getName())."".$entry->getDate()."".$entry->getUser()->getFullname()."".$entry->getComment()."".htmlspecialchars($entry->getUser()->getFullname())."".htmlspecialchars($entry->getComment())."
\n"; diff --git a/views/bootstrap/class.RunSubWorkflow.php b/views/bootstrap/class.RunSubWorkflow.php index ddafc8043..c6d90a0f0 100644 --- a/views/bootstrap/class.RunSubWorkflow.php +++ b/views/bootstrap/class.RunSubWorkflow.php @@ -62,46 +62,46 @@ class SeedDMS_View_RunSubWorkflow extends SeedDMS_Theme_Style { $msg .= getReadableDuration((time()-$enterts))." ago.
"; } $msg .= "The document may stay in this state for ".$currentstate->getMaxTime()." sec."; - $this->infoMsg($msg); - $this->contentContainerStart(); + //$this->contentContainerStart(); // Display the Workflow form. $this->rowStart(); $this->columnStart(4); + $this->infoMsg($msg); ?> - - -
- -
+formSubmit(getMLText("run_subworkflow")); +?>
columnEnd(); - $this->columnStart(4); + $this->columnStart(8); ?>
- +
columnEnd(); $this->rowEnd(); - $this->contentContainerEnd(); + //$this->contentContainerEnd(); if($wkflog) { + $this->contentHeading(getMLText("workflow_log")); echo ""; echo ""; foreach($wkflog as $entry) { echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } echo "
".getMLText('action')."Start stateEnd state".getMLText('date')."".getMLText('user')."".getMLText('comment')."
".getMLText('action_'.$entry->getTransition()->getAction()->getName())."".$entry->getTransition()->getState()->getName()."".$entry->getTransition()->getNextState()->getName()."".htmlspecialchars(getMLText('action_'.strtolower($entry->getTransition()->getAction()->getName()), array(), $entry->getTransition()->getAction()->getName()))."".htmlspecialchars($entry->getTransition()->getState()->getName())."".htmlspecialchars($entry->getTransition()->getNextState()->getName())."".$entry->getDate()."".$entry->getUser()->getFullname()."".$entry->getComment()."".htmlspecialchars($entry->getUser()->getFullname())."".htmlspecialchars($entry->getComment())."
\n"; diff --git a/views/bootstrap/class.TriggerWorkflow.php b/views/bootstrap/class.TriggerWorkflow.php index d5ccc83f1..36c6a04a2 100644 --- a/views/bootstrap/class.TriggerWorkflow.php +++ b/views/bootstrap/class.TriggerWorkflow.php @@ -90,16 +90,18 @@ $(document).ready(function() { $enterts = makeTsFromLongDate($enterdate); } } - $msg .= "The state was entered at ".$enterdate." which was "; - $msg .= getReadableDuration((time()-$enterts))." ago.
"; + if(!empty($enterdate)) { + $msg .= "The state was entered at ".$enterdate." which was "; + $msg .= getReadableDuration((time()-$enterts))." ago.
"; + } } $msg .= "The document may stay in this state for ".$currentstate->getMaxTime()." sec."; - $this->infoMsg($msg); - $this->contentContainerStart(); + //$this->contentContainerStart(); // Display the Workflow form. $this->rowStart(); $this->columnStart(4); + $this->infoMsg($msg); ?>
@@ -123,29 +125,28 @@ $(document).ready(function() { $this->columnStart(8); ?>
- +
columnEnd(); $this->rowEnd(); - $this->contentContainerEnd(); + //$this->contentContainerEnd(); if($wkflog) { - $this->contentContainerStart(); - echo ""; + $this->contentHeading(getMLText("workflow_log")); + echo "
"; echo ""; foreach($wkflog as $entry) { echo ""; - echo ""; - echo ""; - echo ""; + echo ""; + echo ""; + echo ""; echo ""; - echo ""; - echo ""; + echo ""; + echo ""; echo ""; } echo "
".getMLText('action')."Start stateEnd state".getMLText('date')."".getMLText('user')."".getMLText('comment')."
".getMLText('action_'.strtolower($entry->getTransition()->getAction()->getName()), array(), $entry->getTransition()->getAction()->getName())."".$entry->getTransition()->getState()->getName()."".$entry->getTransition()->getNextState()->getName()."".htmlspecialchars(getMLText('action_'.strtolower($entry->getTransition()->getAction()->getName()), array(), $entry->getTransition()->getAction()->getName()))."".htmlspecialchars($entry->getTransition()->getState()->getName())."".htmlspecialchars($entry->getTransition()->getNextState()->getName())."".$entry->getDate()."".$entry->getUser()->getFullname()."".$entry->getComment()."".htmlspecialchars($entry->getUser()->getFullname())."".htmlspecialchars($entry->getComment())."
\n"; - $this->contentContainerEnd(); } $this->contentEnd(); From fa8356d7291a73b018e0479f989b42dc98f554c9 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 20 Aug 2021 10:38:33 +0200 Subject: [PATCH 7/9] in removeWorkflow() remove records from tblWorkflowLog before tblWorkflowDocumentContent --- SeedDMS_Core/Core/inc.ClassDocument.php | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassDocument.php b/SeedDMS_Core/Core/inc.ClassDocument.php index 9345e56d2..7e216019c 100644 --- a/SeedDMS_Core/Core/inc.ClassDocument.php +++ b/SeedDMS_Core/Core/inc.ClassDocument.php @@ -4617,15 +4617,6 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ $currentstate = $this->getWorkflowState(); if(!$currentstate || SeedDMS_Core_DMS::checkIfEqual($this->_workflow->getInitState(), $currentstate) || $unlink == true) { $db->startTransaction(); - $queryStr= - "DELETE FROM `tblWorkflowDocumentContent` WHERE " - ."`version`='".$this->_version."' " - ." AND `document` = '". $this->_document->getID() ."' " - ." AND `workflow` = '". $this->_workflow->getID() ."' "; - if (!$db->getResult($queryStr)) { - $db->rollbackTransaction(); - return false; - } if(!$unlink) { $queryStr= "DELETE FROM `tblWorkflowLog` WHERE " @@ -4637,6 +4628,15 @@ class SeedDMS_Core_DocumentContent extends SeedDMS_Core_Object { /* {{{ */ return false; } } + $queryStr= + "DELETE FROM `tblWorkflowDocumentContent` WHERE " + ."`version`='".$this->_version."' " + ." AND `document` = '". $this->_document->getID() ."' " + ." AND `workflow` = '". $this->_workflow->getID() ."' "; + if (!$db->getResult($queryStr)) { + $db->rollbackTransaction(); + return false; + } $this->_workflow = null; $this->_workflowState = null; $this->verifyStatus(false, $user, 'Workflow removed'); From 160f427bea6f50beebb49b2146b19519c5e5ae8a Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 20 Aug 2021 10:42:26 +0200 Subject: [PATCH 8/9] start new version 5.1.24 --- SeedDMS_Core/Core/inc.ClassDMS.php | 2 +- SeedDMS_Core/package.xml | 48 ++++++++++++++++++++---------- 2 files changed, 33 insertions(+), 17 deletions(-) diff --git a/SeedDMS_Core/Core/inc.ClassDMS.php b/SeedDMS_Core/Core/inc.ClassDMS.php index a914da17e..b4de184d7 100644 --- a/SeedDMS_Core/Core/inc.ClassDMS.php +++ b/SeedDMS_Core/Core/inc.ClassDMS.php @@ -404,7 +404,7 @@ class SeedDMS_Core_DMS { $this->lasterror = ''; $this->version = '@package_version@'; if($this->version[0] == '@') - $this->version = '5.1.23'; + $this->version = '5.1.24'; } /* }}} */ /** diff --git a/SeedDMS_Core/package.xml b/SeedDMS_Core/package.xml index a3089df7f..4b8f3a0b3 100644 --- a/SeedDMS_Core/package.xml +++ b/SeedDMS_Core/package.xml @@ -12,11 +12,11 @@ uwe@steinmann.cx yes - 2021-04-13 + 2021-08-20 - 5.1.23 - 5.1.23 + 5.1.24 + 5.1.24 stable @@ -24,19 +24,7 @@ GPL License -- SeedDMS_Core_DMS::getTimeline() uses status log instead of document content -- add methods SeedDMS_Core_DocumentContent::getReviewers() and SeedDMS_Core_DocumentContent::getApprovers() -- add methods SeedDMS_Core_DocumentContent::getApproveLog() and SeedDMS_Core_DocumentContent::getReviewLog() -- better handling of document with an empty workflow state -- fix checking of email addresses by using filter_var instead of regex -- add new method SeedDMS_Core_Document::hasCategory() -- add new method SeedDMS_Core_DocumentContent::removeReview() -- add new method SeedDMS_Core_DocumentContent::removeApproval() -- add new method SeedDMS_Core_User::getFolders() -- add new method SeedDMS_Core_User::getDocumentContents() -- add new method SeedDMS_Core_User::getDocumentFiles() -- add new method SeedDMS_Core_User::getDocumentLinks() -- add new type 'foldersperuser' to method SeedDMS_Core_DMS::getStatisticalData() +- in SeedDMS_Core_DocumentContent::removeWorkflow() remove records from tblWorklflowLog before tblDWorkflowDocumentContent @@ -1895,5 +1883,33 @@ add method SeedDMS_Core_DatabaseAccess::setLogFp() problem when removing a document + + 2021-08-19 + + + 5.1.23 + 5.1.23 + + + stable + stable + + GPL License + +- SeedDMS_Core_DMS::getTimeline() uses status log instead of document content +- add methods SeedDMS_Core_DocumentContent::getReviewers() and SeedDMS_Core_DocumentContent::getApprovers() +- add methods SeedDMS_Core_DocumentContent::getApproveLog() and SeedDMS_Core_DocumentContent::getReviewLog() +- better handling of document with an empty workflow state +- fix checking of email addresses by using filter_var instead of regex +- add new method SeedDMS_Core_Document::hasCategory() +- add new method SeedDMS_Core_DocumentContent::removeReview() +- add new method SeedDMS_Core_DocumentContent::removeApproval() +- add new method SeedDMS_Core_User::getFolders() +- add new method SeedDMS_Core_User::getDocumentContents() +- add new method SeedDMS_Core_User::getDocumentFiles() +- add new method SeedDMS_Core_User::getDocumentLinks() +- add new type 'foldersperuser' to method SeedDMS_Core_DMS::getStatisticalData() + + From 6a8382747b74e4c4f81dcdfc15b01b19f86edb21 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 20 Aug 2021 10:42:44 +0200 Subject: [PATCH 9/9] start new version 5.1.24 --- inc/inc.Version.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/inc/inc.Version.php b/inc/inc.Version.php index a4e428ad6..367ac2c7d 100644 --- a/inc/inc.Version.php +++ b/inc/inc.Version.php @@ -20,7 +20,7 @@ class SeedDMS_Version { /* {{{ */ - const _number = "5.1.23"; + const _number = "5.1.24"; const _string = "SeedDMS"; function __construct() {