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