[2343] Fix currency not showing in aqbudgets
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / admin / aqbudgetperiods.tmpl
1 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
2 <!-- TMPL_INCLUDE NAME="doc-head-close.inc" -->
3 <!-- TMPL_INCLUDE NAME="calendar.inc" -->
4
5 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/js/acq.js"></script>
6 <script type="text/javascript" src="<!-- TMPL_VAR name="themelang" -->/lib/jquery/plugins/jquery.tablesorter.min.js"></script>
7 <script type="text/javascript">
8 // #################################################################################
9 // Javascript
10 // #################################################################################
11     function Check(f) {
12             var ok=1;
13             var _alertString="";
14             var alertString2;
15
16             if (!(isNotNull(f.budget_period_startdate,1))) {
17                     _alertString += "\n- " + _("Start date missing");
18             }
19
20             if (!(isNotNull(f.budget_period_enddate,1))) {
21                     _alertString += "\n- " + _("End date missing");
22             }
23
24             if ( f.budget_period_startdate >   f.budget_period_enddate )  {
25                     _alertString += "\n- " + _("Start date must be before end date");
26             }
27
28             if (!(isNotNull(f.budget_period_description,1))) {
29                     _alertString += "\n- " + _("Description missing");
30             }
31
32             if (!(isNum(f.budget_period_total))) {
33                     _alertString += "\n- " + _("Amount must be a valid number, or empty");
34             }
35
36 /*
37                         checkBudgetTotal(f) {
38                         }
39 */
40
41             if (_alertString.length==0) {
42                     f.submit();
43             } else {
44                     alertString2  = _("Form not submitted because of the following problem(s)");
45                     alertString2 += "\n------------------------------------------------------------------------------------\n";
46                     alertString2 += _alertString;
47                     alert(alertString2);
48             }
49     }
50         $(document).ready(function() {
51                  $("#periodsh").tablesorter({
52                     widgets : ['zebra'],
53                     sortList: [[0,0]],
54                     headers:  {6:{sorter:false}}
55              });
56         });
57 </script>
58
59 <title>
60     Koha &rsaquo; Administration &rsaquo; Root Budgets
61
62     <!-- TMPL_IF name="add_form" -->&rsaquo;
63         <!-- TMPL_IF name="budget_period_id" -->
64             Modify root budget'<!-- TMPL_VAR name="budget_period_id" -->'
65         <!-- TMPL_ELSE -->
66             Add root budget
67         <!-- /TMPL_IF -->
68     <!-- /TMPL_IF -->
69
70     <!-- TMPL_IF name="delete_confirm" -->&rsaquo;
71             Delete root budget '<!-- TMPL_VAR name="budget_period_description" -->'?
72     <!-- /TMPL_IF -->
73     <!-- TMPL_IF name="delete_confirmed" -->&rsaquo;
74         Data Deleted
75     <!-- /TMPL_IF -->
76 </title>
77
78
79 </head>
80
81 <body>
82
83 <!-- TMPL_INCLUDE NAME="header.inc" -->
84 <!-- TMPL_INCLUDE NAME="budgets-admin-search.inc" -->
85
86 <!-- ################################################################################# -->
87 <!-- BREADCRUMBS -->
88 <!-- ################################################################################# -->
89
90 <div id="breadcrumbs">
91     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
92     <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;
93
94     <!-- add or modify a budget period -->
95     <!-- ####################################### -->
96     <!-- TMPL_IF name="add_form" -->
97         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Root Budget</a> &rsaquo;
98         <!-- TMPL_IF name="budget_period_id" -->
99             Modify root budget <!-- TMPL_VAR name="budget_period_description" -->
100
101         <!-- TMPL_ELSE -->
102             Add root budget
103         <!-- /TMPL_IF -->
104     <!-- /TMPL_IF -->
105
106     <!-- delete a budget period -->
107     <!-- ################################ -->
108     <!-- TMPL_IF name="delete_confirm" -->
109         <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">Root budgets</a> &rsaquo;
110         <!-- TMPL_IF name="total" -->
111             Cannot delete root budget '<!-- TMPL_VAR name="budget_period_description" -->'
112         <!-- TMPL_ELSE -->
113             Delete root budget '<!-- TMPL_VAR name="budget_period_description" -->'?
114         <!-- /TMPL_IF -->
115     <!-- /TMPL_IF -->
116
117     <!-- display budget periods list -->
118     <!-- ########################################## -->
119     <!-- TMPL_IF name="else" -->
120         Root budgets administration
121     <!-- /TMPL_IF -->
122 </div>
123
124 <div id="doc3" class="yui-t2">
125 <div id="bd">
126 <div id="yui-main">
127 <div class="yui-b">
128
129 <!-- TMPL_INCLUDE NAME="budgets-admin-toolbar.inc" -->
130
131 <!-- TMPL_IF name="add_form" -->
132     <!--  add or modify a budget period   -->
133 <!--TMPL_IF Name="duplicates"--><!--TMPL_INCLUDE Name="duplicates.inc"--><!--/TMPL_IF-->
134     <!-- TMPL_IF name="budget_period_id" -->
135         <h3>Modify root budget</h3>
136     <!-- TMPL_ELSE -->
137         <h3>Add root budget</h3>
138         <!-- /TMPL_IF -->
139 <form action="/cgi-bin/koha/admin/aqbudgetperiods.pl" name="f" method="post">
140     <fieldset class="rows">
141     <!-- ################################################################################# -->
142     <!-- display information about the budget period that must be added or modified -->
143     <!-- ################################################################################# -->
144     <input type="hidden" name="op" value="add_validate" />
145     <input type="hidden" name="confirm_not_duplicate" value="<!--TMPL_VAR Name="confirm_not_duplicate"-->" />
146     <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR name="budget_period_id" -->" />
147     <ol>
148     <li>
149     <label for="datefrom">Start date</label>
150     <input type="text" size="10" id="budget_period_startdate" name="budget_period_startdate"   value="<!-- TMPL_VAR NAME="budget_period_startdate" -->"  />
151     <img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" border="0" id="openCalendarFrom" style="cursor: pointer;" valign="top" />
152     <script type="text/javascript">
153         Calendar.setup({
154         inputField     :    "budget_period_startdate",
155         ifFormat         :    "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
156         button         :    "openCalendarFrom",
157         align          :    "Tl",
158         singleClick    :    false
159         });
160     </script>
161     </li>
162     <li>
163
164     <label for="budget_period_enddate">End date</label>
165     <input type="text" size="10" id="budget_period_enddate" name="budget_period_enddate" value="<!-- TMPL_VAR NAME="budget_period_enddate" -->" />
166     <img src="/intranet-tmpl/prog/en/lib/calendar/cal.gif" border="0" id="openCalendarTo" style="cursor: pointer;" valign="top" />
167
168     <script type="text/javascript">
169         Calendar.setup({
170         inputField     :    "budget_period_enddate",
171         ifFormat         :    "<!-- TMPL_VAR NAME="DHTMLcalendar_dateformat" -->",
172         button         :    "openCalendarTo",
173         align          :    "Tl",
174         });
175     </script>
176     </li>
177
178     <li>
179         <!-- DESCRIPTION -->
180         <!-- ############################## -->
181         <label for="budget_period_description">Description</label>
182         <input type="text" id="budget_period_description" name="budget_period_description"
183         size="48" maxlength="80" value="<!-- TMPL_VAR name="budget_period_description" -->" />
184     </li>
185
186     <li>
187         <!-- TOTAL -->
188         <!-- ############################## -->
189         <label for="budget_period_total">Total amount</label>
190         <input type="text" id="budget_period_total" name="budget_period_total"
191         size="10" maxlength="80" value="<!-- TMPL_VAR name="budget_period_total" -->" />
192     </li>
193
194     <li>
195         <!-- ACTIVE -->
196         <!-- ############################## -->
197         <label for="budget_period_active">Make Budget Active</label>
198         <!-- TMPL_IF NAME="budget_period_active" --><input type="checkbox" checked="checked" id="budget_period_active" name="budget_period_active" value="1" /><!--TMPL_ELSE-->  <input type="checkbox" id="budget_period_active" name="budget_period_active" value="1"/> <!--/TMPL_IF-->
199     </li>
200
201     <li>
202         <!-- LOCK  -->
203         <!-- ############################## -->
204         <label for="budget_period_locked">Lock Budget</label>
205         <!-- TMPL_IF NAME="budget_period_locked" --><input type="checkbox" checked="checked" id="budget_period_locked" name="budget_period_locked" value="1" /><!--TMPL_ELSE-->  <input type="checkbox" id="budget_period_locked" name="budget_period_locked" value="1"/> <!--/TMPL_IF-->
206     </li>
207     </ol>
208     </fieldset>
209
210     <fieldset class="action">
211         <!-- "save changes" button -->
212         <!-- ###################################### -->
213         <input type="button" value="Save Changes"  onclick="Check(this.form)"    />
214         <!--             <input type="submit" value="Save Changes"  />  -->
215         <!--            <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl" class="cancel">Cancel</a> -->
216     </fieldset>
217
218 </form>
219
220 <!-- /TMPL_IF -->
221
222 <!-- ####################################################################### -->
223 <!-- delete a budget period -->
224 <!-- ####################################################################### -->
225
226 <!-- TMPL_IF name="delete_confirm" -->
227     <!-- TMPL_IF name="total" -->
228         <div class="dialog message">
229         <h3>Cannot delete root budget</h3>
230         <p><strong>This record is used <!-- TMPL_VAR name="total" --> times</strong>
231         . Deletion is not possible.</p>
232     <!-- TMPL_ELSE -->
233         <div class="dialog alert">
234         <h3>Delete root budget '<!-- TMPL_VAR name="budget_period_description" -->'?</h3>
235     <!-- /TMPL_IF -->
236
237     <!-- ############################################################# -->
238     <!-- "delete" and "cancel" buttons    -->
239     <!-- ############################################################# -->
240
241     <form action="<!-- TMPL_VAR name="script_name" -->" method="post">
242         <input type="hidden" name="op" value="delete_confirmed" />
243         <input type="hidden" name="budget_period_id" value="<!-- TMPL_VAR name="budget_period_id" -->" />
244         <input type="submit" class="approve" value="Delete" />
245     </form>
246
247     <form action="<!-- TMPL_VAR name="script_name" -->" method="post">
248         <input type="submit" class="deny" value="Cancel" />
249     </form>
250
251     </div>
252 <!-- /TMPL_IF -->
253 <!--  DEFAULT  display budget periods list -->
254 <!-- TMPL_IF name="else" -->
255     <h2>Root budgets administration</h2>
256     <p><!-- TMPL_IF name="cur" --><b>Currency = <!-- TMPL_VAR name="cur" --></b><!-- /TMPL_IF --></p>
257     <table id="periodsh">
258     <thead>
259             <tr>
260                 <th>Root Budget Name</th>
261                 <th>Start Date</th>
262                 <th>End Date</th>
263                 <th>Active</th>
264                 <th>Locked</th>
265                 <th>Total</th>
266                 <th>Actions</th>
267             </tr>
268         </thead>
269         <tbody>
270             <!-- TMPL_LOOP name="period_loop" -->
271                 <!-- TMPL_IF NAME="__odd__" -->
272                     <tr>
273                 <!-- TMPL_ELSE -->
274                     <tr class="highlight">
275                 <!-- /TMPL_IF -->
276                 <td><a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=<!-- TMPL_VAR name="budget_period_id" -->" title="View budgets for <!-- TMPL_VAR name="budget_period_description" -->"><!-- TMPL_VAR name="budget_period_description" --></a></td>
277                 <td><!-- TMPL_VAR name="budget_period_startdate" --></td>
278                 <td><!-- TMPL_VAR name="budget_period_enddate" --></td>
279                 <td><!-- TMPL_IF name="budget_period_active" --><span style="color:#669900;">Active</span>&nbsp;<!-- TMPL_ELSE --><!-- /TMPL_IF --> </td>
280                 <td> <!-- TMPL_IF name="budget_period_locked" --><span style="color:#cc0000;">Locked</span>&nbsp;<!-- TMPL_ELSE --><!-- /TMPL_IF --> </td>
281                 <td align='right'><!-- TMPL_VAR NAME="budget_period_total" --></td>
282                 <td>
283                     <a href="<!-- TMPL_VAR name="script_name" -->?op=add_form&amp;budget_period_id=<!-- TMPL_VAR name="budget_period_id" escape="HTML" -->">Edit</a>
284                     <a href="<!-- TMPL_VAR name="script_name"-->?op=delete_confirm&amp;budget_period_id=<!-- TMPL_VAR name="budget_period_id" -->">Delete</a>
285                         <a href="/cgi-bin/koha/admin/aqbudgets.pl?op=add_form&amp;budget_period_id=<!-- TMPL_VAR NAME="budget_period_id" -->">Add Budget</a>
286                 </td>
287                 </tr>
288             <!-- /TMPL_LOOP -->
289             <!-- TMPL_UNLESS NAME="period_loop" -->
290         <tr><td colspan="7">No root budget</td></tr>
291         <!-- /TMPL_UNLESS -->
292     </tbody>
293     </table>
294     <div class="paginationBar"><!-- TMPL_VAR NAME="pagination_bar" --></div>
295 <!-- /TMPL_IF -->
296
297 </div>
298 </div>
299 </div>
300 <!-- TMPL_INCLUDE NAME="intranet-bottom.inc" -->