Bugzilla – Attachment 33771 Details for
Bug 12137
Extend CalendarFirstDayOfWeek to be any day
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 12137 - Extend CalendarFirstDayOfWeek to be any day
Bug-12137---Extend-CalendarFirstDayOfWeek-to-be-an.patch (text/plain), 9.91 KB, created by
Mark Tompsett
on 2014-11-21 00:07:42 UTC
(
hide
)
Description:
Bug 12137 - Extend CalendarFirstDayOfWeek to be any day
Filename:
MIME Type:
Creator:
Mark Tompsett
Created:
2014-11-21 00:07:42 UTC
Size:
9.91 KB
patch
obsolete
>From a918c98d9d1be4d3f1aa6afe5a21ea0ed710e33d Mon Sep 17 00:00:00 2001 >From: Mark Tompsett <mtompset@hotmail.com> >Date: Thu, 24 Apr 2014 19:09:31 -0400 >Subject: [PATCH] Bug 12137 - Extend CalendarFirstDayOfWeek to be any day > >Mubassir Ahsan asked on the Koha mailing list: >Is there any option to set Saturday as the first day of >the week? Please help me. > >CalendarFirstDayOfWeek is currently either Sunday|Monday. > >By converting it to 0|1|2|3|4|5|6 >(Sunday, Monday, ..., Saturday), we can allow any day of the >week to be the first day of the week in the date picker. > >TEST PLAN >--------- >1) Backup DB >2) In mysql: > > DELETE FROM systempreferences; > > SOURCE .../installer/data/mysql/sysprefs.sql > > SELECT variable,value FROM systempreferences; > -- It should say 'CalendarFirstDayOfWeek' and '0' > May say '1' if you are using Norwegian. >3) Restore your DB >4) .../installer/data/mysql/updatedatabase.pl > -- If your previous value for 'CalendarFirstDayOfWeek' was > 'Sunday', it should be '0'. For 'Monday', it should be '1'. >5) Test an installation with 'de-DE' as the language. > -- The default value should be '1'. >6) Test an installation with 'nb-NO' as the language. > -- The default value should be '1'. >7) In the staff client, confirm that any day of the week is > available in the I18N/L10N system preferences for the > CalendarFirstDayOfWeek dropdown. > -- I'm aware they aren't in order, but I'm after > functionality, not finesse. >8) In another tab, go to a staff place that has a datepicker. > For example, Home -> Tools -> Inventory/stocktaking >9) For each possible value in the CalendarFirstDayOfWeek, > go to the other tab, refresh the page after updating the > system preference, and click the datepicker icon. > -- The date picker should then start on the selected > day of the week. >10) Log into OPAC > -- This may require setting: opacuserlogin to 'Allow'. >11) Click the personal details tab on the left. >12) There is a date picker for the date of birth. > -- The date picker should then start on the selected > day of the week. >13) Run koha QA test tools. >--- > C4/Auth.pm | 4 ++-- > .../mysql/de-DE/mandatory/system_preferences.sql | 3 ++- > .../nb-NO/1-Obligatorisk/system_preferences.sql | 3 ++- > installer/data/mysql/sysprefs.sql | 2 +- > installer/data/mysql/updatedatabase.pl | 17 +++++++++++++++++ > .../en/modules/admin/preferences/i18n_l10n.pref | 11 ++++++++--- > 6 files changed, 32 insertions(+), 8 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index b808c66..7239208 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -376,7 +376,7 @@ sub get_template_and_user { > AmazonCoverImages => C4::Context->preference("AmazonCoverImages"), > AutoLocation => C4::Context->preference("AutoLocation"), > "BiblioDefaultView".C4::Context->preference("IntranetBiblioDefaultView") => 1, >- CalendarFirstDayOfWeek => (C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday")?0:1, >+ CalendarFirstDayOfWeek => C4::Context->preference("CalendarFirstDayOfWeek"), > CircAutocompl => C4::Context->preference("CircAutocompl"), > FRBRizeEditions => C4::Context->preference("FRBRizeEditions"), > IndependentBranches => C4::Context->preference("IndependentBranches"), >@@ -447,7 +447,7 @@ sub get_template_and_user { > AuthorisedValueImages => C4::Context->preference("AuthorisedValueImages"), > BranchesLoop => GetBranchesLoop($opac_name), > BranchCategoriesLoop => GetBranchCategories( 'searchdomain', 1, $opac_name ), >- CalendarFirstDayOfWeek => (C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday")?0:1, >+ CalendarFirstDayOfWeek => C4::Context->preference("CalendarFirstDayOfWeek"), > LibraryName => "" . C4::Context->preference("LibraryName"), > LibraryNameTitle => "" . $LibraryNameTitle, > LoginBranchname => C4::Context->userenv?C4::Context->userenv->{"branchname"}:"", >diff --git a/installer/data/mysql/de-DE/mandatory/system_preferences.sql b/installer/data/mysql/de-DE/mandatory/system_preferences.sql >index 42f36b7..e90fd0d 100644 >--- a/installer/data/mysql/de-DE/mandatory/system_preferences.sql >+++ b/installer/data/mysql/de-DE/mandatory/system_preferences.sql >@@ -30,7 +30,8 @@ UPDATE systempreferences SET value = > <li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Google Scholar</a></li> > <li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&title={TITLE}&st=xl&ac=qr" target="_blank">Online-Buchhandel (Bookfinder.com)</a></li>' > WHERE variable = 'OPACSearchForTitleIn'; >-UPDATE systempreferences SET value = 'Monday' WHERE variable = 'CalendarFirstDayOfWeek'; >+-- Sunday = 0, Monday = 1, etc. >+UPDATE systempreferences SET value = '1' WHERE variable = 'CalendarFirstDayOfWeek'; > UPDATE systempreferences SET value = '0.07|0.19|0.00' WHERE variable = 'gist'; > UPDATE systempreferences SET value = 'Dieser Text wird über den Systemparameter <a href="/cgi-bin/koha/admin/preferences.pl?op=search&searchfield=RoutingListNote#jumped">RoutingListNote</a> konfiguriert.' where variable = 'RoutingListNote'; > UPDATE systempreferences SET value = 'barcode stocknumber' WHERE variable = 'uniqueitemfields'; >diff --git a/installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql b/installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql >index eeedc86..cef8500 100644 >--- a/installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql >+++ b/installer/data/mysql/nb-NO/1-Obligatorisk/system_preferences.sql >@@ -26,6 +26,7 @@ UPDATE systempreferences SET value = 'nb-NO' WHERE variable = 'opaclanguages'; > UPDATE systempreferences SET value = '<p>Velkommen til Koha...</p><hr />' WHERE variable = 'OpacMainUserBlock'; > UPDATE systempreferences SET value = '<p>Viktige lenker kan plasseres her</p>' WHERE variable = 'OpacNav'; > UPDATE systempreferences SET value = '<li><a href="http://worldcat.org/search?q={TITLE}" target="_blank">Andre bibliotek (WorldCat)</a></li><li><a href="http://www.scholar.google.com/scholar?q={TITLE}" target="_blank">Andre databaser (Google Scholar)</a></li><li><a href="http://www.bookfinder.com/search/?author={AUTHOR}&title={TITLE}&st=xl&ac=qr" target="_blank">Nettbutikker (Bookfinder.com)</a></li>' WHERE variable = 'OPACSearchForTitleIn'; >-UPDATE systempreferences SET value = 'Monday' WHERE variable = 'CalendarFirstDayOfWeek'; >+-- Sunday = 0, Monday = 1, etc. >+UPDATE systempreferences SET value = '1' WHERE variable = 'CalendarFirstDayOfWeek'; > UPDATE systempreferences SET value = 'A B C D E F G H I J K L M N O P Q R S T U V W X Y Z à à Ã' WHERE variable = 'alphabet'; > UPDATE systempreferences SET value = 'nor' WHERE variable = 'DefaultLanguageField008'; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 4fb8cbd..9f77a63 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -76,7 +76,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('BorrowerUnwantedField','',NULL,'Name the fields you don\'t need to store for a patron\'s account','free'), > ('BranchTransferLimitsType','ccode','itemtype|ccode','When using branch transfer limits, choose whether to limit by itemtype or collection code.','Choice'), > ('CalculateFinesOnReturn','1','','Switch to control if overdue fines are calculated on return or not','YesNo'), >-('CalendarFirstDayOfWeek','Sunday','Sunday|Monday','Select the first day of week to use in the calendar.','Choice'), >+('CalendarFirstDayOfWeek','0','0|1|2|3|4|5|6','Select the first day of week to use in the calendar.','Choice'), > ('canreservefromotherbranches','1','','With Independent branches on, can a user from one library place a hold on an item from another library','YesNo'), > ('casAuthentication','0','','Enable or disable CAS authentication','YesNo'), > ('casLogout','0','','Does a logout from Koha should also log the user out of CAS?','YesNo'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index e36c20e..1ed38c2 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -9525,6 +9525,23 @@ if ( CheckVersion($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "3.17.00.XXX"; >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q{ >+ UPDATE systempreferences SET value='0' WHERE variable='CalendarFirstDayOfWeek' AND value='Sunday'; >+ }); >+ $dbh->do(q{ >+ UPDATE systempreferences SET value='1' WHERE variable='CalendarFirstDayOfWeek' AND value='Monday'; >+ }); >+ $dbh->do(q{ >+ UPDATE systempreferences SET options='0|1|2|3|4|5|6' WHERE variable='CalendarFirstDayOfWeek'; >+ }); >+ >+ print "Upgrade to $DBversion done (Bug 10859 - Extend functionality of CalendarFirstDayOfWeek to be any day)\n"; >+ SetVersion($DBversion); >+} >+ >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >index dde2f09..4d66f50 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref >@@ -19,10 +19,15 @@ I18N/L10N: > - > - Use > - pref: CalendarFirstDayOfWeek >- default: Sunday >+ default: 0 > choices: >- Sunday: Sunday >- Monday: Monday >+ 0: Sunday >+ 1: Monday >+ 2: Tuesday >+ 3: Wednesday >+ 4: Thursday >+ 5: Friday >+ 6: Saturday > - as the first day of week in the calendar. > - > - "Enable the following languages on the staff interface:" >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 12137
:
27560
|
28619
|
33771
|
37017
|
40332
|
40429
|
40430
|
40434
|
40472
|
40473
|
40474