Bugzilla – Attachment 11516 Details for
Bug 8585
Add System Preference to specify Holds to Pull List Start Date
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 8585 : Add System Preference to specify Holds to Pull List Start Date
0001-Bug-8585-Add-System-Preference-to-specify-Holds-to-P.patch (text/plain), 4.90 KB, created by
David Cook
on 2012-08-10 02:44:22 UTC
(
hide
)
Description:
Bug 8585 : Add System Preference to specify Holds to Pull List Start Date
Filename:
MIME Type:
Creator:
David Cook
Created:
2012-08-10 02:44:22 UTC
Size:
4.90 KB
patch
obsolete
>From 00bf3b755d05a47f109fb84a55e936ef4fa3aeb6 Mon Sep 17 00:00:00 2001 >From: David Cook <dcook@prosentient.com.au> >Date: Fri, 10 Aug 2012 12:31:30 +1000 >Subject: [PATCH] Bug 8585 : Add System Preference to specify Holds to Pull > List Start Date >Content-Type: text/plain; charset="utf-8" > >Currently, Koha creates a default value of 2 days ago (-2) for the start date of the Holds to pull List. This system preference allows users to specify their own default start date for this list, since users might not want to have to manually change the date all the time when they already know the set date period they want to view. > >The system preference value is specified as a positive integer, which is then passed as a negative integer in the handler script. This saves users from having to include a qualifer to the sys pref value. >--- > circ/pendingreserves.pl | 5 +++-- > installer/data/mysql/sysprefs.sql | 1 + > installer/data/mysql/updatedatabase.pl | 7 +++++++ > .../en/modules/admin/preferences/circulation.pref | 5 +++++ > 4 files changed, 16 insertions(+), 2 deletions(-) > >diff --git a/circ/pendingreserves.pl b/circ/pendingreserves.pl >index 52a0450..0fa23ec 100755 >--- a/circ/pendingreserves.pl >+++ b/circ/pendingreserves.pl >@@ -68,8 +68,9 @@ my ( $year, $month, $day ) = Today(); > my $todaysdate = sprintf("%-04.4d-%-02.2d-%02.2d", $year, $month, $day); > my $yesterdaysdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -1)); > # changed from delivered range of 10 years-yesterday to 2 days ago-today >-# Find two days ago for the default shelf pull start and end dates >-my $pastdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, -2)); >+# Find two days ago for the default shelf pull start and end dates, unless HoldsToPullStartDate sys pref is set. >+my $defaultstartdate = ( C4::Context->preference('HoldsToPullStartDate') ) ? "-".C4::Context->preference('HoldsToPullStartDate') : -2; >+my $pastdate = sprintf("%-04.4d-%-02.2d-%02.2d", Add_Delta_YMD($year, $month, $day, 0, 0, $defaultstartdate)); > > # Predefine the start and end dates if they are not already defined > $startdate =~ s/^\s+//; >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index f5a18b2..9d5e9bf 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -374,3 +374,4 @@ INSERT INTO systempreferences (variable,value,options,explanation,type) VALUES ( > INSERT INTO systempreferences (variable,value,explanation,type) VALUES('EnableBorrowerFiles','0','If enabled, allows librarians to upload and attach arbitrary files to a borrower record.','YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('UpdateTotalIssuesOnCirc','0','Whether to update the totalissues field in the biblio on each circ.',NULL,'YesNo'); > INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('IntranetSlipPrinterJS','','Use this JavaScript for printing slips. Define at least function printThenClose(). For use e.g. with Firefox PlugIn jsPrintSetup, see http://jsprintsetup.mozdev.org/','','Free'); >+INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'); >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index ed0c674..7532074 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -5635,6 +5635,13 @@ if(C4::Context->preference("Version") < TransformToNum($DBversion) ) { > SetVersion($DBversion); > } > >+$DBversion = "XXX"; >+if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+ $dbh->do("INSERT INTO systempreferences (variable,value,explanation,options,type) VALUES('HoldsToPullStartDate','2','Set the default start date for the Holds to pull list to this many days ago',NULL,'Integer'"); >+ print "Upgrade to $DBversion done (Added HoldsToPullStartDate syspref)\n"; >+ SetVersion($DBversion); >+} >+ > =head1 FUNCTIONS > > =head2 TableExists($table) >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >index a758b19..ca3759f 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref >@@ -52,6 +52,11 @@ Circulation: > no: "Don't allow" > - staff to specify a due date for a checkout. > - >+ - Set the default start date for the Holds to pull list to >+ - pref: HoldsToPullStartDate >+ class: integer >+ - ago. >+ - > - pref: AllowAllMessageDeletion > choices: > yes: Allow >-- >1.7.7.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 8585
:
11516
|
12052
|
12659
|
12796
|
12825