From d5aa4b8e97d82d0fdf23ab4da74b4e4f6ebcbd9a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Mon, 8 Jul 2019 18:27:52 +0000 Subject: [PATCH] Bug 22209: Move stock rotation stage and item forms into modals This patch makes a number of interface changes to the Stock Rotation management interface: - "Add stage" and "Add items" forms are now triggered by clicking new buttons in the toolbar. - "Manage stages" and "Manage items" menu items have been added to a sidebar menu to be displayed when stages or items are being managed. - JavaScript has been added to move focus to the first form field in the modal when it is displayed. The "autofocus" attribute is not sufficent here because the modal is hidden by default. - Add messages to be shown when there are no items or stages to be displayed. - Correct "selected" attributes to use XHTML-style: selected="selected" (https://wiki.koha-community.org/wiki/Coding_Guidelines#HTML_Templates) To test, apply the patch and go to Tools -> Stock rotation. - Create a rota if you don't already have one. - Manage stages for your rota. - If your rota has no stages you should see a message along with an "Add stage" button. The button should trigger the "Add stage" modal. - Test the "Add stage" button in the toolbar. It should trigger a modal dialog containing the form for adding a new stage. The cursor focus should automatically be on the "library" field. - Submitting the form should correctly add the stage. - Verify that there is a new menu in the sidebar, "Manage stages" and "Manage items." - Manage items for your rota. - If your rota has no items you should see a message along with an "Add items" button. The button should trigger the "Add items" modal. - Test the "Add items" button in the toolbar. It should trigger a modal dialog containing the form for adding new items. The cursor focus should automatically be on the "barcode" field. - Submitting either a barcode or a file of barcodes should work correctly. - Verify that the new menu items are shown in the sidebar. Signed-off-by: Maryse Simard --- .../prog/en/includes/stockrotation-toolbar.inc | 2 + .../prog/en/modules/tools/stockrotation.tt | 187 ++++++++++++++------- 2 files changed, 126 insertions(+), 63 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/stockrotation-toolbar.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/stockrotation-toolbar.inc index 064c688..a75408f 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/stockrotation-toolbar.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/stockrotation-toolbar.inc @@ -5,8 +5,10 @@ [% END %] [% IF op == 'manage_stages' %] Edit rota + Add stage [% END %] [% IF op == 'manage_items' %] Edit rota + Add items [% END %] diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt index 6be2492..9c09223 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/tools/stockrotation.tt @@ -133,11 +133,11 @@ @@ -167,7 +167,7 @@ [% END %] -

Manage [% rota.title | html %] stages

+

Manage [% rota.title | html %] stages

-
-
- Add stage -
    -
  1. - - - Required -
  2. -
  3. - - - Required -
  4. -
-
-
- -
- - - -
+ + [% IF existing_stages.size > 0 %]
@@ -243,6 +256,13 @@ [% END %]
+ [% ELSE %] + +
+

This rota has no stages.

+

+
+ [% END %]

Return to rotas

@@ -269,7 +289,7 @@ - - - -
- Use a barcode file -
    -
  1. - - -
  2. -
-
-
- -
- - - - + + + [% IF items.count > 0 %] -

Manage items assigned to "[% rota.title | html %]"

@@ -434,6 +465,13 @@ [% END %]
+ [% ELSE %] + +
+

There are no items assigned to this rota.

+

+
+ [% END %]

Return to rotas

@@ -504,6 +542,26 @@
@@ -517,6 +575,9 @@ [% END %] -- 2.7.4