From cc7618fde1fc90f1e9465ce1ac53908e2c85e487 Mon Sep 17 00:00:00 2001 From: Uwe Steinmann Date: Fri, 12 Mar 2021 10:09:23 +0100 Subject: [PATCH] show date attributes as range --- views/bootstrap/class.Search.php | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/views/bootstrap/class.Search.php b/views/bootstrap/class.Search.php index df7974131..91b8205a3 100644 --- a/views/bootstrap/class.Search.php +++ b/views/bootstrap/class.Search.php @@ -263,7 +263,14 @@ function typeahead() { /* {{{ */ ?> getName()); ?>: - printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true) ?> + +getType() == SeedDMS_Core_AttributeDefinition::type_date) + echo $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from').'  '.getMLText('to').' '.$this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to'); + else + $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true) +?> + getName()); ?>: - printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true) ?> + +getType() == SeedDMS_Core_AttributeDefinition::type_date) + echo $this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['from']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['from'])) : '', 'attributes', true, 'from').'  '.getMLText('to').' '.$this->getAttributeEditField($attrdef, !empty($attributes[$attrdef->getID()]['to']) ? getReadableDate(makeTsFromDate($attributes[$attrdef->getID()]['to'])) : '', 'attributes', true, 'to'); + else + $this->printAttributeEditField($attrdef, isset($attributes[$attrdef->getID()]) ? $attributes[$attrdef->getID()] : '', 'attributes', true) +?>