Bug 16242 - Move staff client JavaScript out of language directory
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / acqui-home.tt
1 [% USE Price %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Acquisitions</title>
4 [% INCLUDE 'doc-head-close.inc' %]
5 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables.css" />
6 [% INCLUDE 'datatables.inc' %]
7 <link href="[% interface %]/lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css" rel="stylesheet" type="text/css" />
8 <script type="text/javascript" src="[% interface %]/lib/jquery/plugins/treetable/jquery.treetable.js"></script>
9
10 <script type="text/javascript">
11 //<![CDATA[
12
13 dt_overwrite_html_sorting_localeCompare();
14
15 $(document).ready(function() {
16
17     var oTable = $("#accounts").dataTable($.extend(true, {}, dataTablesDefaults, {
18         "fnDrawCallback": function ( oSettings ) {
19             if ( oSettings.aiDisplay.length == 0 )
20             {
21                 return;
22             }
23
24             var nTrs = $('#accounts tbody tr');
25             var iColspan = nTrs[0].getElementsByTagName('td').length;
26             var sLastGroup = "";
27             for ( var i=0 ; i<nTrs.length ; i++ )
28             {
29                 var iDisplayIndex = oSettings._iDisplayStart + i;
30                 var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
31                 if ( sGroup != sLastGroup )
32                 {
33                     var nGroup = document.createElement( 'tr' );
34                     var nCell = document.createElement( 'td' );
35                     nCell.colSpan = iColspan;
36                     nCell.className = "group";
37                     nCell.innerHTML = sGroup;
38                     nGroup.appendChild( nCell );
39                     nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
40                     sLastGroup = sGroup;
41                 }
42             }
43         },
44         "footerCallback": function ( row, data, start, end, display ) {
45             var api = this.api(), data;
46             footer_column_sum( api, [ 6, 7, 8, 9 ] );
47         },
48         "aoColumnDefs": [
49             { "bVisible": false, "aTargets": [ 0, 1 ] },
50             { "bSortable": false, "aTargets": ["_all"] }
51         ],
52         'dom': '<"top pager"ilpf>tr<"bottom pager"ip>',
53         'bSort': true,
54         'aaSortingFixed': [[ 1, 'asc' ]],
55         'bPaginate': false,
56         "bAutoWidth": false
57     }));
58
59     $(oTable).treetable({
60         expandable: true
61     });
62     $(oTable).treetable('expandAll');
63     $("#expand_all").click(function(e){
64         e.preventDefault();
65         $(oTable).treetable('expandAll');
66     });
67     $("#collapse_all").click(function(e){
68         e.preventDefault();
69         $(oTable).treetable('collapseAll');
70     });
71
72     $("#hide_inactive").click(function(e){
73         e.preventDefault();
74         oTable.fnFilter( 1, 0 ); // Show only active=1
75     });
76     $("#show_inactive").click(function(e){
77         e.preventDefault();
78         oTable.fnFilter( '', 0 );
79     });
80     $("#hide_inactive").click();
81
82 });
83 //]]>
84 </script>
85
86 </head>
87 <body id="acq_acqui-home" class="acq">
88 [% INCLUDE 'header.inc' %]
89 [% INCLUDE 'acquisitions-search.inc' %]
90
91 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a> &rsaquo; </div>
92
93 <div id="doc3" class="yui-t2">
94
95 <div id="bd">
96     <div id="yui-main">
97     <div class="yui-b">
98
99 [% INCLUDE 'acquisitions-toolbar.inc' %]
100
101 <h1>Acquisitions</h1>
102     [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %]
103     [% UNLESS ( loop_budget ) %]
104         [% IF ( CAN_user_acquisition_period_manage ) %]
105         <div class="dialog alert"><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">You must define a budget in Administration</a></div>
106         [% ELSE %]
107         <div class="dialog alert">Your administrator must define a budget in Administration</div>
108         [% END %]
109     [% END %]
110 <div class="yui-g">
111 <div class="yui-u first">
112 <div id="acqui_acqui_home_order">
113     <fieldset>
114         <legend>Manage orders</legend>
115         <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="post">
116             <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" />
117             <input type="submit" value="Search" />
118             </p>
119         </form>
120     </fieldset>
121 </div>
122 </div>
123
124 [% IF ( suggestion && suggestions_count ) %]
125 <div class="yui-u">
126     <div id="acqui_acqui_home_suggestions">
127         <fieldset>
128         <legend>Pending suggestions</legend>
129             <p>[% suggestions_count %] suggestions waiting. <a href="/cgi-bin/koha/suggestion/suggestion.pl#ASKED">Manage suggestions</a>.</p>
130         </fieldset>
131     </div>
132 </div>
133 [% END %]
134
135 </div>
136
137 [% IF ( loop_budget ) %]
138
139             <h3>All available funds[% IF ( branchname ) %] for [% branchname %][% END %]</h3>
140
141     <div id="BudgetsAndFunds">
142     <table id="accounts">
143         <caption>
144           <span class="actions"><a href="#" id="expand_all">Expand all</a>
145           | <a href="#" id="collapse_all">Collapse all</a>
146           | <a href="#" id="hide_inactive">Hide inactive budgets</a>
147           | <a href="#" id="show_inactive">Show inactive budgets</a></span>
148         </caption>
149
150         <thead>
151         <tr>
152             <th>Active</th>
153             <th>Budget period description</th>
154             <th>Fund code</th>
155             <th>Fund name</th>
156             <th>Owner</th>
157             <th>Library</th>
158             <th>Amount</th>
159             <th>Ordered</th>
160             <th>Spent</th>
161             <th>Total available</th>
162         </tr>
163         </thead>
164         <tfoot id="funds_total">
165         <tr>
166             <th></th>
167             <th></th>
168             <th colspan="4">Total</th>
169             <th class="data"></th>
170             <th class="data"></th>
171             <th class="data"></th>
172             <th class="data"></th>
173         </tr>
174         </tfoot>
175         <tbody>
176         [% FOREACH loop_budge IN loop_budget %]
177             [% IF loop_budge.budget_parent_id %]
178                 <tr data-tt-id="[% loop_budge.budget_id %]" data-tt-parent-id="[% loop_budge.budget_parent_id %]">
179             [% ELSE %]
180                 <tr data-tt-id="[% loop_budge.budget_id %]">
181             [% END %]
182
183                 <td>[% loop_budge.budget_period_active %]</td>
184                 <td>Budget [% loop_budge.budget_period_description %] [id=[% loop_budge.budget_period_id %]][% UNLESS loop_budge.budget_period_active %] (inactive)[% END %]</td>
185                 <td>
186                     [% IF ( CAN_user_acquisition_budget_manage ) %]
187                         <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id %]">[% loop_budge.budget_code %]</a>
188                     [% ELSE %]
189                         [% loop_budge.budget_code %]
190                     [% END %]
191                 </td>
192                 <td>[% loop_budge.budget_name %]</td>
193                 <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %]
194                         <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner_borrowernumber %]">[% loop_budge.budget_owner_surname %], [% loop_budge.budget_owner_firstname %]</a>
195                     [% ELSE %]
196                         &nbsp;
197                     [% END %]
198                 </td>
199                 <td>[% loop_budge.budget_branchname %]</td>
200                 <td class="data">
201                     [% IF loop_budge.budget_parent_id %]
202                         [% loop_budge.budget_amount | $Price %]
203                     [% ELSE %]
204                         <span class="total_amount">[% loop_budge.budget_amount | $Price %]</span>
205                     [% END %]
206                 </td>
207                 <td class="data">
208                     <a href="ordered.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">
209                     [% IF loop_budge.budget_parent_id %]
210                         [% loop_budge.budget_ordered | $Price %]
211                     [% ELSE %]
212                         <span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>
213                     [% END %]
214                     </a>
215                 </td>
216                 <td class="data">
217                     <a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">
218                     [% IF loop_budge.budget_parent_id %]
219                         [% loop_budge.budget_spent | $Price %]
220                     [% ELSE %]
221                         <span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>
222                     [% END %]
223                     </a>
224                 </td>
225                 <td class="data">
226                     [% IF loop_budge.budget_parent_id %]
227                         [% loop_budge.budget_avail | $Price %]
228                     [% ELSE %]
229                         <span class="total_amount">[% loop_budge.budget_avail | $Price %]</span>
230                     [% END %]
231                 </td>
232             </tr>
233         [% END %]
234         </tbody>
235     </table>
236     </div>
237     [% END %]
238
239 </div>
240 </div>
241 <div class="yui-b">
242 [% INCLUDE 'acquisitions-menu.inc' %]
243 </div>
244 </div>
245 [% INCLUDE 'intranet-bottom.inc' %]