Our consortium uses abbreviations for our serials formatting. Existing formatting options for numbering patterns use the full month, day and season. Staff would like additional options for abbreviations. This development would create the option to select three letter abbreviations for: Day (Mon, Tue, Wed, Thu, Fri, Sat, Sun) Month (Jan, Feb, Mar, Apr, May, Jun, Jul, Aug, Sep, Oct, Nov, Dec) Season (Spr, Sum, Fal, Win)
Created attachment 50363 [details] [review] Bug 16289) Abbreviated formatting for numbering patterns This is my first attempt to do some development for Koha, so please take care to make sure I didn't mess anything up :) To test: 1) Go to Serials -> Manage numbering patterns 2) Create ‘New Numbering Pattern’ 3) Type in a name of “Day, Month, Season” and a numbering formula of “{X} {Y} {Z}”. 4) Set up the X field as following: add 1, every 1, set back to 1, when more than 30. 5) Select the formatting for X. There should be six options available instead of the original three. Use the formatting “Name of Day (abbreviated)”. 5) Set up the Y field to add 1 every 30 reset back to 1 when more than 12. Use the formatting “Name of month (abbreviated)” 6) Set up the Z field to add 1 every 90 reset back to 1 when more than 4. Use the formatting “Name of season (abbreviated)”. 8) Select a frequency of “1/day”. 9) Select a first issue publication date of Jan 1, 2016. 10) Set X to begin with 5 and have an inner counter of 5. Set Z to begin with 3 and have an inner counter of 10. 11) Click the “Test Pattern” button. 12) Abbreviated versions of the day, month and season should appear in the test pattern.
yes, it works as describe. Abbreviated versions are well displayed in the test pattern, according to the day, month, and season.
Patch tested with a sandbox, by sonia bouis <sonia.bouis@univ-lyon3.fr>
Created attachment 52058 [details] [review] Bug 16289: Abbreviated formatting for numbering patterns To test: 1) Go to Serials -> Manage numbering patterns 2) Create .New Numbering Pattern. 3) Type in a name of 'Day, Month, Season' and a numbering formula of '{X} {Y} {Z}'. 4) Set up the X field as following: add 1, every 1, set back to 1, when more than 30. 5) Select the formatting for X. There should be six options available instead of the original three. Use the formatting 'Name of Day (abbreviated)'. 5) Set up the Y field to add 1 every 30 reset back to 1 when more than 12. Use the formatting option 'Name of month (abbreviated)'. 6) Set up the Z field to add 1 every 90 reset back to 1 when more than 4. Use the formatting option 'Name of season (abbreviated)'. 8) Select a frequency of 1/day. 9) Select a first issue publication date of Jan 1, 2016. 10) Set X to begin with 5 and have an inner counter of 5. Set Z to begin with 3 and have an inner counter of 10. 11) Click the 'Test Pattern' button. 12) Abbreviated versions of the day, month and season should appear in the test pattern. Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr>
Created attachment 52098 [details] [review] Bug 16289: Abbreviated formatting for numbering patterns To test: 1) Go to Serials -> Manage numbering patterns 2) Create .New Numbering Pattern. 3) Type in a name of 'Day, Month, Season' and a numbering formula of '{X} {Y} {Z}'. 4) Set up the X field as following: add 1, every 1, set back to 1, when more than 30. 5) Select the formatting for X. There should be six options available instead of the original three. Use the formatting 'Name of Day (abbreviated)'. 5) Set up the Y field to add 1 every 30 reset back to 1 when more than 12. Use the formatting option 'Name of month (abbreviated)'. 6) Set up the Z field to add 1 every 90 reset back to 1 when more than 4. Use the formatting option 'Name of season (abbreviated)'. 8) Select a frequency of 1/day. 9) Select a first issue publication date of Jan 1, 2016. 10) Set X to begin with 5 and have an inner counter of 5. Set Z to begin with 3 and have an inner counter of 10. 11) Click the 'Test Pattern' button. 12) Abbreviated versions of the day, month and season should appear in the test pattern. Signed-off-by: sonia bouis <sonia.bouis@univ-lyon3.fr> Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Created attachment 52099 [details] [review] Bug 16289: Refactore code and add tests Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Pushed to master for Koha 16.11, thanks Karl, Jonathan!
I'm tempted to push this enhancement to 16.05 in order to avoid master/stable code divergence, and since template & code modification seems limited. Any objection from anyone?
No objections here!
Looking at this code and some of otherthe code related to seasonal patterns, I believe the abbreviated seasons are not translatable/translated.
(In reply to Katrin Fischer from comment #10) > Looking at this code and some of otherthe code related to seasonal patterns, > I believe the abbreviated seasons are not translatable/translated. Can you expand on that? Is this due to us not using localized DateTimes?
There is a problem witht he way seasonal translations are generated - it only applies to that I think - months, days etc. should probably be ok. If you take a look at the templates, you might see what I mean.
Bug 17245 fixes the problem I meant - thx again Rafal!