Bug 25282: (follow-up) More corrections
[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>Koha &rsaquo; Tools &rsaquo; Plugins </title>
7 [% INCLUDE 'doc-head-close.inc' %]
8 </head>
9
10 <body id="plugins_plugins_home" class="plugins">
11 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'prefs-admin-search.inc' %]
13
14 <div id="breadcrumbs">
15     <a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo;
16     <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a> &rsaquo;
17     Plugins
18 </div>
19
20 <div class="main container-fluid">
21     <div class="row">
22         <div class="col-sm-10 col-sm-push-2">
23             <main>
24
25                 <div class="details">
26
27                     [% IF ( CAN_user_plugins_manage ) %]
28                         <div class="btn-toolbar" id="toolbar">
29                             <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>
30
31                             <div class="btn-group">
32                                 <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>
33                                 <ul class="dropdown-menu">
34                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl">View all plugins</a></li>
35                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=report">View report plugins</a></li>
36                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=tool">View tool plugins</a></li>
37                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=to_marc">View MARC conversion plugins</a></li>
38                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=opac_online_payment">View online payment plugins</a></li>
39                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=intranet_catalog_biblio_enhancements">View intranet catalog biblio enhancement plugins</a></li>
40                                     <li><a href="/cgi-bin/koha/plugins/plugins-home.pl?method=ill_availability_services">View ILL availability plugins</a></li>
41                                 </ul>
42                             </div>
43
44                             <div class="btn-group">
45                                 <form class="form-inline" id="plugin-search-form">
46                                     <div class="form-group">
47                                         <div class="input-group">
48                                             <input type="text" class="form-control" name="plugin-search" id="plugin-repo-search" placeholder="Search for plugins" value="[% search_term | html %]"/>
49                                             <div class="input-group-btn">
50                                                 <button class="btn btn-default" type="button" id="plugin-search-button"><i class="fa fa-search"></i></button>
51                                             </div>
52                                         </div>
53                                     </div>
54                                 </form>
55                             </div>
56                         </div>
57                     [% END %]
58                     <h1>Plugins</h1>
59
60                     [% IF search_results %]
61                         <h2>Search results</h2>
62                         <table class="table table-striped">
63                             <thead>
64                                 <tr>
65                                     <th>Name</th>
66                                     <th>Description</th>
67                                     <th>Organization</th>
68                                     <th>&nbsp;</th>
69                                 </tr>
70                             </thead>
71
72                             [% FOREACH sr IN search_results %]
73                                 <tr>
74                                     <td><a href="[% sr.result.html_url | url %]" target="_new">[% sr.result.name | html %]</a></td>
75                                     <td>[% sr.result.description | html %]</td>
76                                     <td>[% sr.repo.name | html %]</td>
77                                     <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>
78                                 </tr>
79                             [% END %]
80                         </table>
81                     [% END %]
82
83                     [% UNLESS ( plugins ) %]
84                         [% UNLESS ( method ) %]
85                             <div class="dialog message">No plugins installed</div>
86                         [% ELSE %]
87                             [% IF method == 'tool' %]
88                                 <div class="dialog message">No plugins that can be used as a tool are installed</div>
89                             [% ELSIF method == 'report' %]
90                                 <div class="dialog message">No plugins that can create a report are installed</div>
91                             [% ELSIF method == 'to_marc' %]
92                                 <div class="dialog message">No plugins that can convert files to MARC records are installed</div>
93                             [% ELSIF method == 'opac_online_payment' %]
94                                 <div class="dialog message">No plugins that can process online payments via the public catalog are installed</div>
95                             [% ELSIF method == 'intranet_catalog_biblio_enhancements' %]
96                                 <div class="dialog message">No plugins that can enhance the intranet catalog biblio records are installed</div>
97                             [% ELSE %]
98                                 <div class="dialog message">Unknown plugin type <i>[% method | html %]</i></div>
99                             [% END %]
100                         [% END %]
101                     [% ELSE %]
102                         <table>
103                             <tr>
104                                 <th>Name</th>
105                                 <th>Description</th>
106                                 <th>Author</th>
107                                 <th>Plugin version</th>
108                                 <th>Minimum Koha version</th>
109                                 <th>Maximum Koha version</th>
110                                 <th>Last updated</th>
111                                 [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
112                                     <th>Actions</th>
113                                 [% END %]
114                             </tr>
115
116                             [% FOREACH plugin IN plugins %]
117                                 <tr>
118                                     <td>
119                                         <strong>[% plugin.metadata.name | html %]</strong>
120                                         [% IF ( plugin.is_enabled ) %]
121                                             <span class="label label-primary">ENABLED</span>
122                                         [% ELSE %]
123                                             <span class="label label-default">DISABLED</span>
124                                         [% END %]
125                                     </td>
126                                     <td>
127                                         [% plugin.metadata.description | html %]
128
129                                         [% IF ( plugin.metadata.minimum_version && koha_version < plugin.metadata.minimum_version ) %]
130                                             <div class="dialog alert">
131                                                 Warning: This report was written for a newer version of Koha. Run at your own risk.
132                                             </div>
133                                         [% END %]
134
135                                         [% IF ( plugin.metadata.maximum_version && koha_version > plugin.metadata.maximum_version ) %]
136                                             <div class="dialog alert">
137                                                 Warning: This plugin was written for an older version of Koha. Run at your own risk.
138                                             </div>
139                                         [% END %]
140                                     </td>
141                                     <td>[% plugin.metadata.author | html %]</td>
142                                     <td>[% plugin.metadata.version | html %]</td>
143                                     <td>[% plugin.metadata.minimum_version | html %]</td>
144                                     <td>[% plugin.metadata.maximum_version | html %]</td>
145                                     <td>[% plugin.metadata.date_updated | $KohaDates %]</td>
146                                     [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
147                                         <td class="actions">
148                                             <div class="btn-group dropup">
149                                                 <a class="btn btn-default btn-xs dropdown-toggle" id="pluginactions[% plugin.class | html %]" role="button" data-toggle="dropdown" href="#">
150                                                    Actions <b class="caret"></b>
151                                                 </a>
152                                                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="pluginactions[% plugin.class | html %]">
153                                                     [% IF ( CAN_user_plugins_report ) %]
154                                                         [% IF plugin.can('report') %]
155                                                             <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>
156                                                         [% END %]
157                                                     [% END %]
158
159                                                     [% IF ( CAN_user_plugins_tool ) %]
160                                                         [% IF plugin.can('tool') %]
161                                                             <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>
162                                                         [% END %]
163                                                     [% END %]
164
165                                                     [% IF ( CAN_user_plugins_configure ) %]
166                                                         [% IF plugin.can('configure') %]
167                                                             <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>
168                                                         [% END %]
169                                                     [% END %]
170                                                     [% IF ( CAN_user_plugins_manage ) %]
171                                                             <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>
172                                                         [% IF ( plugin.is_enabled ) %]
173                                                                 <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>
174                                                         [% ELSE %]
175                                                                 <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>
176                                                         [% END %]
177                                                     [% END %]
178                                                 </ul>
179                                             </div>
180                                         </td>
181                                     [% END %]
182                             [% END %]
183                         </table>
184                     [% END %]
185                 </div>
186
187             </main>
188         </div> <!-- /.col-sm-10.col-sm-push-2 -->
189
190         <div class="col-sm-2 col-sm-pull-10">
191             <aside>
192                 [% INCLUDE 'tools-menu.inc' %]
193             </aside>
194         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
195      </div> <!-- /.row -->
196
197 [% MACRO jsinclude BLOCK %]
198     [% Asset.js("js/tools-menu.js") | $raw %]
199     [% INCLUDE 'calendar.inc' %]
200     <script>
201         $(document).ready(function(){
202             $(".uninstall_plugin").on("click", function(){
203                 $(".dropdown").removeClass("open");
204                 var plugin_name = $(this).data("plugin-name");
205                 return confirmDelete( _("Are you sure you want to uninstall the plugin %s?").format( plugin_name ) );
206             });
207
208             $("#plugin-search-button").on("click", function(){
209                 $("#plugin-search-form").submit();
210             });
211         });
212     </script>
213 [% END %]
214
215 [% INCLUDE 'intranet-bottom.inc' %]