View | Details | Raw Unified | Return to bug 7804
Collapse All | Expand All

(-)a/Koha/Plugins/Base.pm (-5 / +2 lines)
Lines 60-68 sub new { Link Here
60
60
61
=head2 store_data
61
=head2 store_data
62
62
63
set_data allows a plugin to store key value pairs in the database for future use.
63
store_data allows a plugin to store key value pairs in the database for future use.
64
64
65
usage: $self->set_data({ param1 => 'param1val', param2 => 'param2value' })
65
usage: $self->store_data({ param1 => 'param1val', param2 => 'param2value' })
66
66
67
=cut
67
=cut
68
68
Lines 108-116 C4:Template, but at the moment, it does not. Link Here
108
sub get_template {
108
sub get_template {
109
    my ( $self, $args ) = @_;
109
    my ( $self, $args ) = @_;
110
110
111
    #    my $template =
112
    #      C4::Templates->new( my $interface = 'intranet', my $filename = $self->mbf_path( $args->{'file'} ), my $tmplbase = '', my $query = $self->{'cgi'} );
113
114
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
111
    my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
115
        {   template_name   => $self->mbf_path( $args->{'file'} ),
112
        {   template_name   => $self->mbf_path( $args->{'file'} ),
116
            query           => $self->{'cgi'},
113
            query           => $self->{'cgi'},
(-)a/t/db_dependent/Plugins.t (-4 / +19 lines)
Lines 3-11 Link Here
3
use strict;
3
use strict;
4
use warnings;
4
use warnings;
5
5
6
use Test::More tests => 16;
6
use Test::More tests => 20;
7
use File::Basename;
7
use File::Basename;
8
8
use FindBin qw($Bin);
9
use Archive::Extract;
9
use Module::Load::Conditional qw(can_load);
10
use Module::Load::Conditional qw(can_load);
10
11
11
use C4::Context;
12
use C4::Context;
Lines 38-41 my $metadata = $plugin->get_metadata(); Link Here
38
ok( $metadata->{'name'} eq 'Test Plugin', 'Test $plugin->get_metadata()' );
39
ok( $metadata->{'name'} eq 'Test Plugin', 'Test $plugin->get_metadata()' );
39
40
40
ok( $plugin->get_qualified_table_name('mytable') eq 'koha_plugin_test_mytable', 'Test $plugin->get_qualified_table_name()' );
41
ok( $plugin->get_qualified_table_name('mytable') eq 'koha_plugin_test_mytable', 'Test $plugin->get_qualified_table_name()' );
41
ok( $plugin->get_plugin_http_path() eq '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' );
42
ok( $plugin->get_plugin_http_path() eq '/plugin/Koha/Plugin/Test', 'Test $plugin->get_plugin_http_path()' );
43
44
my @plugins = Koha::Plugins->new()->GetPlugins( 'report' );
45
ok( $plugins[0]->get_metadata()->{'name'} eq 'Test Plugin', "Koha::Plugins::GetPlugins functions correctly" );
46
47
my $plugins_dir = C4::Context->config("pluginsdir");
48
my $ae = Archive::Extract->new( archive => "$Bin/KitchenSinkPlugin.kpz", type => 'zip' );
49
unless ( $ae->extract( to => $plugins_dir ) ) {
50
    warn "ERROR: " . $ae->error;
51
}
52
use_ok('Koha::Plugin::Com::ByWaterSolutions::KitchenSink');
53
$plugin = Koha::Plugin::Com::ByWaterSolutions::KitchenSink->new({ enable_plugins => 1});
54
55
ok( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm", "KitchenSink plugin installed successfully" );
56
Koha::Plugins::Handler->delete({ class => "Koha::Plugin::Com::ByWaterSolutions::KitchenSink" });
57
ok( !( -f $plugins_dir . "/Koha/Plugin/Com/ByWaterSolutions/KitchenSink.pm" ), "Koha::Plugins::Handler::delete works correctly." );
42
- 

Return to bug 7804