View | Details | Raw Unified | Return to bug 17855
Collapse All | Expand All

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep1.tt (-2 / +2 lines)
Lines 65-76 Link Here
65
                 <ol>
65
                 <ol>
66
                     <li>
66
                     <li>
67
                        <label for="branchcode" class="required">Library code: </label>
67
                        <label for="branchcode" class="required">Library code: </label>
68
                        <input type="text"  pattern="^[A-Za-z]{0,10}$" title="Please enter 3 capital letters" name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode |html %]" class="required" required="required" />
68
                        <input type="text"  pattern="[0-9A-Za-z]{1,10}" title="Please enter up to 10 letters and/or numbers" name="branchcode" id="branchcode" size="10" maxlength="10" value="[% library.branchcode |html %]" class="required" required="required" />
69
                        <span class="required">Required</span>
69
                        <span class="required">Required</span>
70
                    </li>
70
                    </li>
71
                    <li>
71
                    <li>
72
                        <label for="branchname" class="required">Name: </label>
72
                        <label for="branchname" class="required">Name: </label>
73
                        <input type="text" pattern="[a-zA-Z ]+" title="Please enter a sentence of letters only" name="branchname" id="branchname" size="42" value="[% library.branchname |html %]" class="    required" required="required" style="width:200px;">
73
                        <input type="text" name="branchname" id="branchname" title="Please enter the name of your institution" size="42" value="[% library.branchname |html %]" class="    required" required="required" style="width:200px;">
74
                        <span class="required">Required</span>
74
                        <span class="required">Required</span>
75
                    </li>
75
                    </li>
76
                 </ol>
76
                 </ol>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep2.tt (-19 / +10 lines)
