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

(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/itemtypes.tt (-50 / +11 lines)
Lines 22-68 Data deleted Link Here
22
[% INCLUDE 'datatables.inc' %]
22
[% INCLUDE 'datatables.inc' %]
23
<script type="text/javascript">
23
<script type="text/javascript">
24
//<![CDATA[
24
//<![CDATA[
25
26
function isNotNull(f,noalert) {
27
	if (f.value.length ==0) {
28
		return false;
29
	}
30
	return true;
31
}
32
33
function isNum(v,maybenull) {
34
var n = new Number(v.value);
35
if (isNaN(n)) {
36
	return false;
37
	}
38
if (maybenull==0 && v.value=='') {
39
	return false;
40
}
41
return true;
42
}
43
44
function Check(f) {
45
	var ok=1;
46
	var _alertString="";
47
	var alertString2;
48
	if (f.itemtype.value.length==0) {
49
		_alertString += "\n- " + _("Itemtype missing");
50
	}
51
	if (!(isNotNull(window.document.Aform.description,1))) {
52
		_alertString += "\n- " + _("Description missing");
53
	}
54
	if ((!isNum(f.rentalcharge,0)) && f.rentalcharge.value.length > 0) {
55
		_alertString += "\n- " + _("Rental charge is not a number");
56
	}
57
	if (_alertString.length==0) {
58
		document.Aform.submit();
59
	} else {
60
		alertString2  = _("Form not submitted because of the following problem(s)");
61
		alertString2 += "\n------------------------------------------------------------------------------------\n";
62
		alertString2 += _alertString;
63
		alert(alertString2);
64
	}
65
}
66
     $(document).ready(function() {
25
     $(document).ready(function() {
67
        $('#icons').tabs();
26
        $('#icons').tabs();
68
        $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
27
        $("#table_item_type").dataTable($.extend(true, {}, dataTablesDefaults, {
Lines 73-78 function Check(f) { Link Here
73
            "aaSorting": [[ 2, "asc" ]],
32
            "aaSorting": [[ 2, "asc" ]],
74
            "iDisplayLength": 10
33
            "iDisplayLength": 10
75
        }));
34
        }));
35
        $( "#itemtypeentry" ).validate({
36
            rules: {
37
                itemtype: { required: true },
38
                description: { required: true },
39
                rentalcharge: { number: true }
40
            }
41
        });
76
     });
42
     });
77
//]]>
43
//]]>
78
</script>
44
</script>
Lines 124-130 Item types administration Link Here
124
  [% ELSE %]
90
  [% ELSE %]
125
      <h3>Add item type</h3>
91
      <h3>Add item type</h3>
126
  [% END %]
92
  [% END %]
127
<form action="[% script_name %]" name="Aform" method="post">
93
<form action="[% script_name %]" name="Aform" method="post" id="itemtypeentry">
128
  <input type="hidden" name="op" value="add_validate" />
94
  <input type="hidden" name="op" value="add_validate" />
129
    <input type="hidden" name="checked" value="0" />
95
    <input type="hidden" name="checked" value="0" />
130
		
96
		
Lines 137-151 Item types administration Link Here
137
     </li>
103
     </li>
138
  [% ELSE %]
104
  [% ELSE %]
139
      <li>
105
      <li>
140
          <label for="itemtype">Item type: </label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" class="focus" />
106
          <label for="itemtype" class="required">Item type: </label> <input type="text" id="itemtype" name="itemtype" size="10" maxlength="10" onblur="toUC(this)" required="required" /> <span class="required">Required</span>
141
      </li>
107
      </li>
142
  [% END %]
108
  [% END %]
143
      <li>
109
      <li>
144
      [% IF ( itemtype ) %]
110
          <label for="description" class="required">Description: </label><input type="text" id="description" name="description" size="48" value="[% description |html %]" required="required" /> <span class="required">Required</span></li>
145
          <label for="description">Description: </label><input type="text" id="description" name="description" size="48" value="[% description |html %]" class="focus" /></li>
146
      [% ELSE %]
147
          <label for="description">Description: </label><input type="text" id="description" name="description" size="48" value="[% description |html %]" /></li>
148
      [% END %]
149
     [% IF ( noItemTypeImages ) %]
111
     [% IF ( noItemTypeImages ) %]
150
	 <li><span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
112
	 <li><span class="label">Image: </span>Item type images are disabled. To enable them, turn off the <a href="/cgi-bin/koha/admin/preferences.pl?op=search&amp;searchfield=noItemTypeImages">noItemTypeImages system preference</a></li></ol>
151
	 [% ELSE %]</ol>
113
	 [% ELSE %]</ol>
Lines 242-248 Item types administration Link Here
242
    </fieldset>
204
    </fieldset>
243
205
244
    <fieldset class="action">
206
    <fieldset class="action">
245
      <input type="button" value="Save changes" onclick="Check(this.form)" />
207
      <input type="submit" value="Save changes" />
246
	  <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
208
	  <a href="/cgi-bin/koha/admin/itemtypes.pl" class="cancel">Cancel</a>
247
    </fieldset>
209
    </fieldset>
248
</form>
210
</form>
249
- 

Return to bug 11793