2 [% USE AuthorisedValues %]
4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Koha › Serials › Manage new fields for subscriptions
6 [% IF op == "list" %] › List of fields
7 [% ELSIF op == "add_form" %]
8 [% IF field %] › Modify field
9 [% ELSE %] › Add field
13 [% INCLUDE 'doc-head-close.inc' %]
14 [% Asset.css("css/datatables.css") %]
17 <body id="ser_add_fields" class="ser">
18 [% INCLUDE 'header.inc' %]
19 [% INCLUDE 'serials-search.inc' %]
21 <div id="breadcrumbs">
22 <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
25 <div id="doc3" class="yui-t2">
30 <div id="toolbar" class="btn-toolbar">
31 <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 field</a>
36 [% FOR message IN messages %]
37 [% IF message.code == 'insert' %]
38 [% IF message.number > 0 %]
39 <div class="dialog message">Field created.</div>
41 <div class="dialog alert">The field could not be created. Perhaps the name already exists?</div>
43 [% ELSIF message.code == 'update' %]
44 [% IF message.number > 0 %]
45 <div class="dialog message">Field updated.</div>
47 <div class="dialog alert">The field could not be updated. Perhaps the name already exists?</div>
49 [% ELSIF message.code == 'delete' %]
50 [% IF message.number > 0 %]
51 <div class="dialog message">Field deleted.</div>
53 <div class="dialog alert">The field could not be deleted. Check the log for errors.</div>
60 <h3>Additional fields for subscriptions</h3>
66 <th>Authorised value category</th>
73 [% FOR field IN fields %]
75 <td>[% field.name %]</td>
76 <td>[% field.authorised_value_category %]</td>
77 <td>[% field.marcfield %]</td>
79 [% IF field.searchable %]Yes[% ELSE %]No[% END %]
82 <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>
83 <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>
90 There is no field defined.
92 [% ELSIF op == 'add_form' %]
98 <form action="/cgi-bin/koha/serials/add_fields.pl" name="add_form" id="add_field" method="post">
99 <fieldset class="rows">
102 <label for="name" class="required">Name: </label>
103 <input type="text" name="name" id="name" value="[% field.name | html %]" class="required" required="required" />
104 <span class="required">Required</span>
107 <label for="av">Authorised value category: </label>
108 <select id="av" name="authorised_value_category">
109 <option value="">None</option>
110 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_value_category ) %]
114 <label for="marcfield">Marc field: </label>
115 <input type="text" name="marcfield" id="marcfield" value="[% field.marcfield| html %]" />
118 <label for="searchable">Searchable: </label>
119 [% IF field.searchable %]
120 <input type="checkbox" name="searchable" id="searchable" checked="checked" />
122 <input type="checkbox" name="searchable" id="searchable" />
127 <fieldset class="action">
129 <input type="hidden" name="field_id" value="[% field.id %]" />
131 <input type="hidden" name="op" value="add" />
132 <input type="submit" value="Save" />
133 <a href="/cgi-bin/koha/serials/add_fields.pl" class="cancel">Cancel</a>
142 [% INCLUDE 'serials-menu.inc' %]
146 [% MACRO jsinclude BLOCK %]
147 [% INCLUDE "datatables.inc" %]
148 <script type="text/javascript">
149 $(document).ready(function(){
151 $("#fieldst").dataTable($.extend(true, {}, dataTablesDefaults, {
153 'sPaginationType': 'four_button',
155 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
159 $(".confirmdelete").click(function(){
160 return confirm(_("Are you sure you want to delete this field?"));
163 $("#add_field").on('submit', function(){
164 if ( $("#marcfield").val().length > 0
165 && $("select[name='authorised_value_category']" ).val().length > 0 ) {
166 alert("You cannot select an authorised value category and a marcfield");
175 [% INCLUDE 'intranet-bottom.inc' %]