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