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