From 114d516330cf074c8227cda313d99d2c88929e45 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Marc=20V=C3=A9ron?= Date: Tue, 17 Feb 2015 22:36:45 +0100 Subject: [PATCH] Bug 4041 - First step (staff interface): Extract address blocks to include files This patch extracts the address blocks in memberentrygen.tt to include files. To test: The overall functionality should remain the same with this patch. In further steps, more country- or region-dependent includes could be added, along with functionality to select them using a system preference. --- .../en/includes/member-alt-address-style-us.inc | 112 +++++++ .../en/includes/member-alt-contact-style-us.inc | 112 +++++++ .../en/includes/member-main-address-style-us.inc | 124 +++++++ .../prog/en/modules/members/memberentrygen.tt | 350 +------------------- 4 files changed, 351 insertions(+), 347 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-us.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-us.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-us.inc diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-us.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-us.inc new file mode 100644 index 0000000..21d000d --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-us.inc @@ -0,0 +1,112 @@ +
+ Alternate address
    + [% UNLESS noB_address %] +
  1. + [% IF ( mandatoryB_address ) %] +
  2. + [% END %] + [% UNLESS noB_address2 %] +
  3. + [% IF ( mandatoryB_address2 ) %] +
  4. + [% END %] + [% UNLESS noB_city %] +
  5. + [% IF ( mandatoryB_city ) %] +
  6. + [% END %] + [% UNLESS noB_state %] +
  7. + [% IF ( mandatoryB_state ) %] +
  8. + [% END %] + [% UNLESS noB_zipcode %] +
  9. + [% IF ( mandatoryB_zipcode ) %] +
  10. + [% END %] + [% UNLESS noB_country %] +
  11. + [% IF ( mandatoryB_country ) %] +
  12. + [% END %] + [% UNLESS noB_phone %] +
  13. + [% IF ( mandatoryB_phone ) %] +
  14. + [% END %] + [% UNLESS noB_email %] +
  15. + [% IF ( mandatoryB_email ) %] +
  16. + [% END %] + [% UNLESS nocontactnote %] +
  17. + [% IF ( mandatorycontactnote ) %] +
  18. + [% END %] +
+
+ diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-us.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-us.inc new file mode 100644 index 0000000..3851891 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-us.inc @@ -0,0 +1,112 @@ +
+ Alternate contact
    + [% UNLESS noaltcontactsurname %] +
  1. + [% IF ( mandatoryaltcontactsurname ) %] +
  2. + [% END %] + [% UNLESS noaltcontactfirstname %] +
  3. + [% IF ( mandatoryaltcontactfirstname ) %] +
  4. + [% END %] + [% UNLESS noaltcontactaddress1 %] +
  5. + [% IF ( mandatoryaltcontactaddress1 ) %] +
  6. + [% END %] + [% UNLESS noaltcontactaddress2 %] +
  7. + [% IF ( mandatoryaltcontactaddress2 ) %] +
  8. + [% END %] + [% UNLESS noaltcontactaddress3 %] +
  9. + [% IF ( mandatoryaltcontactaddress3 ) %] +
  10. + [% END %] + [% UNLESS noaltcontactstate %] +
  11. + [% IF ( mandatoryaltcontactstate ) %] +
  12. + [% END %] + [% UNLESS noaltcontactzipcode %] +
  13. + [% IF ( mandatoryaltcontactzipcode ) %] +
  14. + [% END %] + [% UNLESS noaltcontactcountry %] +
  15. + [% IF ( mandatoryaltcontactcountry ) %] +
  16. + [% END %] + [% UNLESS noaltcontactphone %] +
  17. + [% IF ( mandatoryaltcontactphone ) %] +
  18. + [% END %] +
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-us.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-us.inc new file mode 100644 index 0000000..c2c640a --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-us.inc @@ -0,0 +1,124 @@ +
+ Main address
    + [% UNLESS nostreetnumber %] +
  1. + [% IF ( mandatorystreetnumber ) %] +
  2. + [% END %] + [% UNLESS nostreettype %] + [% IF roadtypes %] +
  3. + [% IF ( mandatorystreettype ) %] +
  4. + [% END %] + [% END %] + [% UNLESS noaddress %] +
  5. + [% IF ( mandatoryaddress ) %] +
  6. + [% END %] + [% UNLESS noaddress2 %] +
  7. + [% IF ( mandatoryaddress2 ) %] +
  8. + [% END %] + [% UNLESS nocity %] +
  9. + [% IF ( mandatorycity ) %] +
  10. + [% END %] + [% UNLESS nostate %] +
  11. + [% IF ( mandatorystate ) %] +
  12. + [% END %] + [% UNLESS nozipcode %] +
  13. + [% IF ( mandatoryzipcode ) %] +
  14. + [% END %] + [% UNLESS nocountry %] +
  15. + [% IF ( mandatorycountry ) %] +
  16. + [% END %] +
