Bug 35356: Show SMS labels only when data exists
[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>Non-public note</th>
57                                 <th>Managed by</th>
58                                 <th>Managed on</th>
59                                 <th>Suggested on</th>
60                                 <th>Status</th>
61                                 </tr>
62                             </thead>
63
64                             <tbody>
65                                 [% FOREACH s IN suggestions %]
66                                     <tr>
67                                         <td>
68                                             <p>
69                                                 <strong>
70                                                     [% IF ( CAN_user_catalogue ) %]
71                                                         <a href="/cgi-bin/koha/suggestion/suggestion.pl?suggestionid=[% s.suggestionid | uri %]&amp;op=show">[% s.title | html %]</a>
72                                                     [% ELSE %]
73                                                         [% s.title | html %]
74                                                     [% END %]
75                                                 </strong>
76                                             </p>
77                                             <p>
78                                                 [% IF ( s.author ) %][% s.author | html %],[% END %]
79                                                 [% IF ( s.copyrightdate ) %] - [% s.copyrightdate | html %],[% END %]
80                                                 [% IF ( s.publishercode ) %] - [% s.publishercode | html %][% END %]
81                                                 [% IF ( s.place ) %]([% s.place | html %])[% END %]
82                                                 [% IF ( s.collectiontitle ) %] , [% s.collectiontitle | html %][% END %]
83                                                 [% IF ( s.itemtype ) %] - [% s.itemtype | html %][% END %]
84                                             </p>
85                                         </td>
86                                         <td>[% s.note | html %]
87                                         <td>[% s.staff_note | html %]
88                                         <td>
89                                             [% INCLUDE 'patron-title.inc' patron => s.manager %]
90                                         </td>
91                                         <td data-order="[% s.manageddate | html %]">
92                                             [% s.manageddate | $KohaDates %]
93                                         </td>
94                                         <td data-order="[% s.suggesteddate | html %]">
95                                             [% s.suggesteddate | $KohaDates %]
96                                         </td>
97                                         <td>
98                                             [% SWITCH s.STATUS %]
99                                             [% CASE "ASKED" %]<span>Requested</span>
100                                             [% CASE "CHECKED" %]<span>Checked by the library</span>
101                                             [% CASE "ACCEPTED" %]<span>Accepted by the library</span>
102                                             [% CASE "ORDERED" %]<span>Ordered by the library</span>
103                                             [% CASE "REJECTED" %]<span>Suggestion declined<span>
104                                             [% CASE "AVAILABLE" %]<span>Available in the library</span>
105                                             [% CASE %]
106                                                 [% SET status_description = AuthorisedValues.GetByCode('SUGGEST_STATUS', s.STATUS) %]
107                                                 [% IF status_description %]
108                                                     [% status_description | html %]
109                                                 [% ELSE %]
110                                                     <span>Unknown</span>
111                                                 [% END %]
112                                             [% END %]
113                                             [% IF s.reason %]([% s.reason | html %])[% END %]
114                                         </td>
115                                     </tr>
116                                 [% END %]
117                             </tbody>
118                         </table>
119                 </div> <!-- /.page-section -->
120                 [% ELSE %]
121                     <div class="dialog message">
122                         <p>This patron has not submitted any purchase suggestions</p>
123                     </div>
124                 [% END %]
125
126             </main>
127         </div> <!-- /.col-sm-10.col-sm-push-2 -->
128
129         <div class="col-sm-2 col-sm-pull-10">
130             <aside>
131                 [% INCLUDE 'circ-menu.inc' %]
132             </aside>
133         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
134      </div> <!-- /.row -->
135
136 [% MACRO jsinclude BLOCK %]
137     [% INCLUDE 'str/members-menu.inc' %]
138     [% Asset.js("js/members-menu.js") | $raw %]
139     [% INCLUDE 'datatables.inc' %]
140     <script>
141         $(document).ready(function() {
142             $("#suggestions").dataTable($.extend(true, {}, dataTablesDefaults, {
143                 'bPaginate': false,
144                 'bFilter': false,
145                 'bInfo': false,
146                 'sDom': 't'
147             } ));
148         });
149     </script>
150 [% END %]
151
152 [% INCLUDE 'intranet-bottom.inc' %]