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

(-)a/C4/Circulation.pm (-3 / +3 lines)
Lines 3256-3263 sub IsBranchTransferAllowed { Link Here
3256
3256
3257
A convenience function to easily check item transfer limits.
3257
A convenience function to easily check item transfer limits.
3258
3258
3259
  $allowed = CheckBranchTransferAllowed( $toBranch, $fromBranch, $item, $biblioitem );
3259
  ($allowed, $errorMessage) = CheckBranchTransferAllowed( $toBranch, $fromBranch, $item, $biblioitem );
3260
  $allowed = CheckBranchTransferAllowed( $toBranch, undef, $item, undef] );
3260
  ($allowed, $errorMessage) = CheckBranchTransferAllowed( $toBranch, undef, $item, undef] );
3261
  
3261
  
3262
Checks if UseBranchTransferLimits global preference is in use.
3262
Checks if UseBranchTransferLimits global preference is in use.
3263
Checks if the given item can be transferred from $fromBranch to $toBranch.
3263
Checks if the given item can be transferred from $fromBranch to $toBranch.
Lines 3333-3339 sub CheckBranchTransferAllowed { Link Here
3333
                        
3333
                        
3334
	## If a row is found, then that combination is not allowed, if no matching row is found, then the combination *is allowed*
3334
	## If a row is found, then that combination is not allowed, if no matching row is found, then the combination *is allowed*
3335
	if ( $limit->{'limitId'} ) {
3335
	if ( $limit->{'limitId'} ) {
3336
		return 0, $toBranch . "::" . $code;
3336
		return 0, "$fromBranch -> $toBranch " . " :: " . $code;
3337
	} else {
3337
	} else {
3338
		return 1;
3338
		return 1;
3339
	}
3339
	}
(-)a/C4/Reserves.pm (-5 / +6 lines)
Lines 418-439 C<$pickupLibrary> OPTIONAL, undef OR the branchcode of the item transfer destina Link Here
418
sub CanBookBeReserved{
418
sub CanBookBeReserved{
419
    my ($borrowernumber, $biblionumber, $pickupLibrary) = @_;
419
    my ($borrowernumber, $biblionumber, $pickupLibrary) = @_;
420
420
421
    my $items = GetItemnumbersForBiblio($biblionumber);
421
    my $itemNumbers = GetItemnumbersForBiblio($biblionumber);
422
    #get items linked via host records
422
    #get items linked via host records
423
    my @hostitems = get_hostitemnumbers_of($biblionumber);
423
    my @hostitems = get_hostitemnumbers_of($biblionumber);
424
    if (@hostitems){
424
    if (@hostitems){
425
		push (@$items,@hostitems);
425
		push (@$itemNumbers,@hostitems);
426
    }
426
    }
427
427
428
    foreach my $item (@$items){
428
    foreach my $itemNumber (@$itemNumbers){
429
		
429
		
430
		if (defined $pickupLibrary) {
430
		if (defined $pickupLibrary) {
431
			my $item = GetItem($itemNumber);
431
			return 1 if ( CanItemBeReserved($borrowernumber, $item) and
432
			return 1 if ( CanItemBeReserved($borrowernumber, $item) and
432
					  CheckBranchTransferLimits($pickupLibrary, $item->{holdingbranch}, $item, undef)
433
					  C4::Circulation::CheckBranchTransferAllowed($pickupLibrary, $item->{holdingbranch}, $item, undef)
433
					);
434
					);
434
		}
435
		}
435
		else {
436
		else {
436
			return 1 if ( CanItemBeReserved($borrowernumber, $item) );
437
			return 1 if ( CanItemBeReserved($borrowernumber, $itemNumber) );
437
		}
438
		}
438
    }
439
    }
439
    return 0;
440
    return 0;
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/reserve/request.tt (-8 / +71 lines)
Lines 130-135 function checkMultiHold() { Link Here
130
	});
130
	});
131
131
132
    $('#hold-request-form').preventDoubleFormSubmit();
132
    $('#hold-request-form').preventDoubleFormSubmit();
133
	$('#reloadPickupLocationForm').preventDoubleFormSubmit();
134
	
135
	//Setting the trigger to reload branchTransferLimits
136
	$('#pickup').change(function() {
137
			var newSelection = $(this).val();
138
			
139
			//Make sure the pickup location is changed to the first select as well.
140
			// The branch selection uses only the first given pickuplocations branch value.
141
			$('#reloadPickupLocationForm > input[name="pickup"]').val(newSelection);
142
			
143
			$('#reloadPickupLocationForm').submit();
144
	});
