Bug 5946 : (MT1177) aqplan.pl, fix the problem of calculating the total remaining.
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqplan.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>Koha &rsaquo; Administration &rsaquo; Budgets &rsaquo; Funds &rsaquo; Planning for <!-- TMPL_VAR NAME="budget_period_description" --> by <!-- TMPL_VAR NAME="authcat" --></title>
3 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
4 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
5 <script type="text/javascript" src="<!-- TMPL_VAR NAME="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     <!-- TMPL_LOOP NAME="authvals_row" -->
52         itemData.push( {   text: "<!-- TMPL_VAR NAME="val" -->",  onclick: { fn: addColumn, obj:  ["<!-- TMPL_VAR NAME="colnum" -->",  "<!-- TMPL_VAR NAME="code" -->"]    }    }     );
53
54     <!-- /TMPL_LOOP -->
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>
70 <!-- TMPL_INCLUDE NAME="header.inc" -->
71 <!-- TMPL_INCLUDE NAME="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=<!-- TMPL_VAR NAME="budget_period_id" -->">Funds</a> &rsaquo;
78     <a href="/cgi-bin/koha/admin/aqplan.pl?budget_period_id=<!-- TMPL_VAR NAME="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 <!-- TMPL_INCLUDE NAME="budgets-admin-toolbar.inc" -->
88
89 <form method="post" id="Aform" name="Aform"  action="/cgi-bin/koha/admin/aqplan.pl">
90 <h3>Planning for <!-- TMPL_VAR NAME="budget_period_description" --> by <!-- TMPL_VAR NAME="authcat" --></h3>
91 <input type="hidden" name="authcat" value="<!-- TMPL_VAR NAME="authcat" -->" />
92 <!-- Budget Lines -->
93
94     <!-- TMPL_IF NAME="budget_lines" -->
95
96     <!-- TMPL_IF name="currency" --><p><b>Currency = <!-- TMPL_VAR name="currency" --></b>.
97     <!-- TMPL_IF NAME="show_actual" -->
98         <b>Each cell contain both actual and estimated values.</b>
99     <!-- TMPL_ELSE -->
100         <b>Cells contain estimated values only.</b>
101     <!-- /TMPL_IF -->
102     </p><!-- TMPL_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 <!-- TMPL_IF NAME="show_actual" -->
104         <p><b>Each cell contain both actual and estimated values.</b></p>
105     <!-- TMPL_ELSE -->
106         <p><b>Cells contain estimated values only.</b></p>
107     <!-- /TMPL_IF -->
108     <!-- /TMPL_IF -->
109
110     <table id="plan" width="100%">
111     <thead>
112     <tr>
113     <th>Fund name</th>
114     <th>Fund total</th>
115
116     <!-- TMPL_LOOP NAME="authvals_row" -->
117          <!-- TMPL_IF NAME="display" -->
118             <th id="col<!-- TMPL_VAR NAME="code" -->" class="<!-- TMPL_VAR NAME="colnum" -->">
119         <!-- TMPL_ELSE -->
120             <th id="col<!-- TMPL_VAR NAME="code" -->" styl="display:none;" class="<!-- TMPL_VAR NAME="colnum" -->">
121         <!-- /TMPL_IF -->
122
123     <!-- TMPL_VAR NAME="code" --></th>
124     <!-- /TMPL_LOOP -->
125
126     <th>Fund remaining</th><th>&nbsp;</th>
127     </tr>
128     <tr>
129     <th>&nbsp;</th><th>&nbsp;</th>
130     <!-- TMPL_LOOP NAME="authvals_row" -->
131          <!-- TMPL_IF NAME="display" -->
132             <th class="<!-- TMPL_VAR NAME="colnum" -->">
133         <!-- TMPL_ELSE -->
134             <th style="display:none;" class="<!-- TMPL_VAR NAME="colnum" -->">
135         <!-- /TMPL_IF -->
136
137     <a class="control" onclick="delColumn('<!-- TMPL_VAR NAME="colnum" -->', 'col<!-- TMPL_VAR NAME="code" -->')" href="#" title="Hide this column">[ hide ]</a></th>
138
139     <!-- /TMPL_LOOP -->
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     <!-- TMPL_LOOP NAME="budget_lines" -->
147     <!-- TMPL_UNLESS NAME="__odd__" --><tr class="highlight"><!-- TMPL_ELSE --><tr><!-- /TMPL_UNLESS -->
148
149         <td align="left"<!-- TMPL_IF NAME="budget_lock" --> class="locked" title="Fund locked"<!-- /TMPL_IF -->><a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_id=<!-- TMPL_VAR NAME="budget_id" -->&amp;budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->"><!-- TMPL_VAR NAME="budget_name_indent"--></a></td>
150         <td><span id="budget_tot_formatted_<!-- TMPL_VAR NAME="budget_id" -->"><!-- TMPL_VAR NAME="budget_amount_formatted"-->&nbsp;</span>
151
152
153         <!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
154         <div style="display:none;" id="budget_tot_<!-- TMPL_VAR NAME="budget_id" -->"><!-- TMPL_VAR NAME="budget_amount"--></div></td>
155
156         <!-- TMPL_LOOP NAME="lines"     -->
157             <!-- TMPL_IF NAME="display" -->
158                 <td class="<!-- TMPL_VAR NAME="colnum"-->">
159             <!-- TMPL_ELSE -->
160                 <td style="display:none;" class="<!-- TMPL_VAR NAME="colnum"-->">
161             <!-- /TMPL_IF -->
162             <table class="invis" width="100%">
163                 <tr>
164                     <!-- TMPL_IF Name="show_actual" -->
165                         <td   width="50%"  ><!-- TMPL_VAR NAME="actual_amount" --></td>
166                     <!--/TMPL_IF -->
167                 <td>
168
169                 <!--TMPL_IF  Name="budget_lock" -->
170                     <!-- TMPL_VAR NAME="estimated_amount" -->&nbsp;
171                     <input type="hidden" style="text-align: right;"  name="<!-- TMPL_VAR NAME="cell_name"-->" value="<!-- TMPL_VAR NAME="estimated_amount" -->"   />
172                 <!--TMPL_ELSE -->
173                     <input type="text" style="text-align: right;  width:90%; " size="6" name="<!-- TMPL_VAR NAME="cell_name"-->"  value="<!-- TMPL_VAR NAME="estimated_amount" -->"  id="budget_<!-- TMPL_VAR NAME="budget_id"--><!-- TMPL_VAR NAME="colnum"-->" class="plan_entry_<!-- TMPL_VAR NAME="budget_id"-->" onchange="calcTotalRow(this);" />
174                 <!--/TMPL_IF -->
175
176                 </td></tr>
177             </table>
178             </td>
179         <!-- /TMPL_LOOP -->
180
181         <td>
182         <table class="invis" width="100%">
183             <tr>
184        <!-- TMPL_IF Name="show_actual" -->
185             <!-- TMPL_IF NAME="act_negative" -->
186                 <td width="50%" style="color: red;">
187             <!-- TMPL_ELSIF NAME="act_positive" -->
188                 <td width="50%" style="color: green;">
189             <!-- TMPL_ELSE -->
190                 <td width="50%">
191             <!--/TMPL_IF -->
192                     <!-- TMPL_VAR NAME="budget_act_remain"-->
193             </td>
194         <!-- /TMPL_IF -->
195
196         <!-- TMPL_IF NAME="est_negative" -->
197             <td width="50%" style="color: red;" id="budget_est_<!-- TMPL_VAR NAME="budget_id"-->">
198         <!-- TMPL_ELSIF NAME="est_positive" -->
199             <td width="50%" style="color: green;" id="budget_est_<!-- TMPL_VAR NAME="budget_id"-->">
200         <!-- TMPL_ELSE -->
201             <td width="50%" id="budget_est_<!-- TMPL_VAR NAME="budget_id"-->">
202         <!--/TMPL_IF --> 
203                 <!-- TMPL_VAR NAME="budget_est_remain"-->&nbsp;
204             </td>
205             </tr>
206         </table>
207         </td>
208
209         <td>
210              <!-- TMPL_UNLESS Name="budget_lock" -->
211                     <input type="button"  onclick="autoFillRow('<!-- TMPL_VAR NAME="budget_id"-->')" value="Auto-fill row"/>
212             <!-- TMPL_ELSE  -->
213              <div style="color:red;">not owned</div>
214             <!-- /TMPL_UNLESS  -->
215         </td>
216         </tr>
217     <!-- /TMPL_LOOP -->
218     </tbody>
219     </table>
220
221     <!-- TMPL_IF name="budget_period_locked" -->
222         <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled="disabled"/> -->
223     <!-- TMPL_ELSE -->
224         <fieldset class="action"><input type="button"  onclick="Check(this.form)" value="Save"/></fieldset>
225     <!-- /TMPL_IF -->
226
227
228 <div id="hide_div">
229     <!-- TMPL_LOOP NAME="authvals_row" -->
230
231      <!-- TMPL_UNLESS Name="display" -->
232         <input type="hidden" value="<!-- TMPL_VAR NAME="code" -->"  name="hide_cols"/>
233      <!-- /TMPL_UNLESS -->
234     <!-- /TMPL_LOOP -->
235
236  </div>
237
238
239 </form>
240
241         <!-- TMPL_ELSE     -->
242 <div class="dialog message">No funds to display for this search criteria</div>
243         <!-- /TMPL_IF  -->
244
245
246 </div>
247 </div>
248 <div class="yui-b">
249
250 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
251 <fieldset class="brief">
252 <h4>Filter</h4>
253
254 <ol>
255     <li>
256         <label for="authcat"> Select planning type:</label>
257         <!-- TMPL_VAR NAME="authcat_dropbox" -->
258     </li>
259     <li class="radio">
260     <!-- TMPL_IF NAME="show_mine" -->
261         <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
262     <!-- TMPL_ELSE -->
263         <input type="checkbox" id="show_mine"  name="show_mine" value="1"  />
264     <!-- /TMPL_IF -->
265     <label for="show_mine">Show my funds only</label>
266     </li>
267
268     <li class="radio">
269     <!-- TMPL_IF NAME="show_active" -->
270         <input type="checkbox" id="show_active" name="show_active" value="1" checked="checked" />
271     <!-- TMPL_ELSE -->
272         <input type="checkbox" id="show_active" name="show_active" value="1" />
273         <!-- /TMPL_IF -->
274     <label for="show_active">Show active funds only</label>
275     </li>
276
277
278     <li class="radio">
279         <!-- TMPL_IF NAME="show_actual" -->
280             <input type="checkbox" id="show_actual" name="show_actual" value="1" checked="checked" />
281         <!-- TMPL_ELSE -->
282             <input type="checkbox" id="show_actual" name="show_actual" value="1"  />
283         <!-- /TMPL_IF -->
284         <label for="show_actual">Show actual/estimated values</label>
285     </li>
286     </ol>
287 <fieldset class="action">
288         <input type="submit" name="option_submit" value="Submit" /></fieldset>
289 </fieldset>
290 </form>
291 <!-- TMPL_IF NAME="budget_lines" -->
292 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
293 <h4>Export</h4>
294 <fieldset class="brief">
295     <ol>
296     <li><label for="basename">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" /></li>
297     <li><label class="inline" for="MIME">Into an application
298     </label><!-- TMPL_VAR NAME="CGIextChoice" -->
299     <!-- TMPL_VAR NAME="CGIsepChoice" --></li>
300     </ol>
301     <fieldset class="action">    <input type="submit" value="Submit"/>
302     <input type="hidden" name="report_name" value="<!--TMPL_VAR NAME="report_name" -->" />
303     <input type="hidden" name="output" value="file" /></fieldset>
304     </fieldset>
305 </form>
306 <!-- /TMPL_IF -->
307
308 <!-- TMPL_INCLUDE NAME="acquisitions-menu.inc" -->
309 </div>
310 </div>
311 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->