Bugzilla – Attachment 20656 Details for
Bug 2720
Overdues which debar automatically should undebar automatically when returned
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 2720 [FOLLOW-UP] Overdues which debar automatically should undebar automatically
Bug-2720-FOLLOW-UP-Overdues-which-debar-automatica.patch (text/plain), 12.82 KB, created by
Kyle M Hall (khall)
on 2013-08-27 17:06:10 UTC
(
hide
)
Description:
Bug 2720 [FOLLOW-UP] Overdues which debar automatically should undebar automatically
Filename:
MIME Type:
Creator:
Kyle M Hall (khall)
Created:
2013-08-27 17:06:10 UTC
Size:
12.82 KB
patch
obsolete
>From 97cfbf6a39d5cebf0a654712eb017083966fa0df Mon Sep 17 00:00:00 2001 >From: Owen Leonard <oleonard@myacpl.org> >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 <kyle@bywatersolutions.com> >--- > .../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 @@ > <script type="text/javascript"> > //<![CDATA[ >- >- function confirm_remove_restriction() { >- return confirm(_("Remove restriction?")); >- } >- >+ $(document).ready(function(e){ >+ $("#remove_restriction").on("click",function(){ >+ return confirm(_("Remove restriction?")); >+ }); >+ 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){ >+ mrlink.show(); >+ mrform.hide(); >+ e.preventDefault(); >+ }); >+ }) > //]]> > </script> > > <div id="reldebarments"> >- [% UNLESS debarments %]<p>Patron is currently unrestricted.</p>[% END %] >- >- <table> >- <thead> >- <tr> >- <th>Type</th> >- <th>Comment</th> >- <th>Expiration</th> >- [% IF ( CAN_user_borrowers ) %] >- <th> </th> >- [% END %] >- </tr> >- </thead> >- >- <tbody> >- [% FOREACH d IN debarments %] >+ [% IF ( debarments.size < 1 ) %] >+ <p>Patron is currently unrestricted.</p> >+ [% ELSE %] >+ <table> >+ <thead> > <tr> >- <td>[% d.type %]</td> >- <td>[% d.comment %]</td> >- <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td> >- [% IF ( CAN_user_borrowers )%] >- <td> >- <a href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&borrower_debarment_id=[% d.borrower_debarment_id %]&action=del" onclick="return confirm_remove_restriction()"> >- Remove >- </a> >- </td> >- [% END %] >+ <th>Type</th> >+ <th>Comment</th> >+ <th>Expiration</th> >+ [% IF ( CAN_user_borrowers ) %] >+ <th> </th> >+ [% END %] > </tr> >- [% END %] >- </tbody> >- >- [% IF ( CAN_user_borrowers )%] >- <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl"> >- <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >- <input type="hidden" name="action" value="add" /> >- >- <tfoot> >+ </thead> >+ <tbody> >+ [% FOREACH d IN debarments %] > <tr> >- <td>MANUAL</td> >- <td><input type="text" name="comment" /></td> >- <td> >- <input name="expiration" id="expiration" size="10" readonly="readonly" value="" class="datepicker" /> >- <a href='#' onclick="document.getElementById('expiration').value='';">Clear Date</a> >- </td> >- <td> >- <input type="submit" value="Add restriction" /> >- </td> >+ <td>[% d.type %]</td> >+ <td>[% d.comment %]</td> >+ <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td> >+ [% IF ( CAN_user_borrowers )%] >+ <td> >+ <a id="remove_restriction" href="/cgi-bin/koha/members/mod_debarment.pl?borrowernumber=[% borrowernumber %]&borrower_debarment_id=[% d.borrower_debarment_id %]&action=del"> >+ Remove >+ </a> >+ </td> >+ [% END %] > </tr> >- </tfoot> >- </form> >- [% END %] >- </table> >+ [% END %] >+ </tbody> >+ </table> >+ [% END %] >+ <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p> >+ [% IF ( CAN_user_borrowers )%] >+ <form method="post" action="/cgi-bin/koha/members/mod_debarment.pl" class="clearfix"> >+ <input type="hidden" name="borrowernumber" value="[% borrowernumber %]" /> >+ <input type="hidden" name="action" value="add" /> >+ <fieldset class="rows" id="manual_restriction_form"> >+ <legend>Add manual restriction</legend> >+ <ol> >+ <li><label for="rcomment">Comment:</label> <input type="text" id="rcomment" name="comment" /></li> >+ <li><label for="rexpiration">Expiration:</label> <input name="expiration" id="rexpiration" size="10" readonly="readonly" value="" class="datepicker" /> >+ <a href='#' onclick="document.getElementById('expiration').value='';">Clear date</a></li> >+ </ol> >+ <fieldset class="action"><input type="submit" value="Add restriction" /> <a href="#" class="cancel" id="cancel_manual_restriction">Cancel</a></fieldset> >+ </fieldset> >+ </form> >+ [% END %] > </div> >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 @@ > > </ol> > </fieldset> >- >+ > <fieldset class="rows"> > <legend>Patron restrictions</legend> > >- [% UNLESS debarments %]<p>Patron is currently unrestricted.</p>[% END %] >- >- <table> >- <thead> >- <tr> >- <th>Type</th> >- <th>Comment</th> >- <th>Expiration</th> >- <th>Remove?</th> >- </tr> >- </thead> >- >- <tbody> >- [% FOREACH d IN debarments %] >+ [% IF ( debarments.size < 1 ) %] >+ <p>Patron is currently unrestricted.</p> >+ [% ELSE %] >+ <table> >+ <thead> > <tr> >- <td>[% d.type %]</td> >- <td>[% d.comment %]</td> >- <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td> >- <td> >- <input type="checkbox" id="debarment_[% d.borrower_debarment_id %]" name="remove_debarment" value="[% d.borrower_debarment_id %]" /> >- </td> >+ <th>Type</th> >+ <th>Comment</th> >+ <th>Expiration</th> >+ <th>Remove?</th> > </tr> >- [% END %] >- </tbody> >+ </thead> >+ >+ <tbody> >+ [% FOREACH d IN debarments %] >+ <tr> >+ <td>[% d.type %]</td> >+ <td>[% d.comment %]</td> >+ <td>[% IF d.expiration %] [% d.expiration | $KohaDates %] [% ELSE %] <i>Indefinite</i> [% END %]</td> >+ <td> >+ <input type="checkbox" id="debarment_[% d.borrower_debarment_id %]" name="remove_debarment" value="[% d.borrower_debarment_id %]" /> >+ </td> >+ </tr> >+ [% END %] >+ </tbody> >+ </table> >+ [% END %] >+ <p><a href="#" id="add_manual_restriction">Add manual restriction</a></p> >+ <fieldset id="manual_restriction_form"> >+ <input type="hidden" id="add_debarment" name="add_debarment" value="1" /> >+ <legend>Add manual restriction</legend> >+ <ol> >+ <li><label for="debarred_comment">Comment: </label><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').prop('checked', true);" /></li> >+ <li><label for="debarred_expiration">Expiration: </label><input name="debarred_expiration" id="debarred_expiration" size="10" readonly="readonly" value="" class="datepicker" onchange="$('#add_debarment').prop('checked', true);" /> >+ <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a></li> > >- <tfoot> >- <tr> >- <td> >- Add new >- <input type="checkbox" id="add_debarment" name="add_debarment" value="1" /> >- </td> >- <td><input type="text" id="debarred_comment" name="debarred_comment" onchange="$('#add_debarment').prop('checked', true);" /></td> >- <td> >- <input name="debarred_expiration" id="debarred_expiration" size="10" readonly="readonly" value="" class="datepicker" onchange="$('#add_debarment').prop('checked', true);" /> >- <a href='javascript:void(0)' onclick="$('#debarred_expiration').val('');">Clear date</a> >- </td> >- <td><a class="btn" href='javascript:void(0)' onclick="$('#debarred_expiration').val(''); $('#add_debarment').prop('checked', false); $('#debarred_comment').val('');">Clear new restriction</a></td> >- </tr> >- </tfoot> >- </table> >+ </ol> >+ <p> >+ <a class="cancel" id="cancel_manual_restriction" href="#" onclick="">Cancel</a> >+ </p> >+ </fieldset> > </fieldset> > [% END %] > >-- >1.7.2.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 2720
:
15045
|
15050
|
15051
|
15052
|
16669
|
18213
|
19401
|
19414
|
19418
|
19419
|
19420
|
19421
|
19755
|
20655
|
20656
|
20657
|
20658
|
21366
|
21367
|
21368
|
21369
|
21405
|
21406
|
21407
|
21408
|
21409
|
21410
|
25575
|
25578