Bug 29083: Update article requests-related Koha::Patron methods to use relationships
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / patron-article-requests.inc
1 [% USE Context %]
2 [% SET current_article_requests = Context.Scalar( Context.Scalar( patron, 'article_requests' ), 'filter_by_current' ) %]
3 <div id="article-requests">
4 [% IF current_article_requests.count > 0 %]
5     <table id="article-requests-table" class="table table-bordered table-striped">
6         <thead>
7             <tr>
8                 <th class="article-request-record-title anti-the">Record title</th>
9                 <th class="article-request-created_on psort">Placed on</th>
10                 <th class="article-request-title anti-the">Title</th>
11                 <th class="article-request-author">Author</th>
12                 <th class="article-request-volume">Volume</th>
13                 <th class="article-request-issue">Issue</th>
14                 <th class="article-request-date">Date</th>
15                 <th class="article-request-pages">Pages</th>
16                 <th class="article-request-chapters">Chapters</th>
17                 <th class="article-request-notes">Notes</th>
18                 <th class="article-request-format">Format</th>
19                 <th class="article-request-status">Status</th>
20                 <th class="article-request-branchcode">Pickup library</th>
21             </tr>
22         </thead>
23
24         <tbody>
25             [% FOREACH ar IN current_article_requests %]
26                 <tr>
27                     <td class="article-request-record-title">
28                         <a class="article-request-title" href="/cgi-bin/koha/circ/request-article.pl?biblionumber=[% ar.biblionumber | html %]">
29                             [% ar.biblio.title | html %]
30                             [% ar.item.enumchron | html %]
31                         </a>
32                         [% ar.biblio.author | html %]
33                         [% IF ar.itemnumber %] <em>(only [% ar.item.barcode | html %])</em>[% END %]
34                     </td>
35
36                     <td class="article-request-created_on">
37                         [% ar.created_on | $KohaDates %]
38                     </td>
39
40                     <td class="article-request-title">
41                         [% ar.title | html %]
42                     </td>
43
44                     <td class="article-request-author">
45                         [% ar.author | html %]
46                     </td>
47
48                     <td class="article-request-volume">
49                         [% ar.volume | html %]
50                     </td>
51
52                     <td class="article-request-issue">
53                         [% ar.issue | html %]
54                     </td>
55
56                     <td class="article-request-date">
57                         [% ar.date | html %]
58                     </td>
59
60                     <td class="article-request-pages">
61                         [% ar.pages | html %]
62                     </td>
63
64                     <td class="article-request-chapters">
65                         [% ar.chapters | html %]
66                     </td>
67
68                     <td class="article-request-patron-notes">
69                         [% ar.patron_notes | html %]
70                     </td>
71
72                     <td class="article-request-format">[% IF ar.format == 'PHOTOCOPY' %]Copy[% ELSIF ar.format == 'SCAN' %]Scan[% END %]</td>
73
74                     <td class="article-request-status">
75                         [% IF ar.status == 'PENDING' %]
76                             Pending
77                         [% ELSIF ar.status == 'PROCESSING' %]
78                             Processing
79                         [% ELSIF ar.status == 'COMPLETED' %]
80                             Completed
81                         [% ELSIF ar.status == 'CANCELED' %]
82                             Canceled
83                         [% END %]
84                     </td>
85
86                     <td class="article-request-branchcode">
87                         [% ar.branch.branchname | html %]
88                     </td>
89                 </tr>
90             [% END %]
91         </tbody>
92     </table>
93     [% ELSE %]
94         Patron has no current article requests.
95     [% END %]
96 </div>