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