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