From 5c5f8ecfed387cef647dcc9d37b8bca1eac7480c Mon Sep 17 00:00:00 2001 From: Alex Buckley Date: Mon, 4 Dec 2017 13:35:01 +1300 Subject: [PATCH] Bug 7047: Storing subscription renewal note in suggestion to be displayed on the suggestion page. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Additionally I have added a library input field in case the librarian wants to set a library branch whilst renewing a subscription. With the use case being they may have ommitted to set the branchcode whilst creating the subscription. Test plan: 1. Create a subscription (if one does not already exist) 2. Set the RenewSerialAddsSuggestion syspref to 'Add' 3. Renew the item making sure to write in a value into the note field 3. Visit the suggestions page and notice that the note is not displayed for the newly created suggestion 4. Apply patch 5. Repeat step 3. Notice that there is now a new branchcode dropdown box. Select one of your libraries and write in the value into the note field 6. Visit suggestions and notice there is now a 'Suggestion note' column in the table containing the note. Also note that the suggestion has the correct branchcode associated with it Sponsored-By: Catalyst IT Signed-off-by: Maksim Sen Signed-off-by: Séverine QUEUNE Signed-off-by: Nick Clemens Signed-off-by: Katrin Fischer Signed-off-by: Martin Renvoize --- C4/Serials.pm | 8 +++++--- .../prog/en/modules/serials/subscription-renew.tt | 14 ++++++++++++++ .../prog/en/modules/suggestion/suggestion.tt | 6 +++++- serials/subscription-renew.pl | 6 +++++- suggestion/suggestion.pl | 1 - 5 files changed, 29 insertions(+), 6 deletions(-) diff --git a/C4/Serials.pm b/C4/Serials.pm index 7d885132e4..66e65218c0 100644 --- a/C4/Serials.pm +++ b/C4/Serials.pm @@ -1476,7 +1476,8 @@ this function renew a subscription with values given on input args. =cut sub ReNewSubscription { - my ( $subscriptionid, $user, $startdate, $numberlength, $weeklength, $monthlength, $note ) = @_; + my ( $subscriptionid, $user, $startdate, $numberlength, $weeklength, $monthlength, $note, $branchcode ) = @_; + warn $note; my $dbh = C4::Context->dbh; my $subscription = GetSubscription($subscriptionid); my $query = qq| @@ -1496,8 +1497,9 @@ sub ReNewSubscription { 'title' => $subscription->{bibliotitle}, 'author' => $biblio->{author}, 'publishercode' => $biblio->{publishercode}, - 'note' => $biblio->{note}, - 'biblionumber' => $subscription->{biblionumber} + 'note' => $note, + 'biblionumber' => $subscription->{biblionumber}, + 'branchcode' => $branchcode, } ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt index 982646485d..cfba7c32a6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/serials/subscription-renew.tt @@ -40,6 +40,20 @@
+ +
  • + (select a library) +
  • +
  • diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt index 38e5410bd0..1d22fbe3b6 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/suggestion/suggestion.tt @@ -474,6 +474,7 @@   Suggestion Suggested by - on + Suggestion note Managed by - on Library Fund @@ -493,7 +494,7 @@
    [% IF ( suggestions_loo.copyrightdate ) %]© [% suggestions_loo.copyrightdate | html %] [% END %] [% IF ( suggestions_loo.volumedesc ) %]; Volume:[% suggestions_loo.volumedesc | html %] [% END %] - [% IF ( suggestions_loo.isbn ) %]; ISBN:[% suggestions_loo.isbn | html %] [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode | html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in [% suggestions_loo.publicationyear | html %] [% END %][% IF ( suggestions_loo.place ) %] in [% suggestions_loo.place | html %] [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle | html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) | html %] [% END %]
    [% IF ( suggestions_loo.note ) %]
    [% suggestions_loo.note | html %]
    [% END %] + [% IF ( suggestions_loo.isbn ) %]; ISBN:[% suggestions_loo.isbn | html %] [% END %][% IF ( suggestions_loo.publishercode ) %]; Published by [% suggestions_loo.publishercode | html %] [% END %][% IF ( suggestions_loo.publicationyear ) %] in [% suggestions_loo.publicationyear | html %] [% END %][% IF ( suggestions_loo.place ) %] in [% suggestions_loo.place | html %] [% END %][% IF ( suggestions_loo.collectiontitle ) %]; [% suggestions_loo.collectiontitle | html %] [% END %][% IF ( suggestions_loo.itemtype ) %]; [% AuthorisedValues.GetByCode( 'SUGGEST_FORMAT', suggestions_loo.itemtype, 0 ) | html %] [% END %]
    [% suggestions_loo.surnamesuggestedby | html %][% IF ( suggestions_loo.firstnamesuggestedby ) %], [% suggestions_loo.firstnamesuggestedby | html %][% END %] [% IF (suggestions_loo.cardnumbersuggestedby ) %]([% suggestions_loo.cardnumbersuggestedby | html %])[% END %] @@ -501,6 +502,9 @@ [% suggestions_loo.surnamemanagedby | html %][% IF ( suggestions_loo.firstnamemanagedby ) %], [% suggestions_loo.firstnamemanagedby | html %][% END %] + + [% IF ( suggestions_loo.note ) %]
    [% suggestions_loo.note | html %]
    [% END %] + [% IF ( suggestions_loo.manageddate ) %] - [% suggestions_loo.manageddate | $KohaDates %][% END %] diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl index ccfbad2916..1e6f85b119 100755 --- a/serials/subscription-renew.pl +++ b/serials/subscription-renew.pl @@ -61,6 +61,7 @@ my $dbh = C4::Context->dbh; my $mode = $query->param('mode') || q{}; my $op = $query->param('op') || 'display'; my @subscriptionids = $query->multi_param('subscriptionid'); +my $branchcode = $query->param('branchcode'); my $done = 0; # for after form has been submitted my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { @@ -83,7 +84,7 @@ if ( $op eq "renew" ) { $subscriptionid, $loggedinuser, $startdate, scalar $query->param('numberlength'), scalar $query->param('weeklength'), scalar $query->param('monthlength'), - scalar $query->param('note') + scalar $query->param('note'), $branchcode ); } elsif ( $op eq 'multi_renew' ) { for my $subscriptionid ( @subscriptionids ) { @@ -113,8 +114,11 @@ if ( $op eq "renew" ) { ); } +my $libraries = Koha::Libraries->search( {}, { order_by => ['branchcode'] }, ); + $template->param( op => $op, + libraries => $libraries, ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/suggestion/suggestion.pl b/suggestion/suggestion.pl index 8c3056e807..e98bbd92e1 100755 --- a/suggestion/suggestion.pl +++ b/suggestion/suggestion.pl @@ -28,7 +28,6 @@ use C4::Budgets; use C4::Search; use C4::Members; use C4::Debug; - use Koha::DateUtils qw( dt_from_string ); use Koha::AuthorisedValues; use Koha::Acquisition::Currencies; -- 2.39.5