From c62e53bb972bf8f200bbf3c693b3089ebc721fda Mon Sep 17 00:00:00 2001 From: =?utf8?q?Juhani=20Sepp=C3=A4l=C3=A4?= Date: Thu, 17 Jul 2014 11:45:06 +0300 Subject: [PATCH] Bug 11888: Random password suggestion does not work twice MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This patch adds a simple ajax-call to pull a new suggested password from the same perl script. To test: 1) Search for a patron and select "Change password" from the moremember-view. 2) In the member-password-view, click on "Click to fill with a randomly generated suggestion". 3) Confirm that you get a new suggested password and click the same link again. 4) Note that you do not get another suggested password - nothing is happening. 5) Apply patch. 6) Repeat steps 1-3 and confirm that you can keep clicking for a new suggested password. Patch works as expected. Signed-off-by: Marc Véron Signed-off-by: Katrin Fischer Passes all tests and QA script. Works as desribed. Signed-off-by: Tomas Cohen Arazi --- .../en/modules/members/member-password.tt | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt index d035a6dcaf..96544e0e7d 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/member-password.tt @@ -14,10 +14,24 @@ }); $("body").on('click', "#fillrandom",function(e) { e.preventDefault(); - $("#newpassword").after("").remove(); - $("#newpassword2").after("").remove(); + $.get("/cgi-bin/koha/members/member-password.pl?member=[% userid %]", function(response) { + var defaultnewpass = $(response).find("#defaultnewpassfield").val(); + $("#newpassword").after("").remove(); + $("#newpassword2").after("").remove(); + }); }); $("div.hint").eq(0).after(" "); + + $(document).ajaxStart(function () { + $("input[name^=newpassword]").hide(); + $("label[for=newpassword2]").hide(); + $(".hint:last").after($(".loading").show()); + }); + $(document).ajaxStop(function () { + $("input[name^=newpassword]").show(); + $("label[for=newpassword2]").show(); + $(".loading").hide(); + }); }); //]]> @@ -91,7 +105,8 @@ - + +
Processing...
[% INCLUDE 'circ-menu.inc' %]
-- 2.39.5