From 8cf8e9c60649514fbb1ff332e722d176f934cebe Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Mon, 20 Apr 2026 20:27:42 +0200 Subject: [PATCH] use attribute def. groups show only selected attributes in search list and search form --- views/bootstrap/class.Search.php | 98 ++++++++++++++++++++++++++++++-- 1 file changed, 92 insertions(+), 6 deletions(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index d847913eb..d65b75de5 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -502,6 +502,7 @@ $(document).ready(function() { $totalfolders = $this->params['totalfolders']; $limit = $this->params['limit']; $attrdefs = $this->params['attrdefs']; + $attrdefgrps = $this->params['attrdefgrps']; $allCats = $this->params['allcategories']; $allUsers = $this->params['allusers']; $mode = $this->params['mode']; @@ -585,11 +586,14 @@ $(document).ready(function() { ?>
+
contentContainerStart(); $this->formField( @@ -692,7 +696,33 @@ $(document).ready(function() { */ $openfilterdlg = false; $hasattrs = false; - if($attrdefs) { + if($attrdefgrps) { + $attrdefids = array(); + foreach($attrdefgrps as $attrdefgrp) { + if($attrdefs = $attrdefgrp->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_all), SeedDMS_Core_AttributeDefinitionGroup::show_search)) { + echo "".htmlspecialchars($attrdefgrp->getName()).""; + foreach($attrdefs as $attrdefarr) { + $attrdef = $attrdefarr['attrdef']; + if(!in_array($attrdef->getID(), $attrdefids)) { + ?> + + getName()); ?>: + printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '') ?> + + getID(); + } else { + ?> + + getName()); ?> + getID()]) ? $attributes[$attrdef->getID()] : ''; ?> + + getObjType() == SeedDMS_Core_AttributeDefinition::objtype_all) { /* Do not check dates because they always have 'from' and 'to' element @@ -858,7 +888,33 @@ $(document).ready(function() { getMLText("status_change")." (".getMLText('to').")", $this->getDateChooser($statusenddate, "statusdateend", $this->params['session']->getLanguage()) ); - if($attrdefs) { + if($attrdefgrps) { + $attrdefids = array(); + foreach($attrdefgrps as $attrdefgrp) { + if($attrdefs = $attrdefgrp->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_document, SeedDMS_Core_AttributeDefinition::objtype_documentcontent), SeedDMS_Core_AttributeDefinitionGroup::show_search)) { + echo "".htmlspecialchars($attrdefgrp->getName()).""; + foreach($attrdefs as $attrdefarr) { + $attrdef = $attrdefarr['attrdef']; + if(!in_array($attrdef->getID(), $attrdefids)) { + ?> + + getName()); ?>: + printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '') ?> + + getID(); + } else { + ?> + + getName()); ?> + getID()]) ? $attributes[$attrdef->getID()] : ''; ?> + + getObjType() == SeedDMS_Core_AttributeDefinition::objtype_document || $attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_documentcontent) { if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) { @@ -896,7 +952,33 @@ $(document).ready(function() { } if($hasattrs) { ob_start(); - if($attrdefs) { + if($attrdefgrps) { + $attrdefids = array(); + foreach($attrdefgrps as $attrdefgrp) { + if($attrdefs = $attrdefgrp->getAttributeDefinitions(array(SeedDMS_Core_AttributeDefinition::objtype_folder), SeedDMS_Core_AttributeDefinitionGroup::show_search)) { + echo "".htmlspecialchars($attrdefgrp->getName()).""; + foreach($attrdefs as $attrdefarr) { + $attrdef = $attrdefarr['attrdef']; + if(!in_array($attrdef->getID(), $attrdefids)) { + ?> + + getName()); ?>: + printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '') ?> + + getID(); + } else { + ?> + + getName()); ?> + getID()]) ? $attributes[$attrdef->getID()] : ''; ?> + + getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder) { if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) { @@ -1548,7 +1630,7 @@ $(document).ready(function() { } } ?> -
+
query) { echo "\n"; @@ -1856,7 +1938,11 @@ $(document).ready(function() { } } } - print "\n"; + $txt = $this->callHook('folderListFooter', null); + if(is_string($txt)) + echo $txt; + else + print "\n"; // $this->contentContainerEnd(); $this->pageList((int) $pageNumber, $totalpages, "../out/out.Search.php", $_GET); } else {