Bugzilla – Attachment 96310 Details for
Bug 7047
Renewing serials note not visible
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 7047: Change ReNewSubscription prototype - use hashref
Bug-7047-Change-ReNewSubscription-prototype---use-.patch (text/plain), 4.50 KB, created by
Jonathan Druart
on 2019-12-16 11:03:34 UTC
(
hide
)
Description:
Bug 7047: Change ReNewSubscription prototype - use hashref
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2019-12-16 11:03:34 UTC
Size:
4.50 KB
patch
obsolete
>From 08826b1f25bf879500ba5d67a8be14be57e7d5ac Mon Sep 17 00:00:00 2001 >From: Jonathan Druart <jonathan.druart@bugs.koha-community.org> >Date: Mon, 16 Dec 2019 11:54:05 +0100 >Subject: [PATCH] Bug 7047: Change ReNewSubscription prototype - use hashref > >It also removes a warn statement. >--- > C4/Serials.pm | 16 +++++++++++++--- > serials/subscription-renew.pl | 25 ++++++++++++++++++------- > t/db_dependent/Serials/ReNewSubscription.t | 8 +++++++- > 3 files changed, 38 insertions(+), 11 deletions(-) > >diff --git a/C4/Serials.pm b/C4/Serials.pm >index 66e65218c0..e7e9e3aa13 100644 >--- a/C4/Serials.pm >+++ b/C4/Serials.pm >@@ -1469,15 +1469,25 @@ sub NewSubscription { > > =head2 ReNewSubscription > >-ReNewSubscription($subscriptionid,$user,$startdate,$numberlength,$weeklength,$monthlength,$note) >+ReNewSubscription($params); >+ >+$params is a hashref with the following keys: subscriptionid, user, startdate, numberlength, weeklength, monthlength, note, branchcode > > this function renew a subscription with values given on input args. > > =cut > > sub ReNewSubscription { >- my ( $subscriptionid, $user, $startdate, $numberlength, $weeklength, $monthlength, $note, $branchcode ) = @_; >- warn $note; >+ my ( $params ) = @_; >+ my $subscriptionid = $params->{subscriptionid}; >+ my $user = $params->{user}; >+ my $startdate = $params->{startdate}; >+ my $numberlength = $params->{numberlength}; >+ my $weeklength = $params->{weeklength}; >+ my $monthlength = $params->{monthlength}; >+ my $note = $params->{note}; >+ my $branchcode = $params->{branchcode}; >+ > my $dbh = C4::Context->dbh; > my $subscription = GetSubscription($subscriptionid); > my $query = qq| >diff --git a/serials/subscription-renew.pl b/serials/subscription-renew.pl >index 1e6f85b119..6fc72984f8 100755 >--- a/serials/subscription-renew.pl >+++ b/serials/subscription-renew.pl >@@ -81,19 +81,30 @@ if ( $op eq "renew" ) { > output_and_exit( $query, $cookie, $template, 'unknown_subscription') unless $subscription; > my $startdate = output_pref( { str => scalar $query->param('startdate'), dateonly => 1, dateformat => 'iso' } ); > ReNewSubscription( >- $subscriptionid, $loggedinuser, >- $startdate, scalar $query->param('numberlength'), >- scalar $query->param('weeklength'), scalar $query->param('monthlength'), >- scalar $query->param('note'), $branchcode >+ { >+ subscriptionid => $subscriptionid, >+ user => $loggedinuser, >+ startdate => $startdate, >+ numberlength => scalar $query->param('numberlength'), >+ weeklength => scalar $query->param('weeklength'), >+ monthlength => scalar $query->param('monthlength'), >+ note => scalar $query->param('note'), >+ branchcode => $branchcode >+ } > ); > } elsif ( $op eq 'multi_renew' ) { > for my $subscriptionid ( @subscriptionids ) { > my $subscription = GetSubscription( $subscriptionid ); > next unless $subscription; > ReNewSubscription( >- $subscriptionid, $loggedinuser, >- $subscription->{enddate}, $subscription->{numberlength}, >- $subscription->{weeklength}, $subscription->{monthlength}, >+ { >+ subscriptionid => $subscriptionid, >+ user => $loggedinuser, >+ startdate => $subscription->{enddate}, >+ numberlength => $subscription->{numberlength}, >+ weeklength => $subscription->{weeklength}, >+ monthlength => $subscription->{monthlength}, >+ } > ); > } > } else { >diff --git a/t/db_dependent/Serials/ReNewSubscription.t b/t/db_dependent/Serials/ReNewSubscription.t >index 1a90c51501..d4331ceb0d 100644 >--- a/t/db_dependent/Serials/ReNewSubscription.t >+++ b/t/db_dependent/Serials/ReNewSubscription.t >@@ -84,7 +84,13 @@ my $subscriptionhistory = $builder->build({ > # Actual testing starts here! > > # Renew the subscription and check that enddate has not been set >-ReNewSubscription($subscription->{subscriptionid},'',"2016-01-01",'','',12,''); >+ReNewSubscription( >+ { >+ subscriptionid => $subscription->{subscriptionid}, >+ startdate => "2016-01-01", >+ monthlength => 12 >+ } >+); > my $history = Koha::Subscription::Histories->find($subscription->{subscriptionid}); > > is ( $history->histenddate(), undef, 'subscription history not empty after renewal'); >-- >2.11.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 7047
:
69474
|
71168
|
72639
|
96309
|
96310
|
96311
|
96317
|
96318
|
96319
|
96320
|
96321
|
96585
|
96586
|
96587
|
96588
|
96589