+
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index b10ac47..2c41a5c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -433,130 +433,7 @@ [% END %] [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %] -
- Main address
    - [% UNLESS nostreetnumber %] -
  1. - [% IF ( mandatorystreetnumber ) %] -
  2. - [% END %] - [% UNLESS nostreettype %] - [% IF roadtypes %] -
  3. - [% IF ( mandatorystreettype ) %] -
  4. - [% END %] - [% END %] - [% UNLESS noaddress %] -
  5. - [% IF ( mandatoryaddress ) %] -
  6. - [% END %] - [% UNLESS noaddress2 %] -
  7. - [% IF ( mandatoryaddress2 ) %] -
  8. - [% END %] - [% UNLESS nocity %] -
  9. - [% IF ( mandatorycity ) %] -
  10. - [% END %] - [% UNLESS nostate %] -
  11. - [% IF ( mandatorystate ) %] -
  12. - [% END %] - [% UNLESS nozipcode %] -
  13. - [% IF ( mandatoryzipcode ) %] -
  14. - [% END %] - [% UNLESS nocountry %] -
  15. - [% IF ( mandatorycountry ) %] -
  16. - [% END %] -
-
+[% INCLUDE 'member-main-address-style-us.inc' %] [% END # nostreet && nocity etc group%] [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %] @@ -645,233 +522,12 @@ [% IF ( step_6 ) %] [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %] -
- Alternate address
    - [% UNLESS noB_address %] -
  1. - [% IF ( mandatoryB_address ) %] -
  2. - [% END %] - [% UNLESS noB_address2 %] -
  3. - [% IF ( mandatoryB_address2 ) %] -
  4. - [% END %] - [% UNLESS noB_city %] -
  5. - [% IF ( mandatoryB_city ) %] -
  6. - [% END %] - [% UNLESS noB_state %] -
  7. - [% IF ( mandatoryB_state ) %] -
  8. - [% END %] - [% UNLESS noB_zipcode %] -
  9. - [% IF ( mandatoryB_zipcode ) %] -
  10. - [% END %] - [% UNLESS noB_country %] -
  11. - [% IF ( mandatoryB_country ) %] -
  12. - [% END %] - [% UNLESS noB_phone %] -
  13. - [% IF ( mandatoryB_phone ) %] -
  14. - [% END %] - [% UNLESS noB_email %] -
  15. - [% IF ( mandatoryB_email ) %] -
  16. - [% END %] - [% UNLESS nocontactnote %] -
  17. - [% IF ( mandatorycontactnote ) %] -
  18. - [% END %] -
-
+[% INCLUDE 'member-alt-address-style-us.inc' %] [% END # UNLESS noB_address && noB_city && noB_state && noB_phone && noB_email %] [% END %] [% IF ( step_2 ) %] [% UNLESS noaltcontactsurname && noaltcontactfirstname && noaltcontactaddress1 && noaltcontactaddress2 && noaltcontactaddress3 && noaltcontactstate && noaltcontactzipcode && noaltcontactcountry && noaltcontactphone %] -
- Alternate contact
    - [% UNLESS noaltcontactsurname %] -
  1. - [% IF ( mandatoryaltcontactsurname ) %] -
  2. - [% END %] - [% UNLESS noaltcontactfirstname %] -
  3. - [% IF ( mandatoryaltcontactfirstname ) %] -
  4. - [% END %] - [% UNLESS noaltcontactaddress1 %] -
  5. - [% IF ( mandatoryaltcontactaddress1 ) %] -
  6. - [% END %] - [% UNLESS noaltcontactaddress2 %] -
  7. - [% IF ( mandatoryaltcontactaddress2 ) %] -
  8. - [% END %] - [% UNLESS noaltcontactaddress3 %] -
  9. - [% IF ( mandatoryaltcontactaddress3 ) %] -
  10. - [% END %] - [% UNLESS noaltcontactstate %] -
  11. - [% IF ( mandatoryaltcontactstate ) %] -
  12. - [% END %] - [% UNLESS noaltcontactzipcode %] -
  13. - [% IF ( mandatoryaltcontactzipcode ) %] -
  14. - [% END %] - [% UNLESS noaltcontactcountry %] -
  15. - [% IF ( mandatoryaltcontactcountry ) %] -
  16. - [% END %] - [% UNLESS noaltcontactphone %] -
  17. - [% IF ( mandatoryaltcontactphone ) %] -
  18. - [% END %] -
-
+[% INCLUDE 'member-alt-contact-style-us.inc' %] [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %] [% END %] -- 1.7.10.4