f73ff27ec3fa0ee3bbf77ecf3975f7e3b2348845
[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="[% themelang %]/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         'bSort': true,
53         'aaSortingFixed': [[ 1, 'asc' ]],
54         'bPaginate': false,
55         "bAutoWidth": false
56     }));
57
58     $(oTable).treetable({
59         expandable: true
60     });
61     $(oTable).treetable('expandAll');
62     $("#expand_all").click(function(e){
63         e.preventDefault();
64         $(oTable).treetable('expandAll');
65     });
66     $("#collapse_all").click(function(e){
67         e.preventDefault();
68         $(oTable).treetable('collapseAll');
69     });
70
71     $("#hide_inactive").click(function(e){
72         e.preventDefault();
73         oTable.fnFilter( 1, 0 ); // Show only active=1
74         inactive.hide();
75         active.show();
76     });
77     $("#show_inactive").click(function(e){
78         e.preventDefault();
79         oTable.fnFilter( '', 0 );
80         inactive.show();
81         active.hide();
82     });
83     $("#hide_inactive").click();
84
85 });
86 //]]>
87 </script>
88
89 </head>
90 <body id="acq_acqui-home" class="acq">
91 [% INCLUDE 'header.inc' %]
92 [% INCLUDE 'acquisitions-search.inc' %]
93
94 <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>
95
96 <div id="doc3" class="yui-t2">
97
98 <div id="bd">
99     <div id="yui-main">
100     <div class="yui-b">
101
102 [% INCLUDE 'acquisitions-toolbar.inc' %]
103
104 <h1>Acquisitions</h1>
105     [% UNLESS ( loop_budget ) %]
106         [% IF ( CAN_user_acquisition_period_manage ) %]
107         <div class="dialog alert">You must <a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">define a budget</a> in Administration</div>
108         [% ELSE %]
109         <div class="dialog alert">Your administrator must define a budget in Administration</div>
110         [% END %]
111     [% END %]
112 <div class="yui-g">
113 <div class="yui-u first">
114 <div id="acqui_acqui_home_order">
115     <fieldset>
116         <legend>Manage orders</legend>
117         <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="post">
118             <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" />
119             <input type="submit" value="Search" />
120             </p>
121         </form>
122     </fieldset>
123 </div>
124 </div>
125
126 [% IF ( suggestion && suggestions_count ) %]
127 <div class="yui-u">
128     <div id="acqui_acqui_home_suggestions">
129         <fieldset>
130         <legend>Pending suggestions</legend>
131             <p>[% suggestions_count %] suggestions waiting. <a href="/cgi-bin/koha/suggestion/suggestion.pl">Manage suggestions</a>.</p>
132         </fieldset>
133     </div>
134 </div>
135 [% END %]
136
137 </div>
138
139 [% IF ( loop_budget ) %]
140
141             <h3>All available funds[% IF ( branchname ) %] for [% branchname %][% END %]</h3>
142
143     <div id="BudgetsAndFunds">
144     <table id="accounts">
145         <caption>
146           <span class="actions"><a href="#" id="expand_all">Expand all</a>
147           | <a href="#" id="collapse_all">Collapse all</a>
148           | <a href="#" id="hide_inactive">Hide inactive budgets</a>
149           | <a href="#" id="show_inactive">Show inactive budgets</a></span>
150         </caption>
151
152         <thead>
153         <tr>
154             <th>Active</th>
155             <th>Budget period description</th>
156             <th>Fund code</th>
157             <th>Fund name</th>
158             <th>Owner</th>
159             <th>Library</th>
160             <th>Amount</th>
161             <th>Ordered</th>
162             <th>Spent</th>
163             <th>Total available</th>
164         </tr>
165         </thead>
166         <tfoot id="funds_total">
167         <tr>
168             <th></th>
169             <th></th>
170             <th colspan="4">Total</th>
171             <th class="data"></th>
172             <th class="data"></th>
173             <th class="data"></th>
174             <th class="data"></th>
175         </tr>
176         </tfoot>
177         <tbody>
178         [% FOREACH loop_budge IN loop_budget %]
179             [% IF loop_budge.budget_parent_id %]
180                 <tr data-tt-id="[% loop_budge.budget_id %]" data-tt-parent-id="[% loop_budge.budget_parent_id %]">
181             [% ELSE %]
182                 <tr data-tt-id="[% loop_budge.budget_id %]">
183             [% END %]
184
185                 <td>[% loop_budge.budget_period_active %]</td>
186                 <td>Budget [% loop_budge.budget_period_description %] [id=[% loop_budge.budget_period_id %]][% UNLESS loop_budge.budget_period_active %] (inactive)[% END %]</td>
187                 <td>
188                     [% IF ( CAN_user_acquisition_budget_manage ) %]
189                         <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id %]">[% loop_budge.budget_code %]</a>
190                     [% ELSE %]
191                         [% loop_budge.budget_code %]
192                     [% END %]
193                 </td>
194                 <td>[% loop_budge.budget_name %]</td>
195                 <td>[% IF ( loop_budge.budget_owner_borrowernumber ) %]
196                         <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>
197                     [% ELSE %]
198                         &nbsp;
199                     [% END %]
200                 </td>
201                 <td>[% loop_budge.budget_branchname %]</td>
202                 <td class="data">
203                     [% IF loop_budge.budget_parent_id %]
204                         [% loop_budge.budget_amount | $Price %]
205                     [% ELSE %]
206                         <span class="total_amount">[% loop_budge.budget_amount | $Price %]</span>
207                     [% END %]
208                 </td>
209                 <td class="data">
210                     <a href="ordered.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">
211                     [% IF loop_budge.budget_parent_id %]
212                         [% loop_budge.budget_ordered | $Price %]
213                     [% ELSE %]
214                         <span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>
215                     [% END %]
216                     </a>
217                 </td>
218                 <td class="data">
219                     <a href="spent.pl?fund=[% loop_budge.budget_id %]&amp;fund_code=[% loop_budge.budget_code %]">
220                     [% IF loop_budge.budget_parent_id %]
221                         [% loop_budge.budget_spent | $Price %]
222                     [% ELSE %]
223                         <span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>
224                     [% END %]
225                     </a>
226                 </td>
227                 <td class="data">
228                     [% IF loop_budge.budget_parent_id %]
229                         [% loop_budge.budget_avail | $Price %]
230                     [% ELSE %]
231                         <span class="total_amount">[% loop_budge.budget_avail | $Price %]</span>
232                     [% END %]
233                 </td>
234             </tr>
235         [% END %]
236         </tbody>
237     </table>
238     </div>
239     [% END %]
240
241 </div>
242 </div>
243 <div class="yui-b">
244 [% INCLUDE 'acquisitions-menu.inc' %]
245 </div>
246 </div>
247 [% INCLUDE 'intranet-bottom.inc' %]