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