From a05addd437241efd9033bd27c71c5a9b887040fb 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] Overdues which debar automatically should undebar automatically 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 --- .../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 9cef519..d85c19c 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 a143c9d..d97fe12 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -39,6 +39,23 @@ [% END %] $("#dateofbirth").datepicker({ maxDate: "-1D" }); $("#entryform").preventDoubleFormSubmit(); + + 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) { @@ -1163,50 +1180,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 %] -- 1.7.2.5