Bugzilla – Attachment 56849 Details for
Bug 17443
Make possible to renew patron by later of expiry and current date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 17443: Make possible to renew patron by later of expiry and current date
Bug-17443-Make-possible-to-renew-patron-by-later-o.patch (text/plain), 4.63 KB, created by
Jonathan Druart
on 2016-10-26 08:14:29 UTC
(
hide
)
Description:
Bug 17443: Make possible to renew patron by later of expiry and current date
Filename:
MIME Type:
Creator:
Jonathan Druart
Created:
2016-10-26 08:14:29 UTC
Size:
4.63 KB
patch
obsolete
>From 48b2f053b4cd11c111ff4aebf151e67fae67bfe2 Mon Sep 17 00:00:00 2001 >From: Josef Moravec <josef.moravec@gmail.com> >Date: Thu, 13 Oct 2016 14:21:48 +0200 >Subject: [PATCH] Bug 17443: Make possible to renew patron by later of expiry > and current date > >Test plan >1) Apply the patch >2) Go to system preferences and find the BorrowerRenewalPeriodBase and note there is new option "the later of current and expiry date" >3) Try all three options and confirm they work as expected > 3.1) The new options should be tested et least with two patrons - one with expiry date in past and one with expiry date in future > >Signed-off-by: radiuscz <radek.siman@centrum.cz> > >Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com> >--- > Koha/Patron.pm | 14 +++++++++----- > installer/data/mysql/atomicupdate/bug_17443.sql | 1 + > installer/data/mysql/sysprefs.sql | 2 +- > .../prog/en/modules/admin/preferences/patrons.pref | 1 + > 4 files changed, 12 insertions(+), 6 deletions(-) > create mode 100644 installer/data/mysql/atomicupdate/bug_17443.sql > >diff --git a/Koha/Patron.pm b/Koha/Patron.pm >index 93c2186..81b2031 100644 >--- a/Koha/Patron.pm >+++ b/Koha/Patron.pm >@@ -295,11 +295,15 @@ Extending the subscription to the expiry date. > > sub renew_account { > my ($self) = @_; >- >- my $date = >- C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry' >- ? dt_from_string( $self->dateexpiry ) >- : dt_from_string; >+ my $date; >+ if ( C4::Context->preference('BorrowerRenewalPeriodBase') eq 'combination' ) { >+ $date = ( dt_from_string gt dt_from_string( $self->dateexpiry ) ) ? dt_from_string : dt_from_string( $self->dateexpiry ); >+ } else { >+ $date = >+ C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry' >+ ? dt_from_string( $self->dateexpiry ) >+ : dt_from_string; >+ } > my $patron_category = Koha::Patron::Categories->find( $self->categorycode ); # FIXME Should be $self->category > my $expiry_date = $patron_category->get_expiry_date($date); > >diff --git a/installer/data/mysql/atomicupdate/bug_17443.sql b/installer/data/mysql/atomicupdate/bug_17443.sql >new file mode 100644 >index 0000000..768bce2 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_17443.sql >@@ -0,0 +1 @@ >+UPDATE systempreferences SET options = "now|dateexpiry|combination", explanation = "Set whether the borrower renewal date should be counted from the dateexpiry, from the current date or by combination: if the dateexpiry is in future use dateexpiry, else use current date " WHERE variable = "BorrowerRenewalPeriodBase"; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index e1d190d..7627b19 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -77,7 +77,7 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('BlockReturnOfWithdrawnItems','1','0','If enabled, items that are marked as withdrawn cannot be returned.','YesNo'), > ('BorrowerMandatoryField','surname|cardnumber',NULL,'Choose the mandatory fields for a patron\'s account','free'), > ('borrowerRelationship','father|mother','','Define valid relationships between a guarantor & a guarantee (separated by | or ,)','free'), >-('BorrowerRenewalPeriodBase','now','dateexpiry|now','Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','Choice'), >+('BorrowerRenewalPeriodBase','now','dateexpiry|now|combination','Set whether the borrower renewal date should be counted from the dateexpiry, from the current date or by combination: if the dateexpiry is in future use dateexpiry, else use current date ','Choice'), > ('BorrowersLog','1',NULL,'If ON, log edit/create/delete actions on patron data','YesNo'), > ('BorrowersTitles','Mr|Mrs|Miss|Ms',NULL,'Define appropriate Titles for patrons','free'), > ('BorrowerUnwantedField','',NULL,'Name the fields you don\'t need to store for a patron\'s account','free'), >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >index 2f2faa0..9683ac9 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/patrons.pref >@@ -133,6 +133,7 @@ Patrons: > choices: > now: current date. > dateexpiry: current membership expiry date. >+ combination: the later one of current and expiry date. > - > - pref: TalkingTechItivaPhoneNotification > choices: >-- >2.1.4
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 17443
:
56443
|
56457
|
56845
| 56849 |
56850