]> git.koha-community.org Git - koha.git/blob - koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt
Bug 31603: Add search option for plugin page
[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 [% INCLUDE 'header.inc' %]
12 [% INCLUDE 'prefs-admin-search.inc' %]
13
14 <nav id="breadcrumbs" aria-label="Breadcrumb" class="breadcrumb">
15     <ol>
16         <li>
17             <a href="/cgi-bin/koha/mainpage.pl">Home</a>
18         </li>
19         <li>
20             <a href="/cgi-bin/koha/tools/tools-home.pl">Tools</a>
21         </li>
22         <li>
23             <a href="#" aria-current="page">
24                 Plugins
25             </a>
26         </li>
27     </ol>
28 </nav>
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 staff catalog biblio enhancement plugins</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                         <table class="table table-striped">
75                             <thead>
76                                 <tr>
77                                     <th>Name</th>
78                                     <th>Description</th>
79                                     <th>Organization</th>
80                                     <th>Latest version</th>
81                                     <th>&nbsp;</th>
82                                 </tr>
83                             </thead>
84
85                             [% FOREACH sr IN search_results %]
86                                 <tr>
87                                     <td><a href="[% sr.result.html_url | url %]" target="_new">[% sr.result.name | html %]</a></td>
88                                     <td>[% sr.result.description | html %]</td>
89                                     <td>[% sr.repo.name | html %]</td>
90                                     <td>[% sr.result.tag_name | html %]</td>
91                                     <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>
92                                 </tr>
93                             [% END %]
94                         </table>
95                     [% END %]
96
97                     [% UNLESS ( plugins ) %]
98                         [% UNLESS ( method ) %]
99                             <div class="dialog message">No plugins installed</div>
100                         [% ELSE %]
101                             [% IF method == 'tool' %]
102                                 <div class="dialog message">No plugins that can be used as a tool are installed</div>
103                             [% ELSIF method == 'report' %]
104                                 <div class="dialog message">No plugins that can create a report are installed</div>
105                             [% ELSIF method == 'to_marc' %]
106                                 <div class="dialog message">No plugins that can convert files to MARC records are installed</div>
107                             [% ELSIF method == 'opac_online_payment' %]
108                                 <div class="dialog message">No plugins that can process online payments via the public catalog are installed</div>
109                             [% ELSIF method == 'intranet_catalog_biblio_enhancements' %]
110                                 <div class="dialog message">No plugins that can enhance the intranet catalog biblio records are installed</div>
111                             [% ELSE %]
112                                 <div class="dialog message">Unknown plugin type <em>[% method | html %]</em></div>
113                             [% END %]
114                         [% END %]
115                     [% ELSE %]
116                         <table id="installed_plugins">
117                             <thead>
118                                 <tr>
119                                     <th>Name</th>
120                                     <th>Description</th>
121                                     <th>Author</th>
122                                     <th>Plugin version</th>
123                                     <th>Minimum Koha version</th>
124                                     <th>Maximum Koha version</th>
125                                     <th>Last updated</th>
126                                     [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
127                                         <th class="noExport">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                                         [% IF ( plugin.is_enabled ) %]
150                                             <span class="label label-primary">ENABLED</span>
151                                         [% ELSE %]
152                                             <span class="label label-default">DISABLED</span>
153                                         [% END %]
154                                     </td>
155                                     <td>
156                                         [% plugin.metadata.description | html %]
157
158                                         [% IF ( plugin.metadata.minimum_version && koha_version < plugin.metadata.minimum_version ) %]
159                                             <div class="dialog alert">
160                                                 Warning: This plugin was written for a newer version of Koha. Use at your own risk.
161                                             </div>
162                                         [% END %]
163
164                                         [% IF ( plugin.metadata.maximum_version && koha_version > plugin.metadata.maximum_version ) %]
165                                             <div class="dialog alert">
166                                                 Warning: This plugin was written for an older version of Koha. Use at your own risk.
167                                             </div>
168                                         [% END %]
169                                     </td>
170                                     <td>[% plugin.metadata.author | html %]</td>
171                                     <td>[% plugin.metadata.version | html %]</td>
172                                     <td>[% plugin.metadata.minimum_version | html %]</td>
173                                     <td>[% plugin.metadata.maximum_version | html %]</td>
174                                     <td>[% plugin.metadata.date_updated | $KohaDates %]</td>
175                                     [% IF ( CAN_user_plugins_configure || CAN_user_plugins_manage || CAN_user_plugins_report || CAN_user_plugins_tool ) %]
176                                         <td class="actions">
177                                             <div class="btn-group dropup">
178                                                 <a class="btn btn-default btn-xs dropdown-toggle" id="pluginactions[% plugin.class | html %]" role="button" data-toggle="dropdown" href="#">
179                                                    Actions <b class="caret"></b>
180                                                 </a>
181                                                 <ul class="dropdown-menu pull-right" role="menu" aria-labelledby="pluginactions[% plugin.class | html %]">
182                                                     [% IF ( CAN_user_plugins_report ) %]
183                                                         [% IF plugin.can('report') %]
184                                                             <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>
185                                                         [% END %]
186                                                     [% END %]
187
188                                                     [% IF ( CAN_user_plugins_tool ) %]
189                                                         [% IF plugin.can('tool') %]
190                                                             <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>
191                                                         [% END %]
192                                                     [% END %]
193
194                                                     [% IF ( CAN_user_plugins_configure ) %]
195                                                         [% IF plugin.can('configure') %]
196                                                             <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>
197                                                         [% END %]
198                                                     [% END %]
199                                                     [% IF ( CAN_user_plugins_manage ) %]
200                                                             <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>
201                                                         [% IF ( plugin.is_enabled ) %]
202                                                                 <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>
203                                                         [% ELSE %]
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=enable"><i class="fa fa-play fa-fw"></i> Enable</a></li>
205                                                         [% END %]
206                                                     [% END %]
207                                                 </ul>
208                                             </div>
209                                         </td>
210                                     [% END %]
211                                 </tr>
212                                 [% END %]
213                             [% END %]
214                         </table>
215                     [% END %]
216                 </div>
217
218             </main>
219         </div> <!-- /.col-sm-10.col-sm-push-2 -->
220
221         <div class="col-sm-2 col-sm-pull-10">
222             <aside>
223                 [% INCLUDE 'tools-menu.inc' %]
224             </aside>
225         </div> <!-- /.col-sm-2.col-sm-pull-10 -->
226      </div> <!-- /.row -->
227
228 [% MACRO jsinclude BLOCK %]
229     [% Asset.js("js/tools-menu.js") | $raw %]
230     [% INCLUDE 'calendar.inc' %]
231     [% INCLUDE 'datatables.inc' %]
232     [% INCLUDE 'columns_settings.inc' %]
233     <script>
234         $(document).ready(function(){
235             $(".uninstall_plugin").on("click", function(){
236                 $(".dropdown").removeClass("open");
237                 var plugin_name = $(this).data("plugin-name");
238                 return confirmDelete( _("Are you sure you want to uninstall the plugin %s?").format( plugin_name ) );
239             });
240
241             $("#plugin-search-button").on("click", function(){
242                 $("#plugin-search-form").submit();
243             });
244
245             KohaTable("installed_plugins", {
246                 "bPaginate": false
247             });
248         });
249     </script>
250 [% END %]
251
252 [% INCLUDE 'intranet-bottom.inc' %]