(bug #4135) fix aqplan form
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqplan.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <title>
3 Budget planning
4 </title>
5 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
6 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
7 <link href="<!-- TMPL_VAR NAME="yuipath" -->/reset/reset.css" rel="stylesheet" type="text/css" />
8 <link href="<!-- TMPL_VAR NAME="yuipath" -->/fonts/fonts.css" rel="stylesheet" type="text/css" />
9 <link href="<!-- TMPL_VAR NAME="yuipath" -->/menu/assets/menu.css" rel="stylesheet" type="text/css" />
10 <link href="<!-- TMPL_VAR NAME="yuipath" -->/container/assets/skins/sam/container.css"  rel="stylesheet" type="text/css" />
11
12 <script  src="<!-- TMPL_VAR NAME="yuipath" -->/yahoo/yahoo.js" type="text/javascript"></script>
13 <script  src="<!-- TMPL_VAR NAME="yuipath" -->/event/event.js" type="text/javascript"></script>
14 <script  src="<!-- TMPL_VAR NAME="yuipath" -->/dom/dom.js" type="text/javascript"></script>
15 <script  src="<!-- TMPL_VAR NAME="yuipath" -->/menu/menu.js" type="text/javascript"></script>
16 <script  src="<!-- TMPL_VAR NAME="yuipath" -->/container/menu.js" type="text/javascript"></script>
17 <script  src="<!-- TMPL_VAR NAME="yuipath" -->/yahoo-dom-event/yahoo-dom-event.js"  type="text/javascript"></script>
18
19 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
20 <script type="text/javascript">
21 // ---------------------------------------------------------------------
22 // Javascript
23 // ---------------------------------------------------------------------
24     function Check(f) {
25             var ok=1;
26             var _alertString="";
27             var alertString2;
28             var arr = document.getElementsByName('est_total')
29
30             for ( var i=0, len=arr.length; i<len; ++i ){
31                     var tot = arr[i].innerHTML;
32
33                     if (tot == 'NaN') {
34                         _alertString += "\n- " + _("One or more cell values is non-numeric");
35                     }
36             }
37
38             if (_alertString.length==0) {
39
40                 var op  = document.createElement('input');
41                 op.setAttribute("type","hidden");
42                 op.setAttribute("name","op");
43                 op.setAttribute("value","save");   //ohh the pain...
44
45                 document.Aform.appendChild(op);
46                 document.Aform.submit()
47
48             } else {
49                     alertString2  = _("Form not submitted because of the following problem(s)");
50                     alertString2 += "\n------------------------------------------------------------------------------------\n";
51                     alertString2 += _alertString;
52                     alert(alertString2);
53             }
54     }
55
56
57 YAHOO.util.Event.onAvailable("popmenu", function () {
58
59     var itemData  = new Array();
60     table = document.getElementById('plan') 
61     tableTmp =  table.cloneNode(true); 
62     tableTmp.id = 'planTmp';
63
64     <!-- TMPL_LOOP NAME="authvals_row" -->
65         itemData.push( {   text: "<!-- TMPL_VAR NAME="val" -->",  onclick: { fn: addColumn, obj:  ["<!-- TMPL_VAR NAME="colnum" -->",  "<!-- TMPL_VAR NAME="code" -->"]    }    }     );
66
67     <!-- /TMPL_LOOP -->
68     oMenu = new YAHOO.widget.Menu("basicmenu",
69             {  position: "dynamic", itemdata: itemData , clicktohide  : "true" , context:["popmenu","tl","tr"] }
70     );
71
72    oMenu.render("popmenu");
73    YAHOO.util.Event.addListener("add_popmenu_item", "click", oMenu.show, null, oMenu);
74
75 // oMenu.removeItem(2);   // TODO.....
76
77 });
78
79 </script>
80
81 <title>
82 Budget & Fund Planning
83 </title>
84 </head>
85 <body>
86 <!-- TMPL_INCLUDE NAME="header.inc" -->
87 <!-- TMPL_INCLUDE NAME="budgets-admin-search.inc" -->
88
89 <div id="breadcrumbs">
90     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
91     <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
92     <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Budgets</a> &rsaquo; 
93     <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->">Funds</a> &rsaquo;
94     <a href="/cgi-bin/koha/admin/aqplan.pl?budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->">Planning</a> &rsaquo;
95 </div>
96
97 <div id="doc3" class="yui-t2">
98 <div id="bd">
99 <div id="yui-main">
100 <div class="yui-b">
101
102
103 <!-- TMPL_INCLUDE NAME="budgets-admin-toolbar.inc" -->
104
105 <br />
106
107 <form method="post" id='Aform' name="Aform"  action="/cgi-bin/koha/admin/aqplan.pl">
108
109 <fieldset style=" border:2px solid #EEEEEE; " >
110 <legend>Planning for <!-- TMPL_VAR NAME="budget_period_description" --> by <!-- TMPL_VAR NAME="authcat" --></legend>
111     <table class="invis" >
112     <tr><td>
113     <!-- TMPL_IF NAME="show_mine" -->
114         <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
115     <!-- TMPL_ELSE -->
116         <input type="checkbox" id="show_mine"  name="show_mine" value="1"  />
117     <!-- /TMPL_IF -->
118     <label for="show_mine">Show my funds only</label>
119     </td>
120     <td>
121         <label for="authcat_dropbox"  > Select planning type:</label>
122         <!-- TMPL_VAR NAME="authcat_dropbox" -->
123         <input type="submit" name="option_submit" value="Select" />
124     </td>
125     </tr>
126
127     <tr><td>
128     <!-- TMPL_IF NAME="show_active" -->
129         <input type="checkbox" id="show_active" name="show_active" value="1" checked="checked" />
130     <!-- TMPL_ELSE -->
131         <input type="checkbox" id="show_active" name="show_active" value="1" />
132         <!-- /TMPL_IF -->
133     <label for="show_active">Show active funds only</label>
134     </td>
135     <td></td>
136     </tr>
137
138     <tr><td>
139         <!-- TMPL_IF NAME="show_actual" -->
140             <input type="checkbox"    id="show_actual"   name="show_actual" value="1"   checked="checked" />
141         <!-- TMPL_ELSE -->
142             <input type="checkbox" id="show_actual" name="show_actual" value="1"  />
143         <!-- /TMPL_IF -->
144         <label for="show_actual">Show actual/estimated values:</label>
145     </td>
146     <td></td>
147     </tr>
148     </table>
149 </fieldset>
150
151 <br />
152
153 <!-- Budget Lines -->
154
155     <!-- TMPL_IF NAME="budget_lines" -->
156
157     <!-- TMPL_IF name="cur" --><p><b>Currency = <!-- TMPL_VAR name="cur" --></b></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><!-- /TMPL_IF -->
158
159     <table id="plan" width="100%">
160     <thead>
161     <tr>
162     <th>Fund name</th>
163     <th>Fund total</th>
164
165     <!-- TMPL_LOOP NAME="authvals_row" -->
166          <!-- TMPL_IF NAME="display" -->
167             <th id="<!-- TMPL_VAR NAME="code" -->"   style="text-align: center;"
168                         class="<!-- TMPL_VAR NAME='colnum' -->" >
169         <!-- TMPL_ELSE -->
170             <th id="<!-- TMPL_VAR NAME="code" -->"   style="text-align: center;
171                             display:none;" 
172                         class="<!-- TMPL_VAR NAME='colnum' -->" >
173         <!-- /TMPL_IF -->
174
175     <!-- TMPL_VAR NAME="code" -->&nbsp;<span class="buttonPlus" onclick="delColumn('<!-- TMPL_VAR NAME="colnum" -->', '<!-- TMPL_VAR NAME="code" -->')"  > - &nbsp;</span></th>
176
177     <!-- /TMPL_LOOP -->
178
179     <th>Fund remaining</th>
180
181     <th id='popmenu' style=" text-align: center;" >
182     <span id="add_popmenu_item" class="buttonPlus" > + </span></th>
183     </tr>
184     </thead>
185
186     <tbody>
187     <!-- TMPL_LOOP NAME="budget_lines" -->
188             <!-- TMPL_IF Name="budget_lock" -->
189         <tr  class="highlight"  > 
190             <!--TMPL_ELSE -->
191         <tr > 
192             <!--/TMPL_IF -->
193
194         <td align='left'><!-- TMPL_VAR NAME="budget_name_indent"--></td>
195         <td align='right'><span id='budget_tot_formatted" -->'><!-- TMPL_VAR NAME="budget_amount_formatted"-->&nbsp;</span>
196
197         <!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
198         <div style="display:none;" id='budget_tot_<!-- TMPL_VAR NAME="budget_id" -->'><!-- TMPL_VAR NAME="budget_amount"--></div></td>
199
200         <!-- TMPL_LOOP NAME="lines"     -->
201             <td 
202             <!-- TMPL_UNLESS Name="display" --> style="display:none;"<!-- /TMPL_UNLESS -->
203                     class="<!-- TMPL_VAR NAME="colnum"-->"  >  
204             <table class="invis" width="100%">
205                 <tr>
206                     <!-- TMPL_IF Name="show_actual" -->
207                         <td   width="50%"  align="right" ><!-- TMPL_VAR NAME="actual_amount" --></td>
208                     <!--/TMPL_IF -->
209                 <td align="right">
210
211                 <!--TMPL_IF  Name="budget_lock" -->
212                     <!-- TMPL_VAR NAME="estimated_amount" -->&nbsp;
213                     <input type="hidden" style="text-align: right;"  name='<!-- TMPL_VAR NAME="cell_name"-->' value="<!-- TMPL_VAR NAME="estimated_amount" -->"   />
214                 <!--TMPL_ELSE -->
215                     <input type="text" style="text-align: right;  width:90%; " size='6' name='<!-- TMPL_VAR NAME="cell_name"-->'  value="<!-- TMPL_VAR NAME="estimated_amount" -->"  id='<!-- TMPL_VAR NAME="budget_id"-->' class='<!-- TMPL_VAR NAME="budget_id"-->' onchange="calcTotalRow(this);" />
216                 <!--/TMPL_IF -->
217
218                 </td></tr>
219             </table>
220             </td>
221         <!-- /TMPL_LOOP -->
222
223         <td>
224         <table class="invis" width="100%">
225             <tr>
226             <td width="50%"    align="right"  
227        <!-- TMPL_IF Name="show_actual" -->
228             <!-- TMPL_IF NAME="act_negative" --> style="color: red;" <!--/TMPL_IF -->
229                 <!-- TMPL_IF NAME="act_positive" --> style="color: green;" <!--/TMPL_IF --> >
230                 <!-- TMPL_VAR NAME="budget_act_remain"-->
231         <!-- TMPL_ELSE --> >
232         <!-- /TMPL_IF -->
233             </td>
234
235             <td width="50%"    align="right"  
236         <!-- TMPL_IF NAME="est_negative" --> style="color: red;" <!--/TMPL_IF --> 
237         <!-- TMPL_IF NAME="est_positive" --> style="color: green;" <!--/TMPL_IF --> 
238         name="est_total" id='budget_est_<!-- TMPL_VAR NAME="budget_id"-->'>  <!-- TMPL_VAR NAME="budget_est_remain"-->&nbsp;    
239             </td>
240             </tr>
241         </table>
242         </td>
243
244         <td align="center">
245              <!-- TMPL_UNLESS Name="budget_lock" -->
246                     <input type="button"  onclick="autoFillRow('<!-- TMPL_VAR NAME="budget_id"-->')" value="Auto-fill row"/>
247             <!-- TMPL_ELSE  -->
248              <div style="color:red;">not owned</div>
249             <!-- /TMPL_UNLESS  -->
250         </td>
251         </tr>
252     <!-- /TMPL_LOOP -->
253     <tbody>
254     </table>
255
256     <!-- TMPL_IF NAME="show_actual" -->
257         <span><b>Each cell contain both actual and estimated values.</b></span><br />
258     <!-- TMPL_ELSE -->
259         <span><b>Cells contain estimated values only.</b></span><br />
260     <!-- /TMPL_IF -->
261     <!-- TMPL_IF name="budget_period_locked" -->
262         <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled='disabled'/> -->
263     <!-- TMPL_ELSE -->
264         <input type="button"  onclick="Check(this.form)" value="Save"/>
265     <!-- /TMPL_IF -->
266
267
268 <div id='hide_div'>
269     <!-- TMPL_LOOP NAME="authvals_row" -->
270
271      <!-- TMPL_UNLESS Name="display" -->
272         <input type="hidden" value="<!-- TMPL_VAR NAME="code" -->"  name="hide_cols"/>
273      <!-- /TMPL_UNLESS -->
274     <!-- /TMPL_LOOP -->
275
276  </div>
277
278
279 </form>
280
281 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
282 <fieldset class="rows">
283     <ol>
284     <li><label for="outputfile">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" />
285     <label class="inline" for="MIME">Into an application
286     </label><!-- TMPL_VAR NAME="CGIextChoice" -->
287     <!-- TMPL_VAR NAME="CGIsepChoice" --> &nbsp;&nbsp;&nbsp;
288     <input type="submit" value="Output"/>
289     <input type="hidden" name="report_name" value="<!--TMPL_VAR NAME="report_name" -->" />
290     <input type="hidden" name="output" value="file" />
291     </li></ol>
292     </fieldset>
293 </form>
294
295         <!-- TMPL_ELSE  -->
296 No funds to display for this search criteria
297         <!-- /TMPL_IF   -->
298
299
300 </div>
301 </div>
302 </div>
303 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->