">
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);
?>