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 {
('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'),
}
$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);
<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 ) %]
- 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 '|')"