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