diff --git a/out/out.EditAttributes.php b/out/out.EditAttributes.php
index dd10a1b09..36f0376b7 100644
--- a/out/out.EditAttributes.php
+++ b/out/out.EditAttributes.php
@@ -60,12 +60,15 @@ if (!is_object($version)) {
$folder = $document->getFolder();
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_documentcontent, SeedDMS_Core_AttributeDefinition::objtype_all));
+$f = null;
+$attrdefgrps = $folder->getAttributeDefintionGroupList(true, $f);
if($view) {
$view->setParam('folder', $folder);
$view->setParam('document', $document);
$view->setParam('version', $version);
$view->setParam('attrdefs', $attrdefs);
+ $view->setParam('attrdefgrps', $attrdefgrps);
$view->setParam('accessobject', $accessop);
$view($_GET);
exit;
diff --git a/out/out.EditDocument.php b/out/out.EditDocument.php
index 131c85248..72898bc23 100644
--- a/out/out.EditDocument.php
+++ b/out/out.EditDocument.php
@@ -56,10 +56,14 @@ if($document->isLocked()) {
$folder = $document->getFolder();
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_all));
+$f = null;
+$attrdefgrps = $folder->getAttributeDefintionGroupList(true, $f);
+
if($view) {
$view->setParam('folder', $folder);
$view->setParam('document', $document);
$view->setParam('attrdefs', $attrdefs);
+ $view->setParam('attrdefgrps', $attrdefgrps);
$view->setParam('strictformcheck', $settings->_strictFormCheck);
$view->setParam('orderby', $settings->_sortFoldersDefault);
$view->setParam('nodocumentformfields', $settings->_noDocumentFormFields);
diff --git a/out/out.EditFolder.php b/out/out.EditFolder.php
index b5a693e46..1e3df9304 100644
--- a/out/out.EditFolder.php
+++ b/out/out.EditFolder.php
@@ -50,7 +50,8 @@ if ($folder->getAccessMode($user) < M_READWRITE) {
}
$attrdefs = $dms->getAllAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_folder, SeedDMS_Core_AttributeDefinition::objtype_all));
-$attrdefgrps = $folder->getAttributeDefintionGroupList();
+$f = null;
+$attrdefgrps = $folder->getAttributeDefintionGroupList(true, $f);
if($view) {
$view->setParam('folder', $folder);
diff --git a/views/bootstrap/class.EditAttributes.php b/views/bootstrap/class.EditAttributes.php
index a06cd28e5..1dc263459 100644
--- a/views/bootstrap/class.EditAttributes.php
+++ b/views/bootstrap/class.EditAttributes.php
@@ -38,6 +38,7 @@ class SeedDMS_View_EditAttributes extends SeedDMS_Theme_Style {
$document = $this->params['document'];
$version = $this->params['version'];
$attrdefs = $this->params['attrdefs'];
+ $attrdefgrps = $this->params['attrdefgrps'];
$this->htmlStartPage(getMLText("document_title", array("documentname" => htmlspecialchars($document->getName()))));
$this->globalNavigation($folder);
@@ -54,7 +55,41 @@ class SeedDMS_View_EditAttributes extends SeedDMS_Theme_Style {
getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all, SeedDMS_Core_AttributeDefinition::objtype_documentcontent));
+ echo "
| ".htmlspecialchars($attrdefgrp['group']->getName())." |
";
+ foreach($attrdefs as $attrdefarr) {
+ $attrdef = $attrdefarr['attrdef'];
+ if(!in_array($attrdef->getID(), $attrdefids)) {
+ $arr = $this->callHook('folderEditAttribute', $folder, $attrdef);
+ if(is_array($arr)) {
+ echo $txt;
+ echo "";
+ echo "| ".$arr[0]." | ";
+ echo "".$arr[1]." | ";
+ echo "
";
+ } else {
+?>
+
+ | getName()); ?> |
+ printAttributeEditField($attrdef, $version->getAttribute($attrdef)) ?> |
+
+getID();
+ } else {
+?>
+
+ | getName()); ?> |
+ getAttribute($attrdef)->getValue(); ?> |
+
+contentContainerStart();
foreach($attrdefs as $attrdef) {
$arr = $this->callHook('editDocumentContentAttribute', $version, $attrdef);
diff --git a/views/bootstrap/class.EditDocument.php b/views/bootstrap/class.EditDocument.php
index 386287f84..b16c94b2a 100644
--- a/views/bootstrap/class.EditDocument.php
+++ b/views/bootstrap/class.EditDocument.php
@@ -61,6 +61,7 @@ $(document).ready( function() {
$folder = $this->params['folder'];
$document = $this->params['document'];
$attrdefs = $this->params['attrdefs'];
+ $attrdefgrps = $this->params['attrdefgrps'];
$strictformcheck = $this->params['strictformcheck'];
$nodocumentformfields = $this->params['nodocumentformfields'];
$orderby = $this->params['orderby'];
@@ -206,8 +207,49 @@ $(document).ready( function() {
$this->formField(getMLText("sequence"), $this->getSequenceChooser($folder, 'd', $document->getID()).($orderby != 's' ? "
".getMLText('order_by_sequence_off') : ''));
}
}
- if($attrdefs) {
+
+ if($attrdefgrps) {
+ $attrdefids = array();
+ foreach($attrdefgrps as $attrdefgrp) {
+ $attrdefs = $attrdefgrp['group']->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all, SeedDMS_Core_AttributeDefinition::objtype_document));
+ echo "| ".htmlspecialchars($attrdefgrp['group']->getName())." |
";
+ foreach($attrdefs as $attrdefarr) {
+ $attrdef = $attrdefarr['attrdef'];
+ if(!in_array($attrdef->getID(), $attrdefids)) {
+ $arr = $this->callHook('editDocumentAttribute', $document, $attrdef);
+ if(is_array($arr)) {
+ echo $txt;
+ echo "";
+ echo "| ".$arr[0]." | ";
+ echo "".$arr[1]." | ";
+ echo "
";
+ } else {
+?>
+
+ | getName()); ?> |
+ printAttributeEditField($attrdef, $document->getAttribute($attrdef)) ?> |
+
+getID();
+ } else {
+?>
+
+ | getName()); ?> |
+ getAttribute($attrdef)->getValue(); ?> |
+
+isMember($attrdef))
+ $found = true;
+ }
+ if($found) {
$arr = $this->callHook('editDocumentAttribute', $document, $attrdef);
if(is_array($arr)) {
if($arr) {
@@ -218,6 +260,16 @@ $(document).ready( function() {
} else {
$this->formField(htmlspecialchars($attrdef->getName()), $this->getAttributeEditField($attrdef, $document->getAttribute($attrdef)));
}
+ } else {
+ if($attribute = $document->getAttribute($attrdef)) {
+?>
+
+ | getName()); ?> |
+ getValue() ?> |
+
+callHook('addDocumentAttributes', $document);
diff --git a/views/bootstrap/class.EditFolder.php b/views/bootstrap/class.EditFolder.php
index 7378cec23..648fd6654 100644
--- a/views/bootstrap/class.EditFolder.php
+++ b/views/bootstrap/class.EditFolder.php
@@ -114,24 +114,38 @@ $(document).ready(function() {
}
if($attrdefgrps) {
+ $attrdefids = array();
foreach($attrdefgrps as $attrdefgrp) {
$attrdefs = $attrdefgrp['group']->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all, SeedDMS_Core_AttributeDefinition::objtype_folder));
- echo "| ".htmlspecialchars($attrdefgrp['group']->getComment())." |
";
- foreach($attrdefs as $attrdef) {
- $arr = $this->callHook('folderEditAttribute', $folder, $attrdef);
- if(is_array($arr)) {
- echo $txt;
- echo "";
- echo "| ".$arr[0]." | ";
- echo "".$arr[1]." | ";
- echo "
";
- } else {
+ echo "| ".htmlspecialchars($attrdefgrp['group']->getName())." |
";
+ foreach($attrdefs as $attrdefarr) {
+ $attrdef = $attrdefarr['attrdef'];
+ if(!in_array($attrdef->getID(), $attrdefids)) {
+ $arr = $this->callHook('folderEditAttribute', $folder, $attrdef);
+ if(is_array($arr)) {
+ echo $txt;
+ echo "";
+ echo "| ".$arr[0]." | ";
+ echo "".$arr[1]." | ";
+ echo "
";
+ } else {
?>
| getName()); ?> |
printAttributeEditField($attrdef, $folder->getAttribute($attrdef)) ?> |
getID();
+ } else {
+ if($folder->getAttribute($attrdef)) {
+?>
+
+ | getName()); ?> |
+ getAttribute($attrdef)->getValue(); ?> |
+
+";
}
}
- $attributes = $folder->getAttributes();
- if($attributes) {
- foreach($attributes as $attribute) {
- $arr = $this->callHook('showFolderAttribute', $folder, $attribute);
- if(is_array($arr)) {
- echo "";
- echo "| ".$arr[0].": | ";
- echo "".$arr[1]." | ";
- echo "
";
- } elseif(is_string($arr)) {
- echo $arr;
- } 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_folder));
+ echo "| ".htmlspecialchars($attrdefgrp['group']->getName())." |
";
+ if($attrdefs) {
+ foreach($attrdefs as $attrdefarr) {
+ $attrdef = $attrdefarr['attrdef'];
+ if($attrdefarr['show'] & SeedDMS_Core_AttributeDefinitionGroup::show_details) {
+ $attribute = $folder->getAttribute($attrdef);
+ if($attribute)
+ $this->printAttribute($attribute);
+ }
+ }
+ }
+ }
+ } else {
+ $attributes = $folder->getAttributes();
+ if($attributes) {
+ foreach($attributes as $attribute) {
+ $arr = $this->callHook('showFolderAttribute', $folder, $attribute);
+ if(is_array($arr)) {
+ echo "";
+ echo "| ".$arr[0].": | ";
+ echo "".$arr[1]." | ";
+ echo "
";
+ } elseif(is_string($arr)) {
+ echo $arr;
+ } else {
+ $this->printAttribute($attribute);
+ }
}
}
}