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