4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Automatic item modifications by age › Cataloging › Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
9 <body id="tools_automatic_item_modification_by_age" class="tools">
10 [% WRAPPER 'header.inc' %]
11 [% INCLUDE 'cat-search.inc' %]
14 [% WRAPPER 'sub-header.inc' %]
15 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
18 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
21 <a href="/cgi-bin/koha/cataloguing/cataloging-home.pl">Cataloging</a>
24 [% IF ( op == 'edit_form' ) %]
26 <a href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">Automatic item modifications by age</a>
29 <a href="#" aria-current="page">
35 <a href="#" aria-current="page">
36 Automatic item modifications by age
45 <div class="main container-fluid">
47 <div class="col-sm-10 col-sm-push-2">
50 [% IF ( op == 'edit_form' ) %]
51 <form method="post" id="rules_form" action="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">
52 <h1>Rules for automatic item modifications by age</h1>
53 <div id="toolbar" class="btn-toolbar">
54 <div class="btn-group">
55 <button class="btn btn-default add_rule"><i class="fa fa-plus"></i> Add rule</button>
57 <div class="btn-group">
58 <button type="submit" id="save_rules" class="btn btn-default"><i class="fa fa-save"></i> Save</button>
60 <div class="btn-group">
61 <a class="btn btn-default" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl"><i class="fa fa-remove"></i> Cancel</a>
65 <h1>Automatic item modifications by age</h1>
67 <div id="toolbar" class="btn-toolbar">
68 <a class="btn btn-default" id="newentry" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl?op=edit_form"><i class="fa fa-pencil"></i> Edit rules</a>
71 <div id="toolbar" class="btn-toolbar">
72 <a class="btn btn-default" id="newentry" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl?op=edit_form"><i class="fa fa-plus"></i> Add rules</a>
77 [% FOR message IN messages %]
78 [% IF message.type == "error" %]
79 <div class="dialog alert">
81 [% IF message.code == "unable_to_load_configuration" %]
82 An error occurs: Unable to load the configuration.
87 [% IF op == 'edit_form' %]
90 [% FOR rule IN rules %]
91 [% SET id = loop.count %]
92 <fieldset class="rule">
93 <legend>Rule <span class="rulecount">[% loop.count | html %]</span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend>
94 <input type="hidden" name="unique_id" value="[% loop.count | html %]" /> <!-- FIXME on update, the unique_id should be filled -->
97 <input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="[% rule.age | html %]" name="age_[% id | html %]" />
100 <select name="agefield_[% id | html %]">
101 <option value="">Choose an age field</option>
102 [% FOR field IN agefields %]
103 [% IF rule.agefield == field %]
104 <option value="[% field | html %]" selected="selected">[% field | html %]</option>
106 <option value="[% field | html %]">[% field | html %]</option>
110 <span class="hint">If not set then items.dateaccessioned will be used</span>
115 [% FOR condition IN rule.conditions %]
117 <select name="condition_field_[% id | html %]">
118 <option value="">Choose a field name</option>
119 [% FOR field IN condition_fields %]
120 [% IF condition.field == field %]
121 <option value="[% field | html %]" selected="selected">[% field | html %]</option>
123 <option value="[% field | html %]">[% field | html %]</option>
128 <input type="text" value="[% condition.value | html %]" name="condition_value_[% id | html %]" />
129 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a>
130 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a>
135 <h5>Substitutions</h5>
136 [% FOR substitution IN rule.substitutions %]
138 <select class="required" required="required" name="substitution_field_[% id | html %]">
139 <option value="">Choose a field name</option>
140 [% FOR field IN substitution_fields %]
141 [% IF substitution.field == field %]
142 <option value="[% field | html %]" selected="selected">[% field | html %]</option>
144 <option value="[% field | html %]">[% field | html %]</option>
149 <input type="text" value="[% substitution.value | html %]" name="substitution_value_[% id | html %]" />
150 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a>
151 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a>
152 <span class="required">A field name is required</span>
159 <input type="hidden" name="op" value="update" />
163 <div id="norules" class="dialog message">
164 There are no rules defined.
167 <fieldset id="new_rule">
168 <legend>Rule <span class="rulecount"></span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend>
169 <input type="hidden" name="unique_id" />
172 <input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="" name="age" />
175 <select name="agefield">
176 <option value="">Choose an age field</option>
177 [% FOR field IN agefields %]
178 <option value="[% field | html %]">[% field | html %]</option>
181 <span class="hint">If not set then items.dateaccessioned will be used</span>
187 <select name="condition_field">
188 <option value="">Choose a field name</option>
189 [% FOR field IN condition_fields %]
190 <option value="[% field | html %]">[% field | html %]</option>
194 <input type="text" value="" name="condition_value" />
195 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a>
196 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a>
200 <h5>Substitutions</h5>
202 <select required="required" class="required" name="substitution_field">
203 <option value="">Choose a field name</option>
204 [% FOR field IN substitution_fields %]
205 <option value="[% field | html %]">[% field | html %]</option>
209 <input type="text" value="" name="substitution_value" />
210 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a>
211 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a>
212 <span class="required">A field name is required</span>
218 <h4>List of rules</h4>
225 <th>Substitutions</th>
229 [% FOR rule IN rules %]
232 [% IF rule.age.defined and rule.age.length > 0 %]
233 <span>[% rule.age | html %] days</span>
235 <span>There is no age for this rule.</span>
239 [% IF rule.agefield %]
240 [% rule.agefield | html %]
242 <!-- In case old rules do not contain an agefield value display that items.dateaccessioned will be used -->
243 items.dateaccessioned
247 [% FOR condition IN rule.conditions %]
248 [% IF condition.field %]
250 [% condition.field | html %] = [% condition.value | html %]
253 There is no condition for this rule.
258 [% FOR substitution IN rule.substitutions %]
260 [% substitution.field | html %] = [% substitution.value | html %]
270 <div class="dialog message">
271 There are no rules defined.
276 </div> <!-- /.col-sm-10.col-sm-push-2 -->
278 <div class="col-sm-2 col-sm-pull-10">
280 [% INCLUDE 'cat-menu.inc' %]
282 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
283 </div> <!-- /.row -->
285 [% MACRO jsinclude BLOCK %]
286 [% Asset.js("lib/hc-sticky.js") | $raw %]
287 [% Asset.js("js/automatic_item_modification_by_age.js") | $raw %]
288 [% IF op == 'edit_form' %]
291 $(document).ready(function() {
292 [% IF ( op == 'edit_form' ) %]
293 Sticky = $("#toolbar");
296 stickyClass: "floating"
299 [% IF rules.size > 0 %]
300 $("#norules").hide();
309 [% INCLUDE 'intranet-bottom.inc' %]