diff --git a/CHANGELOG b/CHANGELOG index 0edc29449..a5422ad9c 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -239,6 +239,7 @@ - running the controller will always call the hooks preRun and postRun - add tabs on ViewFolder page - link behind logo in header can be set in extension +- move attributes for documents and folders on search page into own accordion -------------------------------------------------------------------------------- Changes in version 5.1.26 diff --git a/views/bootstrap/class.Bootstrap.php b/views/bootstrap/class.Bootstrap.php index 14f53db20..45a0d9237 100644 --- a/views/bootstrap/class.Bootstrap.php +++ b/views/bootstrap/class.Bootstrap.php @@ -3939,7 +3939,7 @@ $("body").on("click", "span.openpopupbox", function(e) { echo $html; } /* }}} */ - public function printAccordion($title, $content) { /* {{{ */ + public function printAccordion($title, $content, $open=false) { /* {{{ */ $id = substr(md5(uniqid()), 0, 4); ?>
@@ -3949,7 +3949,7 @@ $("body").on("click", "span.openpopupbox", function(e) {
-
+
">
getDateChooser($createenddate, "createend", $this->params['session']->getLanguage()) ); + $this->contentContainerEnd(); + + /* First check if any of the folder/document filters are set. If it is, + * open the accordion. + */ + $openfilterdlg = false; + if($attrdefs) { + foreach($attrdefs as $attrdef) { + if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) { + /* Do not check dates because they always have 'from' and 'to' element + * even if it is empty. FIXME should be also checked. + */ + if($attrdef->getType() != SeedDMS_Core_AttributeDefinition::type_date) + if(!empty($attributes[$attrdef->getID()])) + $openfilterdlg = true; + } + } + } + ob_start(); if($attrdefs) { foreach($attrdefs as $attrdef) { if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) { @@ -387,8 +406,8 @@ function typeahead() { /* {{{ */ } } } - $this->contentContainerEnd(); - // }}} + $content = ob_get_clean(); + $this->printAccordion(getMLText('filter_for_documents_and_folders'), $content, $openfilterdlg); // Seach options for documents {{{ /* First check if any of the folder filters are set. If it is, @@ -398,8 +417,12 @@ function typeahead() { /* {{{ */ if($attrdefs) { foreach($attrdefs as $attrdef) { if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_document || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent) { - if(!empty($attributes[$attrdef->getID()])) - $openfilterdlg = true; + /* Do not check dates because they always have 'from' and 'to' element + * even if it is empty. FIXME should be also checked. + */ + if($attrdef->getType() != SeedDMS_Core_AttributeDefinition::type_date) + if(!empty($attributes[$attrdef->getID()])) + $openfilterdlg = true; } } } @@ -520,7 +543,7 @@ function typeahead() { /* {{{ */ // Seach options for folders {{{ $content = ob_get_clean(); - $this->printAccordion(getMLText('filter_for_documents'), $content); + $this->printAccordion(getMLText('filter_for_documents'), $content, $openfilterdlg); /* First check if any of the folder filters are set. If it is, * open the accordion. */ @@ -528,8 +551,9 @@ function typeahead() { /* {{{ */ if($attrdefs) { foreach($attrdefs as $attrdef) { if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder) { - if(!empty($attributes[$attrdef->getID()])) - $openfilterdlg = true; + if($attrdef->getType() != SeedDMS_Core_AttributeDefinition::type_date) + if(!empty($attributes[$attrdef->getID()])) + $openfilterdlg = true; } } } @@ -547,7 +571,7 @@ function typeahead() { /* {{{ */ } $content = ob_get_clean(); if($content) - $this->printAccordion(getMLText('filter_for_folders'), $content); + $this->printAccordion(getMLText('filter_for_folders'), $content, $openfilterdlg); // }}} $this->formSubmit(" ".getMLText('search')); diff --git a/views/bootstrap4/class.Bootstrap4.php b/views/bootstrap4/class.Bootstrap4.php index 8abca5b6c..7b86467f0 100644 --- a/views/bootstrap4/class.Bootstrap4.php +++ b/views/bootstrap4/class.Bootstrap4.php @@ -3931,17 +3931,17 @@ $("body").on("click", "span.openpopupbox", function(e) { echo $html; } /* }}} */ - public function printAccordion($title, $content) { /* {{{ */ + public function printAccordion($title, $content, $open=false) { /* {{{ */ $id = substr(md5(uniqid()), 0, 4); ?>
-
+