add new method printVersionAttributes()

This commit is contained in:
Uwe Steinmann 2020-03-19 10:13:12 +01:00
parent cce4be822c
commit bf9a409a71

View File

@ -83,6 +83,23 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
}
} /* }}} */
protected function printVersionAttributes($folder, $version) { /* {{{ */
$attributes = $version->getAttributes();
if($attributes) {
foreach($attributes as $attribute) {
$arr = $this->callHook('showDocumentContentAttribute', $version, $attribute);
if(is_array($arr)) {
print "<li>".$arr[0].": ".$arr[1]."</li>\n";
} else {
$attrdef = $attribute->getAttributeDefinition();
print "<li>".htmlspecialchars($attrdef->getName()).": ";
$this->printAttributeValue($attribute);
echo "</li>\n";
}
}
}
} /* }}} */
function documentListItem() { /* {{{ */
$dms = $this->params['dms'];
$user = $this->params['user'];
@ -623,18 +640,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<p style=\"font-style: italic;\">".htmlspecialchars($latestContent->getComment())."</p>";
}
print "<ul class=\"actions unstyled\">\n";
$attributes = $latestContent->getAttributes();
if($attributes) {
foreach($attributes as $attribute) {
$arr = $this->callHook('showDocumentContentAttribute', $latestContent, $attribute);
if(is_array($arr)) {
print "<li>".$arr[0].": ".$arr[1]."</li>\n";
} else {
$attrdef = $attribute->getAttributeDefinition();
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n";
}
}
}
$this->printVersionAttributes($folder, $latestContent);
print "</ul></td>\n";
// print "<td>".htmlspecialchars($latestContent->getComment())."</td>";
@ -1510,18 +1516,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
print "<p style=\"font-style: italic;\">".htmlspecialchars($version->getComment())."</p>";
}
print "<ul class=\"actions unstyled\">\n";
$attributes = $version->getAttributes();
if($attributes) {
foreach($attributes as $attribute) {
$arr = $this->callHook('showDocumentContentAttribute', $version, $attribute);
if(is_array($arr)) {
print "<li>".$arr[0].": ".$arr[1]."</li>\n";
} else {
$attrdef = $attribute->getAttributeDefinition();
print "<li>".htmlspecialchars($attrdef->getName()).": ".htmlspecialchars(implode(', ', $attribute->getValueAsArray()))."</li>\n";
}
}
}
$this->printVersionAttributes($folder, $version);
print "</ul></td>\n";
// print "<td>".htmlspecialchars($version->getComment())."</td>";
print "<td>".getOverallStatusText($vstat["status"])."</td>";