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