3 [% USE AuthorisedValues %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha › Serials › Manage new fields for subscriptions
7 [% IF op == "list" %] › List of fields
8 [% ELSIF op == "add_form" %]
9 [% IF field %] › Modify field
10 [% ELSE %] › Add field
14 [% INCLUDE 'doc-head-close.inc' %]
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 class="main container-fluid">
27 <div class="col-sm-10 col-sm-push-2">
31 <div id="toolbar" class="btn-toolbar">
32 <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>
37 [% FOR message IN messages %]
38 [% IF message.code == 'insert' %]
39 [% IF message.number > 0 %]
40 <div class="dialog message">Field created.</div>
42 <div class="dialog alert">The field could not be created. Perhaps the name already exists?</div>
44 [% ELSIF message.code == 'update' %]
45 [% IF message.number > 0 %]
46 <div class="dialog message">Field updated.</div>
48 <div class="dialog alert">The field could not be updated. Perhaps the name already exists?</div>
50 [% ELSIF message.code == 'delete' %]
51 [% IF message.number > 0 %]
52 <div class="dialog message">Field deleted.</div>
54 <div class="dialog alert">The field could not be deleted. Check the log for errors.</div>
61 <h3>Additional fields for subscriptions</h3>
67 <th>Authorised value category</th>
74 [% FOR field IN fields %]
76 <td>[% field.name | html %]</td>
77 <td>[% field.authorised_value_category | html %]</td>
78 <td>[% field.marcfield | html %]</td>
80 [% IF field.searchable %]Yes[% ELSE %]No[% END %]
83 <a class="btn btn-default btn-xs" href="/cgi-bin/koha/serials/add_fields.pl?op=add_form&field_id=[% field.id | html %]"><i class="fa fa-pencil"></i> Edit</a>
84 <a class="confirmdelete btn btn-default btn-xs" href="/cgi-bin/koha/serials/add_fields.pl?op=delete&field_id=[% field.id | html %]"><i class="fa fa-trash"></i> Delete</a>
91 There is no field defined.
93 [% ELSIF op == 'add_form' %]
99 <form action="/cgi-bin/koha/serials/add_fields.pl" name="add_form" id="add_field" method="post">
100 <fieldset class="rows">
103 <label for="name" class="required">Name: </label>
104 <input type="text" name="name" id="name" value="[% field.name | html %]" class="required" required="required" />
105 <span class="required">Required</span>
108 <label for="av">Authorised value category: </label>
109 <select id="av" name="authorised_value_category">
110 <option value="">None</option>
111 [% PROCESS options_for_authorised_value_categories authorised_value_categories => AuthorisedValues.GetCategories( selected => field.authorised_value_category ) %]
115 <label for="marcfield">Marc field: </label>
116 <input type="text" name="marcfield" id="marcfield" value="[% field.marcfield | html %]" />
119 <label for="searchable">Searchable: </label>
120 [% IF field.searchable %]
121 <input type="checkbox" name="searchable" id="searchable" checked="checked" />
123 <input type="checkbox" name="searchable" id="searchable" />
128 <fieldset class="action">
130 <input type="hidden" name="field_id" value="[% field.id | html %]" />
132 <input type="hidden" name="op" value="add" />
133 <input type="submit" value="Save" />
134 <a href="/cgi-bin/koha/serials/add_fields.pl" class="cancel">Cancel</a>
140 </div> <!-- /.col-sm-10.col-sm-push-2 -->
142 <div class="col-sm-2 col-sm-pull-10">
144 [% INCLUDE 'serials-menu.inc' %]
146 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
147 </div> <!-- /.row -->
149 [% MACRO jsinclude BLOCK %]
150 [% INCLUDE "datatables.inc" %]
152 $(document).ready(function(){
154 $("#fieldst").dataTable($.extend(true, {}, dataTablesDefaults, {
156 'sPaginationType': 'four_button',
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' %]