Bug 4502: Changing wording again...
[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>[% ELSE %]<div class="dialog alert"><h3>No active currency is defined</h3><p>Please <a href="/cgi-bin/koha/admin/currency.pl">specify an active currency</a>.</p></div>
95 [% IF ( show_actual ) %]
96         <p><b>Each cell contain both actual and estimated values.</b></p>
97     [% ELSE %]
98         <p><b>Cells contain estimated values only.</b></p>
99     [% END %]
100     [% END %]
101     <p id="selections">
102         <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>
103         [% FOREACH authvals_ro IN authvals_row %]
104             <span class="selected"><label><input type="checkbox" checked="checked" id="col[% authvals_ro.colnum %]">[% authvals_ro.code %]</label></span>
105         [% END %]
106     </p>
107     <table id="plan">
108     <thead>
109     <tr>
110     <th>Fund name</th>
111     <th>Fund total</th>
112
113     [% FOREACH authvals_ro IN authvals_row %]
114          [% IF ( authvals_ro.display ) %]
115             <th id="col[% authvals_ro.code %]" class="[% authvals_ro.colnum %]">
116         [% ELSE %]
117             <th id="col[% authvals_ro.code %]" style="display:none;" class="[% authvals_ro.colnum %]">
118         [% END %]
119
120     [% authvals_ro.code %]</th>
121     [% END %]
122
123     <th class="remaining">Fund remaining</th><th>&nbsp;</th>
124     </tr>
125     </thead>
126
127     <tbody>
128     [% FOREACH budget_line IN budget_lines %]
129     <tr>
130         [% IF ( budget_line.budget_lock ) %]
131             <td class="locked" title="Fund locked">
132         [% ELSE %]
133             <td>
134         [% END %]
135         <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>
136         <td><span id="[% budget_line.budget_amount %]">[% budget_line.budget_amount | $Price %]&nbsp;</span>
137
138
139         <!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
140         <div style="display:none;" id="budget_tot_[% budget_line.budget_id %]">[% budget_line.budget_amount %]</div></td>
141
142         [% FOREACH line IN budget_line.lines %]
143             [% IF ( line.display ) %]
144                 <td class="[% line.colnum %]">
145             [% ELSE %]
146                 <td style="display:none;" class="[% line.colnum %]">
147             [% END %]
148             <table class="invis">
149                 <tr>
150                     [% IF show_actual %]
151                         <td    >[% line.actual_amount %]</td>
152                     [% END %]
153                 <td>
154
155                 [% IF ( line.budget_lock ) %]
156                     [% line.estimated_amount %]&nbsp;
157                     <input type="hidden" style="text-align: right;"  name="[% line.cell_name %]" value="[% line.estimated_amount %]"   />
158                 [% ELSE %]
159                     <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);" />
160                 [% END %]
161
162                 </td></tr>
163             </table>
164             </td>
165         [% END %]
166
167         <td>
168         <table class="invis">
169             <tr>
170        [% IF show_actual %]
171             [% IF ( budget_line.act_negative ) %]
172                 <td style="color: red;">
173             [% ELSIF ( budget_line.act_positive ) %]
174                 <td style="color: green;">
175             [% ELSE %]
176                 <td>
177             [% END %]
178                     [% budget_line.budget_act_remain %]
179             </td>
180         [% END %]
181
182         [% IF ( budget_line.est_negative ) %]
183             <td style="color: red;" id="budget_est_[% budget_line.budget_id %]">
184         [% ELSIF ( budget_line.est_positive ) %]
185             <td style="color: green;" id="budget_est_[% budget_line.budget_id %]">
186         [% ELSE %]
187             <td id="budget_est_[% budget_line.budget_id %]">
188         [% END %] 
189                 [% budget_line.budget_est_remain | $Price %]&nbsp;
190             </td>
191             </tr>
192         </table>
193         </td>
194
195         <td>
196              [% UNLESS ( budget_line.budget_lock ) %]
197                     <input type="button"  onclick="autoFillRow('[% budget_line.budget_id %]')" value="Auto-fill row"/>
198             [% ELSE %]
199              <div style="color:red;">not owned</div>
200             [% END %]
201         </td>
202         </tr>
203     [% END %]
204     </tbody>
205     </table>
206
207     <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
208     [% IF ( budget_period_locked ) %]
209         <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled="disabled"/> -->
210     [% ELSE %]
211         <fieldset class="action"><input type="button"  onclick="Check(this.form)" value="Save"/></fieldset>
212     [% END %]
213
214
215 <div id="hide_div">
216     [% FOREACH authvals_ro IN authvals_row %]
217
218      [% UNLESS ( authvals_ro.display ) %]
219         <input type="hidden" value="[% authvals_ro.code %]"  name="hide_cols"/>
220      [% END %]
221     [% END %]
222
223  </div>
224
225
226 </form>
227
228         [% ELSIF not budget_period_id %]
229 <div class="dialog alert">That budget does not exist! Please select a budget to continue.</div>
230         [% ELSE %]
231 <div class="dialog message">No funds to display for this search criteria</div>
232         [% END %]
233
234
235 </div>
236 </div>
237 <div class="yui-b">
238
239 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
240     <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
241 <fieldset class="brief">
242 <h4>Filter</h4>
243 [% BLOCK planning_types %]
244 [%   SWITCH type %]
245 [%     CASE 'MONTHS'    %]<span>by months</span>
246 [%     CASE 'ITEMTYPES' %]<span>by item types</span>
247 [%     CASE 'BRANCHES'  %]<span>by libraries</span>
248 [%   END %]
249 [% END %]
250 <ol>
251     <li>
252         <label for="authcat"> Select planning type:</label>
253         <select name="authcat" id="authcat" size="1">
254         [% FOREACH value IN authcat_dropbox.values %]
255             [% IF ( value == authcat_dropbox.default ) %]
256             <option value="[% value %]" selected="selected">[% PROCESS planning_types type=value %]</option>
257             [% ELSE %]
258             <option value="[% value %]">[% PROCESS planning_types type=value %]</option>
259             [% END %]
260         [% END %]
261         </select>
262     </li>
263     <li class="radio">
264     [% IF ( show_mine ) %]
265         <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
266     [% ELSE %]
267         <input type="checkbox" id="show_mine"  name="show_mine" value="1"  />
268     [% END %]
269     <label for="show_mine">Show my funds only</label>
270     </li>
271
272     <li class="radio">
273     [% IF ( show_active ) %]
274         <input type="checkbox" id="show_active" name="show_active" value="1" checked="checked" />
275     [% ELSE %]
276         <input type="checkbox" id="show_active" name="show_active" value="1" />
277         [% END %]
278     <label for="show_active">Show active funds only</label>
279     </li>
280
281
282     <li class="radio">
283         [% IF ( show_actual ) %]
284             <input type="checkbox" id="show_actual" name="show_actual" value="1" checked="checked" />
285         [% ELSE %]
286             <input type="checkbox" id="show_actual" name="show_actual" value="1"  />
287         [% END %]
288         <label for="show_actual">Show actual/estimated values</label>
289     </li>
290     </ol>
291     <fieldset class="action">
292         <input type="submit" name="option_submit" value="Submit" />
293         <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
294     </fieldset>
295 </fieldset>
296 </form>
297 [% IF ( budget_lines ) %]
298 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
299 <fieldset class="brief">
300 <h4>Export</h4>
301     <ol>
302         <li><label for="basename">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" /></li>
303         <li><label class="inline" for="MIME">Into an application</label>
304             <select name="MIME" id="MIME" size="1">
305             [% FOREACH value IN CGIextChoice %]
306                 <option value="[% value %]">[% value %]</option>
307             [% END %]
308             </select>
309             <select name="sep" id="sep" size="1">
310             [% FOREACH value IN CGIsepChoice %]
311                 <option value="[% value %]">[% value %]</option>
312             [% END %]
313             </select>
314         </li>
315     </ol>
316     <fieldset class="action">    <input type="submit" value="Submit"/>
317     <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
318     <input type="hidden" name="report_name" value="[% report_name %]" />
319     <input type="hidden" name="output" value="file" /></fieldset>
320     <input type="hidden" name="budget_period_id" value="[% budget_period_id %]" />
321     <input type="hidden" name="authcat" value="[% authcat %]" />
322     </fieldset>
323 </form>
324 [% END %]
325
326 [% INCLUDE 'acquisitions-menu.inc' %]
327 </div>
328 </div>
329 [% INCLUDE 'intranet-bottom.inc' %]