Summary: | Allow using the publication date parts for serial numbering | ||
---|---|---|---|
Product: | Koha | Reporter: | Nick Clemens (kidclamp) <nick> |
Component: | Serials | Assignee: | Nick Clemens (kidclamp) <nick> |
Status: | RESOLVED FIXED | QA Contact: | Marcel de Rooy <m.de.rooy> |
Severity: | enhancement | ||
Priority: | P5 - low | CC: | caroline.cyr-la-rose, danielle.elder, esther.melander, fridolin.somers, lthorrat, m.de.rooy, mspinney, phil |
Version: | Main | ||
Hardware: | All | ||
OS: | All | ||
See Also: |
https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=22188 https://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=33039 |
||
Change sponsored?: | --- | Patch complexity: | Small patch |
Documentation contact: | Caroline Cyr La Rose | Documentation submission: | https://gitlab.com/koha-community/koha-manual/-/merge_requests/995 |
Text to go in the release notes: |
This adds some new placeholders to be used within the numbering pattern of a subscription: {Year}, {Day}, {DayName}, {Month}, {MonthName}. They will be automatically replaced with the corresponding value derived from the publication date of the issue when its received.
|
Version(s) released in: |
24.05.00
|
Circulation function: | |||
Bug Depends on: | |||
Bug Blocks: | 37001 | ||
Attachments: |
Bgg 35646: Allow use of publication date fields in serial numbering pattern
Bug 35646: Allow use of publication date fields in serial numbering pattern Bug 35646: Unit tests Bug 35646: Allow use of publication date fields in serial numbering pattern Bug 35646: Unit tests Bug 35646: Allow use of publication date fields in serial numbering pattern Bug 35646: Unit tests Bug 35646: (follow-up) Correct firstaquidate type Bug 35646: Allow use of publication date fields in serial numbering pattern Bug 35646: Unit tests Bug 35646: (follow-up) Correct firstaquidate type |
Description
Nick Clemens (kidclamp)
2023-12-22 18:20:53 UTC
Created attachment 160275 [details] [review] Bgg 35646: Allow use of publication date fields in serial numbering pattern This patch extends the numbering pattern field to accept subsitituations for: {Year} {Day} {DayName} {Month} {MonthName} These fields are based on the publication date for the serial issue. To test: 0 - Apply patch 1 - Setup a enw numbering pattern Serials->Manage numbering patterns + New numbering pattern 2 - In the numbering formula enter: {X} {Y} {Z} {Year} {Month} {Day} {MonthName} {DayName} 3 - Populate X/Y/Z in the table as you wish, these should be unaffected by patch 4 - Set a Frequency / First issue plublication date / Subscription length 5 - Click 'Test pattern' 6 - Confirm the dates in the Number match the publication date values 7 - Try with different frequencies to confirm they match 8 - Save the pattern 9 - Create a new subscription and use the new pattern 10 - Confirm it works as expected Created attachment 160276 [details] [review] Bug 35646: Allow use of publication date fields in serial numbering pattern This patch extends the numbering pattern field to accept subsitituations for: {Year} {Day} {DayName} {Month} {MonthName} These fields are based on the publication date for the serial issue. To test: 0 - Apply patch 1 - Setup a enw numbering pattern Serials->Manage numbering patterns + New numbering pattern 2 - In the numbering formula enter: {X} {Y} {Z} {Year} {Month} {Day} {MonthName} {DayName} 3 - Populate X/Y/Z in the table as you wish, these should be unaffected by patch 4 - Set a Frequency / First issue plublication date / Subscription length 5 - Click 'Test pattern' 6 - Confirm the dates in the Number match the publication date values 7 - Try with different frequencies to confirm they match 8 - Save the pattern 9 - Create a new subscription and use the new pattern 10 - Confirm it works as expected Created attachment 160277 [details] [review] Bug 35646: Unit tests Created attachment 160297 [details] [review] Bug 35646: Allow use of publication date fields in serial numbering pattern This patch extends the numbering pattern field to accept subsitituations for: {Year} {Day} {DayName} {Month} {MonthName} These fields are based on the publication date for the serial issue. To test: 0 - Apply patch 1 - Setup a enw numbering pattern Serials->Manage numbering patterns + New numbering pattern 2 - In the numbering formula enter: {X} {Y} {Z} {Year} {Month} {Day} {MonthName} {DayName} 3 - Populate X/Y/Z in the table as you wish, these should be unaffected by patch 4 - Set a Frequency / First issue plublication date / Subscription length 5 - Click 'Test pattern' 6 - Confirm the dates in the Number match the publication date values 7 - Try with different frequencies to confirm they match 8 - Save the pattern 9 - Create a new subscription and use the new pattern 10 - Confirm it works as expected Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 160298 [details] [review] Bug 35646: Unit tests Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> subsitituations ? Are these events related to using substitutions? Like when I was in a subsitituation the other day ;) + my $dt = dt_from_string( $subscription->{firstaquidate} ); Could be me, but looks like a typo. + firstaquidate => '1970-11-01', Created attachment 165088 [details] [review] Bug 35646: Allow use of publication date fields in serial numbering pattern This patch extends the numbering pattern field to accept subsititutions for: {Year} {Day} {DayName} {Month} {MonthName} These fields are based on the publication date for the serial issue. To test: 0 - Apply patch 1 - Setup a enw numbering pattern Serials->Manage numbering patterns + New numbering pattern 2 - In the numbering formula enter: {X} {Y} {Z} {Year} {Month} {Day} {MonthName} {DayName} 3 - Populate X/Y/Z in the table as you wish, these should be unaffected by patch 4 - Set a Frequency / First issue plublication date / Subscription length 5 - Click 'Test pattern' 6 - Confirm the dates in the Number match the publication date values 7 - Try with different frequencies to confirm they match 8 - Save the pattern 9 - Create a new subscription and use the new pattern 10 - Confirm it works as expected Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 165089 [details] [review] Bug 35646: Unit tests Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Created attachment 165090 [details] [review] Bug 35646: (follow-up) Correct firstaquidate type Created attachment 165093 [details] [review] Bug 35646: Allow use of publication date fields in serial numbering pattern This patch extends the numbering pattern field to accept subsititutions for: {Year} {Day} {DayName} {Month} {MonthName} These fields are based on the publication date for the serial issue. To test: 0 - Apply patch 1 - Setup a enw numbering pattern Serials->Manage numbering patterns + New numbering pattern 2 - In the numbering formula enter: {X} {Y} {Z} {Year} {Month} {Day} {MonthName} {DayName} 3 - Populate X/Y/Z in the table as you wish, these should be unaffected by patch 4 - Set a Frequency / First issue plublication date / Subscription length 5 - Click 'Test pattern' 6 - Confirm the dates in the Number match the publication date values 7 - Try with different frequencies to confirm they match 8 - Save the pattern 9 - Create a new subscription and use the new pattern 10 - Confirm it works as expected Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 165094 [details] [review] Bug 35646: Unit tests Signed-off-by: Lucas Gass <lucas@bywatersolutions.com> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> Created attachment 165095 [details] [review] Bug 35646: (follow-up) Correct firstaquidate type Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl> I do like {Year} {Month} {Day}. I struggle with: {MonthName} {DayName} These don't seem to take the Locale set into account - so maybe English only or will use the interface language? Ideally it should follow the locale setting. Pushed for 24.05! Well done everyone, thank you! Not backported to 23.11.x (In reply to Katrin Fischer from comment #13) > I do like {Year} {Month} {Day}. > > I struggle with: {MonthName} {DayName} > These don't seem to take the Locale set into account - so maybe English only > or will use the interface language? Ideally it should follow the locale > setting. NICK! *tries to get attention* (In reply to Katrin Fischer from comment #16) > (In reply to Katrin Fischer from comment #13) > > I do like {Year} {Month} {Day}. > > > > I struggle with: {MonthName} {DayName} > > These don't seem to take the Locale set into account - so maybe English only > > or will use the interface language? Ideally it should follow the locale > > setting. > > NICK! *tries to get attention* I think it doesn't work because we don't set Locale for the DateTime objects we create in Koha::DateUtils: https://metacpan.org/pod/DateTime#Locales We could easily pass through the 'locale' from the Serial (subscription table) however, I spot tested and got an error for 'Ethiopic'/'gez' though it is listed here: https://metacpan.org/pod/DateTime::Locale::Catalog Our list comes from here: https://www.loc.gov/standards/iso639-2/php/code_list.php Maybe our datetime modules need an update? Here is a full list of ones that throw an error: Invalid locale code or name: akk Invalid locale code or name: tut Invalid locale code or name: grc Invalid locale code or name: ave Invalid locale code or name: bnt Invalid locale code or name: bra Invalid locale code or name: cel Invalid locale code or name: chp Invalid locale code or name: cho Invalid locale code or name: chu Invalid locale code or name: syc Invalid locale code or name: cop Invalid locale code or name: cre Invalid locale code or name: prs Invalid locale code or name: dgr Invalid locale code or name: egy Invalid locale code or name: gez Invalid locale code or name: gem Invalid locale code or name: got Invalid locale code or name: gwi Invalid locale code or name: her Invalid locale code or name: hit Invalid locale code or name: inc Invalid locale code or name: iku Invalid locale code or name: ipk Invalid locale code or name: ira Invalid locale code or name: jrb Invalid locale code or name: csb Invalid locale code or name: lad Invalid locale code or name: lat Invalid locale code or name: myn Invalid locale code or name: dum Invalid locale code or name: enm Invalid locale code or name: frm Invalid locale code or name: gmh Invalid locale code or name: mga Invalid locale code or name: mul Invalid locale code or name: nah Invalid locale code or name: zxx Invalid locale code or name: nya Invalid locale code or name: arc Invalid locale code or name: ang Invalid locale code or name: fro Invalid locale code or name: goh Invalid locale code or name: peo Invalid locale code or name: pro Invalid locale code or name: ota Invalid locale code or name: pal Invalid locale code or name: pli Invalid locale code or name: pbr Invalid locale code or name: pra Invalid locale code or name: roa Invalid locale code or name: rom Invalid locale code or name: sam Invalid locale code or name: sem Invalid locale code or name: den Invalid locale code or name: sla Invalid locale code or name: wen Invalid locale code or name: sux Invalid locale code or name: syr Invalid locale code or name: tgl Invalid locale code or name: tet Invalid locale code or name: uga Invalid locale code or name: mis Filed a new bug for this issue - can we remove addition_work from this one? (In reply to Nick Clemens (kidclamp) from comment #18) > Filed a new bug for this issue - can we remove addition_work from this one? Yep, I used it so we would not forget about this loose end. (In reply to Fridolin Somers from comment #15) > Not backported to 23.11.x |