1 [% USE AuthorisedValues %]
3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Serials › Manage new fields for subscriptions
5 [% IF op == "list" %] › List of fields
6 [% ELSIF op == "add_form" %]
7 [% IF field %] › Modify field
8 [% ELSE %] › Add field
12 [% INCLUDE 'doc-head-close.inc' %]
13 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
16 <body id="ser_add_fields" class="ser">
17 [% INCLUDE 'header.inc' %]
18 [% INCLUDE 'serials-search.inc' %]
20 <div id="breadcrumbs">
21 <a href="/cgi-bin/koha/mainpage.pl">Home</a> › <a href="/cgi-bin/koha/serials/serials-home.pl">Serials</a> › Manage new fields for subscriptions
24 <div id="doc3" class="yui-t2">
29 <div id="toolbar" class="btn-toolbar">
30 <a class="btn btn-default btn-sm" id="newfields" href="/cgi-bin/koha/serials/add_fields.pl?op=add_form"><i class="fa fa-plus"></i> New fields</a>
35 [% FOR message IN messages %]
36 [% IF message.code == 'insert' %]
37 [% IF message.number > 0 %]
38 <div class="dialog message">Field created.</div>
40 <div class="dialog alert">The field could not be created. Perhaps the name already exists?</div>
42 [% ELSIF message.code == 'update' %]
43 [% IF message.number > 0 %]
44 <div class="dialog message">Field updated.</div>
46 <div class="dialog alert">The field could not be updated. Perhaps the name already exists?</div>
48 [% ELSIF message.code == 'delete' %]
49 [% IF message.number > 0 %]
50 <div class="dialog message">Field deleted.</div>
52 <div class="dialog alert">The field could not be deleted. Check the log for errors.</div>
59 <h3>Additional fields for subscriptions</h3>
65 <th>Authorised value category</th>
72 [% FOR field IN fields %]
74 <td>[% field.name %]</td>
75 <td>[% field.authorised_value_category %]</td>
76 <td>[% field.marcfield %]</td>
78 [% IF field.searchable %]Yes[% ELSE %]No[% END %]
81 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/add_fields.pl?op=add_form&field_id=[% field.id %]"><i class="fa fa-pencil"></i> Edit</a>
82 <a class="confirmdelete btn btn-default btn-xs" href="/cgi-bin/koha/serials/add_fields.pl?op=delete&field_id=[% field.id %]"><i class="fa fa-trash"></i> Delete</a>
89 There is no field defined.
91 [% ELSIF op == 'add_form' %]
97 <form action="/cgi-bin/koha/serials/add_fields.pl" name="add_form" id="add_field" method="post">
98 <fieldset class="rows">
101 <label for="name" class="required">Name: </label>
102 <input type="text" name="name" id="name" value="[% field.name | html %]" class="required" required="required" />
103 <span class="required">Required</span>
106 <label for="av">Authorised value category: </label>
107 <select name="authorised_value_category">
108 <option value="">None</option>
109 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_value_category ) %]
113 <label for="marcfield">Marc field: </label>
114 <input type="text" name="marcfield" id="marcfield" value="[% field.marcfield| html %]" />
117 <label for="searchable">Searchable: </label>
118 [% IF field.searchable %]
119 <input type="checkbox" name="searchable" id="searchable" checked="checked" />
121 <input type="checkbox" name="searchable" id="searchable" />
126 <fieldset class="action">
128 <input type="hidden" name="field_id" value="[% field.id %]" />
130 <input type="hidden" name="op" value="add" />
131 <input type="submit" value="Save" />
132 <a href="/cgi-bin/koha/serials/add_fields.pl" class="cancel">Cancel</a>
141 [% INCLUDE 'serials-menu.inc' %]
145 [% MACRO jsinclude BLOCK %]
146 [% INCLUDE "datatables.inc" %]
147 <script type="text/javascript">
148 $(document).ready(function(){
150 $("#fieldst").dataTable($.extend(true, {}, dataTablesDefaults, {
152 'sDom': 't<"bottom pager"ilpf>',
153 'sPaginationType': 'four_button',
154 'aLengthMenu': [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
155 'iDisplayLength': 20,
156 'aaSorting': [[ 0, "asc" ]],
158 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
162 $(".confirmdelete").click(function(){
163 return confirm(_("Are you sure you want to delete this field?"));
166 $("#add_field").on('submit', function(){
167 if ( $("#marcfield").val().length > 0
168 && $("select[name='authorised_value_category']" ).val().length > 0 ) {
169 alert("You cannot select an authorised value category and a marcfield");
178 [% INCLUDE 'intranet-bottom.inc' %]