From 0532bdc95616f80c24f935d1bb5875b2f5e267dd Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 5 Jul 2013 13:05:27 -0400 Subject: [PATCH] Bug 2720: (follow-up) improve data entry form for manual restrictions This follow-up to Bug 2720 makes some template changes which I think make the interface a little more consistent and streamlined. Instead of incorporating the manual entry form into the table it is broken out and follows standard form structure. This lets the table be hidden altogether if there are no existing restrictions. The manual entry form is hidden by default and shown when you click a link to add a manual restriction. These changes have been applied to both the include file used for circulation and patron detail and to the patron entry form template. To test, add and remove manual restrictions from the circulation page, the patron detail page, and the patron edit page. All operations should work correctly. Signed-off-by: Kyle M Hall Signed-off-by: Jonathan Druart Signed-off-by: Galen Charlton --- .../prog/en/includes/borrower_debarments.inc | 115 ++++++++++-------- .../prog/en/modules/members/memberentrygen.tt | 94 ++++++++------ 2 files changed, 118 insertions(+), 91 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc index 9cef519d6e..d85c19cf60 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/borrower_debarments.inc @@ -1,64 +1,73 @@
- [% UNLESS debarments %]

Patron is currently unrestricted.

[% END %] - - - - - - - - [% IF ( CAN_user_borrowers ) %] - - [% END %] - - - - - [% FOREACH d IN debarments %] + [% IF ( debarments.size < 1 ) %] +

Patron is currently unrestricted.

+ [% ELSE %] +
TypeCommentExpiration 
+ - - - - [% IF ( CAN_user_borrowers )%] - - [% END %] + + + + [% IF ( CAN_user_borrowers ) %] + + [% END %] - [% END %] - - - [% IF ( CAN_user_borrowers )%] - - - - - + + + [% FOREACH d IN debarments %] - - - - + + + + [% IF ( CAN_user_borrowers )%] + + [% END %] - - - [% END %] -
[% d.type %][% d.comment %][% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] Indefinite [% END %] - - Remove - - TypeCommentExpiration 
MANUAL - - Clear Date - - - [% d.type %][% d.comment %][% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] Indefinite [% END %] + + Remove + +
+ [% END %] + + + [% END %] +

Add manual restriction

+ [% IF ( CAN_user_borrowers )%] +
+ + +
+ Add manual restriction +
    +
  1. +
  2. + Clear date
  3. +
+
Cancel
+
+
+ [% END %]
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt index dad844c7a8..b1585564ef 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -48,6 +48,23 @@ form.submit(); } }); + + var mrform = $("#manual_restriction_form"); + var mrlink = $("#add_manual_restriction"); + mrform.hide(); + mrlink.on("click",function(e){ + $(this).hide(); + mrform.show(); + e.preventDefault(); + }); + $("#cancel_manual_restriction").on("click",function(e){ + $('#debarred_expiration').val(''); + $('#add_debarment').prop('checked', false); + $('#debarred_comment').val(''); + mrlink.show(); + mrform.hide(); + e.preventDefault(); + }); }); function clear_entry(node) { @@ -1171,50 +1188,51 @@ - +
Patron restrictions - [% UNLESS debarments %]

Patron is currently unrestricted.

[% END %] - - - - - - - - - - - - - [% FOREACH d IN debarments %] + [% IF ( debarments.size < 1 ) %] +

Patron is currently unrestricted.

+ [% ELSE %] +
TypeCommentExpirationRemove?
+ - - - - + + + + - [% END %] - + + + + [% FOREACH d IN debarments %] + + + + + + + [% END %] + +
[% d.type %][% d.comment %][% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] Indefinite [% END %] - - TypeCommentExpirationRemove?
[% d.type %][% d.comment %][% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] Indefinite [% END %] + +
+ [% END %] +

Add manual restriction

+
+ + Add manual restriction +
    +
  1. +
  2. + Clear date
  3. - - - - Add new - - - - - - Clear date - - Clear new restriction - - - +
+

+ Cancel +

+
[% END %] -- 2.39.5