From 12851c1d7d5ac21815dd8871cb380ee6a6a5a742 Mon Sep 17 00:00:00 2001 From: Aina Sitraka <35221835+aynsix@users.noreply.github.com> Date: Wed, 12 Jul 2023 11:34:11 +0300 Subject: [PATCH] PHRAS-3873: prod -advance search - field , leave only label and real field name (#4335) * field label then fieldname * separate with pipe * add backup and ftp folder to gitignore --- .gitignore | 8 ++++++++ lib/Alchemy/Phrasea/Helper/Prod.php | 6 +++--- templates/web/prod/index.html.twig | 17 ++++++++++++++--- 3 files changed, 25 insertions(+), 6 deletions(-) diff --git a/.gitignore b/.gitignore index 730df1318e..d33424b147 100644 --- a/.gitignore +++ b/.gitignore @@ -34,6 +34,14 @@ # Exclude log folder /logs +# Exclude backup folder +/backup +!/backup/.gitkeep + +# Exclude ftp folder +/ftp +!/ftp/.gitkeep + # Exclude plugin folder /plugins # Excluse assets plugin folder diff --git a/lib/Alchemy/Phrasea/Helper/Prod.php b/lib/Alchemy/Phrasea/Helper/Prod.php index 2bf1fe089d..409c653d31 100644 --- a/lib/Alchemy/Phrasea/Helper/Prod.php +++ b/lib/Alchemy/Phrasea/Helper/Prod.php @@ -97,7 +97,7 @@ public function get_search_datas() 'sbas' => array($sbasId), 'fieldname' => $name, 'type' => $type, - 'label' => ($name === $label) ? [$label] : [$name . ' - ' .trim($label)], // add the fieldname in the label + 'label' => ($name === $label) ? [] : [trim($label)], 'id' => $id ); @@ -108,7 +108,7 @@ public function get_search_datas() $dates[$name]['sbas'][] = $sbasId; // add different label for the same field if exist - if (!isset($dates[$name]['label']) || !in_array(strtolower($label), array_map('strtolower', $dates[$name]['label']))) { + if ($name !== $label && (!isset($dates[$name]['label']) || !in_array(strtolower($label), array_map('strtolower', $dates[$name]['label'])))) { $dates[$name]['label'][] = trim($label); } } @@ -126,7 +126,7 @@ public function get_search_datas() $fields[$name]['sbas'][] = $sbasId; // add different label for the same field if exist - if (!in_array(strtolower($label), array_map('strtolower', $fields[$name]['label']))) { + if ($name !== $label && (!in_array(strtolower($label), array_map('strtolower', $fields[$name]['label'])))) { $fields[$name]['label'][] = trim($label); } } else { diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index d6af98f923..8f6f7c820c 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -587,7 +587,13 @@ {% for field_id, field in search_datas['fields'] %} {# {% if field['type'] != 'date' %}#} - + {#{% endif %}#} {% endfor %} @@ -637,8 +643,13 @@ {% for fieldname, date in search_datas['dates'] %} - + {% endfor %}