Bugzilla – Attachment 6781 Details for
Bug 6843
Renew membership from expiry date or from current date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Rebased patch : Patch to allow patron renewal from expiry date or from current date based on a syspref
0001-Bug-6843-Renew-membership-from-expiry-date-or-from-c.patch (text/plain), 4.61 KB, created by
Koustubha Kale
on 2011-12-14 10:36:01 UTC
(
hide
)
Description:
Rebased patch : Patch to allow patron renewal from expiry date or from current date based on a syspref
Filename:
MIME Type:
Creator:
Koustubha Kale
Created:
2011-12-14 10:36:01 UTC
Size:
4.61 KB
patch
obsolete
>From cae4daea88ae11d3023a3ec8393aa4ff99375b88 Mon Sep 17 00:00:00 2001 >From: Koustubha Kale <kmkale@anantcorp.com> >Date: Wed, 14 Dec 2011 15:48:16 +0530 >Subject: [PATCH] [Bug 6843] Renew membership from expiry date or from current > date based on a syspref >Content-Type: text/plain; charset="utf-8" > >This patch adds a system preference under Patron -> BorrowerRenewalPeriodBase >Using this preference the patch allows renewal of Patron account either from todays date or from existing expiry date in the patrons account. > >To test : Apply patch; Set System Preference BorrowerRenewalPeriodBase ( under Patron ) to "current membership expiry date"; >Renew a patron; You will observe that patrons account expiry date has been calculated from previuos expiry date instead of today's date >( as is the default in Koha prior to this patch ). >--- > C4/Members.pm | 4 +++- > ...Renew_membership_from_expiry_or_current_date.pl | 10 ++++++++++ > installer/data/mysql/sysprefs.sql | 1 + > .../prog/en/modules/admin/preferences/patrons.pref | 6 ++++++ > 4 files changed, 20 insertions(+), 1 deletions(-) > create mode 100755 installer/data/mysql/atomicupdate/bug_6843_Renew_membership_from_expiry_or_current_date.pl > >diff --git a/C4/Members.pm b/C4/Members.pm >index 1d7bc42..b81872c 100644 >--- a/C4/Members.pm >+++ b/C4/Members.pm >@@ -1687,7 +1687,9 @@ sub ExtendMemberSubscriptionTo { > my $dbh = C4::Context->dbh; > my $borrower = GetMember('borrowernumber'=>$borrowerid); > unless ($date){ >- $date=POSIX::strftime("%Y-%m-%d",localtime()); >+ $date = (C4::Context->preference('BorrowerRenewalPeriodBase') eq 'dateexpiry') ? >+ C4::Dates->new($borrower->{'dateexpiry'}, 'iso')->output("iso") : >+ C4::Dates->new()->output("iso"); > $date = GetExpiryDate( $borrower->{'categorycode'}, $date ); > } > my $sth = $dbh->do(<<EOF); >diff --git a/installer/data/mysql/atomicupdate/bug_6843_Renew_membership_from_expiry_or_current_date.pl b/installer/data/mysql/atomicupdate/bug_6843_Renew_membership_from_expiry_or_current_date.pl >new file mode 100755 >index 0000000..6007129 >--- /dev/null >+++ b/installer/data/mysql/atomicupdate/bug_6843_Renew_membership_from_expiry_or_current_date.pl >@@ -0,0 +1,10 @@ >+#! /usr/bin/perl >+use strict; >+use warnings; >+use C4::Context; >+my $dbh=C4::Context->dbh; >+$dbh->do(<<ENDOFRENEWAL); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice'); >+ENDOFRENEWAL >+print "Upgrade done (Added a system preference to allow renewal of Patron account either from todays date or from existing expiry date in the patrons account.)\n"; >+ >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 128c9b2..9be4b79 100755 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -328,4 +328,5 @@ INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES(' > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES ('OpacKohaUrl','1',"Show 'Powered by Koha' text on OPAC footer.",NULL,NULL); > INSERT INTO `systempreferences` (variable,value,explanation,options,type) VALUES('EasyAnalyticalRecords','0','If on, display in the catalogue screens tools to easily setup analytical record relationships','','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('OpacShowRecentComments',0,'If ON a link to recent comments will appear in the OPAC masthead',NULL,'YesNo'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('BorrowerRenewalPeriodBase', 'now', 'Set whether the borrower renewal date should be counted from the dateexpiry or from the current date ','dateexpiry|now','Choice'); > >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 ac3e1d2..3d6a705 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 >@@ -107,3 +107,9 @@ Patrons: > yes: Do > no: "Don't" > - store and display surnames in upper case. >+ - >+ - When renewing borrowers, base the new expiry date on >+ - pref: BorrowerRenewalPeriodBase >+ choices: >+ now: current date. >+ dateexpiry: current membership expiry date. >-- >1.7.5.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 6843
:
6263
|
6781
|
6822