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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/patron-attr-types.tt (-42 / +10 lines)
Lines 20-51 $(document).ready(function() { Link Here
20
        $("#branches option:first").attr("selected", "selected");
20
        $("#branches option:first").attr("selected", "selected");
21
    }
21
    }
22
} );
22
} );
23
24
function DoCancel(f) {
25
  f.op.value='';
26
  document.Aform.submit();
27
}
28
29
function CheckAttributeTypeForm(f) {
30
    var ok=1;
31
    var _alertString="";
32
    var alertString2;
33
    if (f.code.value.length==0) {
34
        _alertString += "\n- " + _("Patron attribute type code missing");
35
    }
36
    if (f.description.value.length==0) {
37
        _alertString += "\n- " + _("Description missing");
38
    }
39
    if (_alertString.length==0) {
40
        document.Aform.submit();
41
    } else {
42
        alertString2  = _("Form not submitted because of the following problem(s)");
43
        alertString2 += "\n------------------------------------------------------------------------------------\n";
44
        alertString2 += _alertString;
45
        alert(alertString2);
46
    }
47
}
48
49
//]]>
23
//]]>
50
</script>
24
</script>
51
</head>
25
</head>
Lines 87-93 function CheckAttributeTypeForm(f) { Link Here
87
    &mdash; one with that code already exists.
61
    &mdash; one with that code already exists.
88
</div>
62
</div>
89
[% END %]
63
[% END %]
90
<form action="[% script_name %]" name="Aform" method="post">
64
<form action="[% script_name %]" class="validated" method="post">
91
  <input type="hidden" name="op" value="[% confirm_op %]" />
65
  <input type="hidden" name="op" value="[% confirm_op %]" />
92
  <fieldset class="rows">
66
  <fieldset class="rows">
93
    <ol>
67
    <ol>
Lines 97-109 function CheckAttributeTypeForm(f) { Link Here
97
            <input type="hidden" name="code" value="[% code |html %]" />
71
            <input type="hidden" name="code" value="[% code |html %]" />
98
            [% code |html %]
72
            [% code |html %]
99
          [% ELSE %]
73
          [% ELSE %]
100
		  <label for="code">Patron attribute type code: </label>
74
              <label for="code" class="required">Patron attribute type code: </label>
101
            <input type="text" id="code" name="code"  size="10" maxlength="10" />
75
              <input type="text" id="code" name="code" required="required" class="required" size="10" maxlength="10" />
76
              <span class="required">Required</span>
102
          [% END %]
77
          [% END %]
103
       </li>
78
       </li>
104
       <li><label for="description">Description: </label>
79
       <li><label for="description" class="required">Description: </label>
105
           <input type="text" id="description" name="description" size="50" maxlength="250" 
80
           <input type="text" id="description" name="description" required="required" class="required" size="50" maxlength="250" value="[% description |html %]" />
106
                  value="[% description |html %]" />
81
           <span class="required">Required</span>
107
       </li>
82
       </li>
108
       <li><label for="repeatable">Repeatable: </label>
83
       <li><label for="repeatable">Repeatable: </label>
109
            [% IF ( repeatable_checked ) %]
84
            [% IF ( repeatable_checked ) %]
Lines 217-224 function CheckAttributeTypeForm(f) { Link Here
217
        </li>
192
        </li>
218
        <li>
193
        <li>
219
            <label for="class">Class: </label>
194
            <label for="class">Class: </label>
220
            <select name="class">
195
            <select name="class" id="class">
221
                <option value="" />
196
                <option value=""></option>
222
                [% FOREACH class IN classes_val_loop %]
197
                [% FOREACH class IN classes_val_loop %]
223
                    [% IF class.authorised_value == category_class %]
198
                    [% IF class.authorised_value == category_class %]
224
                        <option value="[% class.authorised_value %]" selected="selected">
199
                        <option value="[% class.authorised_value %]" selected="selected">
Lines 236-248 function CheckAttributeTypeForm(f) { Link Here
236
    </ol>
211
    </ol>
237
  </fieldset>
212
  </fieldset>
238
  <fieldset class="action">
213
  <fieldset class="action">
239
    [% IF ( edit_attribute_type ) %]
214
      <input type="submit" value="Save" />
240
    <input type="button" value="Save"
241
           onclick="CheckAttributeTypeForm(this.form)" />
242
    [% ELSE %]
243
    <input type="button" value="Save"
244
           onclick="CheckAttributeTypeForm(this.form)" />
245
    [% END %]
246
    <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a>
215
    <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a>
247
  </fieldset>
216
  </fieldset>
248
</form>
217
</form>
249
- 

Return to bug 16299