@@ -, +, @@
style" address formats for staff
---
installer/data/mysql/sysprefs.sql | 3 +-
installer/data/mysql/updatedatabase.pl | 9 ++
.../en/includes/member-alt-address-style-de.inc | 112 ++++++++++++++++++
.../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 | 8 ++
.../prog/en/modules/members/memberentrygen.tt | 18 ++-
7 files changed, 382 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
@@ -473,5 +473,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
@@ -9773,6 +9773,15 @@ if ( CheckVersion($DBversion) ) {
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);
+}
+
=head1 FUNCTIONS
=head2 TableExists($table)
--- 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,112 @@
+
+
--- 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 @@
+
--- 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 @@
+
--- 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
@@ -44,3 +44,11 @@ I18N/L10N:
- pref: alphabet
class: long
- for lists of browsable letters. This should be a space separated list of uppercase letters.
+ -
+ - 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
@@ -433,7 +433,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 %]
@@ -522,12 +526,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 %]
--