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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-5 / +23 lines)
Lines 99-105 function check() { Link Here
99
}
99
}
100
100
101
function checkMultiHold() {
101
function checkMultiHold() {
102
    var spans = $(".multi_hold_item");
102
    var spans = $(".multi_hold_item_checkbox:checked");
103
    if ($(spans).size() == 0) {
103
    if ($(spans).size() == 0) {
104
        alert(MSG_NO_ITEMS_AVAILABLE);
104
        alert(MSG_NO_ITEMS_AVAILABLE);
105
        return false;
105
        return false;
Lines 297-302 function checkMultiHold() { Link Here
297
    </form>
297
    </form>
298
  [% ELSIF NOT noitems %]
298
  [% ELSIF NOT noitems %]
299
299
300
[% IF ( checked_previously && !multi_hold ) %]
301
<div class="dialog alert">
302
  <ul>
303
    <li>Patron has previously checked out this title</li>
304
  </ul>
305
</div>
306
[% END %]
307
300
[% IF ( exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
308
[% IF ( exceeded_maxreserves || exceeded_holds_per_record || alreadyreserved || none_available || alreadypossession || ageRestricted ) %]
301
    <div class="dialog alert">
309
    <div class="dialog alert">
302
310
Lines 636-641 function checkMultiHold() { Link Here
636
644
637
    <table id="requesttitles">
645
    <table id="requesttitles">
638
      <tr>
646
      <tr>
647
        <th>&nbsp;</th>
639
        <th>Title</th>
648
        <th>Title</th>
640
        [% UNLESS ( item_level_itypes ) %]
649
        [% UNLESS ( item_level_itypes ) %]
641
          <th>Item type</th>
650
          <th>Item type</th>
Lines 650-664 function checkMultiHold() { Link Here
650
          <tr>
659
          <tr>
651
        [% END %]
660
        [% END %]
652
          <td>
661
          <td>
662
            [% UNLESS ( biblioloo.warn ) %]
663
              <input class="multi_hold_item_checkbox" type="checkbox" checked="checked" title="[% biblioloo.biblionumber %]"/></td>
664
            [% END %]
665
            <td>
653
            <ul>
666
            <ul>
654
              <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]">[% biblioloo.title |html %]</a></li>
667
              <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]">[% biblioloo.title |html %]</a></li>
655
              [% IF ( biblioloo.publicationyear ) %]
668
              [% IF ( biblioloo.publicationyear ) %]
656
                <li><span class="label">Publication year:</span> [% biblioloo.publicationyear %]</li>
669
                <li><span class="label">Publication year:</span> [% biblioloo.publicationyear %]</li>
657
              [% END %]
670
              [% END %]
658
            </ul>
671
            </ul>
659
            [% UNLESS ( biblioloo.warn ) %]
672
            [% IF ( biblioloo.warn ) %]
660
              <span class="multi_hold_item" title="[% biblioloo.biblionumber %]"></span>
661
            [% ELSE %]
662
              <span class="not_holdable" title="[% biblioloo.biblionumber %]"></span>
673
              <span class="not_holdable" title="[% biblioloo.biblionumber %]"></span>
663
            [% END %]
674
            [% END %]
664
          </td>
675
          </td>
Lines 669-674 function checkMultiHold() { Link Here
669
          [% END %]
680
          [% END %]
670
            <td>[% biblioloo.rank %]</td>
681
            <td>[% biblioloo.rank %]</td>
671
          <td>
682
          <td>
683
            [% IF ( biblioloo.checked_previously ) %]
684
              <span class="alert">Patron has previously checked out this title</span><br/>
685
            [% END %]
672
            [% IF ( biblioloo.alreadyres ) %]
686
            [% IF ( biblioloo.alreadyres ) %]
673
              <ul>
687
              <ul>
674
            [% ELSE %]
688
            [% ELSE %]
Lines 706-712 function checkMultiHold() { Link Here
706
            [% ELSIF ( none_available ) %]
720
            [% ELSIF ( none_available ) %]
707
                <input type="submit" disabled="disabled" value="Place hold" />
721
                <input type="submit" disabled="disabled" value="Place hold" />
708
            [% ELSE %]
722
            [% ELSE %]
709
                <input type="submit" value="Place hold" />
723
                [% IF ( multi_hold ) %]
724
                    <input type="submit" value="Place hold" id="multi_hold_submit"/>
725
                [% ELSE %]
726
                    <input type="submit" value="Place hold" />
727
                [% END %]
710
            [% END %]
728
            [% END %]
711
        [% END %]
729
        [% END %]
712
    </fieldset>
730
    </fieldset>
(-)a/reserve/request.pl (-1 / +16 lines)
Lines 133-138 if ( $biblionumbers ) { Link Here
133
    push @biblionumbers, $input->multi_param('biblionumber');
133
    push @biblionumbers, $input->multi_param('biblionumber');
134
}
134
}
135
135
136
my $multihold = scalar $input->param('multi_hold');
136
# FIXME multi_hold should not be a variable but depends on the number of elements in @biblionumbers
137
# FIXME multi_hold should not be a variable but depends on the number of elements in @biblionumbers
137
$template->param(multi_hold => scalar $input->param('multi_hold'));
138
$template->param(multi_hold => scalar $input->param('multi_hold'));
138
139
Lines 198-203 my $patron = Koha::Patrons->find( $borrowernumber_hold ); Link Here
198
199
199
my $logged_in_patron = Koha::Patrons->find( $borrowernumber );
200
my $logged_in_patron = Koha::Patrons->find( $borrowernumber );
200
201
202
my $wants_check;
203
if ($patron) {
204
    $wants_check = $patron->wants_check_for_previous_checkout;
205
}
201
my $itemdata_enumchron = 0;
206
my $itemdata_enumchron = 0;
202
my @biblioloop = ();
207
my @biblioloop = ();
203
foreach my $biblionumber (@biblionumbers) {
208
foreach my $biblionumber (@biblionumbers) {
Lines 363-368 foreach my $biblionumber (@biblionumbers) { Link Here
363
        foreach my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } )    {
368
        foreach my $itemnumber ( @{ $itemnumbers_of_biblioitem{$biblioitemnumber} } )    {
364
            my $item = $iteminfos_of->{$itemnumber};
369
            my $item = $iteminfos_of->{$itemnumber};
365
370
371
            if ( $patron ) {
372
                my $do_check = $patron->do_check_for_previous_checkout($item) if $wants_check;
373
                if ( $do_check && $wants_check ) {
374
                    $item->{checked_previously} = $do_check;
375
                    if ( $multihold ) {
376
                        $biblioloopiter{checked_previously} = $do_check;
377
                    } else {
378
                        $template->param( checked_previously => $do_check );
379
                    }
380
                }
381
            }
366
            $item->{force_hold_level} = $force_hold_level;
382
            $item->{force_hold_level} = $force_hold_level;
367
383
368
            unless (C4::Context->preference('item-level_itypes')) {
384
            unless (C4::Context->preference('item-level_itypes')) {
369
- 

Return to bug 20421