On the Koha list, Mubassir Ahsan<mahsandu@gmail.com> asked: > Is there any option to set Saturday as First Day of Week. Please help me. I > am [stuck]. CalendarFirstDayOfWeek is 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.
Created attachment 27560 [details] [review] Bug 12137 - Extend CalendarFirstDayOfWeek to be any day 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' 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) Find some date picker in the OPAC, and repeat the same process. 11) Run koha QA test tools. NOTE: I was unable to figure out how to trigger OPAC datepicker.
YAY! Found it for OPAC 1) Log into OPAC 2) Personal Details Tab. 3) The date picker is there for the date of birth! And it works. :)
NOTE: With the OPAC, you need to test prog and bootstrap themes.
Adding mahsandu@gmail.com to the list, since the request was theirs.
Created attachment 28619 [details] [review] 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.
Created attachment 33771 [details] [review] 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.
Created attachment 37017 [details] [review] 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.
(In reply to M. Tompsett from comment #7) Applying: Bug 12137 - Extend CalendarFirstDayOfWeek to be any day Using index info to reconstruct a base tree... M C4/Auth.pm M installer/data/mysql/sysprefs.sql M installer/data/mysql/updatedatabase.pl M koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref Falling back to patching base and 3-way merge... Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/i18n_l10n.pref Auto-merging installer/data/mysql/updatedatabase.pl CONFLICT (content): Merge conflict in installer/data/mysql/updatedatabase.pl Auto-merging installer/data/mysql/sysprefs.sql Auto-merging C4/Auth.pm Failed to merge in the changes. Patch failed at 0001 Bug 12137 - Extend CalendarFirstDayOfWeek to be any day
Comment on attachment 37017 [details] [review] Bug 12137 - Extend CalendarFirstDayOfWeek to be any day Review of attachment 37017 [details] [review]: ----------------------------------------------------------------- ::: installer/data/mysql/updatedatabase.pl @@ +9804,4 @@ > SetVersion($DBversion); > } > > +$DBversion = "3.19.00.XXX"; prolly needs to be bumped up to 3.21.00.XXX
Created attachment 40332 [details] [review] 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. NOTE: not an atomic update, since this is an old patch.
Created attachment 40429 [details] [review] 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. NOTE: not an atomic update, since this is an old patch. Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com>
Created attachment 40430 [details] [review] (possible followup) sort <select> index by value adds alphabetical sorting to <select> lists displayed by preferences.tt. although added for sorting the days of the week, this may have larger ramifications. haven't been tested thoroughly, but no apparent breakage seems to be happening in preferences.
Created attachment 40434 [details] [review] Bug 12137: followup sort <select> index by value adds alphabetical sorting to <select> lists displayed by preferences.tt. although added for sorting the days of the week, this may have larger ramifications. haven't been tested thoroughly, but no apparent breakage seems to be happening in preferences. NOTE: Nice tweak. Makes days of week in sensible order. Properly adds sorting based on documentation that is really hard to find. Signed-off-by: Mark Tompsett <mtompset@hotmail.com>
Since the list is complete, it would have been easier to add 'Saturday', don't you think?
(In reply to Jonathan Druart from comment #14) > Since the list is complete, it would have been easier to add 'Saturday', > don't you think? And then add 'Wednesday' or some other day when someone else asks? It's easier to change the values to do any day.
(In reply to M. Tompsett from comment #15) > (In reply to Jonathan Druart from comment #14) > > Since the list is complete, it would have been easier to add 'Saturday', > > don't you think? > > And then add 'Wednesday' or some other day when someone else asks? It's > easier to change the values to do any day. Nobody uses Wednesday as the first day of the week. The 3 possible values are Saturday, Sunday and Monday. https://en.wikipedia.org/wiki/Names_of_the_days_of_the_week#Numbered_days_of_the_week
(In reply to Jonathan Druart from comment #14) > Since the list is complete, it would have been easier to add 'Saturday', > don't you think? Look at the old code: CalendarFirstDayOfWeek => ( C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday" ) ? 0 : 1 Is it easier to extend that with more code? Or just use the values 0-6 in the first place?
(In reply to M. Tompsett from comment #17) > (In reply to Jonathan Druart from comment #14) > > Since the list is complete, it would have been easier to add 'Saturday', > > don't you think? > > Look at the old code: > CalendarFirstDayOfWeek => ( > C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday" ) ? 0 : 1 > > Is it easier to extend that with more code? Or just use the values 0-6 in > the first place? C4::Context->preference("CalendarFirstDayOfWeek") eq "Sunday" ? 0 : C4::Context->preference("CalendarFirstDayOfWeek") eq "Saturday" ? 6 : 1 Not very difficult. We will just need to update the different options available for the pref and if someone already uses this value outside of Koha (ok, there is certainly nobody), he could continue to do it. But this is not the question, is there another value than can exist for the "first day of week"? If only Sunday, Monday and Saturday are used all around the world, I don't see any sense to propose the 4 other days :)
(In reply to Jonathan Druart from comment #18) > If only Sunday, Monday and Saturday are used all around the world, I don't > see any sense to propose the 4 other days :) Why should we use more bits for a date. We will never reach 2000.. LOL
Created attachment 40472 [details] [review] 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. NOTE: not an atomic update, since this is an old patch. Signed-off-by: Indranil Das Gupta (L2C2 Technologies) <indradg@gmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Created attachment 40473 [details] [review] Bug 12137: followup sort <select> index by value adds alphabetical sorting to <select> lists displayed by preferences.tt. although added for sorting the days of the week, this may have larger ramifications. haven't been tested thoroughly, but no apparent breakage seems to be happening in preferences. NOTE: Nice tweak. Makes days of week in sensible order. Properly adds sorting based on documentation that is really hard to find. Signed-off-by: Mark Tompsett <mtompset@hotmail.com> Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
Created attachment 40474 [details] [review] Bug 12137: Use Koha.Preference to access pref value Signed-off-by: Jonathan Druart <jonathan.druart@koha-community.org>
(In reply to Marcel de Rooy from comment #19) > (In reply to Jonathan Druart from comment #18) > > If only Sunday, Monday and Saturday are used all around the world, I don't > > see any sense to propose the 4 other days :) > > Why should we use more bits for a date. We will never reach 2000.. LOL The first day of the week comes from tradition. So let's say we are going to anticipate the change of a tradition.
Enahnement pushed to master. Good job Mark and friends!