Koha/koha-tmpl/intranet-tmpl/prog/en/modules/plugins/plugins-home.tt
Kyle M Hall 5eabc672fd Bug 7804 - Add Koha Plugin System
Adds support for custom plugins. At the moment the Plugins
feature supports two types of plugins, reports and tools.

Plugins are installed by uploading KPZ ( Koha Plugin Zip )
packages. A KPZ file is just a zip file containing the
perl files, template files, and any other files neccessary
to make the plugin work.

Test plan:
1) Apply patch
2) Run updatedatabase.pl
3) Create the directory /var/lib/koha/plugins
4) Add the lines
      <pluginsdir>/var/lib/koha/plugins</pluginsdir>
      <enable_plugins>1</enable_plugins>"
   to your koha-conf.xml file
5) Add the line
       Alias /plugin/ "/var/lib/koha/plugins/"
   to your koha-httpd.conf file
6) Restart your webserver
7) Access the plugins system from the "More" pulldown
8) Upload the example plugin file provided here
9) Try it out!

Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>

Signed-off-by: Jonathan Druart <jonathan.druart@biblibre.com>
Signed-off-by: Kyle M Hall <kyle@bywatersolutions.com>
Signed-off-by: Jared Camins-Esakov <jcamins@cpbibliography.com>
2013-03-20 14:49:47 -04:00

116 lines
5.8 KiB
Text

[% USE KohaDates %]
[% INCLUDE 'doc-head-open.inc' %]
<title>Koha &rsaquo; Tools &rsaquo; Plugins </title>
[% INCLUDE 'doc-head-close.inc' %]
[% INCLUDE 'calendar.inc' %]
</head>
<body>
[% INCLUDE 'header.inc' %]
[% INCLUDE 'circ-search.inc' %]
<div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a>
&rsaquo; Plugins
</div>
<div id="doc3" class="yui-t1">
<div id="bd">
<div id="yui-main">
<div class="yui-b">
<div class="details">
<h1>Plugins</h1>
[% UNLESS ( plugins ) %]
[% UNLESS ( method ) %]
<h3>No plugins installed</h3>
[% ELSE %]
[% IF method == 'tool' %]
<h3>No plugins that can be used as a tool are installed</h3>
[% ELSIF method == 'report' %]
<h3>No plugins that can create a report are installed</h3>
[% ELSE %]
<h3>Unknown plugin type <i>[% method %]</i>
[% END %]
[% END %]
[% ELSE %]
<table>
<tr>
<th>Name</th>
<th>&nbsp;</th>
<th>Description</th>
<th>Author</th>
<th>Plugin Version</th>
<th>Minimum Koha Version</th>
<th>Maximum Koha Version</th>
<th>Last Updated</th>
[% IF ( CAN_user_plugins_configure ) %]<th>Configure</th>[% END %]
[% IF ( CAN_user_plugins_manage ) %]<th>Uninstall</th>[% END %]
</tr>
[% FOREACH plugin IN plugins %]
<tr>
<td><strong>[% plugin.metadata.name %]</strong></td>
<td>
[% IF ( CAN_user_plugins_report ) %]
[% IF plugin.can('report') %]
<p style="white-space:nowrap"><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=report">Run report</a></p>
[% END %]
[% END %]
[% IF ( CAN_user_plugins_tool ) %]
[% IF plugin.can('tool') %]
<p style="white-space:nowrap"><a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=tool">Run tool</a></p>
[% END %]
[% END %]
</td>
<td>
[% plugin.metadata.description %]
[% IF ( plugin.metadata.minimum_version && koha_version < plugin.metadata.minimum_version ) %]
<div class="error">Warning: This report was written for a newer version of Koha. Run at your own risk.</div>
[% END %]
[% IF ( plugin.metadata.maximum_version && koha_version > plugin.metadata.maximum_version ) %]
<div class="error">Warning: This report was written for an older version of Koha. Run at your own risk.</div>
[% END %]
</td>
<td>[% plugin.metadata.author %]</td>
<td>[% plugin.metadata.version %]</td>
<td>[% plugin.metadata.minimum_version %]</td>
<td>[% plugin.metadata.maximum_version %]</td>
<td>[% plugin.metadata.date_updated | $KohaDates %]</td>
[% IF ( CAN_user_plugins_configure ) %]
<td>
[% IF plugin.can('configure') %]
<a href="/cgi-bin/koha/plugins/run.pl?class=[% plugin.class %]&method=configure">Configure</a>
[% END %]
</td>
[% END %]
[% IF ( CAN_user_plugins_manage ) %]
<td>
[% IF plugin.can('uninstall') %]
<a href="/cgi-bin/koha/plugins/plugins-uninstall.pl?class=[% plugin.class %]" onclick="return confirm('Are you sure you want to uninstall the plugin [% plugin.metadata.name %]?')">Uninstall</a>
[% END %]
</td>
[% END %]
[% END %]
</table>
[% END %]
</div>
</div>
</div>
<div class="yui-b noprint">
<div id="navmenu">
<ul id="navmenulist">
[% IF ( CAN_user_plugins_manage ) %]
<li><a href="plugins-upload.pl">Upload a plugin</a></li>
[% END %]
</ul>
</div>
</div>
</div>
</div>
[% INCLUDE 'intranet-bottom.inc' %]