show attribute def groups

code was lost after rebasing
This commit is contained in:
Uwe Steinmann 2016-11-22 18:24:34 +01:00
parent ec82a80010
commit 612a2ca8d6

View File

@ -419,19 +419,44 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
</tr>
<?php
}
?>
<?php
$attributes = $document->getAttributes();
if($attributes) {
foreach($attributes as $attribute) {
$arr = $this->callHook('showDocumentAttribute', $document, $attribute);
if(is_array($arr)) {
echo "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} 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 "<tr><td colspan=\"2\"><b>".htmlspecialchars($attrdefgrp['group']->getName())."</b></td></tr>";
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 "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} 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 "<tr>";
echo "<td>".$arr[0].":</td>";
echo "<td>".$arr[1]."</td>";
echo "</tr>";
} else {
$this->printAttribute($attribute);
}
}
}
}