mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-12-02 04:13:34 +00:00
put output of version attriubtes into separate function
This commit is contained in:
parent
6a367906d6
commit
6e96222466
|
|
@ -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 "<b>".htmlspecialchars($attrdefgrp['group']->getName())."</b><br />";
|
||||
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 "<li>".$arr[0].": ".$arr[1]."</li>\n";
|
||||
} else {
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ";
|
||||
$this->printAttributeValue($attribute);
|
||||
echo "</li>\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 "<li>".$arr[0].": ".$arr[1]."</li>\n";
|
||||
} else {
|
||||
$attrdef = $attribute->getAttributeDefinition();
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ";
|
||||
$this->printAttributeValue($attribute);
|
||||
echo "</li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} /* }}} */
|
||||
|
||||
function timelinedata() { /* {{{ */
|
||||
$dms = $this->params['dms'];
|
||||
$user = $this->params['user'];
|
||||
|
|
@ -507,45 +549,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
print "</ul>\n";
|
||||
print "<p style=\"font-style: italic;\">".htmlspecialchars($latestContent->getComment())."</p>";
|
||||
print "<ul class=\"actions unstyled\">\n";
|
||||
$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 "<b>".htmlspecialchars($attrdefgrp['group']->getName())."</b><br />";
|
||||
foreach($attrdefs as $attrdefarr) {
|
||||
$attrdef = $attrdefarr['attrdef'];
|
||||
$attribute = $latestContent->getAttribute($attrdef);
|
||||
if($attribute) {
|
||||
$arr = $this->callHook('showDocumentContentAttribute', $latestContent, $attribute);
|
||||
if(is_array($arr)) {
|
||||
echo "<li>".$arr[0].": ".$arr[1]."</li>\n";
|
||||
} else {
|
||||
print "<li>".htmlspecialchars($attrdef->getName()).": ";
|
||||
$this->printAttributeValue($attribute);
|
||||
echo "</li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$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()).": ";
|
||||
$this->printAttributeValue($attribute);
|
||||
echo "</li>\n";
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$this->printVersionAttributes($folder, $latestContent);
|
||||
print "</ul></td>\n";
|
||||
|
||||
// print "<td>".htmlspecialchars($latestContent->getComment())."</td>";
|
||||
|
|
@ -1337,18 +1341,7 @@ class SeedDMS_View_ViewDocument extends SeedDMS_Bootstrap_Style {
|
|||
if($version->getComment())
|
||||
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>";
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user