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

(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt (-26 / +59 lines)
Lines 5-10 Link Here
5
<script type="text/javascript">
5
<script type="text/javascript">
6
// <![CDATA[
6
// <![CDATA[
7
 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
7
 var MSG_NO_COPY_SELECTED = _("Expecting a specific copy selection.");
8
 var MSG_NO_TRANSFERRABLE_ITEMS = _("No item can be transferred to your pickup location. Please try another pickup location for ");
8
 var ForceHoldNotesReasons=new Array(
9
 var ForceHoldNotesReasons=new Array(
9
    _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific copy information may be helpful."),
10
    _("This title consists of multiple volumes/parts. Please indicate which part you need. Clicking on specific copy information may be helpful."),
10
    "*** Add a new reason above this line ***" ); // NOTE: Do not renumber reasons; this will affect use of existing ones.
11
    "*** Add a new reason above this line ***" ); // NOTE: Do not renumber reasons; this will affect use of existing ones.
Lines 21-36 Link Here
21
 $(document).ready(function() {
22
 $(document).ready(function() {
22
    $('#hold-request-form').preventDoubleFormSubmit();
23
    $('#hold-request-form').preventDoubleFormSubmit();
23
24
25
    $("#hold-request-form").find("select[name='branch']").change( function() {
26
            var newSelection = $(this).val();
27
28
            //Make sure that when changing the pickup location by resubmitting the form,
29
            // user doesn't accidentally confirm his reservations.
30
            var place_reserveInput = $("#hold-request-form").find('[name="place_reserve"]');
31
            place_reserveInput.attr("value", 0);
32
33
            //Make sure the pickup location is changed to the first select as well.
34
            // The branch selection uses only the first given pickuplocations branch value.
35
            $("#hold-request-form").find("select[name='branch']").val(newSelection);
36
37
            $("#hold-request-form").submit();
38
    });
39
24
    var copiesRowId = null;
40
    var copiesRowId = null;
25
    var wasSpecific = false;
41
    var wasSpecific = false;
26
    var lastCopiesRowId = null;
42
    var lastCopiesRowId = null;
27
	$(".checkitem").parent().click(function(e){
43
    $(".checkitem").parent().click(function(e){
28
		if(e.target.tagName.toLowerCase() == 'td'){
44
        if(e.target.tagName.toLowerCase() == 'td'){
29
           $(this).find("input.checkitem").each( function() {
45
           $(this).find("input.checkitem").each( function() {
30
               $(this).attr('checked', !$(this).attr('checked'));
46
               $(this).attr('checked', !$(this).attr('checked'));
31
			});
47
            });
32
		}
48
        }
33
	});
49
    });
34
    // Hides all 'specific copy' table rows on load.
50
    // Hides all 'specific copy' table rows on load.
35
    $(".copiesrow").hide();
51
    $(".copiesrow").hide();
36
52
Lines 138-143 Link Here
138
            return false;
154
            return false;
139
        }
155
        }
140
156
157
        //Check for each biblio if there are no available Items that can be transferred to the pickup location,
158
        // fail the hold request and alert the user.
159
        var anotherPickupLocationSuggesters = $('#hold-request-form').find('div[id^="suggestAnotherPickupLocation_"]');
160
        if ( $(anotherPickupLocationSuggesters).size() > 0 ) {
161
            anotherPickupLocationSuggesters.each( function() {
162
                    //Extract the biblionumber from the id and fetch the Biblio title
163
                    var idString = $(this).attr('id');
164
                    var bibnumber = idString.replace('suggestAnotherPickupLocation_', '');
165
                    var title = $('#title_'+bibnumber).text();
166
167
                    alert(MSG_NO_TRANSFERRABLE_ITEMS + title);
168
            });
169
            return false;
170
        }
171
141
        // Find the items with the 'Hold' box checked
172
        // Find the items with the 'Hold' box checked
142
        var badBib = null;
173
        var badBib = null;
143
        $(".confirmjs:checked").each(function() {
174
        $(".confirmjs:checked").each(function() {
Lines 189-195 Link Here
189
220
190
221
191
222
192
193
[% FOREACH bibitemloo IN bibitemloop %]
223
[% FOREACH bibitemloo IN bibitemloop %]
194
    [% IF ( bibitemloo.holdable ) %]
224
    [% IF ( bibitemloo.holdable ) %]
195
        // http://jqueryui.com/demos/datepicker/#date-range
225
        // http://jqueryui.com/demos/datepicker/#date-range
Lines 220-226 Link Here
220
  <div id="doc3" class="yui-t7">
250
  <div id="doc3" class="yui-t7">
221
    <div id="bd">
251
    <div id="bd">
222
    [% INCLUDE 'masthead.inc' %]
252
    [% INCLUDE 'masthead.inc' %]
223
	  <div id="yui-g">
253
      <div id="yui-g">
224
        <div id="holds" class="container">
254
        <div id="holds" class="container">
225
        [% IF ( message ) %]
255
        [% IF ( message ) %]
226
            [% IF ( GNA ) %]
256
            [% IF ( GNA ) %]
Lines 273-297 Link Here
273
            [% IF ( none_available ) %]
303
            [% IF ( none_available ) %]
274
                <div id="none_available" class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
304
                <div id="none_available" class="dialog alert"><strong>Sorry</strong>, none of these items can be placed on hold.
275
                </div>
305
                </div>
276
              [% END %]
306
            [% END %]
277
          [% END %]<!-- NAME="message" -->
307
          [% END %]<!-- NAME="message" -->
278
308
279
      [% UNLESS ( message ) %][% UNLESS ( none_available ) %]<h3>Confirm holds for:
309
        [% UNLESS ( message ) %][% IF ( 1 ) %]
280
                      [% FOREACH USER_INF IN USER_INFO %]
310
            <h3>Confirm holds for:
281
                        [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
311
                [% FOREACH USER_INF IN USER_INFO %]
282
                      [% END %]
312
                    [% USER_INF.firstname %] [% USER_INF.surname %] ([% USER_INF.cardnumber %])
283
                    </h3>[% END %]
313
                [% END %]
284
	      [% IF (RESERVE_CHARGE) %]
314
            </h3>[% END %]
285
	      <div class="dialog alert" id="reserve_fee">
315
            [% IF (RESERVE_CHARGE) %]
286
	        There is a charge of [% RESERVE_CHARGE %] for placing this hold
316
                <div class="dialog alert" id="reserve_fee">
287
	      </div>
317
                    There is a charge of [% RESERVE_CHARGE %] for placing this hold
288
	      [% END %]
318
                </div>
319
            [% END %]
289
320
290
            <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
321
            <form action="/cgi-bin/koha/opac-reserve.pl" method="post" id="hold-request-form">
291
            <input type="hidden" name="place_reserve" value="1"/>
322
            <input type="hidden" name="place_reserve" value="1"/>
292
323
293
            <!-- These values are set dynamically by js -->
324
            <!-- These values are set dynamically by js. Biblionumbers is needed for the page reload when changing pickup branch -->
294
            <input type="hidden" name="biblionumbers" id="biblionumbers"/>
325
            <input type="hidden" name="biblionumbers" id="biblionumbers" value="[% biblionumbers %]"/>
295
            <input type="hidden" name="selecteditems" id="selections"/>
326
            <input type="hidden" name="selecteditems" id="selections"/>
296
            <div id="bigloop">
327
            <div id="bigloop">
297
328
Lines 314-320 Link Here
314
                        [% ELSE %]
345
                        [% ELSE %]
315
                        [% END %]
346
                        [% END %]
316
347
317
                            <a class="title" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">[% bibitemloo.title |html %][% IF ( bibitemloo.subtitle ) %] [% FOREACH subtitl IN bibitemloo.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
348
                            <a class="title" id="title_[% bibitemloo.biblionumber %]" href="/cgi-bin/koha/opac-detail.pl?biblionumber=[% bibitemloo.biblionumber %]">[% bibitemloo.title |html %][% IF ( bibitemloo.subtitle ) %] [% FOREACH subtitl IN bibitemloo.subtitle %][% subtitl.subfield %][% END %][% END %]</a>
318
                                            [% IF ( bibitemloo.author ) %],  by [% bibitemloo.author %][% END %]</p>
349
                                            [% IF ( bibitemloo.author ) %],  by [% bibitemloo.author %][% END %]</p>
319
350
320
351
Lines 359-364 Link Here
359
390
360
391
361
                            [% UNLESS ( singleBranchMode ) %]
392
                            [% UNLESS ( singleBranchMode ) %]
393
                                [% IF ( bibitemloo.suggestAnotherPickupLocation ) %]
394
                                    <div id="suggestAnotherPickupLocation_[% bibitemloo.biblionumber %]" class="dialog alert">None of the available items can be transferred to your pickup location. You could try another pickup location.
395
                                    </div>
396
                                [% END %]
362
                                [% IF ( bibitemloo.holdable ) %]
397
                                [% IF ( bibitemloo.holdable ) %]
363
                                    [% IF ( choose_branch ) %]
398
                                    [% IF ( choose_branch ) %]
364
                                        <li class="branch">
399
                                        <li class="branch">
Lines 398-405 Link Here
398
                                    <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
433
                                    <span class="date-format from" data-biblionumber="[% bibitemloo.biblionumber %]">[% INCLUDE 'date-format.inc' %]</span>
399
                                </li>
434
                                </li>
400
                            [% END %]
435
                            [% END %]
436
                        [% END %][%#End of IF ( bibitemloo.holdable ) %]
401
437
402
                        [% END %]
403
                        [% IF ( bibitemloo.holdable ) %]
438
                        [% IF ( bibitemloo.holdable ) %]
404
                            <li>
439
                            <li>
405
                                <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
440
                                <label for="to[% bibitemloo.biblionumber %]">Hold not needed after:</label>
Lines 440-447 Link Here
440
                                           checked="checked"
475
                                           checked="checked"
441
                                    />
476
                                    />
442
                                  [% END %]
477
                                  [% END %]
443
444
                                  <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
478
                                  <label for="reqany_[% bibitemloo.biblionumber %]">Next available copy</label>
479
445
                                  [% UNLESS ( bibitemloo.holdable ) %]
480
                                  [% UNLESS ( bibitemloo.holdable ) %]
446
                                    <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
481
                                    <input type="radio" name="reqtype_[% bibitemloo.biblionumber %]"
447
                                           id="reqspecific_[% bibitemloo.biblionumber %]"
482
                                           id="reqspecific_[% bibitemloo.biblionumber %]"
Lines 500-506 Link Here
500
                                  [% UNLESS ( noItemTypeImages ) %]
535
                                  [% UNLESS ( noItemTypeImages ) %]
501
                                  [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
536
                                  [% IF ( itemLoo.imageurl ) %]<img src="[% itemLoo.imageurl %]" alt="" />[% END %]
502
                                  [% END %]
537
                                  [% END %]
503
								[% itemLoo.description %]
538
                                [% itemLoo.description %]
504
                                </td>
539
                                </td>
505
                              [% END %]
540
                              [% END %]
506
                              <td class="barcode">[% itemLoo.barcode %]</td>
541
                              <td class="barcode">[% itemLoo.barcode %]</td>
Lines 551-560 Link Here
551
            </div><!-- bigloop -->
586
            </div><!-- bigloop -->
552
587
553
            [% UNLESS ( message ) %]
588
            [% UNLESS ( message ) %]
554
            [% UNLESS ( none_available ) %]
555
            <input type="submit" value="Place hold" class="placehold" />
589
            <input type="submit" value="Place hold" class="placehold" />
556
            [% END %]
590
            [% END %]
557
            [% END %]
558
591
559
            </form>
592
            </form>
560
593
(-)a/opac/opac-reserve.pl (-34 / +62 lines)
Lines 58-65 for ( C4::Context->preference("OPACShowHoldQueueDetails") ) { Link Here
58
}
58
}
59
59
60
sub get_out {
60
sub get_out {
61
	output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output;
61
    output_html_with_http_headers(shift,shift,shift); # $query, $cookie, $template->output;
62
	exit;
62
    exit;
63
}
63
}
64
64
65
# get borrower information ....
65
# get borrower information ....
Lines 91-97 if ((! $biblionumbers) && (! $query->param('place_reserve'))) { Link Here
91
}
91
}
92
92
93
# Pass the numbers to the page so they can be fed back
93
# Pass the numbers to the page so they can be fed back
94
# when the hold is confirmed. TODO: Not necessary?
94
# when the hold is confirmed. Biblionumbers are also needed if the
95
# pickup branch changes and the page needs to be reloaded.
95
$template->param( biblionumbers => $biblionumbers );
96
$template->param( biblionumbers => $biblionumbers );
96
97
97
# Each biblio number is suffixed with '/', e.g. "1/2/3/"
98
# Each biblio number is suffixed with '/', e.g. "1/2/3/"
Lines 103-114 if (($#biblionumbers < 0) && (! $query->param('place_reserve'))) { Link Here
103
}
104
}
104
105
105
# pass the pickup branch along....
106
# pass the pickup branch along....
106
my $branch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ;
107
my $pickupBranch = $query->param('branch') || $borr->{'branchcode'} || C4::Context->userenv->{branch} || '' ;
107
($branches->{$branch}) or $branch = "";     # Confirm branch is real
108
($branches->{$pickupBranch}) or $pickupBranch = "";     # Confirm branch is real
108
$template->param( branch => $branch );
109
$template->param( branch => $pickupBranch );
109
110
110
# make branch selection options...
111
# make branch selection options...
111
my $branchloop = GetBranchesLoop($branch);
112
my $branchloop = GetBranchesLoop($pickupBranch);
112
113
113
# Is the person allowed to choose their branch
114
# Is the person allowed to choose their branch
114
my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch")) ? 1 : 0;
115
my $OPACChooseBranch = (C4::Context->preference("OPACAllowUserToChooseBranch")) ? 1 : 0;
Lines 202-220 if ( $query->param('place_reserve') ) { Link Here
202
    }
203
    }
203
204
204
    while (@selectedItems) {
205
    while (@selectedItems) {
205
        my $biblioNum = shift(@selectedItems);
206
        my $biblioNum 		= shift(@selectedItems);
206
        my $itemNum   = shift(@selectedItems);
207
        my $itemNum   		= shift(@selectedItems);
207
        my $branch    = shift(@selectedItems);    # i.e., branch code, not name
208
        my $pickupLocation  = shift(@selectedItems);    # i.e., branch code, not name,
208
209
209
        my $canreserve = 0;
210
        my $canreserve = 0;
210
211
211
        my $singleBranchMode = C4::Context->preference("singleBranchMode");
212
        my $singleBranchMode = C4::Context->preference("singleBranchMode");
212
        if ( $singleBranchMode || !$OPACChooseBranch )
213
        if ( $singleBranchMode || !$OPACChooseBranch )
213
        {    # single branch mode or disabled user choosing
214
        {    # single branch mode or disabled user choosing
214
            $branch = $borr->{'branchcode'};
215
            $pickupLocation = $borr->{'branchcode'};
215
        }
216
        }
216
217
217
#item may belong to a host biblio, if yes change biblioNum to hosts bilbionumber
218
        #item may belong to a host biblio, if yes change biblioNum to hosts bilbionumber
218
        if ( $itemNum ne '' ) {
219
        if ( $itemNum ne '' ) {
219
            my $hostbiblioNum = GetBiblionumberFromItemnumber($itemNum);
220
            my $hostbiblioNum = GetBiblionumberFromItemnumber($itemNum);
220
            if ( $hostbiblioNum ne $biblioNum ) {
221
            if ( $hostbiblioNum ne $biblioNum ) {
Lines 235-254 if ( $query->param('place_reserve') ) { Link Here
235
236
236
        my $expiration_date = $query->param("expiration_date_$biblioNum");
237
        my $expiration_date = $query->param("expiration_date_$biblioNum");
237
238
238
      # If a specific item was selected and the pickup branch is the same as the
239
        # If a specific item was selected and the pickup branch is the same as the
239
      # holdingbranch, force the value $rank and $found.
240
        # holdingbranch, force the value $rank and $found.
240
        my $rank = $biblioData->{rank};
241
        my $rank = $biblioData->{rank};
241
        if ( $itemNum ne '' ) {
242
        if ( $itemNum ne '' ) {
243
            my $item = GetItem($itemNum);
242
            $canreserve = 1 if CanItemBeReserved( $borrowernumber, $itemNum );
244
            $canreserve = 1 if CanItemBeReserved( $borrowernumber, $itemNum );
243
            $rank = '0' unless C4::Context->preference('ReservesNeedReturns');
245
            $rank = '0' unless C4::Context->preference('ReservesNeedReturns');
244
            my $item = GetItem($itemNum);
246
            if ( $item->{'holdingbranch'} eq $pickupLocation ) {
245
            if ( $item->{'holdingbranch'} eq $branch ) {
246
                $found = 'W'
247
                $found = 'W'
247
                  unless C4::Context->preference('ReservesNeedReturns');
248
                  unless C4::Context->preference('ReservesNeedReturns');
248
            }
249
            }
250
251
            # UseBranchTransferLimits checking.
252
            my ($transferOk, $message) = CheckBranchTransferAllowed( $pickupLocation, $item->{'holdingbranch'}, $item, undef );
253
            if (! $transferOk) {
254
                $canreserve = 0;
255
            }
249
        }
256
        }
250
        else {
257
        else {
251
            $canreserve = 1 if CanBookBeReserved( $borrowernumber, $biblioNum );
258
            $canreserve = 1 if CanBookBeReserved( $borrowernumber, $biblioNum, $pickupLocation );
252
259
253
            # Inserts a null into the 'itemnumber' field of 'reserves' table.
260
            # Inserts a null into the 'itemnumber' field of 'reserves' table.
254
            $itemNum = undef;
261
            $itemNum = undef;
Lines 264-270 if ( $query->param('place_reserve') ) { Link Here
264
        # Here we actually do the reserveration. Stage 3.
271
        # Here we actually do the reserveration. Stage 3.
265
        if ($canreserve) {
272
        if ($canreserve) {
266
            AddReserve(
273
            AddReserve(
267
                $branch,      $borrowernumber,
274
                $pickupLocation,      $borrowernumber,
268
                $biblioNum,   'a',
275
                $biblioNum,   'a',
269
                [$biblioNum], $rank,
276
                [$biblioNum], $rank,
270
                $startdate,   $expiration_date,
277
                $startdate,   $expiration_date,
Lines 398-403 foreach my $biblioNum (@biblionumbers) { Link Here
398
        }
405
        }
399
    }
406
    }
400
407
408
    #Collect the amout of items that pass the CheckBranchTransferAllowed-check. This is needed to tell
409
    #  the user if some or all Items cannot be transferred to the pickup location.
410
    my $branchTransferableItemsCount = 0;
411
401
    $biblioLoopIter{itemLoop} = [];
412
    $biblioLoopIter{itemLoop} = [];
402
    my $numCopiesAvailable = 0;
413
    my $numCopiesAvailable = 0;
403
    foreach my $itemInfo (@{$biblioData->{itemInfos}}) {
414
    foreach my $itemInfo (@{$biblioData->{itemInfos}}) {
Lines 434-443 foreach my $biblioNum (@biblionumbers) { Link Here
434
        my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($itemNum);
445
        my ($reservedate,$reservedfor,$expectedAt) = GetReservesFromItemnumber($itemNum);
435
        my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);
446
        my $ItemBorrowerReserveInfo = GetMemberDetails( $reservedfor, 0);
436
447
437
	# the item could be reserved for this borrower vi a host record, flag this
448
        # the item could be reserved for this borrower vi a host record, flag this
438
	if ($reservedfor eq $borrowernumber){
449
        if ($reservedfor eq $borrowernumber){
439
		$itemLoopIter->{already_reserved} = 1;
450
            $itemLoopIter->{already_reserved} = 1;
440
	}
451
        }
441
452
442
        if ( defined $reservedate ) {
453
        if ( defined $reservedate ) {
443
            $itemLoopIter->{backgroundcolor} = 'reserved';
454
            $itemLoopIter->{backgroundcolor} = 'reserved';
Lines 480-491 foreach my $biblioNum (@biblionumbers) { Link Here
480
            $itemLoopIter->{nocancel} = 1;
491
            $itemLoopIter->{nocancel} = 1;
481
        }
492
        }
482
493
483
	# if the items belongs to a host record, show link to host record
494
        # if the items belongs to a host record, show link to host record
484
	if ($itemInfo->{biblionumber} ne $biblioNum){
495
        if ($itemInfo->{biblionumber} ne $biblioNum){
485
		$biblioLoopIter{hostitemsflag} = 1;
496
            $biblioLoopIter{hostitemsflag} = 1;
486
		$itemLoopIter->{hostbiblionumber} = $itemInfo->{biblionumber};
497
            $itemLoopIter->{hostbiblionumber} = $itemInfo->{biblionumber};
487
		$itemLoopIter->{hosttitle} = GetBiblioData($itemInfo->{biblionumber})->{title};
498
            $itemLoopIter->{hosttitle} = GetBiblioData($itemInfo->{biblionumber})->{title};
488
	}
499
        }
489
500
490
        # If there is no loan, return and transfer, we show a checkbox.
501
        # If there is no loan, return and transfer, we show a checkbox.
491
        $itemLoopIter->{notforloan} = $itemLoopIter->{notforloan} || 0;
502
        $itemLoopIter->{notforloan} = $itemLoopIter->{notforloan} || 0;
Lines 501-520 foreach my $biblioNum (@biblionumbers) { Link Here
501
        }
512
        }
502
513
503
        if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum) and ($itemLoopIter->{already_reserved} ne 1)) {
514
        if (IsAvailableForItemLevelRequest($itemNum) and $policy_holdallowed and CanItemBeReserved($borrowernumber,$itemNum) and ($itemLoopIter->{already_reserved} ne 1)) {
515
504
            $itemLoopIter->{available} = 1;
516
            $itemLoopIter->{available} = 1;
505
            $numCopiesAvailable++;
517
            $numCopiesAvailable++;
518
519
            #Check for UseBranchTransferLimit. $numCopiesAvailable is incremented because this Item
520
            #  could still be available from another pickup location
521
            my ($transferOk, $errorMsg) = CheckBranchTransferAllowed( $pickupBranch, undef, GetItem($itemNum), undef );
522
            if (! $transferOk) {
523
                $itemLoopIter->{available} = 0;
524
                $itemLoopIter->{branchTransferBlocked} = 1;
525
            }
526
            else {
527
                $branchTransferableItemsCount++;
528
            }
506
        }
529
        }
507
530
508
	# FIXME: move this to a pm
531
        # FIXME: move this to a pm
509
        my $dbh = C4::Context->dbh;
532
        my $dbh = C4::Context->dbh;
510
        my $sth2 = $dbh->prepare("SELECT * FROM reserves WHERE borrowernumber=? AND itemnumber=? AND found='W'");
533
        my $sth2 = $dbh->prepare("SELECT * FROM reserves WHERE borrowernumber=? AND itemnumber=? AND found='W'");
511
        $sth2->execute($itemLoopIter->{ReservedForBorrowernumber}, $itemNum);
534
        $sth2->execute($itemLoopIter->{ReservedForBorrowernumber}, $itemNum);
512
        while (my $wait_hashref = $sth2->fetchrow_hashref) {
535
        while (my $wait_hashref = $sth2->fetchrow_hashref) {
513
            $itemLoopIter->{waitingdate} = format_date($wait_hashref->{waitingdate});
536
            $itemLoopIter->{waitingdate} = format_date($wait_hashref->{waitingdate});
514
        }
537
        }
515
	$itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} );
538
        $itemLoopIter->{imageurl} = getitemtypeimagelocation( 'opac', $itemTypes->{ $itemInfo->{itype} }{imageurl} );
516
539
517
    # Show serial enumeration when needed
540
        # Show serial enumeration when needed
518
        if ($itemLoopIter->{enumchron}) {
541
        if ($itemLoopIter->{enumchron}) {
519
            $itemdata_enumchron = 1;
542
            $itemdata_enumchron = 1;
520
        }
543
        }
Lines 523-528 foreach my $biblioNum (@biblionumbers) { Link Here
523
    }
546
    }
524
    $template->param( itemdata_enumchron => $itemdata_enumchron );
547
    $template->param( itemdata_enumchron => $itemdata_enumchron );
525
548
549
    ## Set the behaviour flags for the template
526
    if ($numCopiesAvailable > 0) {
550
    if ($numCopiesAvailable > 0) {
527
        $numBibsAvailable++;
551
        $numBibsAvailable++;
528
        $biblioLoopIter{bib_available} = 1;
552
        $biblioLoopIter{bib_available} = 1;
Lines 538-550 foreach my $biblioNum (@biblionumbers) { Link Here
538
        $biblioLoopIter{holdable} = undef;
562
        $biblioLoopIter{holdable} = undef;
539
        $biblioLoopIter{already_patron_possession} = 1;
563
        $biblioLoopIter{already_patron_possession} = 1;
540
    }
564
    }
565
    if ($branchTransferableItemsCount == 0) {
566
        #We can tell our Borrowers that they can try another pickup location if they don't find what they need.
567
        $biblioLoopIter{suggestAnotherPickupLocation} = 1 ;
568
    }
569
541
570
542
    if( $biblioLoopIter{holdable} ){ $anyholdable++; }
571
    if( $biblioLoopIter{holdable} ){ $anyholdable++; }
543
572
544
    push @$biblioLoop, \%biblioLoopIter;
573
    push @$biblioLoop, \%biblioLoopIter;
545
}
574
}
546
575
547
if ( $numBibsAvailable == 0 || $anyholdable == 0) {
576
if ( $numBibsAvailable == 0 || $anyholdable == 0 ) {
548
    $template->param( none_available => 1 );
577
    $template->param( none_available => 1 );
549
}
578
}
550
579
Lines 571-577 if ( Link Here
571
    C4::Context->preference( 'OPACAllowHoldDateInFuture' )
600
    C4::Context->preference( 'OPACAllowHoldDateInFuture' )
572
    ) {
601
    ) {
573
    $template->param(
602
    $template->param(
574
	    reserve_in_future         => 1,
603
        reserve_in_future         => 1,
575
    );
604
    );
576
}
605
}
577
606
578
- 

Return to bug 10993