Skip to content

Commit

Permalink
Merge branch 'master' into PHRAS-3869-secure-locale
Browse files Browse the repository at this point in the history
  • Loading branch information
nmaillat authored Jul 12, 2023
2 parents bec04f4 + 12851c1 commit 3c02831
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 7 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 3 additions & 3 deletions lib/Alchemy/Phrasea/Helper/Prod.php
Original file line number Diff line number Diff line change
Expand Up @@ -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
);

Expand All @@ -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);
}
}
Expand All @@ -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 {
Expand Down
2 changes: 1 addition & 1 deletion lib/Alchemy/Phrasea/Out/Module/PDFRecords.php
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,7 @@ protected function print_thumbnailGrid($links = false)
);
}

$downloadLink = $rec->get_title(['encode'=> record_adapter::ENCODE_FOR_URI]);
$downloadLink = $rec->get_title(['encode'=> record_adapter::ENCODE_FOR_HTML]);


if ($this->canDownload && !empty($this->downloadSubdef) && $rec->has_subdef($this->downloadSubdef)
Expand Down
17 changes: 14 additions & 3 deletions templates/web/prod/index.html.twig
Original file line number Diff line number Diff line change
Expand Up @@ -587,7 +587,13 @@
<option value="">{{ 'Select a field' | trans }}</option>
{% for field_id, field in search_datas['fields'] %}
{# {% if field['type'] != 'date' %}#}
<option class="dbx db_{{field['sbas']|join(' db_')}}" data-fieldtype="{{ field['type'] }}-FIELD" value="{{field_id}}">{{ field['label'] | join(' - ') }}</option>
<option class="dbx db_{{field['sbas']|join(' db_')}}" data-fieldtype="{{ field['type'] }}-FIELD" value="{{field_id}}">
{% if field['label'] is empty %}
{{ field['fieldname'] }}
{% else %}
{{ field['label'] | join(' | ') ~ " ( " ~ field['fieldname'] ~ " )"}}
{% endif %}
</option>
{#{% endif %}#}
{% endfor %}
</select>
Expand Down Expand Up @@ -637,8 +643,13 @@
<option selected="selected"
value="">{{ 'Rechercher dans un champ date' | trans }}</option>
{% for fieldname, date in search_datas['dates'] %}
<option
class="dbx db_{{date['sbas']|join(' db_')}}" value="{{ fieldname }}">{{ date['label'] | join(' - ') }}</option>
<option class="dbx db_{{date['sbas']|join(' db_')}}" value="{{ fieldname }}">
{% if date['label'] is empty %}
{{ fieldname }}
{% else %}
{{ date['label'] | join(' | ') ~ " ( " ~ fieldname ~ " )" }}
{% endif %}
</option>
{% endfor %}
</select>
</span>
Expand Down

0 comments on commit 3c02831

Please sign in to comment.