From f62992e8120b8ddda5d1ac8cb1b3276617d4dd53 Mon Sep 17 00:00:00 2001 From: Katrin Fischer Date: Thu, 17 Aug 2017 14:51:08 +0000 Subject: [PATCH] Bug 19129 - Clean up Details tab for Organisation patrons Problem: A patron category "I" would cause display problems on the details in the intranet. This is because the templates confused patron category "I" with patron type "I" (organisation). Patch: - Cleans up variable confusion between categorycode and categorytype. - The template contained code to change the labels below the address to 'Organisational phone:" etc., I have removed this part as it does not match the edit form anymore. - Initials, date of birth and gender are still hidden for organisation - matching the edit form. Bonus: - The patron category description was missing on the right and left side of the details tab. Now it displays. - Fixes some html issues: - doubled up class attribute in a tag - doubled up To test: - Create 3 patrons - patron category code doesn't matter, but category type organisation - patron category code 'I', category type NOT organisation - patron category code NOT I, category type NOT organisaton - Check details tab in patron account in staff for all 3 - Verify patron category description shows correctly - Verify information added to the account displays correctly (phone numbers, emails, ...) Signed-off-by: Aleisha Amohia Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart (cherry picked from commit 82f183c5ea802e3231cb2442cf32474c92bd6ab4) Signed-off-by: Fridolin Somers --- .../prog/en/includes/circ-menu.inc | 7 +- .../prog/en/includes/members-toolbar.inc | 4 +- .../prog/en/modules/members/moremember.tt | 74 +++++++++---------- members/moremember.pl | 6 +- 4 files changed, 41 insertions(+), 50 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc index 8bc4a5c70a..e621d6409d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc @@ -23,7 +23,8 @@ [% INCLUDE 'member-display-address-style-us.inc' %] [% END %] - [% IF ( phone ) %]
  • + [% IF ( phone || mobile || phonepro ) %]
  • + [% IF ( phone ) %] [% phone | html %] [% ELSE %] [% IF ( mobile ) %] @@ -32,8 +33,8 @@ [% IF ( phonepro ) %] [% phonepro | html %] [% END %] - [% END %]
  • - [% END %] + [% END %] + [% END %][% END %] [% IF ( email ) %] [% ELSE %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc index 5b467ac275..7b91418acc 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/members-toolbar.inc @@ -199,7 +199,7 @@ function searchToHold(){ [% IF ( is_child ) %]
  • Update child to adult patron
  • [% ELSE %] -
  • Update child to adult patron
  • +
  • Update child to adult patron
  • [% END %] [% IF Koha.Preference('intranetreadinghistory') %] [%IF ( privacy == 2 ) %] @@ -249,7 +249,7 @@ function searchToHold(){ diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt index fd6b5e96c6..b40c29a754 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -223,7 +223,7 @@ function validate1(date) {
    - [% UNLESS ( I ) %][% IF ( othernames ) %]“[% othernames | html %]”[% END %] + [% IF ( othernames ) %]“[% othernames | html %]”[% END %]
    [% IF Koha.Preference( 'AddressFormat' ) %] @@ -234,46 +234,40 @@ function validate1(date) {
    -
      - [% IF ( I ) %] - [% IF ( phonepro ) %]
    1. Organization phone: [% phonepro | html %]
    2. [% END %] - [% IF ( emailpro ) %][% END %] - [% ELSE %] - [% IF ( phone ) %]
    3. Primary phone: [% phone | html %]
    4. [% END %] - [% IF ( phonepro ) %]
    5. Secondary phone: [% phonepro | html %]
    6. [% END %] - [% IF ( mobile ) %]
    7. Other phone: [% mobile | html %]
    8. [% END %] - [% END %] - - [% IF ( fax ) %]
    9. Fax: [% fax %]
    10. [% END %] - [% UNLESS ( I ) %] +
        + [% IF ( phone ) %]
      1. Primary phone: [% phone | html %]
      2. [% END %] + [% IF ( phonepro ) %]
      3. Secondary phone: [% phonepro | html %]
      4. [% END %] + [% IF ( mobile ) %]
      5. Other phone: [% mobile | html %]
      6. [% END %] + [% IF ( fax ) %]
      7. Fax: [% fax %]
      8. [% END %] [% IF ( email ) %][% END %] [% IF ( emailpro ) %][% END %] - [% END %] - [% IF ( initials ) %]
      9. Initials: [% initials %]
      10. [% END %] - [% IF ( dateofbirth ) %]
      11. Date of birth:[% dateofbirth | $KohaDates %] ([% age %] years)
      12. [% END %] - [% IF ( sex ) %]
      13. Gender: - [% IF ( sex == 'F' ) %]Female[% ELSIF ( sex == 'M' ) %]Male[% ELSE %][% sex %][% END %] -
      14. [% END %][% END %] - [% IF guarantees %] -
      15. - Guarantees: - -
      16. - [% ELSIF guarantor %] -
      17. - Guarantor: - [% IF guarantor.borrowernumber %] - [% guarantor.firstname | html %] [% guarantor.surname | html %] - [% ELSE %] - [% guarantor.firstname | html %] [% guarantor.surname | html %] - [% END %] -
      18. - [% END %] -
      + + [% END %] +
    [% IF ( guarantor.borrowernumber ) %] @@ -400,7 +394,7 @@ function validate1(date) {
    1. Card number: [% cardnumber %]
    2. Borrowernumber: [% borrowernumber %]
    3. -
    4. Category: [% description %] ([% categorycode %])
    5. +
    6. Category: [% categoryname %] ([% categorycode %])
    7. Registration date: [% dateenrolled | $KohaDates %]
    8. Expiration date: @@ -471,7 +465,6 @@ function validate1(date) {
    - [% UNLESS ( I ) %]

    Alternate address

    @@ -489,7 +482,6 @@ function validate1(date) {
    - [% END %]

    Alternative contact

    diff --git a/members/moremember.pl b/members/moremember.pl index 1ac6a3d404..59c70f9475 100755 --- a/members/moremember.pl +++ b/members/moremember.pl @@ -335,9 +335,6 @@ if ( C4::Context->preference("ExportCircHistory") ) { $template->param(csv_profiles => [ Koha::CsvProfiles->search({ type => 'marc' }) ]); } -# in template => institutional (A for Adult, C for children) -$template->param( $data->{'categorycode'} => 1 ); - # Display the language description instead of the code # Note that this is certainly wrong my ( $subtag, $region ) = split '-', $patron->lang; @@ -349,7 +346,7 @@ $template->param( detailview => 1, borrowernumber => $borrowernumber, othernames => $data->{'othernames'}, - categoryname => $data->{'description'}, + categoryname => $patron->category->description, was_renewed => scalar $input->param('was_renewed') ? 1 : 0, todaysdate => output_pref({ dt => dt_from_string, dateformat => 'iso', dateonly => 1 }), totalprice => sprintf("%.2f", $totalprice), @@ -358,6 +355,7 @@ $template->param( overdues_exist => $overdues_exist, StaffMember => $category_type eq 'S', is_child => $category_type eq 'C', + $category_type => 1, # [% IF ( I ) %] = institutional/organisation samebranch => $samebranch, quickslip => $quickslip, housebound_role => scalar $patron->housebound_role, -- 2.39.5