Bug 17047: SQL reports management with Mana-KB
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / mana / mana-subscription-search-result.inc
1 [% USE KohaDates %]
2 [% USE Koha %]
3 [% USE AuthorisedValues %]
4 [% USE Branches %]
5 [% INCLUDE 'mana.inc' %]
6 <script type="text/javascript">
7 //<![CDATA[
8 $(document).ready(function() {
9     $(document).on('click', 'button.mana-use', function() {
10         id = $(this).attr('id');
11         mana_use(id.substr(9));
12     });
13 });
14 //]]>
15 </script>
16
17 [% IF statuscode == "200" %]
18     <table id="mana_results_datatable" width=100%>
19         <thead>
20             <tr>
21                 <th>ISSN</th>
22                 <th class="anti-the" width=50%>Title</th>
23                 <th> Published by </th>
24                 <th>Frequency</th>
25                 <th>Numbering pattern</th>
26                 <th title="number of libraries using this pattern"># of users</th>
27                 <th class="title-string" title="last time a library used this pattern">Last import</th>
28                 <th> Comments </th>
29                 [% UNLESS search_only %]
30                   <th class="NoSort">Actions</th>
31                 [% END %]
32             </tr>
33         </thead>
34         <tbody>
35             [% FOREACH subscription IN subscriptions %]
36                 [% UNLESS subscription.cannotdisplay %]
37                     [% IF subscription.nbofcomment > highWarned  %]
38                     <tr id="row[% subscription.subscriptionid %]" class = "high-warned-row" title="this resource has been reported more than [% highWarned %] times, take care!">
39                     [% ELSIF subscription.nbofcomment > warned  %]
40                     <tr id="row[% subscription.subscriptionid %]" class = "warned-row" title="this resource has been reported more than [% warned %] times, take care!">
41                     [% ELSIF subscription.nbofcomment > lowWarned  %]
42                     <tr id="row[% subscription.subscriptionid %]" class = "highlighted-row" title="this resource has been reported more than [% lowWarned %] times, take care!">
43                     [% END %]
44                     <input hidden class="rowid" value="[% subscription.id %]">
45                         <td>[% IF ( subscription.issn ) %][% subscription.issn %][% END %]</td>
46                         <td>[% subscription.title %]</a></td>
47                         <td>[% IF ( subscription.publishercode ) %][% subscription.publishercode %][% END %]</td>
48                         <td>[% IF ( subscription.sfdescription ) %][% subscription.sfdescription %][% END %]</td>
49                         <td>[% IF ( subscription.numberingmethod ) %][% subscription.numberingmethod %][% END %]</td>
50                         <td>[% IF ( subscription.nbofusers ) %][% subscription.nbofusers %][% END %]</td>
51                         <td><span title="[% subscription.lastimport %]">[% subscription.lastimport | $KohaDates %]</span></td>
52                         <td>[% FOREACH comment IN subscription.comments %][% comment.message %] ([% comment.nb %]) <br>[% END %]</td>
53
54                         [% UNLESS search_only %]
55                             <td>
56                                 <button class="mana-use" id="mana-use-[% subscription.id %]"><i class="fa fa-inbox"></i> Use</button>
57                                 <select class="mana-actions" id="mana-actions-[% subscription.id %]">
58                                     <option selected disabled>Report mistake</option>
59                                     [% FOREACH comment IN subscription.comments %]
60                                         <option value="[% comment.id %]"> [% comment.message %] ([% comment.nb %])</option>
61                                     [% END %]
62                                         <option>other</option>
63                                 </select>
64                                 <button hidden class="actionreport2" hidden> Cancel</button>
65                             </td>
66                         [% END %]
67                     </tr>
68                 [% END %]
69             [% END %]
70         </tbody>
71     </table>
72 [% ELSE %]
73     <h4>Mana search fails with the code: [% statuscode %] </h4>
74 [% END %]
75
76 <div id="comment_box" class="modal" tabindex="-1" role="dialog" aria-labelledby="mana_search_result_label" style="display: none;">
77     <div class="modal-dialog modal-lg" style="width: 30%">
78         <div class="modal-content" style="">
79             <div class="modal-header">
80                 <button type="button" id="commentCloseButton" class="closebtn" aria-hidden="true">×</button>
81                 <h3 id="mana_submit_comment"> Please enter a new commment (max 35 caracters)</h3>
82             </div>
83             <div class="modal-body">
84                 <form>
85                     <input hidden id="selected_id" value="">
86                     <input type="text" id="manamsg"> Comment:
87                 </form>
88                 <button id="CommentButton"> Comment </button>
89             </div>
90         </div>
91     </div>
92 </div>