diff --git a/views/bootstrap/class.ViewDocument.php b/views/bootstrap/class.ViewDocument.php index 6af971165..61633e284 100644 --- a/views/bootstrap/class.ViewDocument.php +++ b/views/bootstrap/class.ViewDocument.php @@ -419,19 +419,44 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style { - getAttributes(); - if($attributes) { - foreach($attributes as $attribute) { - $arr = $this->callHook('showDocumentAttribute', $document, $attribute); - if(is_array($arr)) { - echo ""; - echo "".$arr[0].":"; - echo "".$arr[1].""; - echo ""; - } else { - $this->printAttribute($attribute); + + $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_document), SeedDMS_Core_AttributeDefinitionGroup::show_details); + if($attrdefs) { + echo "".htmlspecialchars($attrdefgrp['group']->getName()).""; + foreach($attrdefs as $attrdefarr) { + $attrdef = $attrdefarr['attrdef']; + $attribute = $document->getAttribute($attrdef); + if($attribute) { + $arr = $this->callHook('showDocumentAttribute', $document, $attribute, SeedDMS_Core_AttributeDefinitionGroup::show_details); + if(is_array($arr)) { + echo ""; + echo "".$arr[0].":"; + echo "".$arr[1].""; + echo ""; + } else { + $this->printAttribute($attribute); + } + } + } + } + } + } else { + $attributes = $document->getAttributes(); + if($attributes) { + foreach($attributes as $attribute) { + $arr = $this->callHook('showDocumentAttribute', $document, $attribute, SeedDMS_Core_AttributeDefinitionGroup::show_details); + if(is_array($arr)) { + echo ""; + echo "".$arr[0].":"; + echo "".$arr[1].""; + echo ""; + } else { + $this->printAttribute($attribute); + } } } }