Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

Merge branch 'master' into testing

  • Loading branch information...
commit fe96b52e3ddbb51a02c72aca10ef264b1f8608bb 2 parents 80362a7 + 9a5b7d8
Clay Fouts pjones9 authored
2  C4/Reports/Guided.pm
@@ -407,7 +407,7 @@ sub execute_query ($;$$$) {
407 407 if (defined($userlimit)) {
408 408 if ($offset + $limit > $userlimit ) {
409 409 $limit = $userlimit - $offset;
410   - } elsif ( ! $offset && $limit > $userlimit ) {
  410 + } elsif ( ! $offset && $limit < $userlimit ) {
411 411 $limit = $userlimit;
412 412 }
413 413 }
2  admin/circ_exceptions.pl
@@ -23,7 +23,6 @@
23 23 debug => 1,
24 24 });
25 25
26   -use Data::Dumper;
27 26
28 27 my $params = $input->Vars();
29 28 if ($params->{'update_settings'}) {
@@ -33,6 +32,7 @@
33 32 # rely on set_circ_exceptions to ignore the disabled ones
34 33 for my $context (keys %$circ_exceptions){
35 34 for my $code (keys %{$circ_exceptions->{$context}}){
  35 + $circ_exceptions->{$context}->{$code}->{'block'} = ($params->{$context.'--'.$code.'--block'}) ? 1 : 0;
36 36 $circ_exceptions->{$context}->{$code}->{'require_confirm'} = ($params->{$context.'--'.$code.'--require_confirm'}) ? 1 : 0;
37 37 $circ_exceptions->{$context}->{$code}->{'allow_override'} = ($params->{$context.'--'.$code.'--allow_override'}) ? 1 : 0;
38 38 }
43 circ/circulation.pl
@@ -34,6 +34,7 @@
34 34 use C4::Context;
35 35 use C4::Debug;
36 36 use CGI::Session;
  37 +use Data::Dumper;
37 38
38 39
39 40 my $query = new CGI;
@@ -70,6 +71,11 @@
70 71 my $proxy_borrowernumber = $query->param('proxy_borrowernumber');
71 72
72 73 my $barcode = $query->param('barcode') || '';
  74 +my $or_barcode = $query->param('or_barcode');
  75 +if ($or_barcode && !$barcode) {
  76 + $barcode = $or_barcode;
  77 +}
  78 +
73 79 $barcode =~ s/^\s*|\s*$//g; # remove leading/trailing whitespace
74 80
75 81 $barcode = barcodedecode($barcode) if( $barcode && (C4::Context->preference('itemBarcodeInputFilter') || C4::Context->preference('itembarcodelength')));
@@ -81,7 +87,6 @@
81 87
82 88 my $branch = C4::Context->userenv->{'branch'};
83 89 my $permissions = C4::Context->userenv->{'permissions'};
84   -use Data::Dumper;
85 90
86 91 my $borrowerslist;
87 92 my $no_patron_found;
@@ -98,6 +103,10 @@
98 103 }
99 104
100 105 my @new_overrides = ($query->param('overridden_blocks')) ? split(',',$query->param('overridden_blocks')) : ();
  106 +my $overridden_blocks = {};
  107 +for (@new_overrides) {
  108 + $overridden_blocks->{$_} = 1;
  109 +}
101 110 # my @new_confirmed = ($query->param('confirmed_blocks')) ? split(',',$query->param('confirmed_blocks')) : ();
102 111
103 112 # manage circ_session ( certain overrides should remain valid for the duration of a 'circ session',
@@ -109,7 +118,9 @@
109 118 $debug and warn "session overrides: " . join(',',@overrides);
110 119 my $patron_exceptions = get_circ_exceptions('patron');
111 120 # FIXME : This is inefficient way to ignore overrides that shouldn't be stored in session.
112   -if($borrowernumber && $session->param('circ_context') && $session->param('circ_context') eq 'circulation.pl' && $session->param('circ_borrower') == $borrowernumber){
  121 +if($borrowernumber && $session->param('circ_context')
  122 + && $session->param('circ_context') eq 'circulation.pl'
  123 + && $session->param('circ_borrower') == $borrowernumber){
113 124 # if we have new overrides, store them in session.
114 125 my $update_overrides = 0;
115 126 for my $new_or (@new_overrides) {
@@ -223,8 +234,10 @@
223 234 $exception->{'expiry'} = $expiry_date->output();
224 235 }
225 236 if($exception->{'block'}){
226   - unshift @$patron_block, $exception;
227   - push @missing_perms, $condition unless($exception->{'can_override'} || ! $exception->{'allow_override'});
  237 + unshift @{$patron_block}, $exception;
  238 + unless($exception->{'can_override'} || ! $exception->{'allow_override'}) {
  239 + push @missing_perms, $condition;
  240 + }
228 241 } else {
229 242 push @$patron_block, $exception;
230 243 }
@@ -295,6 +308,25 @@
295 308 $template->param( INVALID_DATE => $invalidduedate );
296 309 } else {
297 310 ( $status, $circ_exception ) = CanBookBeIssued( $borrower, $barcode, $datedue , undef );
  311 + if ($status->{block}) {
  312 + my $still_blocked = 0;
  313 + foreach ( keys %{$circ_exception} ) {
  314 + if ($overridden_blocks->{$_}) {
  315 + # delete $circ_exception->{$_};
  316 + $circ_exception->{$_}->{overridden} = 1;
  317 + }
  318 + else {
  319 + $still_blocked = 1;
  320 + }
  321 + }
  322 + if (!$still_blocked) {
  323 + $status->{block} = $still_blocked;
  324 + $status->{can_override} = 0;
  325 + $status->{allow_override} = 0;
  326 + $status->{require_confirm} = 0;
  327 + }
  328 +
  329 + }
298 330 }
299 331 # CIRC_BLOCK
300 332 # each array entry in CIRC_BLOCK will have keys block, allow_override, require_confirm, can_override.
@@ -363,8 +395,6 @@
363 395 ##################################################################################
364 396 # BUILD HTML
365 397 # show all reserves of this borrower, and the position of the reservation ....
366   -my $borrowercategory;
367   -my $category_type;
368 398 if ($borrowernumber) {
369 399
370 400 # Patron HOLDS
@@ -427,7 +457,6 @@
427 457 my @hourlyissues;
428 458 my @todaysissues;
429 459 my @previousissues;
430   - my $allowborrow;
431 460 my %issuetypes;
432 461 my $renewal_permission_on_hold = circ_exception_permissions('checkout','renewal_on_hold');
433 462 my $renewal_permission_too_many = circ_exception_permissions('checkout','renewals_exceed_maxrenewals');
25 koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tmpl
@@ -138,6 +138,7 @@ $.tablesorter.addParser({
138 138 $(".circ_override:checked").each(function(){ var or_str = $(this).attr('id'); overridden_blocks.push(or_str.substr(3)); });
139 139 $("#overridden_blocks").val( overridden_blocks.join(',') );
140 140 $("#circform input#barcode").val( confirm_barcode );
  141 + $("#or_barcode").val( confirm_barcode );
141 142 $("#circform").submit();
142 143 } else {
143 144 alert( _("Please confirm each block you wish to override") );
@@ -165,6 +166,8 @@ $.tablesorter.addParser({
165 166
166 167 function cancelCirc(){
167 168 $("#circform input#barcode").val('');
  169 + $("#circform or_barcode").val('');
  170 + $("#circform overridden_blocks").val( '' );
168 171 $("#circ_blocks").slideUp(); // TODO: test that there aren't blocks that need to be handled.
169 172 if( ! patron_block ){
170 173 toggle_circ(1);
@@ -382,11 +385,30 @@ most, but not all, of these are deprecated.
382 385 </ul>
383 386 </li>
384 387 <!-- /TMPL_IF -->
  388 + <!-- TMPL_IF NAME="BLOCK_item_issued_to_another" -->
  389 + <!-- TMPL_IF NAME="block" --><li class="circ_block"><!-- TMPL_ELSE --><li class="circ_alert"><!-- /TMPL_IF -->
  390 + <p class="circ-hlt">Item currently checked out to <!-- TMPL_VAR NAME="info" --></p>
  391 + <ul>
  392 + <!-- TMPL_IF NAME="allow_override" -->
  393 + <!-- TMPL_IF NAME="can_override" -->
  394 + <li>
  395 + <label for="OR_item_issued_to_another">Override Block?</label>
  396 + <input type="checkbox" class="circ_override" name="OR_item_issued_to_another" id="OR_item_issued_to_another" />
  397 + </li>
  398 + <!-- TMPL_ELSE -->
  399 + <li>You do not have permission to override this block.</li>
  400 + <!-- /TMPL_IF -->
  401 + <!-- /TMPL_IF -->
  402 + </ul>
  403 + </li>
  404 + <!-- /TMPL_IF -->
385 405
386 406 <!-- TMPL_IF NAME="ISSUED_TO_ANOTHER" --> <li>Item currently checked out to <!-- TMPL_VAR NAME="ISSUED_TO_ANOTHER" -->. Check in and check out?</li> <!-- /TMPL_IF -->
387 407 <!-- TMPL_IF NAME="PATRON_CANT" --><li>This patron can't check out this item per library circulation policy</i> <!-- /TMPL_IF -->
388 408 <!-- /TMPL_LOOP -->
389 409 </ul>
  410 +<!-- CSC TRY THIS -->
  411 +
390 412
391 413 <div class="dialog">
392 414 <!-- TMPL_IF NAME="allow_override_circ" -->
@@ -554,6 +576,9 @@ most, but not all, of these are deprecated.
554 576 <div class="yui-g">
555 577 <div class="yui-u first"> <!-- BARCODE ENTRY -->
556 578 <form method="post" action="/cgi-bin/koha/circ/circulation.pl" name="circform" id="circform">
  579 + <input type="hidden" name="borrowernumber" id="borrowernumber" value="<!-- TMPL_VAR NAME="borrowernumber" -->" />
  580 + <input type="hidden" name="or_barcode" id="or_barcode" value="" />
  581 + <input type="hidden" name="overridden_blocks" id="overridden_blocks" value="" />
557 582 <fieldset id="circ_circulation_issue">
558 583 <label for="barcode">Checking out to <!-- TMPL_VAR name="firstname" --> <!-- TMPL_VAR name="surname" --> (<!-- TMPL_VAR NAME="cardnumber" -->)
559 584 <!-- TMPL_IF NAME="CAN_user_circulate_checkout_via_proxy" -->

0 comments on commit fe96b52

Please sign in to comment.
Something went wrong with that request. Please try again.