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