4 [% INCLUDE 'doc-head-open.inc' %]
5 <title>Automatic item modifications by age › Tools › Koha</title>
6 [% INCLUDE 'doc-head-close.inc' %]
9 <body id="tools_automatic_item_modification_by_age" class="tools">
10 [% INCLUDE 'header.inc' %]
11 [% INCLUDE 'cat-search.inc' %]
13 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
16 <a href="/cgi-bin/koha/mainpage.pl">Home</a>
19 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
22 [% IF ( op == 'edit_form' ) %]
24 <a href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">Automatic item modifications by age</a>
27 <a href="#" aria-current="page">
33 <a href="#" aria-current="page">
34 Automatic item modifications by age
41 <div class="main container-fluid">
43 <div class="col-sm-10 col-sm-push-2">
46 [% IF ( op == 'edit_form' ) %]
47 <form method="post" id="rules_form" action="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">
48 <h3>Rules for automatic item modifications by age</h3>
49 <div id="toolbar" class="btn-toolbar">
50 <div class="btn-group">
51 <button class="btn btn-default add_rule"><i class="fa fa-plus"></i> Add rule</button>
53 <div class="btn-group">
54 <button type="submit" id="save_rules" class="btn btn-default"><i class="fa fa-save"></i> Save</button>
56 <div class="btn-group">
57 <a class="btn btn-default" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl"><i class="fa fa-remove"></i> Cancel</a>
61 <h3>Automatic item modifications by age</h3>
63 <div id="toolbar" class="btn-toolbar">
64 <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>
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-plus"></i> Add rules</a>
73 [% FOR message IN messages %]
74 [% IF message.type == "error" %]
75 <div class="dialog alert">
77 [% IF message.code == "unable_to_load_configuration" %]
78 An error occurs: Unable to load the configuration.
83 [% IF op == 'edit_form' %]
86 [% FOR rule IN rules %]
87 [% SET id = loop.count %]
88 <fieldset class="rule">
89 <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>
90 <input type="hidden" name="unique_id" value="[% loop.count | html %]" /> <!-- FIXME on update, the unique_id should be filled -->
93 <input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="[% rule.age | html %]" name="age_[% id | html %]" />
97 [% FOR condition IN rule.conditions %]
99 <select name="condition_field_[% id | html %]">
100 <option value="">Choose a field name</option>
101 [% FOR field IN condition_fields %]
102 [% IF condition.field == field %]
103 <option value="[% field | html %]" selected="selected">[% field | html %]</option>
105 <option value="[% field | html %]">[% field | html %]</option>
110 <input type="text" value="[% condition.value | html %]" name="condition_value_[% id | html %]" />
111 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a>
112 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a>
117 <h5>Substitutions</h5>
118 [% FOR substitution IN rule.substitutions %]
120 <select class="required" required="required" name="substitution_field_[% id | html %]">
121 <option value="">Choose a field name</option>
122 [% FOR field IN substitution_fields %]
123 [% IF substitution.field == field %]
124 <option value="[% field | html %]" selected="selected">[% field | html %]</option>
126 <option value="[% field | html %]">[% field | html %]</option>
131 <input type="text" value="[% substitution.value | html %]" name="substitution_value_[% id | html %]" />
132 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a>
133 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a>
134 <span class="required">A field name is required</span>
141 <input type="hidden" name="op" value="update" />
145 <div id="norules" class="dialog message">
146 There are no rules defined.
149 <fieldset id="new_rule">
150 <legend>Rule <span class="rulecount"></span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend>
151 <input type="hidden" name="unique_id" />
154 <input class="age" type="text" inputmode="numeric" pattern="[0-9]*" value="" name="age" />
159 <select name="condition_field">
160 <option value="">Choose a field name</option>
161 [% FOR field IN condition_fields %]
162 <option value="[% field | html %]">[% field | html %]</option>
166 <input type="text" value="" name="condition_value" />
167 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a>
168 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a>
172 <h5>Substitutions</h5>
174 <select required="required" class="required" name="substitution_field">
175 <option value="">Choose a field name</option>
176 [% FOR field IN substitution_fields %]
177 <option value="[% field | html %]">[% field | html %]</option>
181 <input type="text" value="" name="substitution_value" />
182 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a>
183 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a>
184 <span class="required">A field name is required</span>
190 <h4>List of rules</h4>
196 <th>Substitutions</th>
200 [% FOR rule IN rules %]
203 [% IF rule.age.defined and rule.age.length > 0 %]
204 [% rule.age | html %] days
206 There is no age for this rule.
210 [% FOR condition IN rule.conditions %]
211 [% IF condition.field %]
213 [% condition.field | html %] = [% condition.value | html %]
216 There is no condition for this rule.
221 [% FOR substitution IN rule.substitutions %]
223 [% substitution.field | html %] = [% substitution.value | html %]
233 <div class="dialog message">
234 There are no rules defined.
239 </div> <!-- /.col-sm-10.col-sm-push-2 -->
241 <div class="col-sm-2 col-sm-pull-10">
243 [% INCLUDE 'tools-menu.inc' %]
245 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
246 </div> <!-- /.row -->
248 [% MACRO jsinclude BLOCK %]
249 [% Asset.js("js/tools-menu.js") | $raw %]
250 [% Asset.js("lib/hc-sticky.js") | $raw %]
251 [% Asset.js("js/automatic_item_modification_by_age.js") | $raw %]
252 [% IF op == 'edit_form' %]
255 $(document).ready(function() {
256 [% IF ( op == 'edit_form' ) %]
257 Sticky = $("#toolbar");
260 stickyClass: "floating"
263 [% IF rules.size > 0 %]
264 $("#norules").hide();
273 [% INCLUDE 'intranet-bottom.inc' %]