From 1e35ea33b0a467aa063e169ab77c70a58e8cbc2a Mon Sep 17 00:00:00 2001 From: Bernardo Gonzalez Kriegel Date: Mon, 11 Aug 2014 00:23:52 -0300 Subject: [PATCH] Bug 12222: members-update.tt has a giant hash variable This patch changes that giant hash by a TT block to find apropriate strings To test: 1) Apply the patch 2) On opac log as some user and request some modifications on personal data 3) On staff, reload main, will see a notice that a patron has requested modification, clic on the link 4) All modified data must show with apropriate legends for each db column, check for regressions 5) Update translation files for your preferred language, xx-YY Check for new strings, e.g. egrep "Alternate address" misc/translator/po/xx-YY* You must find old and new instances (old with #~ , in particular the hash one) Signed-off-by: Chris Cormack Works as advertised, strings are now translatable. Signed-off-by: Jonathan Druart Signed-off-by: Tomas Cohen Arazi I like to have this fixed. I'd like it to use C4::Templates::GetColumnDefs instead, but it belongs to another bug report I guess. --- .../prog/en/modules/members/members-update.tt | 108 +++++++++--------- 1 file changed, 55 insertions(+), 53 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt index 38b022c1b0..0e907d715e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/members-update.tt @@ -11,57 +11,59 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'patron-search.inc' %] -[% - SET field_display_names = { - surname => "Surname" - firstname => "First name" - title => "Title" - othernames => "Other names" - initials => "Initials" - streetnumber => "Street number" - streettype => "Street type" - address => "Address" - address2 => "Address 2" - city => "City" - state => "State" - zipcode => "Zip code" - country => "Country" - email => "Email" - phone => "Primary Phone" - mobile => "Primary Mobile Phone" - fax => "Fax" - emailpro => "Secondary email" - phonepro => "Secondary phone" - B_streetnumber => "Alternate address - street number" - B_streettype => "Alternate address - street type" - B_address => "Alternate address" - B_address2 => "Alternate address 2" - B_city => "Alternate address - city" - B_state => "Alternate address - state" - B_zipcode => "Alternate address - zip code" - B_email => "Alternate address - email" - B_phone => "Alternate address - phone" - contactnote => "Alternate address - contact note" - dateofbirth => "Date of birth" - contactname => "Contact - last name" - contactfirstname=> "Contact - first name" - contacttitle => "Contact - title" - relationship => "Contact - relationship" - ethnicity => "Ethnicity" - ethnotes => "Ethnicity notes" - sex => "Sex" - altcontactfirstname => "Alternate contact - first name" - altcontactsurname => "Alternate contact - surname" - altcontactaddress1 => "Alternate contact - address" - altcontactaddress2 => "Alternate contact - address 2" - altcontactaddress3 => "Alternate contact - city" - altcontactstate => "Alternate contact - state" - altcontactzipcode => "Alternate contact - zip code" - altcontactcountry => "Alternate contact - country" - altcontactphone => "Alternate contact - phone" - smsalertnumber => "SMS alert number" - } -%] +[% BLOCK display_names %] +[% SWITCH field %] +[% CASE 'surname' %]Surname +[% CASE 'firstname' %]First name +[% CASE 'title' %]Title +[% CASE 'othernames' %]Other names +[% CASE 'initials' %]Initials +[% CASE 'streetnumber' %]Street number +[% CASE 'streettype' %]Street type +[% CASE 'address' %]Address +[% CASE 'address2' %]Address 2 +[% CASE 'city' %]City +[% CASE 'state' %]State +[% CASE 'zipcode' %]Zip code +[% CASE 'country' %]Country +[% CASE 'email' %]Email +[% CASE 'phone' %]Primary Phone +[% CASE 'mobile' %]Primary Mobile Phone +[% CASE 'fax' %]Fax +[% CASE 'emailpro' %]Secondary email +[% CASE 'phonepro' %]Secondary phone +[% CASE 'B_streetnumber' %]Alternate address: Street number +[% CASE 'B_streettype' %]Alternate address: Street type +[% CASE 'B_address' %]Alternate address: Address +[% CASE 'B_address2' %]Alternate address: Address 2 +[% CASE 'B_city' %]Alternate address: City +[% CASE 'B_state' %]Alternate address: State +[% CASE 'B_zipcode' %]Alternate address: Zip/postal code +[% CASE 'B_email' %]Alternate address: Email +[% CASE 'B_phone' %]Alternate address: Phone +[% CASE 'contactnote' %]Alternate address: Contact note +[% CASE 'dateofbirth' %]Date of birth +[% CASE 'contactname' %]Contact: Last name +[% CASE 'contactfirstname' %]Contact: First name +[% CASE 'contacttitle' %]Contact: Title +[% CASE 'relationship' %]Contact: Relationship +[% CASE 'ethnicity' %]Ethnicity +[% CASE 'ethnotes' %]Ethnicity notes +[% CASE 'sex' %]Sex +[% CASE 'altcontactfirstname' %]Alternate contact: First name +[% CASE 'altcontactsurname' %]Alternate contact: Surname +[% CASE 'altcontactaddress1' %]Alternate contact: Address +[% CASE 'altcontactaddress2' %]Alternate contact: Address 2 +[% CASE 'altcontactaddress3' %]Alternate contact: City +[% CASE 'altcontactstate' %]Alternate contact: State +[% CASE 'altcontactzipcode' %]Alternate contact: Zip code +[% CASE 'altcontactcountry' %]Alternate contact: Country +[% CASE 'altcontactphone' %]Alternate contact: Phone +[% CASE 'smsalertnumber' %]SMS alert number +[% CASE %][% field %] +[% END %] +[% END %] +
@@ -96,10 +98,10 @@ [% FOREACH key IN pm.keys %] - [% IF field_display_names.$key %] + [% IF ( key != "timestamp" ) %] [% IF ( ( pm.$key OR borrowers.$borrowernumber.$key ) && ( pm.$key != borrowers.$borrowernumber.$key ) ) %] - [% field_display_names.$key %] + [% PROCESS display_names field = key %] [% borrowers.$borrowernumber.$key %] [% pm.$key %] -- 2.39.5