Line 0
Link Here
|
|
|
1 |
[% INCLUDE 'doc-head-open.inc' %] |
2 |
<title>Koha › Acquisitions › Manage new fields for order lines |
3 |
[% IF op == "list" %] › List of fields |
4 |
[% ELSIF op == "add_form" %] |
5 |
[% IF field %] › Modify field |
6 |
[% ELSE %] › Add field |
7 |
[% END %] |
8 |
[% END %] |
9 |
</title> |
10 |
[% INCLUDE 'doc-head-close.inc' %] |
11 |
<link rel="stylesheet" type="text/css" href="[% themelang %]/css/datatables.css" /> |
12 |
[% INCLUDE "datatables.inc" %] |
13 |
<script type="text/javascript"> |
14 |
//<![CDATA[ |
15 |
$(document).ready(function(){ |
16 |
|
17 |
$("#fieldst").dataTable($.extend(true, {}, dataTablesDefaults, { |
18 |
'bAutoWidth': false, |
19 |
'sDom': 't<"bottom pager"ilpf>', |
20 |
'sPaginationType': 'four_button', |
21 |
'aLengthMenu': [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]], |
22 |
'iDisplayLength': 20, |
23 |
'aaSorting': [[ 0, "asc" ]], |
24 |
})); |
25 |
|
26 |
$(".confirmdelete").click(function(){ |
27 |
return confirm(_("Are you sure you want to delete this field?")); |
28 |
}); |
29 |
|
30 |
$("#add_field").on('submit', function(){ |
31 |
if ( $("#marcfield").val().length > 0 |
32 |
&& $("select[name='authorised_value_category']" ).val().length > 0 ) { |
33 |
alert("You cannot select an authorised value category and a marcfield"); |
34 |
return false; |
35 |
} |
36 |
return true; |
37 |
}); |
38 |
}); |
39 |
//]]> |
40 |
</script> |
41 |
</head> |
42 |
|
43 |
<body id="acq_add_fields" class="acq"> |
44 |
[% INCLUDE 'header.inc' %] |
45 |
[% INCLUDE 'acquisitions-search.inc' %] |
46 |
|
47 |
<div id="breadcrumbs"> |
48 |
<a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> › Manage new fields for order lines |
49 |
</div> |
50 |
|
51 |
<div id="doc3" class="yui-t2"> |
52 |
<div id="bd"> |
53 |
<div id="yui-main"> |
54 |
<div class="yui-b"> |
55 |
[% IF op == 'list' %] |
56 |
<div id="toolbar" class="btn-toolbar"> |
57 |
<a class="btn btn-small" id="newfields" href="/cgi-bin/koha/acqui/add_order_fields.pl?op=add_form"><i class="icon-plus"></i> New field</a> |
58 |
</div> |
59 |
[% END %] |
60 |
|
61 |
[% IF messages %] |
62 |
[% FOR message IN messages %] |
63 |
[% IF message.code == 'insert' %] |
64 |
[% IF message.number > 0 %] |
65 |
<div class="dialog message">The field has been inserted</div> |
66 |
[% ELSE %] |
67 |
<div class="dialog alert">The field has not been inserted (name still exist?)</div> |
68 |
[% END %] |
69 |
[% ELSIF message.code == 'update' %] |
70 |
[% IF message.number > 0 %] |
71 |
<div class="dialog message">The field has been updated</div> |
72 |
[% ELSE %] |
73 |
<div class="dialog alert">The field has not been updated (name still exist?)</div> |
74 |
[% END %] |
75 |
[% ELSIF message.code == 'delete' %] |
76 |
[% IF message.number > 0 %] |
77 |
<div class="dialog message">The field has been deleted</div> |
78 |
[% ELSE %] |
79 |
<div class="dialog alert">The field has not been deleted</div> |
80 |
[% END %] |
81 |
[% END %] |
82 |
[% END %] |
83 |
[% END %] |
84 |
|
85 |
[% IF op == 'list' %] |
86 |
<h3>Additional fields for order lines</h3> |
87 |
[% IF fields %] |
88 |
<table id="fieldst"> |
89 |
<thead> |
90 |
<tr> |
91 |
<th>Name</th> |
92 |
<th>Authorised value category</th> |
93 |
<th>Marc field</th> |
94 |
<th>Actions</th> |
95 |
</tr> |
96 |
</thead> |
97 |
<tbody> |
98 |
[% FOR field IN fields %] |
99 |
<tr> |
100 |
<td>[% field.name %]</td> |
101 |
<td>[% field.authorised_value_category %]</td> |
102 |
<td>[% field.marcfield %]</td> |
103 |
<td> |
104 |
<a href="/cgi-bin/koha/acqui/add_order_fields.pl?op=add_form&field_id=[% field.id %]" title="Edit this field">Edit</a> |
105 |
<a class="confirmdelete" href="/cgi-bin/koha/acqui/add_order_fields.pl?op=delete&field_id=[% field.id %]" title="Delete this field">Delete</a> |
106 |
</td> |
107 |
</tr> |
108 |
[% END %] |
109 |
</tbody> |
110 |
</table> |
111 |
[% ELSE %] |
112 |
There is no field defined. |
113 |
[% END %] |
114 |
[% ELSIF op == 'add_form' %] |
115 |
[% IF field %] |
116 |
<h3>Modify field</h3> |
117 |
[% ELSE %] |
118 |
<h3>Add field</h3> |
119 |
[% END %] |
120 |
<form action="/cgi-bin/koha/acqui/add_order_fields.pl" name="add_form" id="add_field" method="post"> |
121 |
<fieldset class="rows"> |
122 |
<ol> |
123 |
<li> |
124 |
<label for="name" class="required">Name: </label> |
125 |
<input type="text" name="name" id="name" value="[% field.name | html %]" /> |
126 |
</li> |
127 |
<li> |
128 |
<label for="av">Authorised value category: </label> |
129 |
<select name="authorised_value_category"> |
130 |
<option value="">None</option> |
131 |
[% FOR category IN categories %] |
132 |
[% IF field.authorised_value_category == category %] |
133 |
<option value="[% category %]" selected="selected">[% category %]</option> |
134 |
[% ELSE %] |
135 |
<option value="[% category %]">[% category %]</option> |
136 |
[% END %] |
137 |
[% END %] |
138 |
</select> |
139 |
</li> |
140 |
<li> |
141 |
<label for="marcfield">Marc field: </label> |
142 |
<input type="text" name="marcfield" id="marcfield" value="[% field.marcfield| html %]" /> |
143 |
</li> |
144 |
</ol> |
145 |
</fieldset> |
146 |
<fieldset class="action"> |
147 |
[% IF field %] |
148 |
<input type="hidden" name="field_id" value="[% field.id %]" /> |
149 |
[% END %] |
150 |
<input type="hidden" name="op" value="add" /> |
151 |
<input type="submit" value="Save" /> |
152 |
<a href="/cgi-bin/koha/acqui/add_order_fields.pl" class="cancel">Cancel</a> |
153 |
</fieldset> |
154 |
</form> |
155 |
[% END %] |
156 |
|
157 |
</div> |
158 |
</div> |
159 |
|
160 |
<div class="yui-b"> |
161 |
[% INCLUDE 'acquisitions-menu.inc' %] |
162 |
</div> |
163 |
</div> |
164 |
[% INCLUDE 'intranet-bottom.inc' %] |