When an unexpected double issue is received there needs to be an easy way to skip forward to generate the next expected issue. Eg I receive no 6/7 so the next generated issue should be No 8 rather than having to generate No 7 and 8 and then delete No 7.
Created attachment 148948 [details] [review] Bug 32392: Enable skipping forward issues when receiving serials. Bug 32392: Enable skipping forward issues when receiving serials. This patch adds the ability to skip forward issues when receiving and generating the next issue from both the serial receive page and serial collection page. To test: 1. Apply patch. 2. Set up a subscription for a bib record. 3. Go to Serials -> Search your subscription -> Serial receive 4. Note that below last expected issue there will be checkbox to toggle a field to specify how many issues to skip when recieving and generating the next. 5. On serials-collection page there is also a button 'Skip issues and generate next'. When pressed will open a modal promting how many issues to skip. 6. Generate issues with different values and make sure the correct issue is generated. Sponsored-by: Lund University Library Sponsored-by: Bibliotek Mellansjö, Sweden Co-authored-by: Johan Sahlberg <johan.sahlberg@tidaholm.se>
Created attachment 148949 [details] [review] Bug 32392: Tests for changes in C4::Serials::GetNextSeq Bug 32392: Tests for changes in C4::Serials::GetNextSeq
(In reply to Björn Nylén from comment #1) > Created attachment 148948 [details] [review] [review] > Bug 32392: Enable skipping forward issues when receiving serials. > > Bug 32392: Enable skipping forward issues when receiving serials. > > This patch adds the ability to skip forward issues when receiving and > generating the next issue > from both the serial receive page and serial collection page. > > To test: > 1. Apply patch. > 2. Set up a subscription for a bib record. > 3. Go to Serials -> Search your subscription -> Serial receive > 4. Note that below last expected issue there will be checkbox to toggle > a field to > specify how many issues to skip when recieving and generating the > next. > 5. On serials-collection page there is also a button 'Skip issues and > generate next'. > When pressed will open a modal promting how many issues to skip. > 6. Generate issues with different values and make sure the correct issue > is generated. > > Sponsored-by: Lund University Library > Sponsored-by: Bibliotek Mellansjö, Sweden > Co-authored-by: Johan Sahlberg <johan.sahlberg@tidaholm.se> Signed-off-by: Marie Hedbom <marie.hedbom@musikverket.se> (first sign off, is this enough?)
Looking here
While testing, stumbled over byg 33678
And bug 33679
Do not understand why we add this to serial-EDIT here ? + $("form").on("submit", function(){ + let issues = $('input[name="skip_issues"]').val() ? $('input[name="skip_issues"]').val() : ''; + let too_many = _("Choose a value between 0-10 in issues to skip!"); + let no_number = _("Not a number in skip issues!"); + + if ( issues == '' || ( issues.match(/^\d+$/) && issues <= 10 ) ) { + return true; + } + else if ( issues.match(/^\d+$/) && issues > 10 ) { + alert(too_many); + return false; + } else if ( !issues.match(/^\d+$/) ) { + alert(no_number); + return false; + } + else { + return false; + } + });
And why do we cap at 10 ?
(In reply to Marcel de Rooy from comment #8) > And why do we cap at 10 ? And why dont we cap on serial-collection then ?
serials/serials-collection.pl my $count_forward = int $skip_issues + 1; serials/serials-edit.pl +my $count_forward = $skip_issues + 1; Inconsistent. Remove int ?
Both Perl and JS allow you to write this shorter with a = b || c. Note that Perl also has a // b but this checks on defined instead of true. + my $count = $count_forward ? $count_forward : 1; + let issues = $('input[name="skip_issues"]').val() ? $('input[name="skip_issues"]').val() : ''; No blocker but less typing and errors doing so.
koha-tmpl/intranet-tmpl/prog/en/includes/modals/serials_skip_issues.inc TYPO serils-edit
Just raising questions here. But I spent some time here and am not confident that this change is without bugs. The whole context of Serials is quite buggy, I am afraid. Opened two new reports too.
Created attachment 159617 [details] [review] Bug 32392: Fix QA issues
Created attachment 159618 [details] [review] Bug 32392: Fix QA issues Signed-off-by: Stina <stina.hallin@ub.lu.se>
(In reply to Marie from comment #3) > Signed-off-by: Marie Hedbom <marie.hedbom@musikverket.se> (first sign off, > is this enough?) Congratulations! :-) It would be nice to say at least "followed the test plan and everything works as expected". And if you tested other things than what the test plan says that would be good to mention.
Created attachment 165083 [details] [review] Bug 32392: Enable skipping forward issues when receiving serials. This patch adds the ability to skip forward issues when receiving and generating the next issue from both the serial receive page and serial collection page. To test: 1. Apply patch. 2. Set up a subscription for a bib record. 3. Go to Serials -> Search your subscription -> Serial receive 4. Note that below last expected issue there will be checkbox to toggle a field to specify how many issues to skip when recieving and generating the next. 5. On serials-collection page there is also a button 'Skip issues and generate next'. When pressed will open a modal promting how many issues to skip. 6. Generate issues with different values and make sure the correct issue is generated. Sponsored-by: Lund University Library Sponsored-by: Bibliotek Mellansjö, Sweden Co-authored-by: Johan Sahlberg <johan.sahlberg@tidaholm.se> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 165084 [details] [review] Bug 32392: Tests for changes in C4::Serials::GetNextSeq Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 165085 [details] [review] Bug 32392: Fix QA issues Signed-off-by: Stina <stina.hallin@ub.lu.se> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
This needs some additional work for CSRF. Given our short time frame for release, maybe someone could lend a hand here? When clicking the new button, I get: Programming error - op 'gennext' must start with 'cud-' for POST http://localhost:8081/intranet/serials/serials-collection.pl (referer: http://localhost:8081/cgi-bin/koha/serials/serials-collection.pl?subscriptionid=1) NOTE: Remember to add the missing sign-off lines for Marie.
Created attachment 165729 [details] [review] Bug 32392: Enable skipping forward issues when receiving serials. This patch adds the ability to skip forward issues when receiving and generating the next issue from both the serial receive page and serial collection page. To test: 1. Apply patch. 2. Set up a subscription for a bib record. 3. Go to Serials -> Search your subscription -> Serial receive 4. Note that below last expected issue there will be checkbox to toggle a field to specify how many issues to skip when recieving and generating the next. 5. On serials-collection page there is also a button 'Skip issues and generate next'. When pressed will open a modal promting how many issues to skip. 6. Generate issues with different values and make sure the correct issue is generated. Sponsored-by: Lund University Library Sponsored-by: Bibliotek Mellansjö, Sweden Co-authored-by: Johan Sahlberg <johan.sahlberg@tidaholm.se> Signed-off-by: Marie Hedbom <marie.hedbom@musikverket.se> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 165730 [details] [review] Bug 32392: Tests for changes in C4::Serials::GetNextSeq Signed-off-by: Marie Hedbom <marie.hedbom@musikverket.se> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Created attachment 165731 [details] [review] Bug 32392: Fix QA issues Signed-off-by: Stina <stina.hallin@ub.lu.se> Signed-off-by: Marcel de Rooy <m.de.rooy@rijksmuseum.nl>
Ok, I added CSRF protection to the form, added Marie to the first two patches, and changed it to Signed Off. Is that correct? (In reply to Katrin Fischer from comment #20) > This needs some additional work for CSRF. > > Given our short time frame for release, maybe someone could lend a hand here? > > When clicking the new button, I get: > > Programming error - op 'gennext' must start with 'cud-' for POST > http://localhost:8081/intranet/serials/serials-collection.pl (referer: > http://localhost:8081/cgi-bin/koha/serials/serials-collection. > pl?subscriptionid=1) > > NOTE: Remember to add the missing sign-off lines for Marie.
Grabbing it directly, you are a star Kevin :)
Pushed for 24.05! Well done everyone, thank you!
Not backported to 23.11.x