Lines 166-195 $(document).ready(function(){ Link Here
166
166
167
167
168
<script type="text/javascript">
168
<script type="text/javascript">
169
var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field."));
169
    var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field."));
170
var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date."));
170
    var MSG_ONE_ENROLLMENTPERIOD =(_("Please choose an enrollment period in months OR by date."));
171
var MSG_ONLY_ONE_ENROLLMENTPERIOD=(_("Please only choose one enrolment period."));
171
    var MSG_ONLY_ONE_ENROLLMENTPERIOD=(_("Please only choose one enrolment period."));
172
var MSG_DESCRIPTION_LETTERS_ONLY=(_("Please only enter letters."));
173
</script>
172
</script>
174
173
175
<script type="text/javascript">
174
<script type="text/javascript">
176
jQuery.validator.addMethod( "category_code_check", function(value,element){
175
jQuery.validator.addMethod( "category_code_check", function(value,element){
177
     var patt = /^[A-Za-z]{0,10}$/g;
176
     var patt = /[0-9A-Za-z]{1,10}$/g;
178
     if (patt.test(element.value)) {
177
     if (patt.test(element.value)) {
179
              return true;
178
              return true;
180
     } else {
179
     } else {
181
              return false;
180
              return false;
182
     }
181
     }
183
}, MSG_CATEGORYCODE_CHARS
182
   }, MSG_CATEGORYCODE_CHARS
184
);
185
jQuery.validator.addMethod( "letters_only", function(value,element){
186
        var patt =/^[A-Za-z ]{0,30}$/g;
187
        if (patt.test(element.value)){
188
            return true;
189
        } else {
190
            return false;
191
        }
192
    }, MSG_DESCRIPTION_LETTERS_ONLY
193
);
183
);
194
184
195
jQuery.validator.addMethod( "enrollment_period", function(){
185
jQuery.validator.addMethod( "enrollment_period", function(){
Lines 221-227 $(document).ready(function() { Link Here
221
                     },
211
                     },
222
                     description: {
212
                     description: {
223
                            required:true,
213
                            required:true,
224
                            letters_only: true
225
                     },
214
                     },
226
                     enrolmentperiod: {
215
                     enrolmentperiod: {
227
                           required: function(element){
216
                           required: function(element){
Lines 235-241 $(document).ready(function() { Link Here
235
                               return $("#enrolmentperiod").val() === "";
224
                               return $("#enrolmentperiod").val() === "";
236
                            },
225
                            },
237
                            enrollment_period: true,
226
                            enrollment_period: true,
238
                           // is_valid_date ($(#"enrolementperioddate").val());
239
                    },
227
                    },
240
                     dateofbirthrequired: {
228
                     dateofbirthrequired: {
241
                             digits: true
229
                             digits: true
Lines 254-259 $(document).ready(function() { Link Here
254
                    }
242
                    }
255
                },
243
                },
256
                messages: {
244
                messages: {
245
                      categorycode: {
246
                            required:  MSG_CATEGORYCODE_CHARS
247
                      },
257
                      enrolmentperiod: {
248
                      enrolmentperiod: {
258
                             required: MSG_ONE_ENROLLMENTPERIOD
249
                             required: MSG_ONE_ENROLLMENTPERIOD
259
                      },
250
                      },
Lines 319-331 $(document).ready(function() { Link Here
319
                <ol>
310
                <ol>
320
                    <li>
311
                    <li>
321
                        <label for="categorycode" class="required">Category code: </label>
312
                        <label for="categorycode" class="required">Category code: </label>
322
                        <input type="text" pattern="^[A-Za-z]{0,10}$" title="Please enter 1 or 2 capital letters" id="categorycode" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" />
313
                        <input type="text" pattern="[0-9A-Za-z]{1,10}" title="Please enter up to 10 letters and/or numbers" id="categorycode" name="categorycode" value="[% category.categorycode |html %]" size="10" maxlength="10" class="required" required="required" />
323
                        <span class="required">Required</span>
314
                        <span class="required">Required</span>
324
                    </li>
315
                    </li>
325
316
326
                    <li>
317
                    <li>
327
                        <label for="description" class="required">Description: </label>
318
                        <label for="description" class="required">Description: </label>
328
                        <input type="text"  pattern="[a-zA-Z ]+" title="Please enter a description sentence of letters only" name="description" size="40" maxlength="80" class="required" required="required" value="[% category.description |html %]" />
319
                        <input type="text" name="description" title="Please enter a description of the category" size="40" maxlength="80" class="required" required="required" value="[% category.description |html%]" />
329
                        <span class="required">Required</span>
320
                        <span class="required">Required</span>
330
                    </li>
321
                    </li>
331
322
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep3.tt (-44 / +9 lines)
Lines 15-23 Link Here
15
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
15
<script type="text/javascript" src="[% interface %]/lib/jquery/plugins/jquery.fixFloat.js"></script>
16
16
17
<script type="text/javascript">
17
<script type="text/javascript">
18
 var MSG_CATEGORYCODE_CHARS=(_("Please only enter letters into this field."));
18
     var MSG_PASSWORD_MISMATCH=(_("The entered passwords do not match, please rewrite them"));
19
 var MSG_PASSWORD_MISMATCH=(_("The entered passwords do not match, please rewrite them"));
19
</script>
20
 </script>
20
21
21
22
22
<script type="text/javascript">
23
<script type="text/javascript">
23
jQuery.validator.addMethod( "password_match", function(value,element){
24
jQuery.validator.addMethod( "password_match", function(value,element){
Lines 34-63 jQuery.validator.addMethod( "password_match", function(value,element){ Link Here
34
    },  MSG_PASSWORD_MISMATCH
35
    },  MSG_PASSWORD_MISMATCH
35
);
36
);
36
37
37
jQuery.validator.addMethod( "letters_only", function(value,element){
38
         var patt =/^[a-zA-Z ]+$/g;
39
         if (patt.test(element.value)){
40
             return true;
41
         } else {
42
             return false;
43
         }
44
     }, MSG_DESCRIPTION_LETTERS_ONLY
45
);
46
47
48
jQuery.validator.addMethod( "cardnumber_check", function(value,element){
49
          var patt =/[A-Za-z1-9 ]+$/g;
50
          if (patt.test(element.value)){
51
              return true;
52
          } else {
53
              return false;
54
          }
55
     }, MSG_CARDNUMBER_LETTERS_NUMBERS_ONLY
56
);
57
58
59
60
61
$(document).ready(function(){
38
$(document).ready(function(){
62
39
63
    $("#Submit").click(function(){
40
    $("#Submit").click(function(){
Lines 65-94 $(document).ready(function(){ Link Here
65
         rules: {
42
         rules: {
66
            surname: {
43
            surname: {
67
                required: true,
44
                required: true,
68
                letters_only: true
69
            },
45
            },
70
            firstname: {
46
            firstname: {
71
                required: true,
47
                required: true,
72
                letters_only: true
73
            },
48
            },
74
            cardnumber: {
49
            cardnumber: {
75
                required: true,
50
                required: true,
76
                cardnumber_check: true
77
            },
51
            },
78
           password: {
52
           password: {
79
                 password_match:true
53
                 password_match:true
80
            }
54
            }
81
         },
55
         },
82
         messages: {
56
         messages: {
83
            surname: {
84
                required: MSG_DESCRIPTION_LETTERS_ONLY
85
            },
86
            firstname: {
87
                required: MSG_DESCRIPTION_LETTERS_ONLY
88
            },
89
            cardnumber: {
90
                required: MSG_CARDNUMBER_LETTERS_NUMBERS_ONLY
91
            },
92
            password: {
57
            password: {
93
                 required: MSG_PASSWORD_MISMATCH
58
                 required: MSG_PASSWORD_MISMATCH
94
            },
59
            },
Lines 163-174 $(document).ready(function(){ Link Here
163
                    <h3>Patron identity</h3>
128
                    <h3>Patron identity</h3>
164
                        <li>
129
                        <li>
165
                            <label for="surname" class="required">Surname: </label>
130
                            <label for="surname" class="required">Surname: </label>
166
                            <input type="text"  pattern="[a-zA-Z- ]+" title="Please only enter letters in the surname field" id="surname" name="surname"  value="[% surname %]" class="required" required="required" />
131
                            <input type="text" id="surname" name="surname" title="Please only enter letters in the surname field" value="[% surname |html %]" class="required" required="required" />
167
                            <span class="required">Required</span>
132
                            <span class="required">Required</span>
168
                        </li>
133
                        </li>
169
                        <li>
134
                        <li>
170
                            <label for="firstname" class="required">First name: </label>
135
                            <label for="firstname" class="required">First name: </label>
171
                            <input  type="text"  pattern="[a-zA-Z ]+" title="Please only enter letters in the firstname field" name="firstname" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required">
136
                            <input  type="text" name="firstname" title="Please only enter letters in the first name field" id="firstname" size="20" value="[% firstname |html %]" class="required" required="required">
172
                            <span class="required">Required</span>
137
                            <span class="required">Required</span>
173
                        </li>
138
                        </li>
174
                    </ol>
139
                    </ol>
Lines 177-185 $(document).ready(function(){ Link Here
177
                        <li>
142
                        <li>
178
                            <label for="cardnumber" class="required">Card number: </label>
143
                            <label for="cardnumber" class="required">Card number: </label>
179
                            [% IF patrons && patrons > 1 %]
144
                            [% IF patrons && patrons > 1 %]
180
                            <input type="text" pattern="[A-Za-z1-9 ]+" title="Please only enter letters and numbers into the card number field" id="cardnumber" class="noEnterSubmit valid" name="cardnumber" value="[% newcardnumber %]" class="required" required="required">
145
                                <input type="text" id="cardnumber" title="Please enter a cardnumber" class="noEnterSubmit valid" name="cardnumber" value="[% newcardnumber | html %]" class="required" required="required">
181
                            [% ELSE %]
146
                            [% ELSE %]
182
                            <input type="text" pattern="[A-Za-z1-9 ]+" title="Please only enter letters and numbers into the card number field"id="cardnumber" name="cardnumber" value="[% cardnumber %]" class="required" required="required">
147
                                <input type="text" id="cardnumber" title="Please enter a cardnumber" name="cardnumber" value="[% cardnumber | html %]" class="required" required="required">
183
                            [% END %]
148
                            [% END %]
184
                            <span class="required">Required</span>
149
                            <span class="required">Required</span>
185
                        </li>
150
                        </li>
Lines 221-227 $(document).ready(function(){ Link Here
221
                        <li>
186
                        <li>
222
                            <input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] />
187
                            <input type="hidden" name="BorrowerMandatoryField" value = [% BorrowerMandatoryField %] />
223
                            <label for="userid" class="required">Username: </label>
188
                            <label for="userid" class="required">Username: </label>
224
                            <input type="text" name="userid" id ="userid" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this username field" size="20" value="[% userid %]" class="required" required="required" />
189
                            <input type="text" name="userid" id ="userid" size="20" title="Please only enter a username of letters and numbers" value="[% userid |html %]" class="required" required="required" />
225
                            <span class="required">Required</span>
190
                            <span class="required">Required</span>
226
                        </li>
191
                        </li>
227
                        <li>
192
                        <li>
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/onboarding/onboardingstep4.tt (-3 / +2 lines)
Lines 50-62 Link Here
50
                <ol>
50
                <ol>
51
                    <li>
51
                    <li>
52
                        <label for="itemtype" class="required">Item type code: </label>
52
                        <label for="itemtype" class="required">Item type code: </label>
53
                        <input type="text" name="itemtype" pattern="^[A-Za-z]{0,10}$" title="Please enter either 2 or 3 capital letters as the item type" id="itemtype" size="10" maxlength="10"  class="required" required="required" />
53
                        <input type="text" name="itemtype" pattern="[0-9A-Za-z]{1,10}" title="Please enter up to 10 letters and/or numbers" id="itemtype" size="10" maxlength="10"  class="required" required="required" value="[% itemtype.itemtype |html %]" />
54
                        <span class="required">Required</span>
54
                        <span class="required">Required</span>
55
                    </li>
55
                    </li>
56
56
57
                    <li>
57
                    <li>
58
                        <label for="description" class="required">Description: </label>
58
                        <label for="description" class="required">Description: </label>
59
                        <input type="text" name="description" pattern="[A-Za-z1-9 ]+" title="Please only enter letters or numbers into this item type description" id="description" size="42" value="[% itemtype.description |html %]" class="required" required="required">
59
                        <input type="text" name="description" id="description" title="Please only enter letters and/or numbers into this item type description" size="42" value="[% itemtype.description |html %]" class="required" required="required">
60
                        <span class="required">Required</span>
60
                        <span class="required">Required</span>
61
                    </li>
61
                    </li>
62
                </ol>
62
                </ol>
63
- 

Return to bug 17855