From 97cfbf6a39d5cebf0a654712eb017083966fa0df 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 8141716..25bef0e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -35,6 +35,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) { @@ -1296,50 +1313,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