]> git.koha-community.org Git - koha.git/blob - koha-tmpl/intranet-tmpl/prog/en/modules/acqui/newordersuggestion.tt
Bug 19754: Move template JavaScript to the footer: Acquisitions, part 2
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / newordersuggestion.tt
1 [% SET footerjs = 1 %]
2 [% INCLUDE 'doc-head-open.inc' %]
3 <title>Koha &rsaquo; Acquisitions &rsaquo; Add order from a suggestion</title>
4 <link rel="stylesheet" type="text/css" href="[% interface %]/[% theme %]/css/datatables_[% KOHA_VERSION %].css" />
5 [% INCLUDE 'doc-head-close.inc' %]
6 </head>
7
8 <body id="acq_newordersuggestion" class="acq">
9 [% INCLUDE 'header.inc' %]
10 [% INCLUDE 'suggestions-add-search.inc' %]
11
12 <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; <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]">[% name %]</a> &rsaquo; <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno %]">Basket [% basketno %]</a> &rsaquo; Add order from a suggestion</div>
13
14 <div id="doc3" class="yui-t2">
15    
16    <div id="bd">
17         <div id="yui-main">
18         <div class="yui-b">
19         
20 <h1>Suggestions</h1>
21     [% IF ( suggestions_loop ) %]
22     <a href="#" id="show_only_mine">Show only mine</a> | <a href="#" id="show_all">Show all suggestions</a>
23     <table id="suggestionst">
24         <thead>
25         <tr>
26             <th>Mine</th>
27             <th>Suggestion</th>
28             <th>Suggested by</th>
29             <th>Accepted by</th>
30             <th>&nbsp;</th>
31         </tr>
32         </thead>
33         <tbody>
34         [% FOREACH suggestions_loo IN suggestions_loop %]
35             <tr>
36                 <td>[% suggestions_loo.managedby %]</td>
37                 <td>
38                     <p>[% suggestions_loo.title |html %] - [% suggestions_loo.author %]</p>
39                     <p>
40                         [% IF ( suggestions_loo.copyrightdate ) %]&copy; [% suggestions_loo.copyrightdate %] [% END %]
41                         [% IF ( suggestions_loo.volumedesc ) %]volume: <i>[% suggestions_loo.volumedesc %]</i> [% END %]
42                         [% IF ( suggestions_loo.isbn ) %]ISBN: <i>[% suggestions_loo.isbn %]</i> [% END %]
43                         [% IF ( suggestions_loo.publishercode ) %]<br />published by: [% suggestions_loo.publishercode %] [% END %]
44                         [% IF ( suggestions_loo.publicationyear ) %] in <i>[% suggestions_loo.publicationyear %]</i> [% END %]
45                         [% IF ( suggestions_loo.place ) %] in <i>[% suggestions_loo.place %]</i> [% END %]
46                         [% IF ( suggestions_loo.note ) %]<p><i>([% suggestions_loo.note %])</i></p> [% END %]
47                     </p>
48                 </td>
49                 <td>
50                     [% suggestions_loo.surnamesuggestedby %][% IF ( suggestions_loo.firstnamesuggestedby ) %],[% END %] [% suggestions_loo.firstnamesuggestedby %]
51                 </td>
52                 <td>
53                     [% suggestions_loo.surnamemanagedby %][% IF ( suggestions_loo.firstnamemanagedby ) %],[% END %] [% suggestions_loo.firstnamemanagedby %]
54                 </td>
55                 <td class="actions">
56                     [% IF ( suggestions_loo.biblionumber ) %]
57                         <a href="neworderempty.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;suggestionid=[% suggestions_loo.suggestionid %]&amp;biblio=[% suggestions_loo.biblionumber %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Order</a>
58                     [% ELSE %]
59                         <a href="neworderempty.pl?booksellerid=[% booksellerid %]&amp;basketno=[% basketno %]&amp;suggestionid=[% suggestions_loo.suggestionid %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> Order</a>
60                     [% END %]
61                 </td>
62             </tr>
63         [% END %]
64         </tbody>
65     </table>
66     [% ELSE %]
67         There are no outstanding (accepted) suggestions.
68     [% END %]
69 </div>
70 </div>
71 <div class="yui-b">
72 [% INCLUDE 'acquisitions-menu.inc' %]
73 </div>
74 </div>
75
76 [% MACRO jsinclude BLOCK %]
77     <script type="text/javascript" src="[% interface %]/[% theme %]/js/acquisitions-menu_[% KOHA_VERSION %].js"></script>
78     [% INCLUDE 'datatables.inc' %]
79     <script type="text/javascript">
80     $(document).ready(function() {
81         var suggestionst = $("#suggestionst").dataTable($.extend(true, {}, dataTablesDefaults, {
82             "aoColumnDefs": [
83                 { "aTargets": [ 0 ],  "bVisible": false, "bSearchable": true }, // must be searchable for fnFilter
84                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
85             ],
86             "sPaginationType": "four_button"
87         }));
88         $("#show_only_mine").on('click', function(e){
89             e.preventDefault();
90             suggestionst.fnFilter('^[% loggedinuser %]$', 0, true);
91         });
92         $("#show_all").on('click', function(e){
93             e.preventDefault();
94             suggestionst.fnFilter('', 0 );
95         });
96      });
97     </script>
98 [% END %]
99
100 [% INCLUDE 'intranet-bottom.inc' %]