Bug 23158: keep on-site checkout info when using itemBarcodeFallbackSearch
authorFridolin Somers <fridolin.somers@biblibre.com>
Wed, 19 Jun 2019 11:42:16 +0000 (13:42 +0200)
committerMartin Renvoize <martin.renvoize@ptfs-europe.com>
Mon, 24 Jun 2019 16:14:35 +0000 (17:14 +0100)
When using preference itemBarcodeFallbackSearch one can enter a search term instead of a barcode in checkout form.
If on-site is selected this should be transmitted to itemBarcodeFallbackSearch form.

Test plan :
1) Enable system preferences "itemBarcodeFallbackSearch" and "OnSiteCheckouts"
2) Disable system preference "ConsiderOnSiteCheckoutsAsNormalCheckouts"
3) Go to a patron circulation page
4) Check "On-site checkout" in "Checkout settings"
5) Enter a barcode in checkout form and click on "Check out"
6) You see the checkout in table with red "(On-site checkout)"
7) Check "On-site checkout" in "Checkout settings"
8) Enter the title of a record in in checkout form and click on "Check out"
9) Click on "Checkout" on a line
10) You see the checkout in table with red "(On-site checkout)"

Signed-off-by: Arthur Bousquet <arthur.bousquet@inlibro.com>
Signed-off-by: Jonathan Druart <jonathan.druart@bugs.koha-community.org>
Signed-off-by: Martin Renvoize <martin.renvoize@ptfs-europe.com>

circ/circulation.pl
koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation.tt

index 72a3846..8fcb9bb 100755 (executable)
@@ -329,7 +329,10 @@ if ($patron) {
 if (@$barcodes) {
   my $checkout_infos;
   for my $barcode ( @$barcodes ) {
+
     my $template_params = { barcode => $barcode };
+    $template_params->{onsite_checkout} = $onsite_checkout;
+
     # always check for blockers on issuing
     my ( $error, $question, $alerts, $messages ) = CanBookBeIssued(
         $patron,
@@ -412,7 +415,6 @@ if (@$barcodes) {
                 $template_params->{getTitleMessageIteminfo} = $biblio->title;
                 $template_params->{getBarcodeMessageIteminfo} = $item->barcode;
                 $template_params->{NEEDSCONFIRMATION} = 1;
-                $template_params->{onsite_checkout} = $onsite_checkout;
                 $template_params->{auto_renew} = $session->param('auto_renew');
                 $confirm_required = 1;
             }
index 5ddcb78..41dec3b 100644 (file)
                                                                     <input type="hidden" name="stickyduedate" value="[% stickyduedate | html %]" />
                                                                     <input type="hidden" name="branch" value="[% branch | html %]" />
                                                                     <input type="hidden" name="barcode" value="[% book.barcode | html %]" />
+                                                                    <input type="hidden" name="onsite_checkout" value="[% onsite_checkout | html %]" />
                                                                     <button class="btn btn-default btn-xs" type="submit" name="x"><i class="fa fa-check"></i> Check out</button>
                                                                 </form>
                                                             </td>