Bug 13618: Add html filters to all the variables
[koha.git] / koha-tmpl / intranet-tmpl / prog / en / modules / plugins / plugins-home.tt
1 [% USE raw %]
2 [% USE Asset %]
3 [% USE KohaDates %]
4 [% SET footerjs = 1 %]
5 [% INCLUDE 'doc-head-open.inc' %]
6 <title>Koha &rsaquo; Tools &rsaquo; Plugins </title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9
10 <body id="plugins_plugins_home" class="plugins">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'prefs-admin-search.inc' %]
13
14 <div id="breadcrumbs">
15     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
16     <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
17     Plugins
18 </div>
19
20 <div id="doc3" class="yui-t1">
21     <div id="bd">
22         <div id="yui-main">
23             <div class="yui-b">
24                 <div class="details">
25
26                     [% IF ( CAN_user_plugins_manage ) %]
27                         <div class="btn-toolbar" id="toolbar">
28                             <a href="/cgi-bin/koha/plugins/plugins-upload.pl" id="upload_plugin" class="btn btn-default btn-sm"><i class="fa fa-upload"></i> Upload plugin</a>
29                             <div class="btn-group">
30                                 <button class="btn btn-default btn-sm dropdown-toggle" data-toggle="dropdown"><i class="fa fa-eye"></i> View plugins by class <span class="caret"></span></button>
31                                 <ul class="dropdown-menu">
32                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl">View all plugins</a></li>
33                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">View report plugins</a></li>
34                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">View tool plugins</a></li>
35                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=to_marc">View MARC conversion plugins</a></li>
36                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=opac_online_payment">View online payment plugins</a></li>
37                                 </ul>
38                             </div>
39                         </div>
40                     [% END %]
41                     <h1>Plugins</h1>
42
43                     [% UNLESS ( plugins ) %]
44                         [% UNLESS ( method ) %]
45                             <div class="dialog message">No plugins installed</div>
46                         [% ELSE %]
47                             [% IF method == 'tool' %]
48                                 <div class="dialog message">No plugins that can be used as a tool are installed</div>
49                             [% ELSIF method == 'report' %]
50                                 <div class="dialog message">No plugins that can create a report are installed</div>
51                             [% ELSIF method == 'to_marc' %]
52                                 <div class="dialog message">No plugins that can convert files to MARC records are installed</div>
53                             [% ELSIF method == 'opac_online_payment' %]
54                                 <div class="dialog message">No plugins that can process online payments via the public catalog are installed</div>
55                             [% ELSE %]
56                                 <div class="dialog message">Unknown plugin type <i>[% method | html %]</i></div>
57                             [% END %]
58                         [% END %]
59                     [% ELSE %]
60                         <table>
61                             <tr>
62                                 <th>Name</th>
63                                 <th>Description</th>
64                                 <th>Author</th>
65                                 <th>Plugin version</th>
66                                 <th>Minimum Koha version</th>
67                                 <th>Maximum Koha version</th>
68                                 <th>Last updated</th>
69                                 [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
70                                     <th>Actions</th>
71                                 [% END %]
72                             </tr>
73
74                             [% FOREACH plugin IN plugins %]
75                                 <tr>
76                                     <td><strong>[% plugin.metadata.name | html %]</strong></td>
77                                     <td>
78                                         [% plugin.metadata.description | html %]
79
80                                         [% IF ( plugin.metadata.minimum_version && koha_version < plugin.metadata.minimum_version ) %]
81                                             <div class="error">Warning: This report was written for a newer version of Koha. Run at your own risk.</div>
82                                         [% END %]
83
84                                         [% IF ( plugin.metadata.maximum_version && koha_version > plugin.metadata.maximum_version ) %]
85                                             <div class="error">Warning: This report was written for an older version of Koha. Run at your own risk.</div>
86                                         [% END %]
87                                     </td>
88                                     <td>[% plugin.metadata.author | html %]</td>
89                                     <td>[% plugin.metadata.version | html %]</td>
90                                     <td>[% plugin.metadata.minimum_version | html %]</td>
91                                     <td>[% plugin.metadata.maximum_version | html %]</td>
92                                     <td>[% plugin.metadata.date_updated | $KohaDates %]</td>
93                                     [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
94                                         <td class="actions">
95                                             <div class="dropdown">
96                                                 <a class="btn btn-default btn-xs dropdown-toggle" id="pluginactions[% plugin.class | html %]" role="button" data-toggle="dropdown" href="#">
97                                                    Actions <b class="caret"></b>
98                                                 </a>
99                                                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="pluginactions[% plugin.class | html %]">
100                                                     [% IF ( CAN_user_plugins_report ) %]
101                                                         [% IF plugin.can('report') %]
102                                                             <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | html %]&method=report"><i class="fa fa-table"></i> Run report</a></li>
103                                                         [% END %]
104                                                     [% END %]
105
106                                                     [% IF ( CAN_user_plugins_tool ) %]
107                                                         [% IF plugin.can('tool') %]
108                                                             <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | html %]&method=tool"><i class="fa fa-wrench"></i> Run tool</a></li>
109                                                         [% END %]
110                                                     [% END %]
111
112                                                     [% IF ( CAN_user_plugins_configure ) %]
113                                                         [% IF plugin.can('configure') %]
114                                                             <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | html %]&method=configure"><i class="fa fa-cog"></i> Configure</a></li>
115                                                         [% END %]
116                                                     [% END %]
117                                                     [% IF ( CAN_user_plugins_manage ) %]
118                                                             <li><a class="uninstall_plugin" data-plugin-name="[% plugin.metadata.name | html %]" href="/cgi-bin/koha/plugins/plugins-uninstall.pl?class=[% plugin.class | html %]"><i class="fa fa-trash"></i> Uninstall</a></li>
119                                                     [% END %]
120                                                 </ul>
121                                             </div>
122                                         </td>
123                                     [% END %]
124                             [% END %]
125                         </table>
126                     [% END %]
127                 </div>
128             </div>
129         </div>
130
131     <div class="yui-b noprint">
132         [% INCLUDE 'tools-menu.inc' %]
133     </div>
134 </div>
135
136 [% MACRO jsinclude BLOCK %]
137     [% Asset.js("js/tools-menu.js") | $raw %]
138     [% INCLUDE 'calendar.inc' %]
139     <script type="text/javascript">
140         $(document).ready(function(){
141             $(".uninstall_plugin").on("click", function(){
142                 $(".dropdown").removeClass("open");
143                 var plugin_name = $(this).data("plugin-name");
144                 return confirmDelete( _("Are you sure you want to uninstall the plugin %s?").format( plugin_name ) );
145             });
146         });
147     </script>
148 [% END %]
149
150 [% INCLUDE 'intranet-bottom.inc' %]