From 57a081c3021c1fe700e06b5b86dabdec7658ba0d Mon Sep 17 00:00:00 2001 From: Marcel de Rooy Date: Thu, 16 Oct 2014 16:47:06 +0200 Subject: [PATCH] Bug 13096: Template changes for memberentry in staff. Content-Type: text/plain; charset=utf-8 If AutoEmailOpacUser is enabled, Koha will send an email with account details to the patron at creation time. This report makes it possible to also send this mail when updating patron details, perhaps finishing the registration process at a later stage. This patch makes the needed template changes. It adds a checkbox when a patron is modified (not created/duplicated). It adds javascript to check this checkbox on a username or password change. The staff user can uncheck it again if needed. Test plan: Disable AutoEmailOpacUser. Test adding, duplicating and modifying a patron. You should not see the checkbox. Enable AutoEmailOpacUser. Test adding or duplicating. You should not see the checkbox. Test modifying a patron. If you edit username or password, the checkbox should automatically be checked. You can uncheck it again. --- .../prog/en/modules/members/memberentrygen.tt | 22 +++++++++++++++++-- 1 files changed, 19 insertions(+), 3 deletions(-) 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 56cc570..16bab2c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/members/memberentrygen.tt @@ -1,4 +1,5 @@ [% IF ( opduplicate ) %][% SET focusAction = "clearDupe" %][% END %] +[% USE Koha %] [% USE KohaDates %] [% INCLUDE 'doc-head-open.inc' %] Koha › Patrons › @@ -103,6 +104,12 @@ $(mytables).find(" li[data-category_code='']").show(); } + function checkAcctMail() { + if ( $("#mailacctdetails").length ) { // does it exist? + $("#mailacctdetails").prop('checked', true); + } + } + var MSG_SEPARATOR = _("Separator must be / in field %s"); var MSG_INCORRECT_DAY = _("Invalid day entered in field %s"); var MSG_INCORRECT_MONTH = _("Invalid month entered in field %s"); @@ -1076,7 +1083,7 @@ [% IF ( opduplicate ) %] <input type="text" id="userid" name="userid" size="20" value="" /> [% ELSE %] - <input type="text" id="userid" name="userid" size="20" value="[% userid %]" /> + <input type="text" id="userid" name="userid" size="20" value="[% userid %]" onchange="checkAcctMail();" /> [% END %] [% END %] @@ -1113,14 +1120,14 @@ [% IF ( opduplicate ) %] <input type="password" id="password" name="password" size="20" /> [% ELSE %] - <input type="password" id="password" name="password" size="20" value="****" /> + <input type="password" id="password" name="password" size="20" value="****" onchange="checkAcctMail();" /> [% END %] [% END %] [% ELSE %] [% IF ( NoUpdateLogin ) %] <input type="password" id="password" name="password" size="20" disabled="disabled" value="" /> [% ELSE %] - <input type="password" id="password" name="password" size="20" value="" /> + <input type="password" id="password" name="password" size="20" value="" onchange="checkAcctMail();" /> [% END %] [% END %] [% END %] @@ -1169,6 +1176,15 @@ [% END %] [% IF ( mandatorypassword ) %]<span class="required">Required</span>[% END %][% IF ( ERROR_password_mismatch ) %]<span class="required">Passwords do not match</span>[% END %] </li> + [% IF Koha.Preference('AutoEmailOpacUser') %] + [% IF opadd || opduplicate # will already trigger automatic mail %] + [% ELSE %] + <li> + <label for="mailacctdetails"> </label> + <input type="checkbox" id="mailacctdetails" name="mailacctdetails"> Mail account details to patron when saving this record</input> + </li> + [% END %] + [% END %] </ol> </fieldset> [% END # hide fieldset %][% END %] -- 1.7.7.6