From 11f9630401336792beaf6fc6b88ea5fa5b0e9089 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 6 Jul 2020 15:28:11 +0000 Subject: [PATCH] Bug 23258: (follow-up) Batch holds template followup This patch revises the batch holds template to bring it up to date with current guidelines including corrected indentation, Bootstrap grid, terminology fixes ("hold" instead of "reserve") and JavaScript in the footer. Also changed: - Add specificity to page title and breadcrumbs - Add "Select all" and "Clear all" links to confirmation page - Add jQuery validation of the form, enforcing barcode and patron entry - Swith from "Batch holding" to "Batch place and cancel holds." - Made suggested change to avoid errors in the log: my $op = $input->param('op') // ''; - Fixed some other QA tool errors To test, apply the patch and test the process of placing and cancelling holds in batches: - By uploading a file of barcodes - By submitting barcodes in the textarea - Confirm that holds are placed and cancelled At each step of the process confirm that everything looks good and works properly. --- circ/batch_holding.pl | 6 +- .../prog/en/modules/circ/batch_holding.tt | 408 +++++++++++++-------- .../prog/en/modules/circ/circulation-home.tt | 5 +- 3 files changed, 263 insertions(+), 156 deletions(-) diff --git a/circ/batch_holding.pl b/circ/batch_holding.pl index dcbed73e27..400eb53ff4 100755 --- a/circ/batch_holding.pl +++ b/circ/batch_holding.pl @@ -28,11 +28,9 @@ use List::MoreUtils qw/uniq/; my $input = new CGI; -my $op = $input->param('op'); +my $op = $input->param('op') // ''; my @itemnumbers; -my @errors; - my ( $template, $loggedinuser, $cookie ) = get_template_and_user( { template_name => "circ/batch_holding.tt", @@ -104,6 +102,7 @@ if ($op eq "show"){ borrowernumber => $borrowernumber, branch => $branch, action => $action, + op => $op ); } @@ -146,6 +145,7 @@ elsif ($op eq "result") { holdloop => \@holdloop, cancel => $action eq "cancel" ? 1 : 0, place => $action eq "place" ? 1 : 0, + op => $op ); } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/batch_holding.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/batch_holding.tt index 9ecc04fb7a..c46e604d48 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/batch_holding.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/batch_holding.tt @@ -1,165 +1,271 @@ +[% USE Koha %] [% USE Branches %] +[% SET footerjs = 1 %] [% INCLUDE 'doc-head-open.inc' %] -Koha › Circulation › Batch holding + + Koha › + Circulation › + [% IF ( op == "show" ) %] + Batch place or cancel holds › + Confirm selection + [% ELSIF ( op == "result") %] + Batch place or cancel holds › + Results + [% ELSE %] + Batch place or cancel holds + [% END %] + [% INCLUDE 'doc-head-close.inc' %] - [% INCLUDE 'header.inc' %] [% INCLUDE 'cataloging-search.inc' %] - - -
- -
-
-[% IF show %] - [% IF ( notfoundbarcodes ) %] -

Warning, the following barcodes were not found:

- - - - - - [% FOREACH notfoundbarcode IN notfoundbarcodes %] - - [% END %] - -
Barcodes not found
[% notfoundbarcode.barcode %]
- [% END %] - - [% IF (holdloop) %] -

[% action %] holds on the following barcodes

-
-
    - [% FOREACH hold IN holdloop %] -
  • - [% IF hold.holdable %] - - [% hold.barcode %] - [% ELSE %] - [% hold.barcode %] (This item cannot be reserved) - [% END %] -
  • +
- - - - - -
- [% ELSE %] -

No reservation can be placed or cancelled.

- Batch place or cancel other items - [% END %] - -[% ELSIF result %] - [% IF (holdloop) %] -

Results

-
    - [% IF place %] - The following items have been reserved: -
      - [% FOREACH hold IN holdloop %] -
    • itemnumber [% hold.itemnumber %], reserve_id [% hold.reserve_id %]
    • +
+ +
+
+ [% IF Koha.Preference('CircSidebar') %] +
+ [% ELSE %] +
[% END %] - - [% END %] - [% IF cancel %] - The following reservations were cancelled: -
    - [% FOREACH hold IN holdloop %] -
  • itemnumber [% hold.itemnumber %]
  • +
    + + [% IF show %] + [% IF ( notfoundbarcodes ) %] +

    Warning, the following barcodes were not found:

    + + + + + + + [% FOREACH notfoundbarcode IN notfoundbarcodes %] + + [% END %] + +
    Barcodes not found
    [% notfoundbarcode.barcode | html %]
    + [% END #/IF notfoundbarcodes %] + + [% IF (holdloop) %] + [% IF ( action == "place" ) %] +

    Place holds on the following barcodes

    + [% ELSE %] +

    Cancel holds on the following barcodes

    + [% END %] + + + +
    + + + [% FOREACH hold IN holdloop %] + + + + [% END %] + +
    + [% IF hold.holdable %] + + [% ELSE %] + + [% hold.barcode | html %] (This item cannot be placed on hold) + [% END %] +
    + + + + +
    + + Cancel +
    +
    + [% ELSE %] +

    No holds can be placed or cancelled.

    + Batch place or cancel other holds + [% END # /IF holdloop %] + + [% ELSIF result %] + + [% IF (holdloop) %] +

    Results

    + [% IF place %] + The following items have been placed on hold: +
      + [% FOREACH hold IN holdloop %] +
    • itemnumber [% hold.itemnumber | html %], reserve_id [% hold.reserve_id | html %]
    • + [% END %] +
    + [% END %] + [% IF cancel %] + The following holds were cancelled: +
      + [% FOREACH hold IN holdloop %] +
    • itemnumber [% hold.itemnumber | html %]
    • + [% END %] +
    + [% END %] + [% ELSE %] +

    No holds could be placed or cancelled.

    + [% END %] + Batch place or cancel other holds + + [% ELSE %] + +

    Batch place or cancel holds

    +
    +
    + Use a barcode file + + +
    + +
    + Or scan items one by one +
      +
    1. + + +
    2. +
    +
    + +
    + Place hold for +
      +
    1. + + +
      + + Required +
      +
      + Enter patron card number or partial name +
      +
    2. +
    3. + + +
    4. +
    +
    + +
    + Action +
      +
    1. + + +
    2. +
    3. + + +
    4. +
    +
    + +
    + + +
    +
    + [% END # /IF show %] + +
    +
+ [% IF Koha.Preference('CircSidebar') %] +
+ +
[% END %] - - [% END %] - - [% ELSE %] -

No reservation could be placed or cancelled.

- [% END %] - Batch place or cancel other items -[% ELSE %] -

Batch holding

-
-
- Use a barcode file - -
-
- Or scan items one by one -
    -
  1. - - -
  2. -
-
-
- Holding informations -
    -
  1. - - -
    - -
    -
  2. -
  3. - - - -
  4. -
-
-
- Action -
    -
  1. - - -
  2. -
  3. - - -
  4. -
-
- - -
+
+ +[% MACRO jsinclude BLOCK %] + [% END %] -
-
-
[% INCLUDE 'intranet-bottom.inc' %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt index a16f72ca27..6f75fdff65 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/circ/circulation-home.tt @@ -9,7 +9,8 @@ [% INCLUDE 'header.inc' %] [% INCLUDE 'circ-search.inc' %] - + -- 2.11.0