Bug 32618: Add 'page-section' to various administration pages
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqplan.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Price %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 [% PROCESS 'budget_planning.inc' %]
7 <title>Planning for [% budget_period_description | html %] [% PROCESS planning plan=authcat %] &rsaquo; Funds &rsaquo; Budgets &rsaquo; Administration &rsaquo; Koha</title>
8 [% INCLUDE 'doc-head-close.inc' %]
9 <style>td.locked { background-image: url('[% interface | html %]/[% theme | html %]/img/locked.png'); padding-left : 20px; background-repeat: no-repeat; background-position: 5px 5px; } a.control { font-size:85%;text-decoration:none; } .plan_entry { text-align: right; width:90%; }</style>
10 </head>
11
12 <body id="admin_aqplan" class="admin">
13 [% WRAPPER 'header.inc' %]
14     [% INCLUDE 'budgets-admin-search.inc' %]
15 [% END %]
16
17 [% WRAPPER 'sub-header.inc' %]
18 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
19     <ol>
20         <li>
21             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
22         </li>
23         <li>
24             <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
25         </li>
26         <li>
27             <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a>
28         </li>
29         <li>
30             <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% budget_period_id | uri %]">Funds</a>
31         </li>
32         <li>
33             <a href="#" aria-current="page">Planning</a>
34         </li>
35     </ol>
36 </nav>
37 [% END %]
38
39 <div class="main container-fluid">
40     <div class="row">
41         <div class="col-sm-10 col-sm-push-2">
42             <main>
43
44 [% INCLUDE 'budgets-admin-toolbar.inc' %]
45
46 <form method="post" id="Aform" name="Aform"  action="/cgi-bin/koha/admin/aqplan.pl">
47 <h1>Planning for [% budget_period_description | html %] [% PROCESS planning plan=authcat %]</h1>
48 <input type="hidden" name="authcat" value="[% authcat | html %]" />
49 <!-- Budget Lines -->
50
51     <div class="page-section">
52
53         [% IF ( budget_lines ) %]
54
55             [% INCLUDE 'budgets-active-currency.inc' %]
56             [% IF ( show_actual ) %]
57                 <p><strong>Each cell contain both actual and estimated values.</strong></p>
58             [% ELSE %]
59                 <p><strong>Cells contain estimated values only.</strong></p>
60             [% END %]
61
62         <p id="selections">
63             <strong>Show/hide columns:</strong> <span class="selected"><input type="checkbox" checked="checked" id="showall"/><label for="showall">Show all columns</label></span> <span><input type="checkbox" id="hideall"/><label for="hideall">Hide all columns</label></span>
64             [% FOREACH authvals_ro IN authvals_row %]
65                 <span class="selected"><label><input type="checkbox" checked="checked" id="col[% authvals_ro.colnum | html %]">[% authvals_ro.code | html %]</label></span>
66             [% END %]
67         </p>
68         <table id="plan">
69             <thead>
70                 <tr>
71                     <th>Fund name</th>
72                     <th>Fund total</th>
73                     [% FOREACH authvals_ro IN authvals_row %]
74                         [% IF ( authvals_ro.display ) %]
75                             <th id="col[% authvals_ro.code | html %]" class="[% authvals_ro.colnum | html %]">
76                         [% ELSE %]
77                             <th id="col[% authvals_ro.code | html %]" style="display:none;" class="[% authvals_ro.colnum | html %]">
78                         [% END %]
79                         [% authvals_ro.code | html %]</th>
80                     [% END %]
81                     <th class="remaining">Fund remaining</th>
82                     <th class="noExport">Actions</th>
83                 </tr>
84             </thead>
85
86             <tbody>
87                 [% FOREACH budget_line IN budget_lines %]
88                     <tr id="[% budget_line.budget_id | html %]">
89                         [% IF ( budget_line.budget_lock ) %]
90                             <td class="locked" title="Fund locked">
91                         [% ELSE %]
92                             <td>
93                         [% END %]
94                             <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_id=[% budget_line.budget_id | uri %]&amp;budget_period_id=[% budget_period_id | uri %]">[% budget_line.budget_name | html %]</a></td>
95                         <td><span id="[% budget_line.budget_amount | html %]">[% budget_line.budget_amount | $Price %]&nbsp;</span>
96                         <!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
97                         <div style="display:none;" id="budget_tot_[% budget_line.budget_id | html %]">[% budget_line.budget_amount | html %]</div></td>
98
99                         [% FOREACH line IN budget_line.lines %]
100                             [% IF ( line.display ) %]
101                                 <td class="[% line.colnum | html %]">
102                             [% ELSE %]
103                                 <td style="display:none;" class="[% line.colnum | html %]">
104                             [% END %]
105                                 <table class="invis">
106                                     <tr>
107                                         [% IF show_actual %]
108                                             <td    >[% line.actual_amount | html %]</td>
109                                         [% END %]
110                                     <td>
111
112                                         [% IF ( line.budget_lock ) %]
113                                             [% line.estimated_amount | html %]&nbsp;
114                                             <input type="hidden" style="text-align: right;"  name="[% line.cell_name | html %]" value="[% line.estimated_amount | html %]"   />
115                                         [% ELSE %]
116                                             <input type="text" size="6" name="[% line.cell_name | html %]"  value="[% line.estimated_amount | html %]"  id="budget_[% line.budget_id | html %][% line.colnum | html %]" class="plan_entry plan_entry_[% line.budget_id | html %]" />
117                                         [% END %]
118
119                                     </td></tr>
120                                 </table>
121                             </td>
122                         [% END %]
123
124                         <td>
125                             <table class="invis">
126                                 <tr>
127                                     [% IF show_actual %]
128                                         [% IF ( budget_line.act_negative ) %]
129                                             <td style="color: red;">
130                                         [% ELSIF ( budget_line.act_positive ) %]
131                                             <td style="color: green;">
132                                         [% ELSE %]
133                                             <td>
134                                         [% END %]
135                                         [% budget_line.budget_act_remain | html %]
136                                         </td>
137                                     [% END %]
138
139                                     [% IF ( budget_line.est_negative ) %]
140                                         <td style="color: red;" id="budget_est_[% budget_line.budget_id | html %]">
141                                     [% ELSIF ( budget_line.est_positive ) %]
142                                         <td style="color: green;" id="budget_est_[% budget_line.budget_id | html %]">
143                                     [% ELSE %]
144                                         <td id="budget_est_[% budget_line.budget_id | html %]">
145                                     [% END %]
146                                         [% budget_line.budget_est_remain | $Price %]&nbsp;
147                                     </td>
148                                 </tr>
149                             </table>
150                         </td>
151
152                         <td class="actions">
153                             [% UNLESS ( budget_line.budget_lock ) %]
154                                 <input type="button" class="auto_fill_row btn btn-default btn-xs" data-budget-id="[% budget_line.budget_id | html %]" value="Auto-fill row"/>
155                                 <input type="button" class="clear_fields btn btn-default btn-xs" data-budget-id="[% budget_line.budget_id | html %]" value="Clear">
156                             [% ELSE %]
157                                 <div style="color:red;">not owned</div>
158                             [% END %]
159                         </td>
160                     </tr>
161                 [% END %]
162             </tbody>
163         </table>
164
165         <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
166         [% IF ( budget_period_locked ) %]
167             <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled="disabled"/> -->
168         [% ELSE %]
169             <input type="hidden" name="op" value="save" />
170             <fieldset class="action"><input type="submit" class="btn btn-primary" value="Save" /></fieldset>
171         [% END %]
172
173     </div> <!-- /.page-section -->
174
175 <div id="hide_div">
176     [% FOREACH authvals_ro IN authvals_row %]
177
178      [% UNLESS ( authvals_ro.display ) %]
179         <input type="hidden" value="[% authvals_ro.code | html %]"  name="hide_cols"/>
180      [% END %]
181     [% END %]
182
183  </div>
184
185
186 </form>
187
188         [% ELSIF not budget_period_id %]
189 <div class="dialog alert">That budget does not exist! Please select a budget to continue.</div>
190         [% ELSE %]
191 <div class="dialog message">No funds to display for this search criteria</div>
192         [% END %]
193
194
195
196             </main>
197         </div> <!-- /.col-sm-10.col-sm-push-2 -->
198
199         <div class="col-sm-2 col-sm-pull-10">
200             <aside>
201
202 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
203     <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
204 <fieldset class="brief">
205 <h4>Filter</h4>
206 [% BLOCK planning_types %]
207 [%   SWITCH type %]
208 [%     CASE 'MONTHS'    %]<span>by months</span>
209 [%     CASE 'ITEMTYPES' %]<span>by item types</span>
210 [%     CASE 'BRANCHES'  %]<span>by libraries</span>
211 [%     CASE             %]<span>by [% type | html %]</span>
212 [%   END %]
213 [% END %]
214 <ol>
215     <li>
216         <label for="authcat"> Select planning type:</label>
217         <select name="authcat" id="authcat">
218         [% FOREACH value IN authcat_dropbox.values %]
219             [% IF ( value == authcat_dropbox.default ) %]
220             <option value="[% value | html %]" selected="selected">[% PROCESS planning_types type=value %]</option>
221             [% ELSE %]
222             <option value="[% value | html %]">[% PROCESS planning_types type=value %]</option>
223             [% END %]
224         [% END %]
225         </select>
226     </li>
227     <li class="radio">
228     [% IF ( show_mine ) %]
229         <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
230     [% ELSE %]
231         <input type="checkbox" id="show_mine"  name="show_mine" value="1"  />
232     [% END %]
233     <label for="show_mine">Show my funds only</label>
234     </li>
235
236     <li class="radio">
237     [% IF ( show_active ) %]
238         <input type="checkbox" id="show_active" name="show_active" value="1" checked="checked" />
239     [% ELSE %]
240         <input type="checkbox" id="show_active" name="show_active" value="1" />
241         [% END %]
242     <label for="show_active">Show active funds only</label>
243     </li>
244
245
246     <li class="radio">
247         [% IF ( show_actual ) %]
248             <input type="checkbox" id="show_actual" name="show_actual" value="1" checked="checked" />
249         [% ELSE %]
250             <input type="checkbox" id="show_actual" name="show_actual" value="1"  />
251         [% END %]
252         <label for="show_actual">Show actual/estimated values</label>
253     </li>
254     </ol>
255     <fieldset class="action">
256         <input type="submit" name="option_submit" class="btn btn-primary" value="Submit" />
257         <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
258     </fieldset>
259 </fieldset>
260 </form>
261 [% IF ( budget_lines ) %]
262 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
263 <fieldset class="brief">
264 <h4>Export</h4>
265     <ol>
266         <li><label for="basename">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" /></li>
267         <li><label class="inline" for="MIME">Into an application</label>
268             <select name="MIME" id="MIME">
269             [% FOREACH value IN CGIextChoice %]
270                 <option value="[% value | html %]">[% value | html %]</option>
271             [% END %]
272             </select>
273             <select name="sep" id="sep">
274             [% FOREACH value IN CGIsepChoice %]
275                 <option value="[% value | html %]">[% value | html %]</option>
276             [% END %]
277             </select>
278         </li>
279     </ol>
280     <fieldset class="action">    <input type="submit" class="btn btn-primary" value="Submit" />
281     <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
282     <input type="hidden" name="report_name" value="[% report_name | html %]" />
283     <input type="hidden" name="output" value="file" /></fieldset>
284     <input type="hidden" name="budget_period_id" value="[% budget_period_id | html %]" />
285     <input type="hidden" name="authcat" value="[% authcat | html %]" />
286     </fieldset>
287 </form>
288 [% END %]
289
290                 [% INCLUDE 'acquisitions-menu.inc' %]
291             </aside>
292         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
293      </div> <!-- /.row -->
294
295 [% MACRO jsinclude BLOCK %]
296     [% Asset.js("js/acq.js") | $raw %]
297     <script>
298         jQuery.validator.addClassRules({ plan_entry: { pnumber: true } }); // require that input be a number in fields with the class 'plan_entry'
299         jQuery.validator.addMethod("pnumber", $.validator.methods.number, _("Please enter a valid number.") );
300         var zero_formatted = "[% 0 | $Price on_editing => 1 %]";
301         $(document).ready(function() {
302             $("#selections input").on("change",function(e){
303                 var num = $(this).attr("id");
304                 if(num == 'showall'){
305                     showAllColumns();
306                     e.stopPropagation();
307                 } else if(num == 'hideall'){
308                     hideAllColumns();
309                     e.stopPropagation();
310                 } else {
311                     if($(this).prop("checked")){
312                         showColumn(num);
313                     } else {
314                         hideColumn(num);
315                     }
316                 }
317             });
318             $(".plan_entry").on("change",function(){
319                 calcTotalRow( this );
320             });
321             $("#Aform").validate();
322             $(".auto_fill_row").on("click",function(){
323                 var budget_id = $(this).data("budget-id");
324                 autoFillRow( budget_id );
325             });
326             $(".clear_fields").on("click",function(){
327                 var budget_id = $(this).data("budget-id");
328                 var edit_row = $("#"+budget_id);
329                 $(edit_row).find("input").each(function(){
330                     var type = $(this).attr("type");
331                     if (type != "button" && type != "submit" ) {
332                       $(this).val(zero_formatted);
333                       $(this).prop('disabled', false);
334                     }
335                 });
336                 $("#budget_est_"+budget_id).text($("#budget_tot_"+budget_id).prev().text());
337                 $("#budget_est_"+budget_id).css("color","green");
338             });
339         });
340     </script>
341 [% END %]
342 [% INCLUDE 'intranet-bottom.inc' %]