Bug 33908: Improve translation of title tags: Acquisitions
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / acqui-home.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Price %]
4 [% USE Branches %]
5 [% USE TablesSettings %]
6 [% SET footerjs = 1 %]
7 [% PROCESS 'i18n.inc' %]
8 [% INCLUDE 'doc-head-open.inc' %]
9 <title>[% FILTER collapse %]
10     [% t("Acquisitions") | html %] &rsaquo;
11     [% t("Koha") | html %]
12 [% END %]</title>
13 [% INCLUDE 'doc-head-close.inc' %]
14 [% Asset.css("lib/jquery/plugins/treetable/stylesheets/jquery.treetable.css") | $raw %]
15 </head>
16
17 <body id="acq_acqui-home" class="acq">
18 [% WRAPPER 'header.inc' %]
19     [% INCLUDE 'acquisitions-search.inc' %]
20 [% END %]
21
22 [% WRAPPER 'sub-header.inc' %]
23     [% WRAPPER breadcrumbs %]
24         [% WRAPPER breadcrumb_item bc_active= 1 %]
25             <span>Acquisitions</span>
26         [% END %]
27     [% END #/ WRAPPER breadcrumbs %]
28 [% END %]
29
30 <div class="main container-fluid">
31     <div class="row">
32         <div class="col-sm-10 col-sm-push-2">
33             <main>
34
35 [% INCLUDE 'acquisitions-toolbar.inc' %]
36
37 <h1>Acquisitions</h1>
38     [% INCLUDE 'budgets-active-currency.inc' hide = 'yes' %]
39     [% UNLESS ( loop_budget ) %]
40         [% IF ( CAN_user_acquisition_period_manage ) %]
41         <div class="dialog alert"><a href="/cgi-bin/koha/admin/aqbudgetperiods.pl">You must define a budget in Administration</a></div>
42         [% ELSE %]
43         <div class="dialog alert">Your administrator must define a budget in Administration</div>
44         [% END %]
45     [% END %]
46 <div class="row">
47     [% IF ( suggestions_count || all_pendingsuggestions ) %]
48         <div class="col-sm-6">
49     [% ELSE %]
50         <div class="col-sm-12">
51     [% END %]
52 <div id="acqui_acqui_home_order">
53     <fieldset>
54         <legend>Manage orders</legend>
55         <form name="findsupplier" action="/cgi-bin/koha/acqui/booksellers.pl" method="post">
56             <p><label for="supplierpage">Vendor: </label><input type="text" size="25" name="supplier" id="supplierpage" class="focus" />
57             <input type="submit" class="btn btn-primary" value="Search" />
58             </p>
59         </form>
60     </fieldset>
61 </div>
62 </div>
63
64 [% IF ( CAN_user_suggestions_suggestions_manage && ( suggestions_count || all_pendingsuggestions ) ) %]
65 <div class="col-sm-6">
66     <div id="acqui_acqui_home_suggestions">
67         <fieldset>
68         <legend>Pending suggestions</legend>
69         <p>
70             Manage suggestions:
71             <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=[% Branches.GetLoggedInBranchcode | url %]#ASKED">
72                 <span id="pendingsuggestions" class="pending-number-link">[% Branches.GetLoggedInBranchname | html %]: [% suggestions_count | html %]</span>
73             </a>
74             [% IF (all_pendingsuggestions > 0) %]
75                 /
76                 <a href="/cgi-bin/koha/suggestion/suggestion.pl?branchcode=__ANY__#ASKED">
77                     <span id="all_pendingsuggestions" class="pending-number-link">All libraries: [% all_pendingsuggestions | html %]</span>
78                 </a>
79             [% END %]
80         </p>
81         </fieldset>
82     </div>
83 </div>
84 [% END %]
85
86 </div>
87
88 [% IF ( loop_budget ) %]
89
90 <div class="page-section">
91     <h3>All available funds</h3>
92
93     <div id="BudgetsAndFunds">
94         <div class="toolbar btn-toolbar">
95             <span class="actions">
96                 <a href="#" id="expand_all">Expand all</a> |
97                 <a href="#" id="collapse_all">Collapse all</a> |
98                 <a href="#" id="hide_inactive">Hide inactive budgets</a> |
99                 <a href="#" id="show_inactive">Show inactive budgets</a> |
100                 <select id="library-filter">
101                     <option value="">Filter by library</option>
102                     [% FOREACH b IN Branches.all %]
103                         <option value="[% b.branchname | html %]">[% b.branchname | html %]</option>
104                     [% END %]
105                 </select>
106             </span>
107         </div>
108             <table id="accounts">
109
110                 <thead>
111                     <tr>
112                         <th>Active</th>
113                         <th>Budget period description</th>
114                         <th>Fund code</th>
115                         <th>Fund name</th>
116                         <th>Owner</th>
117                         <th>Library</th>
118                         <th>Amount</th>
119                         <th>Ordered</th>
120                         <th>Spent</th>
121                         <th>Total available</th>
122                     </tr>
123                 </thead>
124                 <tfoot id="funds_total">
125                     <tr>
126                         <th></th>
127                         <th></th>
128                         <th colspan="4">Total</th>
129                         <th class="data"></th>
130                         <th class="data"></th>
131                         <th class="data"></th>
132                         <th class="data"></th>
133                     </tr>
134                 </tfoot>
135                 <tbody>
136                 [% FOREACH loop_budge IN loop_budget %]
137                     [% IF loop_budge.budget_parent_id %]
138                         <tr data-tt-id="[% loop_budge.budget_id | html %]" data-tt-parent-id="[% loop_budge.budget_parent_id | html %]">
139                     [% ELSE %]
140                         <tr data-tt-id="[% loop_budge.budget_id | html %]">
141                     [% END %]
142
143                         <td>[% loop_budge.budget_period_active | html %]</td>
144                         <td>Budget [% loop_budge.budget_period_description | html %] [id=[% loop_budge.budget_period_id | html %]][% UNLESS loop_budge.budget_period_active %] (inactive)[% END %]</td>
145                         <td>
146                             [% IF ( CAN_user_acquisition_budget_manage ) %]
147                                 <a href="/cgi-bin/koha/admin/aqbudgets.pl?budget_period_id=[% loop_budge.budget_period_id | uri %]">[% loop_budge.budget_code | html %]</a>
148                             [% ELSE %]
149                                 [% loop_budge.budget_code | html %]
150                             [% END %]
151                         </td>
152                         <td>[% loop_budge.budget_name | html %]</td>
153                         <td>[% IF ( loop_budge.budget_owner ) %]
154                                 <a href="/cgi-bin/koha/members/moremember.pl?borrowernumber=[% loop_budge.budget_owner.borrowernumber | uri %]">[% loop_budge.budget_owner.surname | html %], [% loop_budge.budget_owner.firstname | html %]</a>
155                             [% ELSE %]
156                                 &nbsp;
157                             [% END %]
158                         </td>
159                         <td>[% Branches.GetName( loop_budge.budget_branchcode ) | html %]</td>
160                         <td class="data">
161                             <span class="total_amount" data-parent_id="[% loop_budge.budget_parent_id | html %]" data-self_id="[% loop_budge.budget_id | html %]">[% loop_budge.budget_amount | $Price %]</span>
162                         </td>
163                         <td class="data">
164                             <a href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&amp;fund_code=[% loop_budge.budget_code | uri %]">
165                             [% IF loop_budge.children.size %]
166                                 <a title="Ordered from this fund" href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&amp;fund_code=[% loop_budge.budget_code | uri %]">
167                                     (<span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>)
168                                 </a>
169                                 <span title="Ordered from this fund and children" class="inclusive_amount">[% loop_budge.total_ordered | $Price %]</span>
170                             [% ELSE %]
171                                 <a href="ordered.pl?fund=[% loop_budge.budget_id | uri %]&amp;fund_code=[% loop_budge.budget_code | uri %]">
172                                     <span class="total_amount">[% loop_budge.budget_ordered | $Price %]</span>
173                                 </a>
174                             [% END %]
175                         </td>
176                         <td class="data">
177                             [% IF loop_budge.children.size %]
178                                 <a title="Spent from this fund" href="spent.pl?fund=[% loop_budge.budget_id | uri %]&amp;fund_code=[% loop_budge.budget_code | uri %]">
179                                     (<span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>)
180                                 </a>
181                                 <span title="Spent from this fund and children" class="inclusive_amount">[% loop_budge.total_spent | $Price %]</span>
182                             [% ELSE %]
183                                 <a href="spent.pl?fund=[% loop_budge.budget_id | uri %]&amp;fund_code=[% loop_budge.budget_code | uri %]">
184                                     <span class="total_amount">[% loop_budge.budget_spent | $Price %]</span>
185                                 </a>
186                             [% END %]
187                         </td>
188                         <td class="data">
189                             [% IF loop_budge.children.size %]
190                                 (<span title="Remaining in this fund" class="parent_amount" data-parent_id="[% loop_budge.budget_parent_id | html %]" data-self_id="[% loop_budge.budget_id | html %]">[% loop_budge.budget_avail | $Price %]</span>)
191                                 <span title="Remaining with child funds included" class="total_amount" data-parent_id="[% loop_budge.budget_parent_id | html %]" data-self_id="[% loop_budge.budget_id | html %]">[% loop_budge.total_avail | $Price %]</span>
192                             [% ELSE %]
193                                 <span class="total_amount" data-parent_id="[% loop_budge.budget_parent_id | html %]" data-self_id="[% loop_budge.budget_id | html %]">[% loop_budge.budget_avail | $Price %]</span>
194                             [% END %]
195                         </td>
196                     </tr>
197                 [% END %]
198                 </tbody>
199             </table>
200     </div><!-- /#BudgetsAndFunds -->
201 </div><!-- /.page-section -->
202 [% END %]
203
204 </main>
205 </div> <!-- /.col-sm-10.col-sm-push-2 -->
206
207 <div class="col-sm-2 col-sm-pull-10">
208     <aside>
209         [% INCLUDE 'acquisitions-menu.inc' %]
210     </aside>
211 </div>
212 </div> <!-- /.row -->
213
214 [% MACRO jsinclude BLOCK %]
215     [% INCLUDE 'datatables.inc' %]
216     [% Asset.js("lib/jquery/plugins/treetable/jquery.treetable.js") | $raw %]
217     [% Asset.js("js/acquisitions-menu.js") | $raw %]
218     [% INCLUDE 'columns_settings.inc' %]
219     <script>
220         dt_overwrite_html_sorting_localeCompare();
221
222         $(document).ready(function() {
223             var table_settings = [% TablesSettings.GetTableSettings( 'acqui', 'acq_acqui-home', 'accounts', 'json' ) | $raw %];
224             var oTable = KohaTable("accounts", {
225                 "fnDrawCallback": function ( oSettings ) {
226                     if ( oSettings.aiDisplay.length == 0 )
227                     {
228                         return;
229                     }
230
231                     var nTrs = $('#accounts tbody tr');
232                     var iColspan = nTrs[0].getElementsByTagName('td').length;
233                     var sLastGroup = "";
234                     for ( var i=0 ; i<nTrs.length ; i++ )
235                     {
236                         var iDisplayIndex = oSettings._iDisplayStart + i;
237                         var sGroup = oSettings.aoData[ oSettings.aiDisplay[iDisplayIndex] ]._aData[1];
238                         if ( sGroup != sLastGroup )
239                         {
240                             var nGroup = document.createElement( 'tr' );
241                             var nCell = document.createElement( 'td' );
242                             nCell.colSpan = iColspan;
243                             nCell.className = "group";
244                             nCell.innerHTML = sGroup;
245                             nGroup.appendChild( nCell );
246                             nTrs[i].parentNode.insertBefore( nGroup, nTrs[i] );
247                             sLastGroup = sGroup;
248                         }
249                     }
250                 },
251                 "footerCallback": function ( row, data, start, end, display ) {
252                     var api = this.api(), data;
253                     footer_column_sum( api, [ 6, 7, 8, 9 ] );
254                 },
255                 "aoColumnDefs": [
256                     { "bVisible": false, "aTargets": [ 0, 1 ] },
257                     { "bSortable": false, "aTargets": ["_all"] }
258                 ],
259                 'bSort': true,
260                 'aaSortingFixed': [[ 1, 'asc' ]],
261                 'bPaginate': false,
262                 "bAutoWidth": false
263             }, table_settings );
264
265             $(oTable).treetable({
266                 expandable: true
267             });
268             $(oTable).treetable('expandAll');
269             $("#expand_all").click(function(e){
270                 e.preventDefault();
271                 $(oTable).treetable('expandAll');
272             });
273             $("#collapse_all").click(function(e){
274                 e.preventDefault();
275                 $(oTable).treetable('collapseAll');
276             });
277
278             $("#hide_inactive").click(function(e){
279                 e.preventDefault();
280                 oTable.fnFilter( 1, 0 ); // Show only active=1
281             });
282             $("#show_inactive").click(function(e){
283                 e.preventDefault();
284                 oTable.fnFilter( '', 0 );
285             });
286             $("#hide_inactive").click();
287
288             $("#library-filter").change(function(){
289                 $("#accounts").DataTable().search(this.value);
290                 $("#accounts").DataTable().draw();
291             });
292
293         });
294     </script>
295 [% END %]
296
297 [% INCLUDE 'intranet-bottom.inc' %]