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 209-216 function CheckAttributeTypeForm(f) { Link Here
209
        </li>
184
        </li>
210
        <li>
185
        <li>
211
            <label for="class">Class: </label>
186
            <label for="class">Class: </label>
212
            <select name="class">
187
            <select name="class" id="class">
213
                <option value="" />
188
                <option value=""></option>
214
                [% FOREACH class IN classes_val_loop %]
189
                [% FOREACH class IN classes_val_loop %]
215
                    [% IF class.authorised_value == category_class %]
190
                    [% IF class.authorised_value == category_class %]
216
                        <option value="[% class.authorised_value %]" selected="selected">
191
                        <option value="[% class.authorised_value %]" selected="selected">
Lines 228-240 function CheckAttributeTypeForm(f) { Link Here
228
    </ol>
203
    </ol>
229
  </fieldset>
204
  </fieldset>
230
  <fieldset class="action">
205
  <fieldset class="action">
231
    [% IF ( edit_attribute_type ) %]
206
      <input type="submit" value="Save" />
232
    <input type="button" value="Save"
233
           onclick="CheckAttributeTypeForm(this.form)" />
234
    [% ELSE %]
235
    <input type="button" value="Save"
236
           onclick="CheckAttributeTypeForm(this.form)" />
237
    [% END %]
238
    <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a>
207
    <a class="cancel" href="/cgi-bin/koha/admin/patron-attr-types.pl">Cancel</a>
239
  </fieldset>
208
  </fieldset>
240
</form>
209
</form>
241
- 

Return to bug 16299