From 8ba164b3bbcffe80c726b4e38c3bab80d2d3b42a Mon Sep 17 00:00:00 2001 From: =?utf8?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. Signed-off-by: Mirko Tietgen Signed-off-by: Kyle M Hall Signed-off-by: Tomas Cohen Arazi --- .../includes/member-alt-address-style-us.inc | 111 ++++++ .../includes/member-alt-contact-style-us.inc | 112 ++++++ .../includes/member-main-address-style-us.inc | 124 +++++++ .../prog/en/modules/members/memberentrygen.tt | 350 +----------------- 4 files changed, 350 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 0000000000..1d2d8b2e26 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-us.inc @@ -0,0 +1,111 @@ +
+ 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 0000000000..ff0f99bf5b --- /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 0000000000..60c44b4fb7 --- /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 8412c90a65..3b19b68036 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -470,130 +470,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 %] @@ -682,233 +559,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 %] -- 2.39.5