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