Bug 22197: Add Mana KB link to administration sidebar menu
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / includes / mana / mana-report-search-result.inc
1 [% USE KohaDates %]
2 [% USE Koha %]
3 [% USE AuthorisedValues %]
4 [% USE Branches %]
5 [% USE raw %]
6
7 <script>
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     $(document).on('change', 'select.mana-actions', function() {
16         report_id = $(this).attr('id').substr(13);
17         if ($(this).val() == 'other') {
18             $('input#selected_id').val(report_id);
19             $('#comment_box').modal('show');
20         } else {
21             comment_id = $(this).val();
22             mana_increment(comment_id, 'resource_comment', 'nb');
23         }
24     });
25 });
26 //]]>
27 </script>
28 [% INCLUDE 'mana.inc' %]
29
30 [% IF statuscode == "200" AND reports %]
31     <table id="mana_results_datatable" width=100%>
32         <thead>
33             <tr>
34                 <th>Report Name</th>
35                 <th class="anti-the" width=35%>Notes</th>
36                 <th>Type</th>
37                 <th title="number of libraries using this pattern"># of users</th>
38                 <th class="title-string" title="last time a library used this pattern">Last import</th>
39                 <th> Comments </th>
40                 [% UNLESS search_only %]
41                   <th class="NoSort">Actions</th>
42                 [% END %]
43             </tr>
44         </thead>
45         <tbody>
46             [% FOREACH report IN reports %]
47                 [% UNLESS report.cannotdisplay %]
48                     [% IF report.nbofcomment > highWarned %]
49                   <tr id="row[% report.id | $raw %]" class = "high-warned-row">
50                     [% ELSIF report.nbofcomment > warned %]
51                   <tr id="row[% report.id | $raw %]" class = "warned-row">
52                     [% ELSIF report.nbofcomment > lowWarned %]
53                   <tr id="row[% report.id | $raw %]" class = "highlighted-row">
54                     [% END %]
55                     <input hidden class="rowid" value="[% report.id | $raw %]">
56                     <td>[% IF ( report.report_name ) %][% report.report_name | html %][% END %]</td>
57                     <td title="[% report.savedsql | html %]"><div>
58                         [% IF report.notes.length > 200 %]
59                             [% report.notes.substr(0,200) | html %]<a class="showbutton">Show More</a></div><div hidden>
60                         [% END %]
61                             [% report.notes | html %]
62                         [% IF report.notes.length > 200 %]
63                                 <a class="hidebutton">Show Less</a></div> </td>
64                         [% END %]
65                     <td> [% report.type | html %] </td>
66                     <td>[% IF ( report.nbofusers ) %][% report.nbofusers | $raw %][% END %]</td>
67                     <td><span title="[% report.lastimport | $KohaDates %]">[% report.lastimport | $KohaDates %]</span></td>
68                     <td>[% FOREACH comment IN report.comments %][% comment.message | html %] ([% comment.nb | $raw %]) <br>[% END %]</td>
69
70                     [% UNLESS search_only %]
71                         <td>
72                             <button class="mana-use" id="mana-use-[% report.id | $raw %]"><i class="fa fa-inbox"></i> Use</button>
73                         </td>
74                     [% END %]
75                   </tr>
76                 [% END %]
77             [% END %]
78         </tbody>
79     </table>
80 [% ELSE %]
81     <h4> [% msg | html %]  statuscode: [% statuscode | $raw %]</h4>
82 [% END %]