fix adding workflow log

This commit is contained in:
Uwe Steinmann 2024-04-22 17:47:11 +02:00
parent 50b25a59ec
commit 7f16340a26

View File

@ -203,7 +203,7 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
if($attributes = $folder->getAttributes()) {
foreach($attributes as $attribute) {
$attrdef = $attribute->getAttributeDefinition();
echo $indent." <attr type=\"user\" attrdef=\"".$attrdef->getID()."\">".wrapWithCData($attribute->getValue())."</attr>\n";
echo $indent." <attr type=\"user\" attrdef=\"".$attrdef->getID()."\">".wrapWithCData($attribute->getValueAsString())."</attr>\n";
}
}
$notifications = $folder->getNotifyList();
@ -278,7 +278,7 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
if($attributes = $document->getAttributes()) {
foreach($attributes as $attribute) {
$attrdef = $attribute->getAttributeDefinition();
echo $indent." <attr type=\"user\" attrdef=\"".$attrdef->getID()."\">".wrapWithCData($attribute->getValue())."</attr>\n";
echo $indent." <attr type=\"user\" attrdef=\"".$attrdef->getID()."\">".wrapWithCData($attribute->getValueAsString())."</attr>\n";
}
}
@ -335,7 +335,7 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
if($attributes = $version->getAttributes()) {
foreach($attributes as $attribute) {
$attrdef = $attribute->getAttributeDefinition();
echo $indent." <attr type=\"user\" attrdef=\"".$attrdef->getID()."\">".wrapWithCData($attribute->getValue())."</attr>\n";
echo $indent." <attr type=\"user\" attrdef=\"".$attrdef->getID()."\">".wrapWithCData($attribute->getValueAsString())."</attr>\n";
}
}
if($statuslog = $version->getStatusLog()) {
@ -371,18 +371,23 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
$workflowstate = $version->getWorkflowState();
echo $indent." <workflow id=\"".$workflow->getID()."\" state=\"".$workflowstate->getID()."\"></workflow>\n";
}
$wkflogs = $version->getWorkflowLog();
if($wkflogs) {
if($workflow)
$wkfalllogs[$workflow->getId()] = $version->getWorkflowLog();
else
$wkfalllogs = $version->getWorkflowLog();
if($wkfalllogs) {
echo $indent." <workflowlogs>\n";
foreach($wkflogs as $wklog) {
echo $indent." <workflowlog>\n";
echo $indent." <attr name=\"date\" format=\"Y-m-d H:i:s\">".$wklog->getDate()."</attr>\n";
echo $indent." <attr name=\"workflow\">".$wklog->getWorkflow()->getID()."</attr>\n";
echo $indent." <attr name=\"transition\">".$wklog->getTransition()->getID()."</attr>\n";
$loguser = $wklog->getUser();
echo $indent." <attr name=\"user\">".$loguser->getID()."</attr>\n";
echo $indent." <attr name=\"comment\">".wrapWithCData($wklog->getComment())."</attr>\n";
echo $indent." </workflowlog>\n";
foreach($wkfalllogs as $wkflogs) {
foreach($wkflogs as $wklog) {
echo $indent." <workflowlog>\n";
echo $indent." <attr name=\"date\" format=\"Y-m-d H:i:s\">".$wklog->getDate()."</attr>\n";
echo $indent." <attr name=\"workflow\">".$wklog->getWorkflow()->getID()."</attr>\n";
echo $indent." <attr name=\"transition\">".$wklog->getTransition()->getID()."</attr>\n";
$loguser = $wklog->getUser();
echo $indent." <attr name=\"user\">".$loguser->getID()."</attr>\n";
echo $indent." <attr name=\"comment\">".wrapWithCData($wklog->getComment())."</attr>\n";
echo $indent." </workflowlog>\n";
}
}
echo $indent." </workflowlogs>\n";
}
@ -470,11 +475,11 @@ function tree($folder, $parent=null, $indent='', $skipcurrent=false) { /* {{{ */
} /* }}} */
include($myincpath."/inc/inc.Settings.php");
include($myincpath."/inc/inc.Utils.php");
include($myincpath."/inc/inc.Init.php");
include($myincpath."/inc/inc.Extension.php");
include($myincpath."/inc/inc.DBInit.php");
include($myincpath."/inc/inc.ClassSettings.php");
include($myincpath."/inc/inc.Acl.php");
include($myincpath."/inc/inc.ClassAcl.php");
if(!$folderid) {
$folderid = $settings->_rootFolderID;