From f1ab482894877227ee4c502b420c2d29ae5f17e3 Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Fri, 27 Apr 2012 08:57:16 -0400 Subject: [PATCH] Bug 8014 - On the patron entry form hide "restricted until" field if "Restricted: No" is checked Content-Type: text/plain; charset="UTF-8" This patch adds JavaScript to automatically hide the "Restricted unil" form field on the patron entry form if "Restricted: No" is selected. If "Restricted: Yes" is chosen the "Until:" field is shown and focus is given to it. The patch also adds a note, "(optional)" after the "Until:" field to make it clearer that a date is not required. To test, open a patron record and try moving the selection between "Restricted: No" and "Restricted: Yes." Confirm that the "Until:" field is shown and hidden as expected. Confirm that the restricted flag is correctly set or unset upon save, including setting the flag with or without a date. Signed-off-by: Jared Camins-Esakov --- koha-tmpl/intranet-tmpl/prog/en/js/members.js | 16 ++++++++ .../prog/en/modules/members/memberentrygen.tt | 38 ++++++++++---------- 2 files changed, 35 insertions(+), 19 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/js/members.js b/koha-tmpl/intranet-tmpl/prog/en/js/members.js index 3ed6195..cdc1442 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/js/members.js +++ b/koha-tmpl/intranet-tmpl/prog/en/js/members.js @@ -167,3 +167,19 @@ function Dopopguarantor(link) { var newin=window.open(link,'popup','width=600,height=400,resizable=no,toolbar=false,scrollbars=yes,top'); } + +$(document).ready(function(){ + if($("#yesdebarred").is(":checked")){ + $("#debarreduntil").show(); + } else { + $("#debarreduntil").hide(); + } + $("#yesdebarred,#nodebarred").change(function(){ + if($("#yesdebarred").is(":checked")){ + $("#debarreduntil").show(); + $("#datedebarred").focus(); + } else { + $("#debarreduntil").hide(); + } + }); +}); \ No newline at end of file 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 0cb2877..45a8731 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1344,25 +1344,25 @@ [% END %] - -
- - [% IF opduplicate %] - - [% ELSE %] - - [% END %] - Show Calendar - -
+ + + [% IF opduplicate %] + + [% ELSE %] + + [% END %] + Show Calendar + (optional) + +
  • [% IF ( opduplicate ) %] -- 1.7.2.5