1 package Koha::Plugin::Test;
3 ## It's good practice to use Modern::Perl
6 use Mojo::JSON qw(decode_json);
8 ## Required for all plugins
9 use base qw(Koha::Plugins::Base);
13 name => 'Test Plugin',
14 author => 'Kyle M Hall',
15 description => 'Test plugin',
16 date_authored => '2013-01-14',
17 date_updated => '2013-01-14',
18 minimum_version => '3.11',
19 maximum_version => undef,
21 my_example_tag => 'find_me',
24 ## This is the minimum code required for a plugin's 'new' method
25 ## More can be added, but none should be removed
27 my ( $class, $args ) = @_;
28 $args->{'metadata'} = $metadata;
29 my $self = $class->SUPER::new($args);
34 my ( $self, $args ) = @_;
35 return "Koha::Plugin::Test::report";
39 my ( $self, $args ) = @_;
40 return "Koha::Plugin::Test::tool";
44 my ( $self, $args ) = @_;
45 return "Koha::Plugin::Test::to_marc";
48 sub intranet_catalog_biblio_enhancements_toolbar_button {
49 my ( $self, $args ) = @_;
50 return "Koha::Plugin::Test::intranet_catalog_biblio_enhancements_toolbar_button";
53 sub intranet_catalog_biblio_enhancements {
54 my ( $self, $args ) = @_;
55 return "Koha::Plugin::Test::intranet_catalog_biblio_enhancements";
58 sub opac_online_payment {
59 my ( $self, $args ) = @_;
60 return "Koha::Plugin::Test::opac_online_payment";
63 sub opac_online_payment_begin {
64 my ( $self, $args ) = @_;
65 return "Koha::Plugin::Test::opac_online_payment_begin";
68 sub opac_online_payment_end {
69 my ( $self, $args ) = @_;
70 return "Koha::Plugin::Test::opac_online_payment_end";
74 my ( $self, $args ) = @_;
75 return "Koha::Plugin::Test::opac_head";
79 my ( $self, $args ) = @_;
80 return "Koha::Plugin::Test::opac_js";
84 my ( $self, $args ) = @_;
85 return "Koha::Plugin::Test::intranet_head";
89 my ( $self, $args ) = @_;
90 return "Koha::Plugin::Test::intranet_js";
94 my ( $self, $args ) = @_;
95 return "Koha::Plugin::Test::configure";;
99 my ( $self, $args ) = @_;
100 return "Koha::Plugin::Test::install";
104 my ( $self, $args ) = @_;
105 return "Koha::Plugin::Test::upgrade";
109 my ( $self, $args ) = @_;
110 return "Koha::Plugin::Test::uninstall";
115 $self->output( '¡Hola output!', 'json' );
118 sub test_output_html {
120 $self->output_html( '¡Hola output_html!' );
128 my ( $self, $args ) = @_;
132 "/patrons/{patron_id}/bother": {
134 "x-mojo-to": "Koha::Plugin::Test#bother",
135 "operationId": "BotherPatron",
140 "description": "Internal patron identifier",
149 "description": "A bothered patron",
154 "description": "If the patron has been bothered",
161 "description": "An error occurred",
166 "description": "An explanation for the error",
173 "x-koha-authorization": {
183 return decode_json($spec);