1 [% USE AuthorisedValues %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha › Serials › Manage new fields for subscriptions
4 [% IF op == "list" %] › List of fields
5 [% ELSIF op == "add_form" %]
6 [% IF field %] › Modify field
7 [% ELSE %] › Add field
11 [% INCLUDE 'doc-head-close.inc' %]
12 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
13 [% INCLUDE "datatables.inc" %]
14 <script type="text/javascript">
16 $(document).ready(function(){
18 $("#fieldst").dataTable($.extend(true, {}, dataTablesDefaults, {
20 'sDom': 't<"bottom pager"ilpf>',
21 'sPaginationType': 'four_button',
22 'aLengthMenu': [[10, 20, 50, 100, -1], [10, 20, 50, 100, "All"]],
24 'aaSorting': [[ 0, "asc" ]],
26 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
30 $(".confirmdelete").click(function(){
31 return confirm(_("Are you sure you want to delete this field?"));
34 $("#add_field").on('submit', function(){
35 if ( $("#marcfield").val().length > 0
36 && $("select[name='authorised_value_category']" ).val().length > 0 ) {
37 alert("You cannot select an authorised value category and a marcfield");
47 <body id="ser_add_fields" class="ser">
48 [% INCLUDE 'header.inc' %]
49 [% INCLUDE 'serials-search.inc' %]
51 <div id="breadcrumbs">
52 <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
55 <div id="doc3" class="yui-t2">
60 <div id="toolbar" class="btn-toolbar">
61 <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>
66 [% FOR message IN messages %]
67 [% IF message.code == 'insert' %]
68 [% IF message.number > 0 %]
69 <div class="dialog message">Field created.</div>
71 <div class="dialog alert">The field could not be created. Perhaps the name already exists?</div>
73 [% ELSIF message.code == 'update' %]
74 [% IF message.number > 0 %]
75 <div class="dialog message">Field updated.</div>
77 <div class="dialog alert">The field could not be updated. Perhaps the name already exists?</div>
79 [% ELSIF message.code == 'delete' %]
80 [% IF message.number > 0 %]
81 <div class="dialog message">Field deleted.</div>
83 <div class="dialog alert">The field could not be deleted. Check the log for errors.</div>
90 <h3>Additional fields for subscriptions</h3>
96 <th>Authorised value category</th>
103 [% FOR field IN fields %]
105 <td>[% field.name %]</td>
106 <td>[% field.authorised_value_category %]</td>
107 <td>[% field.marcfield %]</td>
109 [% IF field.searchable %]Yes[% ELSE %]No[% END %]
112 <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>
113 <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>
120 There is no field defined.
122 [% ELSIF op == 'add_form' %]
124 <h3>Modify field</h3>
128 <form action="/cgi-bin/koha/serials/add_fields.pl" name="add_form" id="add_field" method="post">
129 <fieldset class="rows">
132 <label for="name" class="required">Name: </label>
133 <input type="text" name="name" id="name" value="[% field.name | html %]" class="required" required="required" />
134 <span class="required">Required</span>
137 <label for="av">Authorised value category: </label>
138 <select name="authorised_value_category">
139 <option value="">None</option>
140 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_value_category ) %]
144 <label for="marcfield">Marc field: </label>
145 <input type="text" name="marcfield" id="marcfield" value="[% field.marcfield| html %]" />
148 <label for="searchable">Searchable: </label>
149 [% IF field.searchable %]
150 <input type="checkbox" name="searchable" id="searchable" checked="checked" />
152 <input type="checkbox" name="searchable" id="searchable" />
157 <fieldset class="action">
159 <input type="hidden" name="field_id" value="[% field.id %]" />
161 <input type="hidden" name="op" value="add" />
162 <input type="submit" value="Save" />
163 <a href="/cgi-bin/koha/serials/add_fields.pl" class="cancel">Cancel</a>
172 [% INCLUDE 'serials-menu.inc' %]
175 [% INCLUDE 'intranet-bottom.inc' %]