From 0960f2f1617e23762692dbbf895dfe6c7c41edcc 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 by introducint a new variable 'is_organisation' instead of using 'I'. - 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, ...) --- .../intranet-tmpl/prog/en/includes/circ-menu.inc | 7 +- .../prog/en/includes/members-toolbar.inc | 4 +- .../prog/en/modules/members/moremember.tt | 74 ++++++++++------------ 3 files changed, 40 insertions(+), 45 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 8bc4a5c..e621d64 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 ) %]
  • [% email | html %]
  • [% 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 5b467ac..7b91418 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 fd6b5e9..589acd6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/moremember.tt @@ -218,12 +218,12 @@ function validate1(date) { [% END %] -

    [% UNLESS ( I ) %] +

    [% UNLESS ( is_organisation ) %] [% title | html %] [% firstname | html %] [% END %] [% surname | html %] ([% cardnumber | html %])

    - [% 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: -- 2.1.4