From c0964fd310f14b86c2649ea9a4027398714203d2 Mon Sep 17 00:00:00 2001 From: Julian Maurice Date: Mon, 14 Feb 2022 15:30:51 +0100 Subject: [PATCH] Bug 30096: Add "late issue notification" to subscriptions batch mod tool This patch depends on bug 29997 Test plan: 1. On the Serials module main page, do a search that return at least 2 subscriptions 2. Check at least 2 boxes in the first column of the table, then click on "Edit selected serials" above the table 3. Verify that the table above the form display correct data for the "Late issue notification" column 4. Submit the form without changing anything. Verify that the setting "late issue notification" was not changed for selected subscriptions 5. Repeat steps 1 and 2. Set "Late issue notification" to one of the available options and submit the form. Verify that the setting "late issue notification" was changed to the selected option for all selected subscriptions --- .../modules/serials/subscription-batchedit.tt | 17 +++++++++++++++++ serials/subscription-batchedit.pl | 15 +++++++++++++++ 2 files changed, 32 insertions(+) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-batchedit.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-batchedit.tt index 360b18e41d..4a31786a67 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-batchedit.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-batchedit.tt @@ -49,6 +49,7 @@ Nonpublic notes Call number Create item when receiving + Late issue notification Expiration date @@ -71,6 +72,13 @@ No [% END %] + + [% IF letters_map.defined(subscription.late_issue_letter_code) %] + [% letters_map.item(subscription.late_issue_letter_code) | html %] + [% ELSE %] + [% subscription.late_issue_letter_code | html %] + [% END %] + [% subscription.enddate | $KohaDates %] [% END %] @@ -140,6 +148,15 @@ +
  • + + +
  • diff --git a/serials/subscription-batchedit.pl b/serials/subscription-batchedit.pl index 556f81e8b3..24c5b3baae 100755 --- a/serials/subscription-batchedit.pl +++ b/serials/subscription-batchedit.pl @@ -27,6 +27,7 @@ use C4::Serials qw( can_edit_subscription ); use Koha::Subscriptions; use Koha::Acquisition::Booksellers; use Koha::AdditionalFields; +use Koha::Database; use Koha::DateUtils qw( dt_from_string ); my $cgi = CGI->new; @@ -59,6 +60,7 @@ if ($batchedit) { notes => scalar $cgi->param('notes'), internalnotes => scalar $cgi->param('internalnotes'), serialsadditems => scalar $cgi->param('serialsadditems'), + late_issue_letter_code => scalar $cgi->param('late_issue_letter_code'), enddate => dt_from_string(scalar $cgi->param('enddate')), ); @@ -96,11 +98,24 @@ if ($batchedit) { exit; } +my $schema = Koha::Database->schema; +my @letters = $schema->resultset('Letter')->search( + { module => 'serial' }, + { + columns => ['code', 'name'], + distinct => 1, + order_by => 'code', + }, +); +my %letters_map = map { $_->code => $_->name } @letters; + $template->param( subscriptions => \@subscriptions, booksellers => [ Koha::Acquisition::Booksellers->search->as_list ], additional_fields => \@additional_fields, referrer => scalar $cgi->param('referrer'), + letters => \@letters, + letters_map => \%letters_map, ); output_html_with_http_headers $cgi, $cookie, $template->output; -- 2.30.2