Bug 34131: (QA follow-up): Add 'ill_availability_services' to method filter check
[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>Plugins &rsaquo; Tools &rsaquo; Koha </title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9
10 <body id="plugins_plugins_home" class="plugins">
11 [% WRAPPER 'header.inc' %]
12     [% INCLUDE 'prefs-admin-search.inc' %]
13 [% END %]
14
15 [% WRAPPER 'sub-header.inc' %]
16     [% WRAPPER breadcrumbs %]
17         [% WRAPPER breadcrumb_item %]
18             [% IF ( method == 'tool' ) %]
19                 <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
20             [% ELSE %]
21                 <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a>
22             [% END %]
23         [% END %]
24         [% WRAPPER breadcrumb_item bc_active= 1 %]
25             <span>Plugins</span>
26         [% END %]
27     [% END #/ WRAPPER breadcrumbs %]
28 [% END #/ WRAPPER sub-header.inc %]
29
30 <div class="main container-fluid">
31     <div class="row">
32         <div class="col-sm-10 col-sm-push-2">
33             <main>
34                     <h1>Plugins</h1>
35
36                 <div class="details">
37
38                     [% IF ( CAN_user_plugins_manage ) %]
39                         <div class="btn-toolbar" id="toolbar">
40                             <a href="/cgi-bin/koha/plugins/plugins-upload.pl" id="upload_plugin" class="btn btn-default"><i class="fa fa-upload"></i> Upload plugin</a>
41
42                             <div class="btn-group">
43                                 <button class="btn btn-default dropdown-toggle" data-toggle="dropdown"><i class="fa fa-eye"></i> View plugins by class <span class="caret"></span></button>
44                                 <ul class="dropdown-menu">
45                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl">View all plugins</a></li>
46                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">View report plugins</a></li>
47                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">View tool plugins</a></li>
48                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=to_marc">View MARC conversion plugins</a></li>
49                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=opac_online_payment">View online payment plugins</a></li>
50                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=intranet_catalog_biblio_enhancements">View bibliographic record enhancement plugins for the staff interface</a></li>
51                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=ill_availability_services">View ILL availability plugins</a></li>
52                                 </ul>
53                             </div>
54
55                             [% IF can_search %]
56                             <div class="btn-group">
57                                 <form class="form-inline" id="plugin-search-form">
58                                     <div class="form-group">
59                                         <div class="input-group">
60                                             <input type="text" class="form-control" name="plugin-search" id="plugin-repo-search" placeholder="Search for plugins" value="[% search_term | html %]"/>
61                                             <div class="input-group-btn">
62                                                 <button class="btn btn-default" type="button" id="plugin-search-button"><i class="fa fa-search"></i></button>
63                                             </div>
64                                         </div>
65                                     </div>
66                                 </form>
67                             </div>
68                             [% END %]
69                         </div>
70                     [% END %]
71
72                     [% IF search_results %]
73                         <h2>Search results</h2>
74                         <div class="page-section">
75                             <table class="table table-striped">
76                                 <thead>
77                                     <tr>
78                                         <th>Name</th>
79                                         <th>Description</th>
80                                         <th>Organization</th>
81                                         <th>Latest version</th>
82                                         <th>&nbsp;</th>
83                                     </tr>
84                                 </thead>
85
86                                 [% FOREACH sr IN search_results %]
87                                     <tr>
88                                         <td><a href="[% sr.result.html_url | url %]" target="_new">[% sr.result.name | html %]</a></td>
89                                         <td>[% sr.result.description | html %]</td>
90                                         <td>[% sr.repo.name | html %]</td>
91                                         <td>[% sr.result.tag_name | html %]</td>
92                                         <td><a class="btn btn-default btn-sm btn-install-plugin" href="/cgi-bin/koha/plugins/plugins-upload.pl?op=Upload&uploadfile=[% sr.result.install_name | uri %]&uploadlocation=[% sr.result.install_url | uri %]"><i class="fa fa-download"></i> Install</a></td>
93                                     </tr>
94                                 [% END %]
95                             </table>
96                         </div><!-- /.page-section -->
97                     [% END %]
98
99                     [% UNLESS ( plugins ) %]
100                         [% UNLESS ( method ) %]
101                             <div class="dialog message">No plugins installed</div>
102                         [% ELSE %]
103                             [% IF method == 'tool' %]
104                                 <div class="dialog message">No plugins that can be used as a tool are installed</div>
105                             [% ELSIF method == 'report' %]
106                                 <div class="dialog message">No plugins that can create a report are installed</div>
107                             [% ELSIF method == 'to_marc' %]
108                                 <div class="dialog message">No plugins that can convert files to MARC records are installed</div>
109                             [% ELSIF method == 'opac_online_payment' %]
110                                 <div class="dialog message">No plugins that can process online payments via the public catalog are installed</div>
111                             [% ELSIF method == 'intranet_catalog_biblio_enhancements' %]
112                                 <div class="dialog message">No plugins that can enhance the bibliographic records in the staff interface are installed</div>
113                             [% ELSIF method == 'ill_availability_services' %]
114                                 <div class="dialog message">No plugins that can show ILL availability results are installed</div>
115                             [% ELSE %]
116                                 <div class="dialog message">Unknown plugin type <em>[% method | html %]</em></div>
117                             [% END %]
118                         [% END %]
119                     [% ELSE %]
120                         <div class="page-section">
121                             <table id="installed_plugins">
122                                 <thead>
123                                     <tr>
124                                         <th>Name</th>
125                                         <th>Description</th>
126                                         <th>Author</th>
127                                         <th>Plugin version</th>
128                                         <th>Minimum Koha version</th>
129                                         <th>Maximum Koha version</th>
130                                         <th>Last updated</th>
131                                         <th>Status</th>
132                                         [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
133                                             <th class="noExport NoSort">Actions</th>
134                                         [% END %]
135                                     </tr>
136                                 </thead>
137
138                                 [% FOREACH plugin IN plugins %]
139                                     [% IF plugin.error %]
140                                     <tr class="warn">
141                                         <td>
142                                             <strong>[% plugin.name | html %]</strong>
143                                             <span class="label label-warning">ERRORS</span>
144                                         </td>
145                                         [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
146                                         <td colspan="7">Error found whilst attempting to load plugin</td>
147                                         [% ELSE %]
148                                         <td colspan="6">Error found whilst attempting to load plugin</td>
149                                         [% END %]
150                                     </tr>
151                                     [% ELSE %]
152                                     <tr>
153                                         <td>
154                                             <strong>[% plugin.metadata.name | html %]</strong>
155                                         </td>
156                                         <td>
157                                             [% plugin.metadata.description | html %]
158
159                                             [% IF ( plugin.metadata.minimum_version && koha_version < plugin.metadata.minimum_version ) %]
160                                                 <div class="dialog alert">
161                                                     Warning: This plugin was written for a newer version of Koha. Use at your own risk.
162                                                 </div>
163                                             [% END %]
164
165                                             [% IF ( plugin.metadata.maximum_version && koha_version > plugin.metadata.maximum_version ) %]
166                                                 <div class="dialog alert">
167                                                     Warning: This plugin was written for an older version of Koha. Use at your own risk.
168                                                 </div>
169                                             [% END %]
170                                         </td>
171                                         <td>[% plugin.metadata.author | html %]</td>
172                                         <td>[% plugin.metadata.version | html %]</td>
173                                         <td>[% plugin.metadata.minimum_version | html %]</td>
174                                         <td>[% plugin.metadata.maximum_version | html %]</td>
175                                         <td>[% plugin.metadata.date_updated | $KohaDates %]</td>
176                                         <td>
177                                             [% IF ( plugin.is_enabled ) %]
178                                                 <span class="bg-success">Enabled</span>
179                                             [% ELSE %]
180                                                 <span class="bg-warning">Disabled</span>
181                                             [% END %]
182                                         </td>
183                                         [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
184                                             <td class="actions">
185                                                 <div class="btn-group dropup">
186                                                     <a class="btn btn-default btn-xs dropdown-toggle" id="pluginactions[% plugin.class | html %]" role="button" data-toggle="dropdown" href="#">
187                                                        Actions <b class="caret"></b>
188                                                     </a>
189                                                     <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="pluginactions[% plugin.class | html %]">
190                                                         [% IF ( CAN_user_plugins_report ) %]
191                                                             [% IF plugin.can('report') %]
192                                                                 <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=report"><i class="fa fa-table fa-fw"></i> Run report</a></li>
193                                                             [% END %]
194                                                         [% END %]
195
196                                                         [% IF ( CAN_user_plugins_tool ) %]
197                                                             [% IF plugin.can('tool') %]
198                                                                 <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=tool"><i class="fa fa-wrench fa-fw"></i> Run tool</a></li>
199                                                             [% END %]
200                                                         [% END %]
201
202                                                         [% IF ( CAN_user_plugins_configure ) %]
203                                                             [% IF plugin.can('configure') %]
204                                                                 <li><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class | uri %]&method=configure"><i class="fa fa-cog fa-fw"></i> Configure</a></li>
205                                                             [% END %]
206                                                         [% END %]
207                                                         [% IF ( CAN_user_plugins_manage ) %]
208                                                                 <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 fa-fw"></i> Uninstall</a></li>
209                                                             [% IF ( plugin.is_enabled ) %]
210                                                                     <li><a class="enable_plugin" data-plugin-name="[% plugin.metadata.name | html %]" href="/cgi-bin/koha/plugins/plugins-enable.pl?class=[% plugin.class | html %]&method=disable"><i class="fa fa-pause fa-fw"></i> Disable</a></li>
211                                                             [% ELSE %]
212                                                                     <li><a class="enable_plugin" data-plugin-name="[% plugin.metadata.name | html %]" href="/cgi-bin/koha/plugins/plugins-enable.pl?class=[% plugin.class | html %]&method=enable"><i class="fa fa-play fa-fw"></i> Enable</a></li>
213                                                             [% END %]
214                                                         [% END %]
215                                                     </ul>
216                                                 </div>
217                                             </td>
218                                         [% END %]
219                                     </tr>
220                                     [% END %]
221                                 [% END %]
222                             </table>
223                         </div><!-- /.page-section -->
224                     [% END %]
225                 </div>
226
227             </main>
228         </div> <!-- /.col-sm-10.col-sm-push-2 -->
229
230         <div class="col-sm-2 col-sm-pull-10">
231             <aside>
232                 [% IF ( method == 'tool' ) %]
233                     [% INCLUDE 'tools-menu.inc' %]
234                 [% ELSE %]
235                     [% INCLUDE 'admin-menu.inc' %]
236                 [% END %]
237             </aside>
238         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
239      </div> <!-- /.row -->
240
241 [% MACRO jsinclude BLOCK %]
242     [% Asset.js("js/tools-menu.js") | $raw %]
243     [% INCLUDE 'calendar.inc' %]
244     [% INCLUDE 'datatables.inc' %]
245     [% INCLUDE 'columns_settings.inc' %]
246     <script>
247         $(document).ready(function(){
248             $(".uninstall_plugin").on("click", function(){
249                 $(".dropdown").removeClass("open");
250                 var plugin_name = $(this).data("plugin-name");
251                 return confirmDelete( _("Are you sure you want to uninstall the plugin %s?").format( plugin_name ) );
252             });
253
254             $("#plugin-search-button").on("click", function(){
255                 $("#plugin-search-form").submit();
256             });
257
258             KohaTable("installed_plugins", {
259                 "bPaginate": false
260             });
261         });
262     </script>
263 [% END %]
264
265 [% INCLUDE 'intranet-bottom.inc' %]