View | Details | Raw Unified | Return to bug 11759
Collapse All | Expand All

(-)a/circ/circulation.pl (-2 / +2 lines)
Lines 114-122 my $borrowernumber = $query->param('borrowernumber'); Link Here
114
my $borrower = $borrowernumber ? GetMember( borrowernumber => $borrowernumber ) : undef;
114
my $borrower = $borrowernumber ? GetMember( borrowernumber => $borrowernumber ) : undef;
115
my $batch = $query->param('batch');
115
my $batch = $query->param('batch');
116
my $batch_allowed = 0;
116
my $batch_allowed = 0;
117
if ( $batch ) {
117
if ( $batch && C4::Context->preference('BatchCheckouts') ) {
118
    $template_name = q|circ/circulation_batch_checkouts.tt|;
118
    $template_name = q|circ/circulation_batch_checkouts.tt|;
119
    my @batch_category_codes = split '\|', C4::Context->preference('batch_checkouts');
119
    my @batch_category_codes = split '\|', C4::Context->preference('BatchCheckoutsValidCategories');
120
    if ( grep {/^$borrower->{categorycode}$/} @batch_category_codes ) {
120
    if ( grep {/^$borrower->{categorycode}$/} @batch_category_codes ) {
121
        $batch_allowed = 1;
121
        $batch_allowed = 1;
122
    } else {
122
    } else {
(-)a/installer/data/mysql/sysprefs.sql (-1 / +2 lines)
Lines 63-69 INSERT INTO systempreferences ( `variable`, `value`, `options`, `explanation`, ` Link Here
63
('BakerTaylorPassword','','','Baker & Taylor Password for Content Cafe (external content)','Free'),
63
('BakerTaylorPassword','','','Baker & Taylor Password for Content Cafe (external content)','Free'),
64
('BakerTaylorUsername','','','Baker & Taylor Username for Content Cafe (external content)','Free'),
64
('BakerTaylorUsername','','','Baker & Taylor Username for Content Cafe (external content)','Free'),
65
('BasketConfirmations','1','always ask for confirmation.|do not ask for confirmation.','When closing or reopening a basket,','Choice'),
65
('BasketConfirmations','1','always ask for confirmation.|do not ask for confirmation.','When closing or reopening a basket,','Choice'),
66
('batch_checkouts','',NULL,'Allow patron categories allowed to checkout in a batch','Free'),
66
('BatchCheckouts','0','','Enable or disable batch checkouts','YesNo'),
67
('BatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch','Free'),
67
('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'),
68
('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'),
68
('BiblioDefaultView','normal','normal|marc|isbd','Choose the default detail view in the catalog; choose between normal, marc or isbd','Choice'),
69
('BiblioDefaultView','normal','normal|marc|isbd','Choose the default detail view in the catalog; choose between normal, marc or isbd','Choice'),
69
('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'),
70
('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'),
(-)a/installer/data/mysql/updatedatabase.pl (-2 / +6 lines)
Lines 11121-11130 if ( CheckVersion($DBversion) ) { Link Here
11121
}
11121
}
11122
11122
11123
$DBversion = "3.21.00.XXX";
11123
$DBversion = "3.21.00.XXX";
11124
if ( C4::Context->preference("Version") < TransformToNum($DBversion) ) {
11124
if ( CheckVersion($DBversion) ) {
11125
    $dbh->do(q|
11126
        INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type )
11127
        VALUES ('BatchCheckouts','0','','Enable or disable batch checkouts','YesNo')
11128
    |);
11125
    $dbh->do(q|
11129
    $dbh->do(q|
11126
        INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type )
11130
        INSERT IGNORE INTO systempreferences ( variable, value, options, explanation, type )
11127
        VALUES ('batch_checkouts','','','Allow patron categories allowed to checkout in a batch','Free')
11131
        VALUES ('BatchCheckoutsValidCategories','',NULL,'Patron categories allowed to checkout in a batch','Free')
11128
    |);
11132
    |);
11129
    print "Upgrade to $DBversion done (Bug 11759: Add batch_checkouts system preference)\n";
11133
    print "Upgrade to $DBversion done (Bug 11759: Add batch_checkouts system preference)\n";
11130
    SetVersion($DBversion);
11134
    SetVersion($DBversion);
(-)a/koha-tmpl/intranet-tmpl/prog/en/includes/circ-menu.inc (-1 / +2 lines)
Lines 64-70 Link Here
64
<div id="menu">
64
<div id="menu">
65
<ul>
65
<ul>
66
    [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]">Check out</a></li>
66
    [% IF ( circview ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]">Check out</a></li>
67
    [% IF Koha.Preference('batch_checkouts').split('\|').grep(categorycode).size > 0 %]
67
    [% IF Koha.Preference('BatchCheckouts') &&
68
          Koha.Preference('BatchCheckoutsValidCategories').split('\|').grep(categorycode).size > 0 %]
68
      [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]&amp;batch=1">Batch check out</a></li>
69
      [% IF ( batch_checkout_view ) %]<li class="active">[% ELSE %]<li>[% END %]<a href="/cgi-bin/koha/circ/circulation.pl?borrowernumber=[% borrowernumber %]&amp;batch=1">Batch check out</a></li>
69
    [% END %]
70
    [% END %]
70
    [% IF ( CAN_user_borrowers ) %]
71
    [% IF ( CAN_user_borrowers ) %]
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/preferences/circulation.pref (-4 / +9 lines)
Lines 714-719 Circulation: Link Here
714
            - course reserves
714
            - course reserves
715
    Batch checkout:
715
    Batch checkout:
716
        -
716
        -
717
            - "Allow some patron categories to checkout in a batch"
717
            - pref: BatchCheckouts
718
            - pref: batch_checkouts
718
              choices:
719
            - "(list of patron category separated with a pipe '|')"
719
                  yes: Allow
720
                  no: "Don't allow"
721
            - "batch checkouts"
722
        -
723
            - "Patron categories allowed to checkout in a batch"
724
            - pref: BatchCheckoutsValidCategories
725
            - "(list of patron categories separated with a pipe '|')"
720
- 

Return to bug 11759