From adcbbb3bac8c1b9d355eb51466018980dbfa051a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Juhani=20Sepp=C3=A4l=C3=A4?= Date: Thu, 17 Jul 2014 11:45:06 +0300 Subject: [PATCH] [PASSED QA] Bug 11888: Random password suggestion does not work twice MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 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. --- .../prog/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 d035a6d..96544e0 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' %]
-- 1.9.1