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