BUGFIX new_acq (Javascript error under certain circumstances)
[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
8 </head>
9 <body>
10 <!-- TMPL_INCLUDE NAME="header.inc" -->
11 <!-- TMPL_INCLUDE NAME="budgets-admin-search.inc" -->
12
13 <script type="text/javascript" src="<!-- TMPL_VAR NAME='themelang' -->/js/acq.js"></script>
14 <script type="text/javascript">
15 // ######################################################################
16 // Javascript
17 // ######################################################################
18     function Check(f) {
19             var ok=1;
20             var _alertString="";
21             var alertString2;
22             var arr = document.getElementsByName('est_total')
23
24             for ( var i=0, len=arr.length; i<len; ++i ){
25                     var tot = arr[i].innerHTML;
26
27                     if (tot == 'NaN') {
28                         _alertString += "\n- " + _("One or more cell values is non-numeric");
29                     }
30             }
31
32             if (_alertString.length==0) {
33                     document.Aform.submit();
34             } else {
35                     alertString2  = _("Form not submitted because of the following problem(s)");
36                     alertString2 += "\n------------------------------------------------------------------------------------\n";
37                     alertString2 += _alertString;
38                     alert(alertString2);
39             }
40     }
41 </script>
42
43 <div id="breadcrumbs">
44     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
45     <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
46     <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->">Budgets</a> &rsaquo;
47     <a href="/cgi-bin/koha/admin/aqplan.pl?budget_period_id=   <!-- TMPL_VAR NAME="budget_period_id" -->">Planning</a> &rsaquo;
48 </div>
49
50 <div id="doc3" class="yui-t2">
51 <div id="bd">
52 <div id="yui-main">
53 <div class="yui-b">
54
55 <!-- TMPL_INCLUDE NAME="budgets-admin.inc" -->    
56
57 <h1>Planning for <!-- TMPL_VAR NAME="budget_period_description" --> by <!-- TMPL_VAR NAME="authcat" --></h1>
58 <br>
59
60 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
61     <fieldset>
62     <legend>Planning options</legend>
63      <li><label for="budget_period_dropbox">Select budget period:</label>
64      <!-- TMPL_VAR name="budget_period_dropbox" -->
65     </li>
66
67     <li><label for="authcat_dropbox"  > Select planning type:</label>
68     <!-- TMPL_VAR NAME="authcat_dropbox" -->
69     </li>
70
71     <li>
72     <!-- TMPL_IF NAME="show_mine" -->
73         <input type="checkbox" id="show_mine"  name="show_mine" value="1" checked="checked" />
74     <!-- TMPL_ELSE -->  
75         <input type="checkbox" id="show_mine"  name="show_mine" value="1"  />
76     <!-- /TMPL_IF -->  
77     <label for="show_mine">Show my budgets only</label>
78     </li>
79     <input type="hidden" name="show" value="1"  -->
80
81     <li>
82     <!-- TMPL_IF NAME="show_active" -->
83         <input type="checkbox" id="show_active" name="show_active" value="1" checked="checked" />
84     <!-- TMPL_ELSE -->  
85         <input type="checkbox" id="show_active" name="show_active" value="1" />
86         <!-- /TMPL_IF --> 
87     <label for="show_active">Show active budgets only</label>
88     </li>
89
90     <!-- TMPL_UNLESS  name="budget_period_locked" -->
91         <li>
92         <label for="show_actual">Show actual/estimated values:</label>
93         <!-- TMPL_IF NAME="show_actual" -->
94             <input type="checkbox" name="show_actual" value="1"   checked="checked" />
95         <!-- TMPL_ELSE -->  
96             <input type="checkbox" name="show_actual" value="1"  />
97         <!-- /TMPL_IF -->
98         </li>
99     <!-- /TMPL_UNLESS -->
100
101     <li>
102     <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->" />
103      <input style="position:relative; left:180px"   type="submit" value="Select" />
104     </li>
105     <br>
106     </fieldset>
107 </form>
108
109 <form method="post" name="Aform"  ction="/cgi-bin/koha/admin/aqplan.pl">
110     <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR NAME="budget_period_id" -->" />
111
112     <table>
113     <tr>
114     <th>Budget name</th>
115     <th>Budget total</th>
116     <!-- TMPL_LOOP NAME="authvals_row" -->
117         <th><!-- TMPL_VAR NAME="val" --></th>
118     <!-- /TMPL_LOOP -->
119     <th >Budget remaining</th>
120
121     <!-- TMPL_UNLESS Name="budget_period_locked" -->
122         <th></th>
123     <!-- /TMPL_UNLESS -->
124     </tr>
125
126     <!-- TMPL_LOOP NAME="budget_lines" -->
127         <tr>
128         <td align='left'><!-- TMPL_VAR NAME="budget_name_indent"--></td>
129         <td align='center'><span id='budget_tot_formatted" -->'><!-- TMPL_VAR NAME="budget_amount_formatted"--></span></td>
130
131         <!-- NEXT DIV ELEMENT IS USED BY JS FOR CALC-ING AUTO-FILL AND ESTIMATED AMOUNTS -->
132         <div style="display:none;" id='budget_tot_<!-- TMPL_VAR NAME="budget_id" -->'><!-- TMPL_VAR NAME="budget_amount"--></div>
133         <!-- TMPL_LOOP NAME="lines"     -->
134
135             <td align='center'>
136             <span>
137             <!-- TMPL_IF Name="show_actual" -->
138                 <!-- TMPL_VAR NAME="actual_amount" --> /
139             <!--/TMPL_IF -->
140             <!-- TMPL_IF Name="budget_period_locked" -->
141                 <!-- TMPL_VAR NAME="estimated_amount" -->
142             <!--TMPL_ELSIF  Name="budget_lock" -->
143                 <!-- TMPL_VAR NAME="estimated_amount" -->
144             <!--TMPL_ELSE -->
145             <input type="text" style="text-align: right;" 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);" >
146             <!--/TMPL_IF -->
147
148             </span>
149             </td>
150         <!-- /TMPL_LOOP -->
151
152         <td align="center">
153
154         <!-- TMPL_IF Name="show_actual" -->
155             <span
156             <!-- TMPL_IF NAME="act_negative" --> style="color: red;" <!--/TMPL_IF -->
157                 <!-- TMPL_IF NAME="act_positive" --> style="color: green;" <!--/TMPL_IF --> >
158                 <!-- TMPL_VAR NAME="budget_act_remain"-->
159             </span> /
160         <!-- /TMPL_IF -->
161         <span
162         <!-- TMPL_IF NAME="est_negative" --> style="color: red;" <!--/TMPL_IF -->
163         <!-- TMPL_IF NAME="est_positive" --> style="color: green;" <!--/TMPL_IF -->
164         name="est_total" id='budget_est_<!-- TMPL_VAR NAME="budget_id"-->'><!-- TMPL_VAR NAME="budget_est_remain"-->
165         </span></td>
166         <!-- TMPL_UNLESS Name="budget_period_locked" -->
167             <td><input type="button"  onclick="autoFillRow('<!-- TMPL_VAR NAME="budget_id"-->')" value="Auto-fill row"/> </td>
168         <!-- /TMPL_UNLESS  -->
169         </tr>
170     <!-- /TMPL_LOOP -->
171     </table>
172     <!-- TMPL_IF NAME="show_actual" -->
173         <span><b>Cells contain 'Actual / Estimated' values.</b></span><br>
174     <!-- TMPL_ELSE -->
175         <span><b>Cells contain estimated values only.</b></span><br>
176     <!-- /TMPL_IF -->
177     <span><b>Currency = <!-- TMPL_VAR NAME="cur" --> <!-- TMPL_VAR NAME="cur_format" --></b></span><br>
178     <!-- TMPL_IF name="budget_period_locked" -->
179         <!-- <input STYLE="background: gray;"   type="submit" value="Save" disabled='disabled'/> -->
180     <!-- TMPL_ELSE -->
181         <input type="button"  onclick="Check(this.form)" value="Save"/>
182         <input type="hidden" name="op" value="save"/>
183     <!-- /TMPL_IF -->
184         <input type="hidden" name="authcat" value="<!-- TMPL_VAR NAME="authcat"-->"/>
185 </form>
186
187 <form method="post" action="/cgi-bin/koha/admin/aqplan.pl">
188 <fieldset class="rows">
189     <ol>
190     <li><label for="outputfile">Output to a file named: </label><input type="text" name="basename" id="basename" value="Export" />
191     <label class="inline" for="MIME">Into an application
192     </label><!-- TMPL_VAR NAME="CGIextChoice" -->
193     <!-- TMPL_VAR NAME="CGIsepChoice" --> &nbsp;&nbsp;&nbsp;
194     <input type="submit" value="Output"/>
195     <input type="hidden" name="report_name" value="<!--TMPL_VAR NAME="report_name" -->" />
196     <input type="hidden" name="output" value="file" />
197     </li></ol>
198     </fieldset>
199 </form>
200
201 </div>
202 </div>
203 <div class="yui-b">
204 <!-- TMPL_INCLUDE NAME="admin-menu.inc" -->
205 </div>
206 </div>
207 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->