From 07890e31635cf8d818a937e1df47fb62676e4e8b Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Fri, 5 Jan 2024 12:10:33 +0100 Subject: [PATCH] Bug 35329: Move patron search to modal - funds This is a tricky one. We can have several modals per page, patron-search.inc needs to be adjusted to not use ids but classes. Also we need to declare JS variables with 'var' instead of 'let' (which does not allow redefinition of the same variable). Test plan: Create or modify a fund "Select owner" and "Add users" to open the modals. Signed-off-by: Owen Leonard Signed-off-by: Martin Renvoize Signed-off-by: Jonathan Druart --- .../prog/en/includes/av-build-dropbox.inc | 12 +- .../prog/en/includes/patron-search.inc | 260 ++++++++++-------- .../prog/en/includes/patronfields.inc | 2 +- .../prog/en/modules/admin/aqbudgets.tt | 37 +-- .../prog/en/modules/members/member.tt | 6 +- 5 files changed, 173 insertions(+), 144 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc index 263a190a15..78b4bcbbf5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/av-build-dropbox.inc @@ -12,7 +12,11 @@ [% DEFAULT class = '' size = 20 %] [% IF avs.count %] - + [% ELSE %] + [% ELSE %] - + [% IF no_id %] + + [% ELSE %] + + [% END %] [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc index 4a18c0ffe0..36614be110 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -7,11 +7,13 @@ [% USE Asset %] [% USE To %] +[% SET search_results_block_id = 'searchresults' %] + [%# Display a simple form %] [% BLOCK patron_search_filters_simple %] -
+
Enter patron card number or partial name:
- +
[% END %] @@ -27,13 +29,13 @@ [%# - search_type: select 'contains' or 'starts with' %] [%- searchtype = searchtype || Koha.Preference('DefaultPatronSearchMethod') -%] [% BLOCK patron_search_filters %] -
+

Search for patron

  1. - +
  2. [% FOR f IN filters %] @@ -41,7 +43,7 @@ [% CASE 'branch' %]
  3. - [% SET libraries = Branches.all( only_from_group => 1 ) %] [% IF libraries.size != 1 %] @@ -54,7 +56,7 @@ [% CASE 'category' %]
  4. - [% FOREACH category IN Categories.limited.unblessed %] @@ -64,12 +66,12 @@ [% CASE 'sort1' %]
  5. - [% PROCESS 'av-build-dropbox.inc' name="sort1_filter", category="Bsort1", empty=1, size = 20 %] + [% PROCESS 'av-build-dropbox.inc' no_id => 1, name="sort1_filter", category="Bsort1", empty=1, size = 20 %]
  6. [% CASE 'sort2' %]
  7. - [% PROCESS 'av-build-dropbox.inc' name="sort2_filter", category="Bsort2", empty=1, size = 20 %] + [% PROCESS 'av-build-dropbox.inc' no_id => 1, name="sort2_filter", category="Bsort2", empty=1, size = 20 %]
  8. [% CASE 'search_field' %]
  9. @@ -78,7 +80,7 @@ [% CASE 'search_type' %]
  10. - [% IF searchtype == "starts_with" %] @@ -93,7 +95,7 @@
- +
@@ -135,14 +137,14 @@ [% END %] -

Patrons found for:

+

Patrons found for: