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