Bug 22015: Move DataTables CSS to global include
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / members / purchase-suggestions.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE Koha %]
4 [% USE AuthorisedValues  %]
5 [% USE Branches %]
6 [% SET footerjs = 1 %]
7 [% INCLUDE 'doc-head-open.inc' %]
8 <title>Koha &rsaquo; Patrons &rsaquo; Purchase suggestions for [% INCLUDE 'patron-title.inc' no_html = 1 %]</title>
9 [% INCLUDE 'doc-head-close.inc' %]
10 </head>
11
12 <body id="pat_purchase_suggestions" class="pat">
13 [% INCLUDE 'header.inc' %]
14 [% INCLUDE 'patron-search.inc' %]
15
16 <div id="breadcrumbs">
17          <a href="/cgi-bin/koha/mainpage.pl">Home</a>
18 &rsaquo; <a href="/cgi-bin/koha/members/members-home.pl">Patrons</a>
19 &rsaquo; Purchase suggestions for [% INCLUDE 'patron-title.inc' %]
20 </div>
21
22 <div class="main container-fluid">
23     <div class="row">
24         <div class="col-sm-10 col-sm-push-2">
25             <main>
26
27                 <h2>Purchase suggestions</h2>
28
29                 <div id="toolbar" class="btn-toolbar">
30                     <a class="btn btn-default btn-sm" id="newsuggestion" href="/cgi-bin/koha/suggestion/suggestion.pl?op=add&amp;suggestedby=[% patron.borrowernumber | html %]&amp;redirect=purchase_suggestions&amp;borrowernumber=[% patron.borrowernumber | html %]"><i class="fa fa-plus"></i> New purchase suggestion</a>
31                 </div>
32
33                 [% IF suggestions %]
34                   <table id="suggestions">
35                     <thead>
36                         <tr>
37                           <th>Summary</th>
38                           <th>Note</th>
39                           <th>Managed by</th>
40                           <th>Status</th>
41                         </tr>
42                     </thead>
43
44                     <tbody>
45                         [% FOREACH s IN suggestions %]
46                             <tr>
47                                 <td>
48                                     <p>
49                                         <strong>
50                                             [% IF ( CAN_user_catalogue ) %]
51                                                 <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% s.suggestionid | uri %]&amp;op=show">[% s.title | html %]</a>
52                                             [% ELSE %]
53                                                 [% s.title | html %]
54                                             [% END %]
55                                         </strong>
56                                     </p>
57                                     <p>
58                                         [% IF ( s.author ) %][% s.author | html %],[% END %]
59                                         [% IF ( s.copyrightdate ) %] - [% s.copyrightdate | html %],[% END %]
60                                         [% IF ( s.publishercode ) %] - [% s.publishercode | html %][% END %]
61                                         [% IF ( s.place ) %]([% s.place | html %])[% END %]
62                                         [% IF ( s.collectiontitle ) %] , [% s.collectiontitle | html %][% END %]
63                                         [% IF ( s.itemtype ) %] - [% s.itemtype | html %][% END %]
64                                     </p>
65                                 </td>
66                                 <td>[% s.note | html %]
67                                 <td>
68                                     [% IF ( s.surnamemanagedby ) %]
69                                         [% s.surnamemanagedby | html %]
70                                         [% IF ( s.firstnamemanagedby ) %],[% END %]
71                                         [% s.firstnamemanagedby | html %]
72                                     [% ELSE %]
73                                         &nbsp;
74                                     [% END %]
75                                 </td>
76                                 <td>
77                                     [% SWITCH s.STATUS %]
78                                     [% CASE "ASKED" %]<span>Requested</span>
79                                     [% CASE "CHECKED" %]<span>Checked by the library</span>
80                                     [% CASE "ACCEPTED" %]<span>Accepted by the library</span>
81                                     [% CASE "ORDERED" %]<span>Ordered by the library</span>
82                                     [% CASE "REJECTED" %]<span>Suggestion declined<span>
83                                     [% CASE "AVAILABLE" %]<span>Available in the library</span>
84                                     [% CASE %]
85                                         [% SET status_description = AuthorisedValues.GetByCode('SUGGEST_STATUS', s.STATUS) %]
86                                         [% IF status_description %]
87                                             [% status_description | html %]
88                                         [% ELSE %]
89                                             <span>Unknown</span>
90                                         [% END %]
91                                     [% END %]
92                                     [% IF s.reason %]([% s.reason | html %])[% END %]
93                                 </td>
94                             </tr>
95                         [% END %]
96                     </tbody>
97                   </table>
98                 [% ELSE %]
99                     <div class="dialog message">
100                         <p>This patron has not submitted any purchase suggestions</p>
101                     </div>
102                 [% END %]
103
104             </main>
105         </div> <!-- /.col-sm-10.col-sm-push-2 -->
106
107         <div class="col-sm-2 col-sm-pull-10">
108             <aside>
109                 [% INCLUDE 'circ-menu.inc' %]
110             </aside>
111         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
112      </div> <!-- /.row -->
113
114 [% MACRO jsinclude BLOCK %]
115     [% INCLUDE 'str/members-menu.inc' %]
116     [% Asset.js("js/members-menu.js") | $raw %]
117     [% INCLUDE 'datatables.inc' %]
118     <script>
119         $(document).ready(function() {
120             $("#suggestions").dataTable($.extend(true, {}, dataTablesDefaults, {
121                 'bPaginate': false,
122                 'bFilter': false,
123                 'bInfo': false,
124                 'sDom': 't'
125             } ));
126         });
127     </script>
128 [% END %]
129
130 [% INCLUDE 'intranet-bottom.inc' %]