Bugzilla – Attachment 43627 Details for
Bug 11759
Batch checkout
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11759: (QA followup) Sysprefs should be kosher
Bug-11759-QA-followup-Sysprefs-should-be-kosher.patch (text/plain), 6.32 KB, created by
Tomás Cohen Arazi (tcohen)
on 2015-10-20 13:49:03 UTC
(
hide
)
Description:
Bug 11759: (QA followup) Sysprefs should be kosher
Filename:
MIME Type:
Creator:
Tomás Cohen Arazi (tcohen)
Created:
2015-10-20 13:49:03 UTC
Size:
6.32 KB
patch
obsolete
>From 2f02d4b74c6f9784dad1d7db25327b1b8a7bb3f9 Mon Sep 17 00:00:00 2001 >From: Tomas Cohen Arazi <tomascohen@theke.io> >Date: Mon, 19 Oct 2015 15:19:28 -0300 >Subject: [PATCH] Bug 11759: (QA followup) Sysprefs should be kosher > >The introduced syspref was defined before we added new guidelines >for them. This patch puts them in sync with current standards. It also >splits them into: > > - A big on/off switch (BatchCheckouts) > - Patron category filter (BatchCheckoutsValidCategories) > >The latter is expected to go away if we move this into a boolean column >on the 'categories' table, which seems a better approach. I'm filling a >new bug for this last comment. > >Signed-off-by: Tomas Cohen Arazi <tomascohen@theke.io> >--- > circ/circulation.pl | 4 ++-- > installer/data/mysql/sysprefs.sql | 3 ++- > installer/data/mysql/updatedatabase.pl | 8 ++++++-- > koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc | 3 ++- > .../prog/en/modules/admin/preferences/circulation.pref | 12 +++++++++--- > 5 files changed, 21 insertions(+), 9 deletions(-) > >diff --git a/circ/circulation.pl b/circ/circulation.pl >index ed470ec..828ed89 100755 >--- a/circ/circulation.pl >+++ b/circ/circulation.pl >@@ -114,9 +114,9 @@ my $borrowernumber = $query->param('borrowernumber'); > my $borrower = $borrowernumber ? GetMember( borrowernumber => $borrowernumber ) : undef; > my $batch = $query->param('batch'); > my $batch_allowed = 0; >-if ( $batch ) { >+if ( $batch && C4::Context->preference('BatchCheckouts') ) { > $template_name = q|circ/circulation_batch_checkouts.tt|; >- my @batch_category_codes = split '\|', C4::Context->preference('batch_checkouts'); >+ my @batch_category_codes = split '\|', C4::Context->preference('BatchCheckoutsValidCategories'); > if ( grep {/^$borrower->{categorycode}$/} @batch_category_codes ) { > $batch_allowed = 1; > } else { >diff --git a/installer/data/mysql/sysprefs.sql b/installer/data/mysql/sysprefs.sql >index 9e7b98b..578ab79 100644 >--- a/installer/data/mysql/sysprefs.sql >+++ b/installer/data/mysql/sysprefs.sql >@@ -63,7 +63,8 @@ INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` > ('BakerTaylorPassword','','','Baker & Taylor Password for Content Cafe (external content)','Free'), > ('BakerTaylorUsername','','','Baker & Taylor Username for Content Cafe (external content)','Free'), > ('BasketConfirmations','1','always ask for confirmation.|do not ask for confirmation.','When closing or reopening a basket,','Choice'), >-('batch_checkouts','',NULL,'Allow patron categories allowed to checkout in a batch','Free'), >+('BatchCheckouts','0','','Enable or disable batch checkouts','YesNo'), >+('BatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch','Free'), > ('BiblioAddsAuthorities','0',NULL,'If ON, adding a new biblio will check for an existing authority record and create one on the fly if one doesn\'t exist','YesNo'), > ('BiblioDefaultView','normal','normal|marc|isbd','Choose the default detail view in the catalog; choose between normal, marc or isbd','Choice'), > ('BibtexExportAdditionalFields', '', NULL , 'Define additional BibTex tags to export from MARC records in YAML format as an associative array with either a marc tag/subfield combination as the value, or a list of tag/subfield combinations.', 'textarea'), >diff --git a/installer/data/mysql/updatedatabase.pl b/installer/data/mysql/updatedatabase.pl >index 152df42..c53b47f 100755 >--- a/installer/data/mysql/updatedatabase.pl >+++ b/installer/data/mysql/updatedatabase.pl >@@ -11121,10 +11121,14 @@ if ( CheckVersion($DBversion) ) { > } > > $DBversion = "3.21.00.XXX"; >-if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) { >+if ( CheckVersion($DBversion) ) { >+ $dbh->do(q| >+ INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) >+ VALUES ('BatchCheckouts','0','','Enable or disable batch checkouts','YesNo') >+ |); > $dbh->do(q| > INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type ) >- VALUES ('batch_checkouts','','','Allow patron categories allowed to checkout in a batch','Free') >+ VALUES ('BatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch','Free') > |); > print "Upgrade to $DBversion done (Bug 11759: Add batch_checkouts system preference)\n"; > SetVersion($DBversion); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >index 12c1e98..8c058f1 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >+++ b/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc >@@ -64,7 +64,8 @@ > <div id="menu"> > <ul> > [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]">Check out</a></li> >- [% IF Koha.Preference('batch_checkouts').split('\|').grep(categorycode).size > 0 %] >+ [% IF Koha.Preference('BatchCheckouts') && >+ Koha.Preference('BatchCheckoutsValidCategories').split('\|').grep(categorycode).size > 0 %] > [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]&batch=1">Batch check out</a></li> > [% END %] > [% IF ( CAN_user_borrowers ) %] >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 8b13ac1..d0d2aca 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 >@@ -714,6 +714,12 @@ Circulation: > - course reserves > Batch checkout: > - >- - "Allow some patron categories to checkout in a batch" >- - pref: batch_checkouts >- - "(list of patron category separated with a pipe '|')" >+ - pref: BatchCheckouts >+ choices: >+ yes: Allow >+ no: "Don't allow" >+ - "batch checkouts" >+ - >+ - "Patron categories allowed to checkout in a batch" >+ - pref: BatchCheckoutsValidCategories >+ - "(list of patron categories separated with a pipe '|')" >-- >2.6.2
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 11759
:
25255
|
25256
|
25257
|
25258
|
25260
|
25620
|
26442
|
26455
|
26806
|
26807
|
26808
|
26809
|
26810
|
26811
|
26813
|
26814
|
26815
|
26833
|
26854
|
27613
|
37603
|
37604
|
37605
|
37606
|
37607
|
37608
|
37609
|
37610
|
37611
|
37612
|
37613
|
37614
|
37650
|
37653
|
41692
|
41693
|
41694
|
41695
|
41696
|
41697
|
41698
|
41735
|
41736
|
41737
|
41738
|
41739
|
41740
|
41741
|
43626
| 43627