Bug 11877 - Eliminate use of deprecated jQuery .live() method
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / member-password.tt
1 [% INCLUDE 'doc-head-open.inc' %]
2 <title>Koha &rsaquo; Patrons &rsaquo; [% IF ( newpassword ) %]Password updated [% ELSE %]Update password for [% surname %], [% firstname %][% END %]</title>
3 [% INCLUDE 'doc-head-close.inc' %]
4 <script type="text/JavaScript">
5 //<![CDATA[
6     $(document).ready(function() {
7         $("#changepasswordf").submit(function(){
8             if($("input[name='newpassword']").val() != $("input[name='newpassword2']").val()){
9                 alert(_("Passwords do not match"));
10                 return false;
11             } else {
12                 return true;
13             }
14         });
15         $("body").on('click', "#fillrandom",function(e) {
16             e.preventDefault();
17             $("#newpassword").after("<input type=\"text\" name=\"newpassword\" value=\"[% defaultnewpassword %]\">").remove();
18             $("#newpassword2").after("<input type=\"text\" name=\"newpassword2\" value=\"[% defaultnewpassword %]\">").remove();
19         });
20         $("div.hint").eq(0).after(" <div class=\"hint\"><a href=\"#\" id=\"fillrandom\">"+_("Click to fill with a randomly generated suggestion. ")+"<strong>"+_("Passwords will be displayed as text")+"</strong>.</a></div>");
21     });
22 //]]>
23 </script>
24 </head>
25 <body id="pat_member-password" class="pat">
26 [% INCLUDE 'header.inc' %]
27 [% INCLUDE 'patron-search.inc' %]
28
29 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>  &rsaquo; <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">[% firstname %] [% surname %]</a> &rsaquo; [% IF ( newpassword ) %]Password Updated[% ELSE %]Change username and/or password[% END %]</div>
30
31 <div id="doc3" class="yui-t2">
32
33    <div id="bd">
34         <div id="yui-main">
35         <div class="yui-b">
36 [% INCLUDE 'members-toolbar.inc' %]
37
38 [% IF ( newpassword ) %]
39 <h1>Password Updated</h1>
40
41 [% ELSE %]
42
43 <form method="post" id="changepasswordf" action="/cgi-bin/koha/members/member-password.pl">
44 <input type="hidden" name="destination" value="[% destination %]" />
45 <input type="hidden" name="cardnumber" value="[% cardnumber %]" />
46 <input type="hidden" name="borrowernumber" id="borrowernumber" value="[% borrowernumber %]" />
47         [% IF ( errormsg ) %]
48                 <div class="dialog alert">
49                 <h4>The following errors have occurred:</h4>
50                 <ul>
51                 [% IF ( BADUSERID ) %]
52         <li>You have entered a username that already exists. Please choose another one.</li>
53                 [% END %]
54                 [% IF ( SHORTPASSWORD ) %]
55                 <li><strong>The password entered is too short</strong>. Password must be at least [% minPasswordLength %] characters.</li>
56                 [% END %]
57                 [% IF ( NOPERMISSION ) %]
58                 <li>You do not have permission to edit this patron's login information.</li>
59                 [% END %]
60                 [% IF ( NOMATCH ) %]
61                 <li><strong>The passwords entered do not match</strong>. Please re-enter the new password.</li>
62                 [% END %]
63                 </ul>
64                 </div>
65         [% END %]
66
67
68     <fieldset class="brief"><legend>Change username and/or password for [% firstname %] [% surname %]</legend>
69         <ol>
70     <li><label for="newuserid">New username:</label>
71         <input type="hidden" name="member" value="[% borrowernumber %]" /><input type="text" id="newuserid" name="newuserid" size="20" value="[% userid %]" /></li>
72     <li><label for="newpassword">New password:</label>
73     <div class="hint">Koha cannot display existing passwords. Leave the field blank to leave password unchanged.</div>
74         [% IF ( minPasswordLength ) %]<div class="hint">Minimum password length: [% minPasswordLength %]</div>[% END %]
75         [% IF ( NOMATCH ) %]
76         <input name="newpassword"  id="newpassword" type="password" size="20" class="focus" />
77         <input name="newpassword" id="newpassword_random" readonly="readonly" disabled="disabled" type="hidden" />
78         [% ELSE %]
79         <input name="newpassword"  id="newpassword" type="password" size="20" />
80         <input name="newpassword" readonly="readonly" disabled="disabled" type="hidden" />
81         [% END %]
82         </li>
83     <li><label for="newpassword2">Confirm new password:</label>
84         <input name="newpassword2"  id="newpassword2" type="password" size="20" />
85         <input name="newpassword2" id="newpassword2_random" readonly="readonly" disabled="disabled" type="hidden" />
86         </li>
87         </ol>
88 </fieldset>
89         <fieldset class="action"><input type="submit" value="Save" /> <a class="cancel" href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% borrowernumber %]">Cancel</a></fieldset>
90 </form>[% END %]
91
92 </div>
93 </div>
94
95 <div class="yui-b">
96 [% INCLUDE 'circ-menu.inc' %]
97 </div>
98 </div>
99 [% INCLUDE 'intranet-bottom.inc' %]