145
	
133
146
134
[% UNLESS ( borrowernumber || borrower_list ) %]
147
[% UNLESS ( borrowernumber || borrower_list ) %]
135
    [% IF ( CircAutocompl ) %]
148
    [% IF ( CircAutocompl ) %]
Lines 352-361 function checkMultiHold() { Link Here
352
        [% END %]
365
        [% END %]
353
366
354
</ol>
367
</ol>
355
   [% UNLESS ( multi_hold ) %]
368
369
370
371
	[% UNLESS ( multi_hold ) %]
356
        <fieldset class="action">
372
        <fieldset class="action">
357
            [% IF ( borrowernumber ) %]
373
            [% IF ( borrowernumber ) %]
358
                [% IF ( override_required ) %]
374
				[% IF ( bookBranchTransferDenied ) %]
375
					<input type="submit" disabled="disabled" value="Place hold" />
376
                [% ELSIF ( override_required ) %]
359
                    <input type="submit" class="warning" value="Place hold" />
377
                    <input type="submit" class="warning" value="Place hold" />
360
                [% ELSIF ( none_available ) %]
378
                [% ELSIF ( none_available ) %]
361
                    <input type="submit" disabled="disabled" value="Place hold" />
379
                    <input type="submit" disabled="disabled" value="Place hold" />
Lines 367-377 function checkMultiHold() { Link Here
367
        [% FOREACH bibitemloo IN bibitemloop %]
385
        [% FOREACH bibitemloo IN bibitemloop %]
368
          <ol>
386
          <ol>
369
            [% UNLESS ( item_level_itypes ) %]
387
            [% UNLESS ( item_level_itypes ) %]
370
              <li><span class="label">Item type:</span> [% bibitemloo.description %]</li>
388
				<li><span class="label">Item type:</span> [% bibitemloo.description %]</li>
371
            [% END %]
389
            [% END %]
372
390
373
            [% IF ( bibitemloo.publicationyear ) %]<li><span class="label">Publication year:</span> [% bibitemloo.publicationyear %]</li>[% END %]
391
            [% IF ( bibitemloo.publicationyear ) %]
392
				<li><span class="label">Publication year:</span> [% bibitemloo.publicationyear %]</li>
393
			[% END %]
374
          </ol>
394
          </ol>
395
		  
396
			[% IF ( bibitemloo.suggestAnotherPickupLocation ) %]
397
				<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.</div>
398
			[% END %]
375
399
376
        <table id="requestspecific">
400
        <table id="requestspecific">
377
        <caption>Place a hold on a specific copy</caption>
401
        <caption>Place a hold on a specific copy</caption>
Lines 396-407 function checkMultiHold() { Link Here
396
            <td>
420
            <td>
397
            [% IF ( itemloo.available ) %]
421
            [% IF ( itemloo.available ) %]
398
                <input type="radio" name="checkitem" value="[% itemloo.itemnumber %]" />
422
                <input type="radio" name="checkitem" value="[% itemloo.itemnumber %]" />
423
			[% ELSIF ( itemloo.branchTransferDenied ) %]
424
			    <input disabled="disabled" type="radio" name="checkitem" value="[% itemloo.itemnumber %]" />
425
                <img src="/intranet-tmpl/[% theme %]/img/famfamfam/silk/cross.png" title="Cannot transfer this item to your pickup location" alt="Cannot transfer this item to your pickup location" />
399
            [% ELSIF ( itemloo.override ) %]
426
            [% ELSIF ( itemloo.override ) %]
400
                <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber %]" />
427
                <input type="radio" name="checkitem" class="needsoverride" value="[% itemloo.itemnumber %]" />
401
                <img src="/intranet-tmpl/[% theme %]/img/famfamfam/silk/error.png" alt="Requires override of hold policy" />
428
                <img src="/intranet-tmpl/[% theme %]/img/famfamfam/silk/error.png" title="Requires override of hold policy" alt="Requires override of hold policy" />
402
            [% ELSE %]
429
            [% ELSE %]
403
                <input disabled="disabled" type="radio" name="checkitem" value="[% itemloo.itemnumber %]" />
430
                <input disabled="disabled" type="radio" name="checkitem" value="[% itemloo.itemnumber %]" />
404
                <img src="/intranet-tmpl/[% theme %]/img/famfamfam/silk/cross.png" alt="Cannot be put on hold" />
431
                <img src="/intranet-tmpl/[% theme %]/img/famfamfam/silk/cross.png" title="Cannot be put on hold" alt="Cannot be put on hold" />
405
            [% END %]
432
            [% END %]
406
            </td>
433
            </td>
407
            [% IF ( item_level_itypes ) %]
434
            [% IF ( item_level_itypes ) %]
Lines 475-480 function checkMultiHold() { Link Here
475
    [% END %] <!-- bibitemloop -->
502
    [% END %] <!-- bibitemloop -->
476
503
477
  [% ELSE %]<!-- UNLESS multi_hold -->
504
  [% ELSE %]<!-- UNLESS multi_hold -->
505
  
478
506
479
    <table id="requesttitles">
507
    <table id="requesttitles">
480
      <tr>
508
      <tr>
Lines 493-499 function checkMultiHold() { Link Here
493
        [% END %]
521
        [% END %]
494
          <td>
522
          <td>
495
            <ul>
523
            <ul>
496
              <li><a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]">[% biblioloo.title |html %]</a></li>
524
              <li>
525
			    [% IF ( biblioloo.suggestAnotherPickupLocation ) %]
526
					<img src="/intranet-tmpl/[% theme %]/img/famfamfam/silk/cross.png" title="Cannot transfer this item to your pickup location" alt="Cannot transfer this item to your pickup location" />
527
				[% END %]
528
				<a href="/cgi-bin/koha/catalogue/detail.pl?biblionumber=[% biblioloo.biblionumber %]">[% biblioloo.title |html %]</a>
529
			  </li>
497
              [% IF ( biblioloo.publicationyear ) %]
530
              [% IF ( biblioloo.publicationyear ) %]
498
                <li><span class="label">Publication year:</span> [% biblioloo.publicationyear %]</li>
531
                <li><span class="label">Publication year:</span> [% biblioloo.publicationyear %]</li>
499
              [% END %]
532
              [% END %]
Lines 538-549 function checkMultiHold() { Link Here
538
        </tr>
571
        </tr>
539
      [% END %]
572
      [% END %]
540
    </table>
573
    </table>
574
	
575
	[% IF ( bookBranchTransferDenied ) %]
576
		<div class="dialog alert">
577
			Some books cannot be transferred to your pickup location. Please try another pickup location, or reserve fewer items at once.
578
		</div>
579
	[% END %]
541
580
542
  [% END %]<!-- /multi_hold -->
581
  [% END %]<!-- /multi_hold -->
543
582
544
    <fieldset class="action">
583
    <fieldset class="action">
545
        [% IF ( borrowernumber ) %]
584
        [% IF ( borrowernumber ) %]
546
            [% IF ( override_required ) %]
585
			[% IF ( bookBranchTransferDenied ) %]
586
				<input type="submit" disabled="disabled" value="Place hold" />
587
            [% ELSIF ( override_required ) %]
547
                <input type="submit" class="warning" value="Place hold" />
588
                <input type="submit" class="warning" value="Place hold" />
548
            [% ELSIF ( none_available ) %]
589
            [% ELSIF ( none_available ) %]
549
                <input type="submit" disabled="disabled" value="Place hold" />
590
                <input type="submit" disabled="disabled" value="Place hold" />
Lines 765-768 function checkMultiHold() { Link Here
765
806
766
</div>
807
</div>
767
</div>
808
</div>
809
[% IF ( multi_hold ) %]
810
<form id="reloadPickupLocationForm" name="reloadPickupLocationForm" method="post" action="request.pl">
811
	<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
812
    <input type="hidden" name="type" value="str8" />
813
	<input type="hidden" name="multi_hold" value="[% multi_hold %]"/>
814
	<input type="hidden" name="biblionumbers" id="multi_hold_bibs" value="[% biblionumbers %]"/>
815
	<input type="hidden" name="bad_bibs" id="bad_bibs" value=""/>
816
	<input type="hidden" name="request" value="any"/>
817
	<input type="hidden" name="pickup" value="fromJavascript" />
818
    [% FOREACH biblioloo IN biblioloop %]
819
        <input type="hidden" name="title_[% biblioloo.biblionumber %]" value="[% biblioloo.title |html %]"/>
820
        <input type="hidden" name="rank_[% biblioloo.biblionumber %]" value="[% biblioloo.rank %]"/>
821
    [% END %]
822
</form>
823
[% ELSE %]
824
<form id="reloadPickupLocationForm" name="reloadPickupLocationForm" method="post" action="request.pl">
825
	<input type="hidden" name="borrowernumber" value="[% borrowernumber %]" />
826
	<input type="hidden" name="biblionumber" value="[% biblionumber %]" />
827
	<input type="hidden" name="pickup" value="fromJavascript" />
828
</form>
829
[% END %]
830
768
[% INCLUDE 'intranet-bottom.inc' %]
831
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/koha-tmpl/opac-tmpl/prog/en/modules/opac-reserve.tt (-1 / +1 lines)
Lines 399-405 Link Here
399
                                        <li class="branch">
399
                                        <li class="branch">
400
                                            <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
400
                                            <label for="branch_[% bibitemloo.biblionumber %]">Pick up location:</label>
401
                                            [% UNLESS ( bibitemloo.holdable ) %]
401
                                            [% UNLESS ( bibitemloo.holdable ) %]
402
                                                <select onClick="alert('digg')" name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
402
                                                <select name="branch" id="branch_[% bibitemloo.biblionumber %]" disabled="disabled">
403
                                                    [% FOREACH branchloo IN bibitemloo.branchloop %]
403
                                                    [% FOREACH branchloo IN bibitemloo.branchloop %]
404
                                                        [% IF ( branchloo.selected ) %]
404
                                                        [% IF ( branchloo.selected ) %]
405
                                                            <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
405
                                                            <option value="[% branchloo.branchcode %]" selected="selected">[% branchloo.branchname %]</option>
(-)a/opac/opac-reserve.pl (-1 / +1 lines)
Lines 406-412 foreach my $biblioNum (@biblionumbers) { Link Here
406
    }
406
    }
407
407
408
	#Collect the amout of items that pass the CheckBranchTransferAllowed-check. This is needed to tell
408
	#Collect the amout of items that pass the CheckBranchTransferAllowed-check. This is needed to tell
409
	#  the Borrower if some or all Items cannot be transferred to the pickup location.
409
	#  the user if some or all Items cannot be transferred to the pickup location.
410
	my $branchTransferableItemsCount = 0;	
410
	my $branchTransferableItemsCount = 0;	
411
	
411
	
412
    $biblioLoopIter{itemLoop} = [];
412
    $biblioLoopIter{itemLoop} = [];
(-)a/reserve/placerequest.pl (-30 / +49 lines)
Lines 59-64 my $multi_hold = $input->param('multi_hold'); Link Here
59
my $biblionumbers = $multi_hold ? $input->param('biblionumbers') : ($biblionumber . '/');
59
my $biblionumbers = $multi_hold ? $input->param('biblionumbers') : ($biblionumber . '/');
60
my $bad_bibs = $input->param('bad_bibs');
60
my $bad_bibs = $input->param('bad_bibs');
61
61
62
my $transferOk; # Used to check if this reservation passes UseBranchTransferLimits check.
63
my $errorMessages; # Used to concatenate generated error messages from multiple biblios.
64
62
my %bibinfos = ();
65
my %bibinfos = ();
63
my @biblionumbers = split '/', $biblionumbers;
66
my @biblionumbers = split '/', $biblionumbers;
64
foreach my $bibnum (@biblionumbers) {
67
foreach my $bibnum (@biblionumbers) {
Lines 67-78 foreach my $bibnum (@biblionumbers) { Link Here
67
    $bibinfo{rank} = $input->param("rank_$bibnum");
70
    $bibinfo{rank} = $input->param("rank_$bibnum");
68
    $bibinfos{$bibnum} = \%bibinfo;
71
    $bibinfos{$bibnum} = \%bibinfo;
69
}
72
}
70
71
my $found;
73
my $found;
72
74
73
# if we have an item selectionned, and the pickup branch is the same as the holdingbranch
75
# if we have an item selectionned, and the pickup branch is the same as the holdingbranch
74
# of the document, we force the value $rank and $found .
76
# of the document, we force the value $rank and $found .
75
if ($checkitem ne ''){
77
if (defined $checkitem && $checkitem ne ''){
76
    $rank[0] = '0' unless C4::Context->preference('ReservesNeedReturns');
78
    $rank[0] = '0' unless C4::Context->preference('ReservesNeedReturns');
77
    my $item = $checkitem;
79
    my $item = $checkitem;
78
    $item = GetItem($item);
80
    $item = GetItem($item);
Lines 97-131 if ($type eq 'str8' && $borrower){ Link Here
97
            }
99
            }
98
        }
100
        }
99
        my $const;
101
        my $const;
100
102
		
101
	if ($checkitem ne ''){
103
		if (defined $checkitem && $checkitem ne ''){
102
		my $item = GetItem($checkitem);
104
			my $item = GetItem($checkitem);
103
        	if ($item->{'biblionumber'} ne $biblionumber) {
105
			
104
                	$biblionumber = $item->{'biblionumber'};
106
			#Making sure the biblionumber is present. Pretty robust! And possibly scary?
105
        	}
107
			if ($item->{'biblionumber'} ne $biblionumber) {
106
	}
108
				$biblionumber = $item->{'biblionumber'};
107
109
			}
108
110
			my $errorMsg;
109
111
			($transferOk, $errorMsg) = CheckBranchTransferAllowed($branch, $item->{holdingbranch}, $item, undef);
110
        if ($multi_hold) {
112
			if (! $transferOk) {
111
            my $bibinfo = $bibinfos{$biblionumber};
113
				$errorMessages .= $errorMsg . ', ';
112
            AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',[$biblionumber],
114
			}
113
                       $bibinfo->{rank},$startdate,$expirationdate,$notes,$bibinfo->{title},$checkitem,$found);
115
		}
114
        } else {
116
		else {
115
            if ($input->param('request') eq 'any'){
117
			#Final check if UseBranchTransferLimits validate for this Biblio.
116
                # place a request on 1st available
118
			$transferOk = CanBookBeReserved( $borrowernumber, $biblionumber, $branch );
117
                AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem,$found);
119
		}
118
            } elsif ($reqbib[0] ne ''){
120
119
                # FIXME : elsif probably never reached, (see top of the script)
121
120
                # place a request on a given item
122
		if ($transferOk) {
121
                AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'o',\@reqbib,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
123
		
122
            } else {
124
			if ($multi_hold) {
123
                AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
125
				my $bibinfo = $bibinfos{$biblionumber};
124
            }
126
				AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',[$biblionumber],
125
        }
127
						   $bibinfo->{rank},$startdate,$expirationdate,$notes,$bibinfo->{title},$checkitem,$found);
128
			}
129
			else {
130
				if ($input->param('request') eq 'any'){
131
					# place a request on 1st available
132
					AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem,$found);
133
				} elsif ($reqbib[0] ne ''){
134
					# FIXME : elsif probably never reached, (see top of the script)
135
					# place a request on a given item
136
					AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'o',\@reqbib,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
137
				} else {
138
					AddReserve($branch,$borrower->{'borrowernumber'},$biblionumber,'a',\@realbi,$rank[0],$startdate,$expirationdate,$notes,$title,$checkitem, $found);
139
				}
140
			}
141
		}
