mirror of
https://git.code.sf.net/p/seeddms/code
synced 2025-05-12 04:31:32 +00:00
Merge branch 'seeddms-5.1.x' into seeddms-6.0.x
This commit is contained in:
commit
6d9cc4039b
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
?>
|
||||
<div class="accordion" id="accordion<?php echo $id; ?>">
|
||||
|
@ -3949,7 +3949,7 @@ $("body").on("click", "span.openpopupbox", function(e) {
|
|||
<?php echo $title; ?>
|
||||
</a>
|
||||
</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">
|
||||
<?php
|
||||
echo $content;
|
||||
|
|
|
@ -376,6 +376,25 @@ function typeahead() { /* {{{ */
|
|||
getMLText("creation_date")." (".getMLText('to').")",
|
||||
$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) {
|
||||
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("<i class=\"fa fa-search\"></i> ".getMLText('search'));
|
||||
|
|
|
@ -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);
|
||||
?>
|
||||
<div class="accordion" id="accordion<?php echo $id; ?>">
|
||||
<div class="card">
|
||||
<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; ?>
|
||||
</a>
|
||||
</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">
|
||||
<?php
|
||||
echo $content;
|
||||
|
|
Loading…
Reference in New Issue
Block a user