From 3da0f426535372a69aa6ddcc41b76ce451f724e1 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 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 Signed-off-by: Paul Poulain --- 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 3ed6195e8d..cdc1442980 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 119542f31f..41ce66d773 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 ) %] -- 2.39.5