From a853b0653f1096a5b1d8ec5aea2132487c65670c Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Mon, 14 Feb 2022 17:13:53 +0100 Subject: [PATCH] Bug 30063: Fix address format MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Séverine Queune Signed-off-by: Martin Renvoize Signed-off-by: Fridolin Somers --- .../prog/css/src/staff-global.scss | 6 ++--- .../prog/en/includes/patron-search.inc | 25 +++++++++++++++++++ .../prog/en/modules/members/member.tt | 7 +++--- koha-tmpl/intranet-tmpl/prog/js/members.js | 2 +- 4 files changed, 33 insertions(+), 7 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss index b1b12ffcaa..b9d0573dc7 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss +++ b/koha-tmpl/intranet-tmpl/prog/css/src/staff-global.scss @@ -2161,7 +2161,8 @@ li { } } -#searchresults { +#searchresults, +#table_borrowers { .address { ul { margin: 0; @@ -4031,8 +4032,7 @@ input.renew { } #pat_member { - #patron_list_dialog, - #searchresults { + #patron_list_dialog { display: none; } } 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 11fce49397..6e19c926cc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/patron-search.inc @@ -421,6 +421,31 @@ return r; } } + [% CASE 'name-address' %] + { + "data": "me.firstname:me.surname:me.othernames:me.street_number:me.address:me.address2:me.city:me.state:me.postal_code:me.country", + "searchable": true, + "orderable": true, + "render": function( data, type, row, meta ) { + let patron_id = encodeURIComponent(row.patron_id); + let r = ''; + [% IF ! open_on_row_click %] + r += "" + $patron_to_html(row, { invert_name: 1 }) + ""; + [% ELSE %] + r += $patron_to_html(row, { invert_name: 1 }); + [% END %] + r += '
'; + r += '
    '; + r += $format_address(row, { no_line_break: 1 }); + + if ( row.email ) { + r += "
  • " + _("Email: ") + "" + escape_str(row.email) + "
  • "; + } + r += '
' + + return r; + } + } [% CASE 'name' %] { "data": "me.firstname:me.surname:me.othernames", diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt index 016060065d..f8c60f664b 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member.tt @@ -8,7 +8,7 @@ [% PROCESS 'patronfields.inc' %] [% SET libraries = Branches.all %] [% SET categories = Categories.all.unblessed %] -[% SET columns = ['cardnumber', 'name', 'dateofbirth', 'branch', 'category', 'dateexpiry', 'checkouts', 'account_balance', 'borrowernotes', 'action'] %] +[% SET columns = ['cardnumber', 'name-address', 'dateofbirth', 'branch', 'category', 'dateexpiry', 'checkouts', 'account_balance', 'borrowernotes', 'action'] %] [% PROCESS 'patron-search.inc' %] [% INCLUDE 'doc-head-open.inc' %] Patrons[% IF ( searching ) %] › Search results[% END %] › Koha @@ -64,7 +64,7 @@ [% END %] -
+
[% IF CAN_user_tools_manage_patron_lists || CAN_user_borrowers_edit_borrowers %]