use attribute def. groups

show only selected attributes in search list and search form
This commit is contained in:
Uwe Steinmann 2026-04-20 20:27:42 +02:00
parent f67f30717c
commit 8cf8e9c606

View File

@ -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() {
?>
</ul>
<div class="tab-content">
<?php
// Database search Form {{{
?>
<div class="tab-pane <?php echo ($fullsearch == false) ? 'active' : ''; ?>" id="database">
<form class="form-horizontal mb-4" action="<?= $this->params['settings']->_httpRoot ?>out/out.Search.php" name="form1">
<input type="hidden" name="fullsearch" value="0" />
<?php
// Database search Form {{{
// General search options {{{
$this->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 "<tr><td colspan=\"2\"><b>".htmlspecialchars($attrdefgrp->getName())."</b></td></tr>";
foreach($attrdefs as $attrdefarr) {
$attrdef = $attrdefarr['attrdef'];
if(!in_array($attrdef->getID(), $attrdefids)) {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '') ?></td>
</tr>
<?php
$attrdefids[] = $attrdef->getID();
} else {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
<td><?php echo isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : ''; ?></td>
</tr>
<?php
}
}
}
}
} elseif($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
@ -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 "<tr><td colspan=\"2\"><b>".htmlspecialchars($attrdefgrp->getName())."</b></td></tr>";
foreach($attrdefs as $attrdefarr) {
$attrdef = $attrdefarr['attrdef'];
if(!in_array($attrdef->getID(), $attrdefids)) {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '') ?></td>
</tr>
<?php
$attrdefids[] = $attrdef->getID();
} else {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
<td><?php echo isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : ''; ?></td>
</tr>
<?php
}
}
}
}
} elseif($attrdefs) {
foreach($attrdefs as $attrdef) {
if($attrdef->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 "<tr><td colspan=\"2\"><b>".htmlspecialchars($attrdefgrp->getName())."</b></td></tr>";
foreach($attrdefs as $attrdefarr) {
$attrdef = $attrdefarr['attrdef'];
if(!in_array($attrdef->getID(), $attrdefids)) {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?>:</td>
<td><?php $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '') ?></td>
</tr>
<?php
$attrdefids[] = $attrdef->getID();
} else {
?>
<tr>
<td><?php echo htmlspecialchars($attrdef->getName()); ?></td>
<td><?php echo isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : ''; ?></td>
</tr>
<?php
}
}
}
}
} elseif($attrdefs) {
foreach($attrdefs as $attrdef) {
if($attrdef->getObjType() == SeedDMS_Core_AttributeDefinition::objtype_folder) {
if($attrdef->getType() == SeedDMS_Core_AttributeDefinition::type_date) {
@ -1548,7 +1630,7 @@ $(document).ready(function() {
}
}
?>
</div>
</div>
<?php
if($this->query) {
echo "</div>\n";
@ -1856,7 +1938,11 @@ $(document).ready(function() {
}
}
}
print "</tbody></table>\n";
$txt = $this->callHook('folderListFooter', null);
if(is_string($txt))
echo $txt;
else
print "</tbody></table>\n";
// $this->contentContainerEnd();
$this->pageList((int) $pageNumber, $totalpages, "../out/out.Search.php", $_GET);
} else {