@@ -, +, @@ style" address formats for staff --- installer/data/mysql/sysprefs.sql | 3 +- installer/data/mysql/updatedatabase.pl | 8 ++ .../en/includes/member-alt-address-style-de.inc | 111 ++++++++++++++++++ .../en/includes/member-alt-contact-style-de.inc | 112 ++++++++++++++++++ .../en/includes/member-main-address-style-de.inc | 124 ++++++++++++++++++++ .../en/modules/admin/preferences/i18n_l10n.pref | 7 ++ .../prog/en/modules/members/memberentrygen.tt | 18 ++- 7 files changed, 379 insertions(+), 4 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-de.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-de.inc --- a/installer/data/mysql/sysprefs.sql +++ a/installer/data/mysql/sysprefs.sql @@ -474,5 +474,6 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` ('XSLTDetailsDisplay','default','','Enable XSL stylesheet control over details page display on intranet','Free'), ('XSLTResultsDisplay','default','','Enable XSL stylesheet control over results page display on intranet','Free'), ('z3950AuthorAuthFields','701,702,700',NULL,'Define the MARC biblio fields for Personal Name Authorities to fill biblio.author','free'), -('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo') +('z3950NormalizeAuthor','0','','If ON, Personal Name Authorities will replace authors in biblio.author','YesNo'), +('addressformat','us','','Choose format to display postal addresses', 'Choice') ; --- a/installer/data/mysql/updatedatabase.pl +++ a/installer/data/mysql/updatedatabase.pl @@ -9977,6 +9977,14 @@ if ( CheckVersion($DBversion) ) { print "Upgrade to $DBversion done (Bug 9580: Cover image from Coce, a remote image URL cache)\n"; SetVersion($DBversion); } +$DBversion = "XXX"; +if ( CheckVersion($DBversion) ) { + $dbh->do(q| + INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('addressformat','us','Choose format to display postal addresses',NULL,'Choice') + |); + print "Upgrade to $DBversion done (Bug 4041: Address Format as a I18N/L10N system preference\n"; + SetVersion ($DBversion); +} # DEVELOPER PROCESS, search for anything to execute in the db_update directory --- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-de.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-address-style-de.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_zipcode %] +
  5. + [% IF ( mandatoryB_zipcode ) %] +
  6. + [% END %] + [% UNLESS noB_city %] +
  7. + [% IF ( mandatoryB_city ) %] +
  8. + [% END %] + [% UNLESS noB_state %] +
  9. + [% IF ( mandatoryB_state ) %] +
  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 %] +
+
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/member-alt-contact-style-de.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 noaltcontactzipcode %] +
  9. + [% IF ( mandatoryaltcontactzipcode ) %] +
  10. + [% END %] + [% UNLESS noaltcontactaddress3 %] +
  11. + [% IF ( mandatoryaltcontactaddress3 ) %] +
  12. + [% END %] + [% UNLESS noaltcontactstate %] +
  13. + [% IF ( mandatoryaltcontactstate ) %] +
  14. + [% END %] + [% UNLESS noaltcontactcountry %] +
  15. + [% IF ( mandatoryaltcontactcountry ) %] +
  16. + [% END %] + [% UNLESS noaltcontactphone %] +
  17. + [% IF ( mandatoryaltcontactphone ) %] +
  18. + [% END %] +
+
--- a/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-de.inc +++ a/koha-tmpl/intranet-tmpl/prog/en/includes/member-main-address-style-de.inc @@ -0,0 +1,124 @@ +
+ Main address
    +[% UNLESS nostreettype %] + [% IF roadtypes %] +
  1. + [% IF ( mandatorystreettype ) %] +
  2. + [% END %] + [% END %] + [% UNLESS noaddress %] +
  3. + [% IF ( mandatoryaddress ) %] +
  4. + [% END %] + [% UNLESS nostreetnumber %] +
  5. + [% IF ( mandatorystreetnumber ) %] +
  6. + [% END %] + [% UNLESS noaddress2 %] +
  7. + [% IF ( mandatoryaddress2 ) %] +
  8. + [% END %] + [% UNLESS nozipcode %] +
  9. + [% IF ( mandatoryzipcode ) %] +
  10. + [% END %] + [% UNLESS nocity %] +
  11. + [% IF ( mandatorycity ) %] +
  12. + [% END %] + [% UNLESS nostate %] +
  13. + [% IF ( mandatorystate ) %] +
  14. + [% END %] + [% UNLESS nocountry %] +
  15. + [% IF ( mandatorycountry ) %] +
  16. + [% END %] +
+
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref @@ -45,3 +45,10 @@ I18N/L10N: class: long - "for lists of browsable letters. This should be a space separated list of uppercase letters." - "
Hint: Changing collation in the database for the 'surname' column of the 'borrowers' table is helpful to make browsing by last name work in members-home.pl when using an alphabet outside of A-Z" + - + - Format postal addresses using + - pref: addressformat + default: us + choices: + us: US style + de: German style --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -470,7 +470,11 @@ [% END %] [% UNLESS noaddress && noaddress2 && nocity && nostate && nozipcode && nocountry %] -[% INCLUDE 'member-main-address-style-us.inc' %] + [% IF Koha.Preference( 'addressformat' ) %] + [% INCLUDE "member-main-address-style-${ Koha.Preference( 'addressformat' ) }.inc" %] + [% ELSE %] + [% INCLUDE 'member-main-address-style-us.inc' %] + [% END %] [% END # nostreet && nocity etc group%] [% UNLESS nophone && nophonepro && nomobile && noemail && noemailpro && nofax %] @@ -559,12 +563,20 @@ [% IF ( step_6 ) %] [% UNLESS noB_address && noB_address2 && noB_city && noB_zipcode && noB_state && noB_country &&nocontactnote && noB_phone && noB_email %] -[% INCLUDE 'member-alt-address-style-us.inc' %] + [% IF Koha.Preference( 'addressformat' ) %] + [% INCLUDE "member-alt-address-style-${ Koha.Preference( 'addressformat' ) }.inc" %] + [% ELSE %] + [% INCLUDE 'member-alt-address-style-us.inc' %] + [% END %] [% 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 %] -[% INCLUDE 'member-alt-contact-style-us.inc' %] + [% IF Koha.Preference( 'addressformat' ) %] + [% INCLUDE "member-alt-contact-style-${ Koha.Preference( 'addressformat' ) }.inc" %] + [% ELSE %] + [% INCLUDE 'member-alt-contact-style-us.inc' %] + [% END %] [% END # UNLESS noaltcontactsurname && noaltcontactfirstname etc %] [% END %] --