Merge branch 'seeddms-5.1.x' into seeddms-6.0.x

This commit is contained in:
Uwe Steinmann 2022-08-18 09:25:13 +02:00
commit 6d9cc4039b
4 changed files with 38 additions and 13 deletions

View File

@ -239,6 +239,7 @@
- running the controller will always call the hooks preRun and postRun - running the controller will always call the hooks preRun and postRun
- add tabs on ViewFolder page - add tabs on ViewFolder page
- link behind logo in header can be set in extension - 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 Changes in version 5.1.26

View File

@ -3939,7 +3939,7 @@ $("body").on("click", "span.openpopupbox", function(e) {
echo $html; echo $html;
} /* }}} */ } /* }}} */
public function printAccordion($title, $content) { /* {{{ */ public function printAccordion($title, $content, $open=false) { /* {{{ */
$id = substr(md5(uniqid()), 0, 4); $id = substr(md5(uniqid()), 0, 4);
?> ?>
<div class="accordion" id="accordion<?php echo $id; ?>"> <div class="accordion" id="accordion<?php echo $id; ?>">
@ -3949,7 +3949,7 @@ $("body").on("click", "span.openpopupbox", function(e) {
<?php echo $title; ?> <?php echo $title; ?>
</a> </a>
</div> </div>
<div id="collapse<?php echo $id; ?>" class="accordion-body collapse" style="height: 0px;"> <div id="collapse<?php echo $id; ?>" class="accordion-body collapse<?= $open ? " in" : "" ?>">
<div class="accordion-inner"> <div class="accordion-inner">
<?php <?php
echo $content; echo $content;

View File

@ -376,6 +376,25 @@ function typeahead() { /* {{{ */
getMLText("creation_date")." (".getMLText('to').")", getMLText("creation_date")." (".getMLText('to').")",
$this->getDateChooser($createenddate, "createend", $this->params['session']->getLanguage()) $this->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) { if($attrdefs) {
foreach($attrdefs as $attrdef) { foreach($attrdefs as $attrdef) {
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) { 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 {{{ // Seach options for documents {{{
/* First check if any of the folder filters are set. If it is, /* First check if any of the folder filters are set. If it is,
@ -398,8 +417,12 @@ function typeahead() { /* {{{ */
if($attrdefs) { if($attrdefs) {
foreach($attrdefs as $attrdef) { foreach($attrdefs as $attrdef) {
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_document || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent) { if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_document || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent) {
if(!empty($attributes[$attrdef->getID()])) /* Do not check dates because they always have 'from' and 'to' element
$openfilterdlg = true; * 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 {{{ // Seach options for folders {{{
$content = ob_get_clean(); $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, /* First check if any of the folder filters are set. If it is,
* open the accordion. * open the accordion.
*/ */
@ -528,8 +551,9 @@ function typeahead() { /* {{{ */
if($attrdefs) { if($attrdefs) {
foreach($attrdefs as $attrdef) { foreach($attrdefs as $attrdef) {
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder) { if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder) {
if(!empty($attributes[$attrdef->getID()])) if($attrdef->getType() != SeedDMS_Core_AttributeDefinition::type_date)
$openfilterdlg = true; if(!empty($attributes[$attrdef->getID()]))
$openfilterdlg = true;
} }
} }
} }
@ -547,7 +571,7 @@ function typeahead() { /* {{{ */
} }
$content = ob_get_clean(); $content = ob_get_clean();
if($content) if($content)
$this->printAccordion(getMLText('filter_for_folders'), $content); $this->printAccordion(getMLText('filter_for_folders'), $content, $openfilterdlg);
// }}} // }}}
$this->formSubmit("<i class=\"fa fa-search\"></i> ".getMLText('search')); $this->formSubmit("<i class=\"fa fa-search\"></i> ".getMLText('search'));

View File

@ -3931,17 +3931,17 @@ $("body").on("click", "span.openpopupbox", function(e) {
echo $html; echo $html;
} /* }}} */ } /* }}} */
public function printAccordion($title, $content) { /* {{{ */ public function printAccordion($title, $content, $open=false) { /* {{{ */
$id = substr(md5(uniqid()), 0, 4); $id = substr(md5(uniqid()), 0, 4);
?> ?>
<div class="accordion" id="accordion<?php echo $id; ?>"> <div class="accordion" id="accordion<?php echo $id; ?>">
<div class="card"> <div class="card">
<div class="card-header" id="accordionheader<?php echo $id; ?>"> <div class="card-header" id="accordionheader<?php echo $id; ?>">
<a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion<?php echo $id; ?>" data-target="#collapse<?php echo $id; ?>"> <a class="accordion-toggle" data-toggle="collapse" data-parent="#accordion<?php echo $id; ?>" data-target="#collapse<?php echo $id; ?>"<?= $open ? ' aria-expanded="true"' : '' ?>>
<?php echo $title; ?> <?php echo $title; ?>
</a> </a>
</div> </div>
<div id="collapse<?php echo $id; ?>" class="collapse" data-parent="accordion<?php echo $id; ?>"> <div id="collapse<?php echo $id; ?>" class="collapse<?= $open ? ' show' : '' ?>" data-parent="accordion<?php echo $id; ?>">
<div class="card-body"> <div class="card-body">
<?php <?php
echo $content; echo $content;