126
    }
142
    }
127
143
	if ($errorMessages) {
128
    if ($multi_hold) {
144
		print $input->header();
145
		print "The following branch transfer limits are blocked:\n".$errorMessages;
146
	}
147
    elsif ($multi_hold) {
129
        if ($bad_bibs) {
148
        if ($bad_bibs) {
130
            $biblionumbers .= $bad_bibs;
149
            $biblionumbers .= $bad_bibs;
131
        }
150
        }
(-)a/reserve/request.pl (-10 / +31 lines)
Lines 69-74 my $userbranch = ''; Link Here
69
if (C4::Context->userenv && C4::Context->userenv->{'branch'}) {
69
if (C4::Context->userenv && C4::Context->userenv->{'branch'}) {
70
    $userbranch = C4::Context->userenv->{'branch'};
70
    $userbranch = C4::Context->userenv->{'branch'};
71
}
71
}
72
my $pickupBranch = $input->param('pickup') ? $input->param('pickup') : $userbranch;
72
73
73
74
74
# Select borrowers infos
75
# Select borrowers infos
Lines 282-293 foreach my $biblionumber (@biblionumbers) { Link Here
282
        my $num_available = 0;
283
        my $num_available = 0;
283
        my $num_override  = 0;
284
        my $num_override  = 0;
284
        my $hiddencount   = 0;
285
        my $hiddencount   = 0;
286
		
287
		#Collect the amout of items that pass the CheckBranchTransferAllowed-check. This is needed to tell
288
		#  the user if some or all Items cannot be transferred to the pickup location.
289
		my $branchTransferableItemsCount = 0;
285
290
286
        $biblioitem->{description} =
291
        $biblioitem->{description} =
287
          $itemtypes->{ $biblioitem->{itemtype} }{description};
292
          $itemtypes->{ $biblioitem->{itemtype} }{description};
288
	if($biblioitem->{biblioitemnumber} ne $biblionumber){
293
		if($biblioitem->{biblioitemnumber} ne $biblionumber){
289
		$biblioitem->{hostitemsflag}=1;
294
			$biblioitem->{hostitemsflag}=1;
290
	}
295
		}	
291
        $biblioloopiter{description} = $biblioitem->{description};
296
        $biblioloopiter{description} = $biblioitem->{description};
292
        $biblioloopiter{itypename} = $biblioitem->{description};
297
        $biblioloopiter{itypename} = $biblioitem->{description};
293
        $biblioloopiter{imageurl} =
298
        $biblioloopiter{imageurl} =
Lines 311-320 foreach my $biblionumber (@biblionumbers) { Link Here
311
                  $branches->{ $item->{holdingbranch} }{branchname};
316
                  $branches->{ $item->{holdingbranch} }{branchname};
312
            }
317
            }
313
318
314
		if($item->{biblionumber} ne $biblionumber){
319
			if($item->{biblionumber} ne $biblionumber){
315
			$item->{hostitemsflag}=1;
320
				$item->{hostitemsflag}=1;
316
		        $item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
321
					$item->{hosttitle} = GetBiblioData($item->{biblionumber})->{title};
317
		}
322
			}
318
		
323
		
319
            #   add information
324
            #   add information
320
            $item->{itemcallnumber} = $item->{itemcallnumber};
325
            $item->{itemcallnumber} = $item->{itemcallnumber};
Lines 389-394 foreach my $biblionumber (@biblionumbers) { Link Here
389
                    }
394
                    }
390
                }
