3 [% INCLUDE 'doc-head-open.inc' %]
4 <title>Koha › Tools › Automatic item modifications by age</title>
5 [% INCLUDE 'doc-head-close.inc' %]
8 <body id="tools_automatic_item_modification_by_age" class="tools">
9 [% INCLUDE 'header.inc' %]
10 [% INCLUDE 'cat-search.inc' %]
11 <div id="breadcrumbs">
12 <a href="/cgi-bin/koha/mainpage.pl">Home</a> ›
13 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> ›
14 [% IF ( op == 'edit_form' ) %]
15 <a href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">Automatic item modifications by age</a> ›
18 Automatic item modifications by age
22 <div id="doc3" class="yui-t2">
27 [% IF ( op == 'edit_form' ) %]
28 <form method="post" id="rules_form" action="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl">
29 <h3>Rules for automatic item modifications by age</h3>
30 <div id="toolbar" class="btn-toolbar">
31 <div class="btn-group">
32 <button class="btn btn-default btn-sm add_rule"><i class="fa fa-plus"></i> Add rule</button>
34 <div class="btn-group">
35 <button type="submit" id="save_rules" class="btn btn-default btn-sm"><i class="fa fa-save"></i> Save</button>
37 <div class="btn-group">
38 <a class="btn btn-default btn-sm" href="/cgi-bin/koha/tools/automatic_item_modification_by_age.pl"><i class="fa fa-remove"></i> Cancel</a>
42 <h3>Automatic item modifications by age</h3>
44 <div id="toolbar" class="btn-toolbar">
45 <a class="btn btn-default btn-sm" 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>
48 <div id="toolbar" class="btn-toolbar">
49 <a class="btn btn-default btn-sm" 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>
54 [% FOR message IN messages %]
55 [% IF message.type == "error" %]
56 <div class="dialog alert">
58 [% IF message.code == "unable_to_load_configuration" %]
59 An error occurs: Unable to load the configuration.
64 [% IF op == 'edit_form' %]
67 [% FOR rule IN rules %]
68 [% SET id = loop.count %]
69 <fieldset class="rule">
70 <legend>Rule <span class="rulecount">[% loop.count %]</span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend>
71 <input type="hidden" name="unique_id" value="[% loop.count %]" /> <!-- FIXME on update, the unique_id should be filled -->
74 <input class="age" type="number" value="[% rule.age %]" name="age_[% id %]" />
78 [% FOR condition IN rule.conditions %]
80 <select name="condition_field_[% id %]">
81 <option value="">Choose a field name</option>
82 [% FOR field IN condition_fields %]
83 [% IF condition.field == field %]
84 <option value="[% field %]" selected="selected">[% field %]</option>
86 <option value="[% field %]">[% field %]</option>
91 <input type="text" value="[% condition.value %]" name="condition_value_[% id%]" />
92 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a>
93 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a>
98 <h5>Substitutions</h5>
99 [% FOR substitution IN rule.substitutions %]
101 <select class="required" required="required" name="substitution_field_[% id %]">
102 <option value="">Choose a field name</option>
103 [% FOR field IN substitution_fields %]
104 [% IF substitution.field == field %]
105 <option value="[% field %]" selected="selected">[% field %]</option>
107 <option value="[% field %]">[% field %]</option>
112 <input type="text" value="[% substitution.value %]" name="substitution_value_[% id %]" />
113 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a>
114 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a>
115 <span class="required">A field name is required</span>
122 <input type="hidden" name="op" value="update" />
126 <div id="norules" class="dialog message">
127 There are no rules defined.
130 <fieldset id="new_rule">
131 <legend>Rule <span class="rulecount"></span> <a href="#" class="remove_rule"><i class="fa fa-trash"></i> Remove this rule</a></legend>
132 <input type="hidden" name="unique_id" />
135 <input class="age" type="number" value="" name="age" />
140 <select name="condition_field">
141 <option value="">Choose a field name</option>
142 [% FOR field IN condition_fields %]
143 <option value="[% field %]">[% field %]</option>
147 <input type="text" value="" name="condition_value" />
148 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a condition</a>
149 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove condition</a>
153 <h5>Substitutions</h5>
155 <select required="required" class="required" name="substitution_field">
156 <option value="">Choose a field name</option>
157 [% FOR field IN substitution_fields %]
158 <option value="[% field %]">[% field %]</option>
162 <input type="text" value="" name="substitution_value" />
163 <a class="add_block" href="#"><i class="fa fa-plus"></i> Add a substitution</a>
164 <a class="remove_block" href="#"><i class="fa fa-trash"></i> Remove substitution</a>
165 <span class="required">A field name is required</span>
171 <h4>List of rules</h4>
177 <th>Substitutions</th>
181 [% FOR rule IN rules %]
184 [% IF rule.age.defined and rule.age.length > 0 %]
187 There is no age for this rule.
191 [% FOR condition IN rule.conditions %]
192 [% IF condition.field %]
194 [% condition.field %] = [% condition.value %]
197 There is no condition for this rule.
202 [% FOR substitution IN rule.substitutions %]
204 [% substitution.field %] = [% substitution.value %]
214 <div class="dialog message">
215 There are no rules defined.
221 <div class="yui-b noprint">
222 [% INCLUDE 'tools-menu.inc' %]
226 [% MACRO jsinclude BLOCK %]
227 [% Asset.js("js/tools-menu.js") %]
228 [% Asset.js("lib/jquery/plugins/jquery.fixFloat.js") %]
229 [% Asset.js("js/automatic_item_modification_by_age.js") %]
230 [% IF op == 'edit_form' %]
231 <script type="text/javascript">
232 $(document).ready(function() {
233 [% IF ( op == 'edit_form' ) %]
234 $('#toolbar').fixFloat();
236 [% IF rules.size > 0 %]
237 $("#norules").hide();
246 [% INCLUDE 'intranet-bottom.inc' %]