Bug 7760: Add unique ids and a module class to all administration pages
[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 [% INCLUDE 'calendar.inc' %]
5 <script type="text/javascript" src="[% themelang %]/js/acq.js"></script>
6 <script type="text/javascript">
7 //<![CDATA[
8 // ---------------------------------------------------------------------
9 // Javascript
10 // ---------------------------------------------------------------------
11     function Check(f) {
12             var ok=1;
13             var _alertString="";
14             var alertString2;
15             var arr = document.getElementsByName('est_total')
16
17             for ( var i=0, len=arr.length; i<len; ++i ){
18                     var tot = arr[i].innerHTML;
19
20                     if (tot == 'NaN') {
21                         _alertString += "\n- " + _("One or more cell values is non-numeric");
22                     }
23             }
24
25             if (_alertString.length==0) {
26
27                 var op  = document.createElement('input');
28                 op.setAttribute("type","hidden");
29                 op.setAttribute("name","op");
30                 op.setAttribute("value","save");   //ohh the pain...
31
32                 document.Aform.appendChild(op);
33                 document.Aform.submit()
34
35             } else {
36                     alertString2  = _("Form not submitted because of the following problem(s)");
37                     alertString2 += "\n------------------------------------------------------------------------------------\n";
38                     alertString2 += _alertString;
39                     alert(alertString2);
40             }
41     }
42
43
44 YAHOO.util.Event.onAvailable("popmenu", function () {
45
46     var itemData  = new Array();
47     table = document.getElementById('plan') 
48     tableTmp =  table.cloneNode(true); 
49     tableTmp.id = 'planTmp';
50
51     [% FOREACH authvals_ro IN authvals_row %]
52         itemData.push( {   text: "[% authvals_ro.val %]",  onclick: { fn: addColumn, obj:  ["[% authvals_ro.colnum %]",  "[% authvals_ro.code %]"]    }    }     );
53
54     [% END %]
55     oMenu = new YAHOO.widget.Menu("basicmenu",
56             {  position: "dynamic", itemdata: itemData , clicktohide  : "true" , context:["popmenu","tl","tr"] }
57     );
58
59    oMenu.render("popmenu");
60    YAHOO.util.Event.addListener("add_popmenu_item", "click", oMenu.show, null, oMenu);
61
62 // oMenu.removeItem(2);   // TODO.....
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
87 [% INCLUDE 'budgets-admin-toolbar.inc' %]
88
89 <form method="post" id="Aform" name="Aform"  action="/cgi-bin/koha/admin/aqplan.pl">
90 <h3>Planning for [% budget_period_description %] by [% authcat %]</h3>
91 <input type="hidden" name="authcat" value="[% authcat %]" />
92 <!-- Budget Lines -->
93
94     [% IF ( budget_lines ) %]
95
96     [% IF ( currency ) %]<p><b>Currency = [% currency %]</b>.
97     [% IF ( show_actual ) %]
98         <b>Each cell contain both actual and estimated values.</b>
99     [% ELSE %]
100         <b>Cells contain estimated values only.</b>
101     [% END %]
102     </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>
103 [% IF ( show_actual ) %]
104         <p><b>Each cell contain both actual and estimated values.</b></p>
105     [% ELSE %]
106         <p><b>Cells contain estimated values only.</b></p>
107     [% END %]
108     [% END %]
109
110     <table id="plan" width="100%">
111     <thead>
112     <tr>
113     <th>Fund name</th>
114     <th>Fund total</th>
115
116     [% FOREACH authvals_ro IN authvals_row %]
117          [% IF ( authvals_ro.display ) %]
118             <th id="col[% authvals_ro.code %]" class="[% authvals_ro.colnum %]">
119         [% ELSE %]
120             <th id="col[% authvals_ro.code %]" styl="display:none;" class="[% authvals_ro.colnum %]">
121         [% END %]
122
123     [% authvals_ro.code %]</th>
124     [% END %]
125
126     <th>Fund remaining</th><th>&nbsp;</th>
127     </tr>
128     <tr>
129     <th>&nbsp;</th><th>&nbsp;</th>
130     [% FOREACH authvals_ro IN authvals_row %]
131          [% IF ( authvals_ro.display ) %]
132             <th class="[% authvals_ro.colnum %]">
133         [% ELSE %]
134             <th style="display:none;" class="[% authvals_ro.colnum %]">
135         [% END %]
136
137     <a class="control" onclick="delColumn('[% authvals_ro.colnum %]', 'col[% authvals_ro.code %]')" href="#" title="Hide this column">[ hide ]</a></th>
138
139     [% END %]
140     <th id="popmenu"><a style="font-size:85%;text-decoration:none;" id="add_popmenu_item" href="#" title="Show a hidden column">[ show a column ]</a></th><th>&nbsp;</th>
141      </tr>
142
143     </thead>
144
145     <tbody>
146     [% FOREACH budget_line IN budget_lines %]
147     [% UNLESS ( loop.odd ) %]<tr class="highlight">[% ELSE %]<tr>[% END %]
148         [% IF ( budget_line.budget_lock ) %]
149             <td align="left" class="locked" title="Fund locked">
150         [% ELSE %]
151             <td align="left">
152         [% END %]
153         <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>
154         <td><span id="budget_tot_formatted_[% budget_line.budget_id %]">[% budget_line.budget_amount_formatted %]&nbsp;</span>
155
156
157         <!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
158         <div style="display:none;" id="budget_tot_[% budget_line.budget_id %]">[% budget_line.budget_amount %]</div></td>
159
160         [% FOREACH line IN budget_line.lines %]
161             [% IF ( line.display ) %]
162                 <td class="[% line.colnum %]">
163             [% ELSE %]
164                 <td style="display:none;" class="[% line.colnum %]">
165             [% END %]
166             <table class="invis" width="100%">
167                 <tr>
168                     [% IF ( line.show_actual ) %]
169                         <td   width="50%"  >[% line.actual_amount %]</td>
170                     [% END %]
171                 <td>
172
173                 [% IF ( line.budget_lock ) %]
174                     [% line.estimated_amount %]&nbsp;
175                     <input type="hidden" style="text-align: right;"  name="[% line.cell_name %]" value="[% line.estimated_amount %]"   />
176                 [% ELSE %]
177                     <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);" />
178                 [% END %]
179
180                 </td></tr>
181             </table>
182             </td>
183         [% END %]
184
185         <td>
186         <table class="invis" width="100%">
187             <tr>
188        [% IF ( budget_line.show_actual ) %]
189             [% IF ( budget_line.act_negative ) %]
190                 <td width="50%" style="color: red;">
191             [% ELSIF ( budget_line.act_positive ) %]
192                 <td width="50%" style="color: green;">
193             [% ELSE %]
194                 <td width="50%">
195             [% END %]
196                     [% budget_line.budget_act_remain %]
197             </td>
198         [% END %]
199
200         [% IF ( budget_line.est_negative ) %]
201             <td width="50%" style="color: red;" id="budget_est_[% budget_line.budget_id %]">
202         [% ELSIF ( budget_line.est_positive ) %]
203             <td width="50%" style="color: green;" id="budget_est_[% budget_line.budget_id %]">
204         [% ELSE %]
205             <td width="50%" id="budget_est_[% budget_line.budget_id %]">
206         [% END %] 
207                 [% budget_line.budget_est_remain %]&nbsp;
208             </td>
209             </tr>
210         </table>
211         </td>
212
213         <td>
214              [% UNLESS ( budget_line.budget_lock ) %]
215                     <input type="button"  onclick="autoFillRow('[% budget_line.budget_id %]')" value="Auto-fill row"/>
216             [% ELSE %]
217              <div style="color:red;">not owned</div>
218             [% END %]
219         </td>
220         </tr>
221     [% END %]
222     </tbody>
223     </table>
224
225     [% IF ( budget_period_locked ) %]
226         <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled="disabled"/> -->
227     [% ELSE %]
228         <fieldset class="action"><input type="button"  onclick="Check(this.form)" value="Save"/></fieldset>
229     [% END %]
230
231
232 <div id="hide_div">
233     [% FOREACH authvals_ro IN authvals_row %]
234
235      [% UNLESS ( authvals_ro.display ) %]
236         <input type="hidden" value="[% authvals_ro.code %]"  name="hide_cols"/>
237      [% END %]
238     [% END %]
239
240  </div>
241
242
243 </form>
244
245         [% ELSE %]
246 <div class="dialog message">No funds to display for this search criteria</div>
247         [% END %]
248
249
250 </div>
251 </div>
252 <div class="yui-b">
253
254 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
255 <fieldset class="brief">
256 <h4>Filter</h4>
257
258 <ol>
259     <li>
260         <label for="authcat"> Select planning type:</label>
261         [% authcat_dropbox %]
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" /></fieldset>
293 </fieldset>
294 </form>
295 [% IF ( budget_lines ) %]
296 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
297 <h4>Export</h4>
298 <fieldset class="brief">
299     <ol>
300     <li><label for="basename">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" /></li>
301     <li><label class="inline" for="MIME">Into an application
302     </label>[% CGIextChoice %]
303     [% CGIsepChoice %]</li>
304     </ol>
305     <fieldset class="action">    <input type="submit" value="Submit"/>
306     <input type="hidden" name="report_name" value="[% report_name %]" />
307     <input type="hidden" name="output" value="file" /></fieldset>
308     </fieldset>
309 </form>
310 [% END %]
311
312 [% INCLUDE 'acquisitions-menu.inc' %]
313 </div>
314 </div>
315 [% INCLUDE 'intranet-bottom.inc' %]