From a885447d01127dbe40b2fdea54c6b22d026e600a Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 31 May 2018 15:07:17 +0000 Subject: [PATCH] Bug 13680 - Items list on edit items page separates add items form from header and sidebar This is a proof of concept patch showing how I would improve this interface with a modal window for the item add form. The "views" menu is converted to a button menu. That goes against interface guidelines, but I don't see how else to handle it without taking up valuable screen real estate. This patch isn't complete--it doesn't handle edit operations. I just wanted to show the layout changes and how the "Add" button triggers the modal. Feeback welcome. --- koha-tmpl/intranet-tmpl/prog/css/staff-global.css | 6 + .../prog/en/includes/item-add-form.inc | 149 ++++++++++++++++++++ .../prog/en/modules/cataloguing/additem.tt | 155 ++++----------------- 3 files changed, 179 insertions(+), 131 deletions(-) create mode 100644 koha-tmpl/intranet-tmpl/prog/en/includes/item-add-form.inc diff --git a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css index c68bff6..e02b722 100644 --- a/koha-tmpl/intranet-tmpl/prog/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/css/staff-global.css @@ -2721,6 +2721,12 @@ button.closebtn{padding:0;cursor:pointer;background:transparent;border:0;-webkit width: 80%; } +.modal fieldset.rows { + border: 0; + background-color: transparent; + margin: 0; +} + .btn-group label, .btn-group select { font-size: 13px; diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/item-add-form.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/item-add-form.inc new file mode 100644 index 0000000..9b022c0 --- /dev/null +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/item-add-form.inc @@ -0,0 +1,149 @@ +
+ + + +
[%# /#cataloguing_additem_newitem %] \ No newline at end of file diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt index 6b86b21..a741ff5 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/additem.tt @@ -17,6 +17,10 @@ browser.show(); $(document).ready(function(){ + var view_menu = $("#menu"); + view_menu.hide(); + var menu_html = view_menu.find("ul").html(); + $("#item_edit_view_menu").append( menu_html ); // Remove the onclick event defined in browser.js, // otherwise the deletion confirmation will not work correctly @@ -133,10 +137,12 @@ function confirm_deletion() { [% Asset.css("css/addbiblio.css") %] [% INCLUDE 'select2.inc' %] - [% IF ( bidi ) %] @@ -159,6 +165,19 @@ function confirm_deletion() {
+
+
+ +
+
+ + +
+
+

Items for [% title |html %] [% IF ( author ) %] by [% author | html %][% END %] (Record #[% biblionumber %])

[% IF ( barcode_not_unique ) %]
Error saving item: Barcode must be unique.
[% END %] @@ -245,135 +264,9 @@ function confirm_deletion() { [% INCLUDE 'biblio-view-menu.inc' %]
-
-
- - [% IF (popup) %] - - [% END %] - - [% IF ( opisadd ) %] -

Add item [% IF (circborrowernumber) %](fast cataloging)[% END %]

- [% ELSE %] -

Edit Item #[% itemnumber %][% IF ( barcode ) %] / Barcode [% barcode %][% END %]

- [% END %] -
-
    - [% FOREACH ite IN item %] -
  1. - [% IF ( ite.mandatory ) %] - - [% ELSE %] - - [% END %] - [% SET mv = ite.marc_value %] - [% IF ( mv.type == 'hidden' ) %] - - [% ELSIF ( mv.type == 'select' ) %] - [% IF ( mv.readonly ) %] - - [% END %] - [% FOREACH aval IN mv.values %] - [% IF aval == mv.default %] - - [% ELSE %] - - [% END %] - [% END %] - - [% ELSIF ( mv.type == 'text_auth' ) %] - [% IF mv.readonly %] - - [% ELSE %] - - [% SET dopop = "Dopop('/cgi-bin/koha/authorities/auth_finder.pl?authtypecode=\"${mv.authtypecode}\"&index=${mv.id}','${mv.id}')" %] - ... - [% END %] - [% ELSIF ( mv.type == 'text_plugin' ) %] - [% IF mv.readonly %] - - [% ELSE %] - - [% IF ( mv.nopopup ) %] - ... - [% ELSE %] - ... - [% END %] - [%- mv.javascript -%] - [% END %] - [% ELSIF ( mv.type == 'text' ) %] - [% IF mv.readonly %] - - [% ELSE %] - - [% END %] - [% ELSIF ( mv.type == 'textarea' ) %] - [% IF mv.readonly %] - - [% ELSE %] - - [% END %] - [% END %] + [% INCLUDE 'item-add-form.inc' %] - - - - [% IF ( ite.repeatable ) %] - - Clone - - [% END %] - [% IF ( ite.mandatory ) %] Required[% END %] -
  2. - [% END %] -
-
- - - - -
[% IF ( opisadd ) %] - - - - - - - - - -
- - - Cancel -

The barcode you enter will be incremented for each additional item.

-
- - [% ELSE %] - - - - - - Cancel - [% END %]
- - [%# Fields for fast cataloging %] - - - - - [%# End fields for fast cataloging %] - - -
-
-- 2.1.4