From 6e9622246622b58e91e999c23c8d6a20a06829bc Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Wed, 3 Aug 2016 15:18:36 +0200 Subject: [PATCH] put output of version attriubtes into separate function --- views/bootstrap/class.ViewDocument.php | 95 ++++++++++++-------------- 1 file changed, 44 insertions(+), 51 deletions(-) diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 2132e7735..6af971165 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -76,6 +76,48 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { } } /* }}} */ + protected function printVersionAttributes($folder, $version) { /* {{{ */ + $f = null; + $attrdefgrps = $folder->getAttributeDefintionGroupList(true, $f); + if($attrdefgrps) { + foreach($attrdefgrps as $attrdefgrp) { + $attrdefs = $attrdefgrp['group']->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all, SeedDMS_Core_AttributeDefinition::objtype_documentcontent), SeedDMS_Core_AttributeDefinitionGroup::show_details); + if($attrdefs) { + echo "".htmlspecialchars($attrdefgrp['group']->getName())."
"; + foreach($attrdefs as $attrdefarr) { + $attrdef = $attrdefarr['attrdef']; + $attribute = $version->getAttribute($attrdef); + if($attribute) { + $arr = $this->callHook('showDocumentContentAttribute', $version, $attribute, SeedDMS_Core_AttributeDefinitionGroup::show_details); + if(is_array($arr)) { + echo "
  • ".$arr[0].": ".$arr[1]."
  • \n"; + } else { + print "
  • ".htmlspecialchars($attrdef->getName()).": "; + $this->printAttributeValue($attribute); + echo "
  • \n"; + } + } + } + } + } + } else { + $attributes = $version->getAttributes(); + if($attributes) { + foreach($attributes as $attribute) { + $arr = $this->callHook('showDocumentContentAttribute', $version, $attribute, SeedDMS_Core_AttributeDefinitionGroup::show_details); + if(is_array($arr)) { + print "
  • ".$arr[0].": ".$arr[1]."
  • \n"; + } else { + $attrdef = $attribute->getAttributeDefinition(); + print "
  • ".htmlspecialchars($attrdef->getName()).": "; + $this->printAttributeValue($attribute); + echo "
  • \n"; + } + } + } + } + } /* }}} */ + function timelinedata() { /* {{{ */ $dms = $this->params['dms']; $user = $this->params['user']; @@ -507,45 +549,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { print "\n"; print "

    ".htmlspecialchars($latestContent->getComment())."

    "; print "\n"; // print "".htmlspecialchars($latestContent->getComment()).""; @@ -1337,18 +1341,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { if($version->getComment()) print "

    ".htmlspecialchars($version->getComment())."

    "; print "\n"; // print "".htmlspecialchars($version->getComment()).""; print "".getOverallStatusText($vstat["status"])."";