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