Brimbank Libraries Australia would like to be able to use the publication date of a serial as the issue number.
Created attachment 84314 [details] [review] Bug 22188: Use publication date as numbering pattern Brimbank were trying to make a numbering pattern that displays the publication date, but numbering patterns are calculated mathematically, and dates are not always consistent and don't work that way. I've written a feature that hardcodes an option to use the publication date instead of a numbering pattern, in a 'Y M D' format. To test: 1) Go to Serials 2) Click New subscription 3) Fill in the necessary details for the first page and click Next 4) Fill in the necessary details for the second page. Under numbering pattern, select Number. 5) Notice the advanced pattern table shows. Put some random data in these fields 6) Change numbering pattern to Use publication date. Confirm that selecting this option hides the advanced pattern table and clears its fields. 7) Click Test prediction pattern and confirm the prediction pattern shows as expected 8) Save subscription 9) You should now be on the subscription detail page for your new subscription. Go to the Planning tab and confirm that it says 'uses publication date' under Number pattern and that there is now table saying 'Starting with' and 'Rollover' 10) Go to the Issues tab and confirm the first serial is there with the correct issue number (publication date). 11) Click the Receive button 12) Confirm the publication date shows under the Numbered column, in the Issue text field and click Save 13) Click the Generate next button and confirm the alert box 14) Confirm the publication date shows under 'Number' 15) Find/make a subscription that uses a normal numbering pattern 16) Edit this subscription to now use the publication date as numbering pattern 17) Upon saving, confirm that previously received serials keep their old issue numbers 18) Click Receive and Generate next again and confirm that the next serial now has the publication date 19) Confirm that making a subscription with a normal numbering pattern works as expected. Upon saving, the table should show under the Planning tab with 'Starting with' and 'Rollover' and all other fields should be filled correctly. Sponsored-by: Brimbank Libraries Australia
The patch does not apply.
Created attachment 85415 [details] [review] Bug 22188: Use publication date as numbering pattern Brimbank were trying to make a numbering pattern that displays the publication date, but numbering patterns are calculated mathematically, and dates are not always consistent and don't work that way. I've written a feature that hardcodes an option to use the publication date instead of a numbering pattern, in a 'Y M D' format. To test: 1) Go to Serials 2) Click New subscription 3) Fill in the necessary details for the first page and click Next 4) Fill in the necessary details for the second page. Under numbering pattern, select Number. 5) Notice the advanced pattern table shows. Put some random data in these fields 6) Change numbering pattern to Use publication date. Confirm that selecting this option hides the advanced pattern table and clears its fields. 7) Click Test prediction pattern and confirm the prediction pattern shows as expected 8) Save subscription 9) You should now be on the subscription detail page for your new subscription. Go to the Planning tab and confirm that it says 'uses publication date' under Number pattern and that there is now table saying 'Starting with' and 'Rollover' 10) Go to the Issues tab and confirm the first serial is there with the correct issue number (publication date). 11) Click the Receive button 12) Confirm the publication date shows under the Numbered column, in the Issue text field and click Save 13) Click the Generate next button and confirm the alert box 14) Confirm the publication date shows under 'Number' 15) Find/make a subscription that uses a normal numbering pattern 16) Edit this subscription to now use the publication date as numbering pattern 17) Upon saving, confirm that previously received serials keep their old issue numbers 18) Click Receive and Generate next again and confirm that the next serial now has the publication date 19) Confirm that making a subscription with a normal numbering pattern works as expected. Upon saving, the table should show under the Planning tab with 'Starting with' and 'Rollover' and all other fields should be filled correctly. Sponsored-by: Brimbank Libraries Australia
Rebased, please test.
Hi Aleisha, This is a useful enhancement, but I have some questions and issues. > 7) Click Test prediction pattern and confirm the prediction pattern shows as > expected The issue number is formatted as 'YYYY Month DD', is there a way to modify it using the advanced pattern ? I failed trying it. > 9) You should now be on the subscription detail page for your new > subscription. Go to the Planning tab and confirm that it says 'uses > publication date' under Number pattern and that there is now table > saying 'Starting with' and 'Rollover' Ok for 'Number pattern: Uses publication date', but I don't see the table. > 12) Confirm the publication date shows under the Numbered column, in the > Issue text field and click Save Ok for display, but each time I tried to save the receive, I get this Software error : Can't use string ("1") as a HASH ref while "strict refs" in use at /home/koha/src/C4/Serials.pm line 2353. This message also occurs for 1) receipt of serial that uses other numbering patterns, 2) for multi-receiving and 3) when generating a new issue if the last one in still 'Expected'. When I go back to /cgi-bin/koha/serials/serials-collection.pl, in case 1) serial is corectly received, case 2) only one issue is received (I wanted to receive 3) and in case 3) issue is correctly set tot 'late' and the next is 'Expected'. [Sorry if this bug is not due to this patch] > 13) Click the Generate next button and confirm the alert box I created several subscriptions and I always have the same problem : when I generate the next issue, the number format changes from 'YYYY Month DD' to 'YYYY-MM-DD', and the date of the previous issue is used, which creates a gap in the number pattern (see screenshot attached) > 16) Edit this subscription to now use the publication date as numbering > pattern ok > 17) Upon saving, confirm that previously received serials keep their old > issue numbers ok > 18) Click Receive and Generate next again and confirm that the next > serial now has the publication date Badaboum... Same problem as step 13 : the date of the previous issue is used as number (see the second screenshot attached) I didn't see this step on your plan test, but when I edit a subscription using 'Use publication date', the 'Numbering pattern' is cleared (see the last screenshot attached). I hope my comments are clear enough... Very interested to see this one pushed soon !
Created attachment 85540 [details] Sceenshot 1 - Problem on step 13
Created attachment 85541 [details] Sceenshot 2 - Problem on step 18
Created attachment 85542 [details] Screenshot 3 - Numbering pattern cleared
Created attachment 86419 [details] [review] Bug 22188: (follow-up) Introducing dateformat field and other fixes To test with this patch, please update the database and update the schema. With this patch, you can now choose the dateformat of the date pattern by editing the subscription. This information is now saved in the DB subscription table. This patch also fixes previous problems with receiving and generating the next serial. Sponsored-by: Brimbank Libraries Australia
(In reply to Séverine Queune from comment #5) > > 9) You should now be on the subscription detail page for your new > > subscription. Go to the Planning tab and confirm that it says 'uses > > publication date' under Number pattern and that there is now table > > saying 'Starting with' and 'Rollover' > > Ok for 'Number pattern: Uses publication date', but I don't see the table. > Sorry I forgot to fix my test plan - this table does not show if using publication date pattern. It will show for all other number patterns. This should be ready to test again now!
Created attachment 87433 [details] [review] Bug 22188: (follow-up) Introducing dateformat field and other fixes To test with this patch, please update the database and update the schema. With this patch, you can now choose the dateformat of the date pattern by editing the subscription. This information is now saved in the DB subscription table. This patch also fixes previous problems with receiving and generating the next serial. Sponsored-by: Brimbank Libraries Australia
Sorry Aleisha... The sandbox you've requested is not ready. Some problems occurred applying patches from bug 22188: <h1>Something went wrong !</h1>Applying: Bug 22188: Use publication date as numbering pattern Using index info to reconstruct a base tree... M C4/Serials.pm M koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt M koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt M koha-tmpl/intranet-tmpl/prog/js/subscription-add.js M serials/showpredictionpattern.pl M serials/subscription-add.pl Falling back to patching base and 3-way merge... Auto-merging serials/subscription-add.pl Auto-merging serials/showpredictionpattern.pl Auto-merging koha-tmpl/intranet-tmpl/prog/js/subscription-add.js Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt Auto-merging C4/Serials.pm Warning: commit message did not conform to UTF-8. You may want to amend it after fixing the message, or set the config variable i18n.commitencoding to the encoding your project uses. Applying: Bug 22188: (follow-up) Introducing dateformat field and other fixes fatal: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt). Patch failed at 0001 Bug 22188: (follow-up) Introducing dateformat field and other fixes The copy of the patch that failed is found in: .git/rebase-apply/patch When you have resolved this problem run git bz apply --continue. If you would prefer to skip this patch, instead run git bz apply --skip. To restore the original branch and stop patching run git bz apply --abort. error: could not build fake ancestor Bug 22188 - Use publication date as numbering pattern 85415 - Bug 22188: Use publication date as numbering pattern 87433 - Bug 22188: (follow-up) Introducing dateformat field and other fixes Apply? [(y)es, (n)o, (i)nteractive] Patch left in /tmp/Bug-22188-follow-up-Introducing-dateformat-field-a-vPc2wv.patch .
Created attachment 88830 [details] [review] Bug 22188: (follow-up) Introducing dateformat field and other fixes To test with this patch, please update the database and update the schema. With this patch, you can now choose the dateformat of the date pattern by editing the subscription. This information is now saved in the DB subscription table. This patch also fixes previous problems with receiving and generating the next serial. Sponsored-by: Brimbank Libraries Australia
Patch doesn't apply Applying: Bug 22188: Use publication date as numbering pattern Using index info to reconstruct a base tree... M C4/Serials.pm M koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt M koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt M koha-tmpl/intranet-tmpl/prog/js/subscription-add.js M serials/serials-collection.pl M serials/showpredictionpattern.pl M serials/subscription-add.pl Falling back to patching base and 3-way merge... Auto-merging serials/subscription-add.pl Auto-merging serials/showpredictionpattern.pl Auto-merging serials/serials-collection.pl Auto-merging koha-tmpl/intranet-tmpl/prog/js/subscription-add.js Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-detail.tt Auto-merging koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-add.tt Auto-merging C4/Serials.pm Applying: Bug 22188: (follow-up) Introducing dateformat field and other fixes fatal: sha1 information is lacking or useless (C4/Serials.pm). error: could not build fake ancestor Patch failed at 0001 Bug 22188: (follow-up) Introducing dateformat field and other fixes
Created attachment 91761 [details] [review] Bug 22188: Use publication date as numbering pattern Brimbank were trying to make a numbering pattern that displays the publication date, but numbering patterns are calculated mathematically, and dates are not always consistent and don't work that way. I've written a feature that hardcodes an option to use the publication date instead of a numbering pattern, in a 'Y M D' format. To test: 1) Go to Serials 2) Click New subscription 3) Fill in the necessary details for the first page and click Next 4) Fill in the necessary details for the second page. Under numbering pattern, select Number. 5) Notice the advanced pattern table shows. Put some random data in these fields 6) Change numbering pattern to Use publication date. Confirm that selecting this option hides the advanced pattern table and clears its fields. 7) Click Test prediction pattern and confirm the prediction pattern shows as expected 8) Save subscription 9) You should now be on the subscription detail page for your new subscription. Go to the Planning tab and confirm that it says 'uses publication date' under Number pattern and that there is now table saying 'Starting with' and 'Rollover' 10) Go to the Issues tab and confirm the first serial is there with the correct issue number (publication date). 11) Click the Receive button 12) Confirm the publication date shows under the Numbered column, in the Issue text field and click Save 13) Click the Generate next button and confirm the alert box 14) Confirm the publication date shows under 'Number' 15) Find/make a subscription that uses a normal numbering pattern 16) Edit this subscription to now use the publication date as numbering pattern 17) Upon saving, confirm that previously received serials keep their old issue numbers 18) Click Receive and Generate next again and confirm that the next serial now has the publication date 19) Confirm that making a subscription with a normal numbering pattern works as expected. Upon saving, the table should show under the Planning tab with 'Starting with' and 'Rollover' and all other fields should be filled correctly. Sponsored-by: Brimbank Libraries Australia
Created attachment 91762 [details] [review] Bug 22188: (follow-up) Introducing dateformat field and other fixes To test with this patch, please update the database and update the schema. With this patch, you can now choose the dateformat of the date pattern by editing the subscription. This information is now saved in the DB subscription table. This patch also fixes previous problems with receiving and generating the next serial. Sponsored-by: Brimbank Libraries Australia
Rebased
Hi Aleisha, I'm not able to set any dates in form for subscription.From caledar I get error about format, manually I can't add "/" delimiter. Video maybe help: https://recordit.co/0IrAibfJUJ
Created attachment 92185 [details] [review] Bug 22188: (follow-up) Introducing dateformat field and other fixes To test with this patch, please update the database and update the schema. With this patch, you can now choose the dateformat of the date pattern by editing the subscription. This information is now saved in the DB subscription table. This patch also fixes previous problems with receiving and generating the next serial. Sponsored-by: Brimbank Libraries Australia
Created attachment 92186 [details] [review] Bug 22188: Tests This patch fixes the t/db_dependent/Serials.t test which fails with this feature (without this fix). Ensure all other tests that use NewSubscription, ModSubscription, GetNextSeq, GetSeq still pass. db_dependent/Acquisition/OrderFromSubscription.t db_dependent/Bookseller.t db_dependent/Koha/Acquisition/Booksellers.t db_dependent/Letters.t db_dependent/Serials.t db_dependent/Serials/Claims.t db_dependent/Serials/ReNewSubscription.t db_dependent/Serials_2.t db_dependent/Serials/Frequency.t db_dependent/Serials/Numberpattern.t db_dependent/Serials/GetNextSeq.t Serials/GetNextSeq.t Sponsored-by: Brimbank Libraries Australia
I'm failing on step 18 of the test plan. I created a new subscription using a Number pattern, received several issues, edited the subscription to use Pub Date instead, saved it. But when I either Generate Next Issue or receive the issue that's already expected the subscription reverts to Number pattern. That said, this is a really great feature! Thanks for writing it!
Created attachment 92345 [details] [review] Bug 22188: Tests This patch fixes the t/db_dependent/Serials.t test which fails with this feature (without this fix). Ensure all other tests that use NewSubscription, ModSubscription, GetNextSeq, GetSeq still pass. db_dependent/Acquisition/OrderFromSubscription.t db_dependent/Bookseller.t db_dependent/Koha/Acquisition/Booksellers.t db_dependent/Letters.t db_dependent/Serials.t db_dependent/Serials/Claims.t db_dependent/Serials/ReNewSubscription.t db_dependent/Serials_2.t db_dependent/Serials/Frequency.t db_dependent/Serials/Numberpattern.t db_dependent/Serials/GetNextSeq.t Serials/GetNextSeq.t This patch also adds tests to db_dependent/Serials_2.t so check these tests pass prove -v t/db_dependent/Serials_2.t Sponsored-by: Brimbank Libraries Australia
Created attachment 92364 [details] [review] Bug 22188: (follow-up) Ensuring publication date numbering patterns shows when receiving serials This follow-up addresses the issue in Comment 21. To test: 1) Save a subscription with a regular number pattern and receive a few issues 2) Edit the subscription to use publication date and save 3) Receive an issue 4) Notice the issue number under the 'Numbered' column has not updated to reflect the publication date number pattern 5) Apply patch and refresh page 6) The issue number in the 'Numbered' column should now use the publication date
Created attachment 94290 [details] display error on subscription See attached for display errors on the subscription page. Data is displayed twice, along with what looks like some comments from the code.
Created attachment 94291 [details] error when generating next issue I receive the attached error when trying to generate the next issue of a subscription using date as numbering pattern. I do not receive this error when trying to generate next on a subscription using the Number numbering pattern.
Created attachment 156886 [details] [review] Bug 22188: Use publication date as numbering pattern Brimbank were trying to make a numbering pattern that displays the publication date, but numbering patterns are calculated mathematically, and dates are not always consistent and don't work that way. I've written a feature that hardcodes an option to use the publication date instead of a numbering pattern, in a 'Y M D' format. To test: 1) Go to Serials 2) Click New subscription 3) Fill in the necessary details for the first page and click Next 4) Fill in the necessary details for the second page. Under numbering pattern, select Number. 5) Notice the advanced pattern table shows. Put some random data in these fields 6) Change numbering pattern to Use publication date. Confirm that selecting this option hides the advanced pattern table and clears its fields. 7) Click Test prediction pattern and confirm the prediction pattern shows as expected 8) Save subscription 9) You should now be on the subscription detail page for your new subscription. Go to the Planning tab and confirm that it says 'uses publication date' under Number pattern and that there is now table saying 'Starting with' and 'Rollover' 10) Go to the Issues tab and confirm the first serial is there with the correct issue number (publication date). 11) Click the Receive button 12) Confirm the publication date shows under the Numbered column, in the Issue text field and click Save 13) Click the Generate next button and confirm the alert box 14) Confirm the publication date shows under 'Number' 15) Find/make a subscription that uses a normal numbering pattern 16) Edit this subscription to now use the publication date as numbering pattern 17) Upon saving, confirm that previously received serials keep their old issue numbers 18) Click Receive and Generate next again and confirm that the next serial now has the publication date 19) Confirm that making a subscription with a normal numbering pattern works as expected. Upon saving, the table should show under the Planning tab with 'Starting with' and 'Rollover' and all other fields should be filled correctly. Sponsored-by: Brimbank Libraries Australia
Created attachment 156887 [details] [review] Bug 22188: (follow-up) Introducing dateformat field and other fixes To test with this patch, please update the database and update the schema. With this patch, you can now choose the dateformat of the date pattern by editing the subscription. This information is now saved in the DB subscription table. This patch also fixes previous problems with receiving and generating the next serial. Sponsored-by: Brimbank Libraries Australia
Created attachment 156888 [details] [review] Bug 22188: Tests This patch fixes the t/db_dependent/Serials.t test which fails with this feature (without this fix). Ensure all other tests that use NewSubscription, ModSubscription, GetNextSeq, GetSeq still pass. db_dependent/Acquisition/OrderFromSubscription.t db_dependent/Bookseller.t db_dependent/Koha/Acquisition/Booksellers.t db_dependent/Letters.t db_dependent/Serials.t db_dependent/Serials/Claims.t db_dependent/Serials/ReNewSubscription.t db_dependent/Serials_2.t db_dependent/Serials/Frequency.t db_dependent/Serials/Numberpattern.t db_dependent/Serials/GetNextSeq.t Serials/GetNextSeq.t This patch also adds tests to db_dependent/Serials_2.t so check these tests pass prove -v t/db_dependent/Serials_2.t Sponsored-by: Brimbank Libraries Australia
Created attachment 156889 [details] [review] Bug 22188: (follow-up) Ensuring publication date numbering patterns shows when receiving serials This follow-up addresses the issue in Comment 21. To test: 1) Save a subscription with a regular number pattern and receive a few issues 2) Edit the subscription to use publication date and save 3) Receive an issue 4) Notice the issue number under the 'Numbered' column has not updated to reflect the publication date number pattern 5) Apply patch and refresh page 6) The issue number in the 'Numbered' column should now use the publication date
Created attachment 156890 [details] [review] Bug 22188: updating kohastructure.sql to include creation of pubdatepatternformat field Sponsored-by: Auckland University of Technology
Created attachment 156891 [details] [review] Bug 22188: updated Subscription.pm for database update Sponsored-by: Auckland University of Technology
Have updated a few files attempting to rebase this for most recent version. I haven't finished just yet but thought I should share what I have done so far.
Created attachment 157009 [details] [review] Bug 22188: Use publication date as numbering pattern Brimbank were trying to make a numbering pattern that displays the publication date, but numbering patterns are calculated mathematically, and dates are not always consistent and don't work that way. I've written a feature that hardcodes an option to use the publication date instead of a numbering pattern, in a 'Y M D' format. To test: 1) Go to Serials 2) Click New subscription 3) Fill in the necessary details for the first page and click Next 4) Fill in the necessary details for the second page. Under numbering pattern, select Number. 5) Notice the advanced pattern table shows. Put some random data in these fields 6) Change numbering pattern to Use publication date. Confirm that selecting this option hides the advanced pattern table and clears its fields. 7) Click Test prediction pattern and confirm the prediction pattern shows as expected 8) Save subscription 9) You should now be on the subscription detail page for your new subscription. Go to the Planning tab and confirm that it says 'uses publication date' under Number pattern and that there is now table saying 'Starting with' and 'Rollover' 10) Go to the Issues tab and confirm the first serial is there with the correct issue number (publication date). 11) Click the Receive button 12) Confirm the publication date shows under the Numbered column, in the Issue text field and click Save 13) Click the Generate next button and confirm the alert box 14) Confirm the publication date shows under 'Number' 15) Find/make a subscription that uses a normal numbering pattern 16) Edit this subscription to now use the publication date as numbering pattern 17) Upon saving, confirm that previously received serials keep their old issue numbers 18) Click Receive and Generate next again and confirm that the next serial now has the publication date 19) Confirm that making a subscription with a normal numbering pattern works as expected. Upon saving, the table should show under the Planning tab with 'Starting with' and 'Rollover' and all other fields should be filled correctly. Sponsored-by: Brimbank Libraries Australia
Created attachment 157010 [details] [review] Bug 22188: (follow-up) Introducing dateformat field and other fixes
Created attachment 157011 [details] [review] Bug 22188: Tests This patch fixes the t/db_dependent/Serials.t test which fails with this feature (without this fix). Ensure all other tests that use NewSubscription, ModSubscription, GetNextSeq, GetSeq still pass. db_dependent/Acquisition/OrderFromSubscription.t db_dependent/Bookseller.t db_dependent/Koha/Acquisition/Booksellers.t db_dependent/Letters.t db_dependent/Serials.t db_dependent/Serials/Claims.t db_dependent/Serials/ReNewSubscription.t db_dependent/Serials_2.t db_dependent/Serials/Frequency.t db_dependent/Serials/Numberpattern.t db_dependent/Serials/GetNextSeq.t Serials/GetNextSeq.t This patch also adds tests to db_dependent/Serials_2.t so check these tests pass prove -v t/db_dependent/Serials_2.t Sponsored-by: Brimbank Libraries Australia
Created attachment 157012 [details] [review] Bug 22188: (follow-up) Ensuring publication date numbering patterns shows when receiving serials This follow-up addresses the issue in Comment 21. To test: 1) Save a subscription with a regular number pattern and receive a few issues 2) Edit the subscription to use publication date and save 3) Receive an issue 4) Notice the issue number under the 'Numbered' column has not updated to reflect the publication date number pattern 5) Apply patch and refresh page 6) The issue number in the 'Numbered' column should now use the publication date
Created attachment 157013 [details] [review] Bug 22188: updating kohastructure.sql to include creation of pubdatepatternformat field Sponsored-by: Auckland University of Technology
Created attachment 157014 [details] [review] Bug 22188: Schema updates
Just updated to pull the schema updates into their own patch
Created attachment 157015 [details] [review] Bug 22188: Additional fixes
Created attachment 157179 [details] [review] Bug 22188: Atomic update for pubdatepatternformat (cherry picked from commit 2277d729b9266c0f084b6489d52f0c4e230fe121)
Created attachment 158638 [details] [review] Bug 22188: Bad rebase conflict fix
Created attachment 158659 [details] [review] Bug 22188: Add Koha::DateUtils for dt_from_string function
Hi all, I didn't see this and ended up working on 35646 - I think it meets the same basic need, but with a slightly different implementation.
+1