Bug 23991: Move SearchSuggestion to Koha::Suggestions
[srvgit] / koha-tmpl / intranet-tmpl / prog / en / modules / acqui / newordersuggestion.tt
1 [% USE raw %]
2 [% USE Branches %]
3 [% USE Price %]
4 [% USE Asset %]
5 [% PROCESS 'i18n.inc' %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Add order from a suggestion &rsaquo; Acquisitions &rsaquo; Koha</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="acq_newordersuggestion" class="acq">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'suggestions-add-search.inc' %]
15
16 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
17     <ol>
18         <li>
19             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
20         </li>
21         <li>
22             <a href="/cgi-bin/koha/acqui/acqui-home.pl">Acquisitions</a>
23         </li>
24         <li>
25             <a href="/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid | uri %]">[% name | html %]</a>
26         </li>
27         <li>
28             <a href="/cgi-bin/koha/acqui/basket.pl?basketno=[% basketno | uri %]">Basket [% basketno | html %]</a>
29         </li>
30         <li>
31             <a href="#" aria-current="page">
32                 Add order from a suggestion
33             </a>
34         </li>
35     </ol>
36 </nav>
37
38 <div class="main container-fluid">
39     <div class="row">
40         <div class="col-sm-10 col-sm-push-2">
41             <main>
42
43 <h1>Suggestions</h1>
44     [% IF suggestions.size %]
45     <a href="#" id="show_only_mine">Show only mine</a> | <a href="#" id="show_all">Show all suggestions</a>
46     <table id="suggestionst">
47         <thead>
48         <tr>
49             <th>Mine</th>
50             <th>Suggestion</th>
51             <th>Suggested by</th>
52             <th>Accepted by</th>
53             <th>Library</th>
54             <th>Fund</th>
55             <th>Price</th>
56             <th>Quantity</th>
57             <th>Total</th>
58             <th>&nbsp;</th>
59         </tr>
60         </thead>
61         <tbody>
62         [% FOREACH suggestion IN suggestions %]
63             <tr>
64                 <td>[% suggestion.managedby | html %]</td>
65                 <td>
66                     <p>[% suggestion.title | html %] - [% suggestion.author | html %]</p>
67                     <p>
68                         [% IF ( suggestion.copyrightdate ) %]&copy; [% suggestion.copyrightdate | html %] [% END %]
69                         [% IF ( suggestion.volumedesc ) %]volume: <em>[% suggestion.volumedesc | html %]</em> [% END %]
70                         [% IF ( suggestion.isbn ) %]ISBN: <em>[% suggestion.isbn | html %]</em> [% END %]
71                         [% IF ( suggestion.publishercode ) %]<br />published by: [% suggestion.publishercode | html %] [% END %]
72                         [% IF ( suggestion.publicationyear ) %] in <em>[% suggestion.publicationyear | html %]</em> [% END %]
73                         [% IF ( suggestion.place ) %] in <em>[% suggestion.place | html %]</em> [% END %]
74                         [% IF ( suggestion.note ) %]<p><em>([% suggestion.note | html %])</em></p> [% END %]
75                     </p>
76                 </td>
77                 <td>[% INCLUDE 'patron-title.inc' patron => suggestion.suggester %]</td>
78                 <td>[% INCLUDE 'patron-title.inc' patron => suggestion.manager %]</td>
79                 <td>
80                     [% Branches.GetName(suggestion.branchcode) | html %]
81                 </td>
82                 <td>
83                     [% suggestion.fund.budget_name | html %]
84                 </td>
85                 <td>
86                     [% suggestion.price | $Price %]
87                 </td>
88                 <td>
89                     [% IF (suggestion.quantity > 0) %]
90                         [% suggestion.quantity | html %]
91                     [% END %]
92                 </td>
93                 <td>
94                     [% suggestion.total | $Price %]
95                 </td>
96                 <td class="actions">
97                     [% IF ( suggestion.biblionumber ) %]
98                         <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;suggestionid=[% suggestion.suggestionid | uri %]&amp;biblio=[% suggestion.biblionumber | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a>
99                     [% ELSE %]
100                         <a href="neworderempty.pl?booksellerid=[% booksellerid | uri %]&amp;basketno=[% basketno | uri %]&amp;suggestionid=[% suggestion.suggestionid | uri %]" class="btn btn-default btn-xs"><i class="fa fa-plus"></i> [% tp('verb', 'Order') | html %]</a>
101                     [% END %]
102                 </td>
103             </tr>
104         [% END %]
105         </tbody>
106     </table>
107     [% ELSE %]
108         There are no outstanding (accepted) suggestions.
109     [% END %]
110 </main>
111 </div> <!-- /.col-sm-10.col-sm-push-2 -->
112
113 <div class="col-sm-2 col-sm-pull-10">
114     <aside>
115         [% INCLUDE 'acquisitions-menu.inc' %]
116     </aside>
117 </div> <!-- /.col-sm-2.col-sm-pull-10 -->
118 </div> <!-- /.row -->
119
120 [% MACRO jsinclude BLOCK %]
121     [% Asset.js("js/acquisitions-menu.js") | $raw %]
122     [% INCLUDE 'datatables.inc' %]
123     [% INCLUDE 'calendar.inc' %]
124     <script>
125     $(document).ready(function() {
126         var suggestionst = $("#suggestionst").dataTable($.extend(true, {}, dataTablesDefaults, {
127             "aoColumnDefs": [
128                 { "aTargets": [ 0 ],  "bVisible": false, "bSearchable": true }, // must be searchable for fnFilter
129                 { "aTargets": [ -1 ], "bSortable": false, "bSearchable": false },
130             ],
131             "sPaginationType": "full"
132         }));
133         $("#show_only_mine").on('click', function(e){
134             e.preventDefault();
135             suggestionst.fnFilter('^[% logged_in_user.borrowernumber | html %]$', 0, true);
136         });
137         $("#show_all").on('click', function(e){
138             e.preventDefault();
139             suggestionst.fnFilter('', 0 );
140         });
141      });
142     </script>
143 [% END %]
144
145 [% INCLUDE 'intranet-bottom.inc' %]