395
                }
391
            }
396
            }
397
			
398
			# UseBranchTransferLimits checking
399
			my ($transferOk, $errorMessage) = CheckBranchTransferAllowed( $pickupBranch, $item->{holdingbranch}, $item, undef );
400
			if ( ! $transferOk ) {
401
				$item->{cantreserve} = 1 ;
402
				$item->{branchTransferDenied} = 1 ;
403
			}
404
			else {
405
				$branchTransferableItemsCount++;
406
			}
407
			
392
408
393
            my $branch = C4::Circulation::_GetCircControlBranch($item, $borrowerinfo);
409
            my $branch = C4::Circulation::_GetCircControlBranch($item, $borrowerinfo);
394
410
Lines 417-423 foreach my $biblionumber (@biblionumbers) { Link Here
417
            }
433
            }
418
            elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) {
434
            elsif ( C4::Context->preference('AllowHoldPolicyOverride') ) {
419
435
420
# If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules
436
				# If AllowHoldPolicyOverride is set, it should override EVERY restriction, not just branch item rules
421
                $item->{override} = 1;
437
                $item->{override} = 1;
422
                $num_override++;
438
                $num_override++;
423
            }
439
            }
Lines 446-451 foreach my $biblionumber (@biblionumbers) { Link Here
446
            $biblioloopiter{warn} = 1;
462
            $biblioloopiter{warn} = 1;
447
            $biblioloopiter{none_avail} = 1;
463
            $biblioloopiter{none_avail} = 1;
448
        }
464
        }
465
		if ( $branchTransferableItemsCount == 0) {
466
			$biblioloopiter{suggestAnotherPickupLocation} = 1;
467
			$biblioitem->{suggestAnotherPickupLocation} = 1;
468
			$template->param( bookBranchTransferDenied => 1 );
469
		}
470
		
449
        $template->param( hiddencount => $hiddencount);
471
        $template->param( hiddencount => $hiddencount);
450
472
451
        push @bibitemloop, $biblioitem;
473
        push @bibitemloop, $biblioitem;
Lines 538-544 foreach my $biblionumber (@biblionumbers) { Link Here
538
    my $time = time();
560
    my $time = time();
539
561
540
    $template->param(
562
    $template->param(
541
                     branchloop  => GetBranchesLoop($userbranch),
563
                     branchloop  => GetBranchesLoop($pickupBranch),
542
                     time        => $time,
564
                     time        => $time,
543
                     fixedRank   => $fixedRank,
565
                     fixedRank   => $fixedRank,
544
                    );
566
                    );
545
- 

Return to bug 11020