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

(-)a/C4/Context.pm (-19 / +1 lines)
Lines 211-217 returns the kohaversion stored in kohaversion.pl file Link Here
211
=cut
211
=cut
212
212
213
sub KOHAVERSION {
213
sub KOHAVERSION {
214
    my $cgidir = C4::Context->intranetdir;
214
    my $cgidir = C4::Context->config('intranetdir');
215
215
216
    # Apparently the GIT code does not run out of a CGI-BIN subdirectory
216
    # Apparently the GIT code does not run out of a CGI-BIN subdirectory
217
    # but distribution code does?  (Stan, 1jan08)
217
    # but distribution code does?  (Stan, 1jan08)
Lines 651-674 sub set_preference { Link Here
651
    $sth->finish;
651
    $sth->finish;
652
}
652
}
653
653
654
# AUTOLOAD
655
# This implements C4::Config->foo, and simply returns
656
# C4::Context->config("foo"), as described in the documentation for
657
# &config, above.
658
659
# FIXME - Perhaps this should be extended to check &config first, and
660
# then &preference if that fails. OTOH, AUTOLOAD could lead to crappy
661
# code, so it'd probably be best to delete it altogether so as not to
662
# encourage people to use it.
663
sub AUTOLOAD
664
{
665
    my $self = shift;
666
667
    $AUTOLOAD =~ s/.*:://;        # Chop off the package name,
668
                    # leaving only the function name.
669
    return $self->config($AUTOLOAD);
670
}
671
672
=head2 Zconn
654
=head2 Zconn
673
655
674
  $Zconn = C4::Context->Zconn
656
  $Zconn = C4::Context->Zconn
(-)a/C4/Items.pm (-1 / +1 lines)
Lines 3032-3038 sub PrepareItemrecordDisplay { Link Here
3032
                    };
3032
                    };
3033
                } elsif ( $tagslib->{$tag}->{$subfield}->{value_builder} ) {
3033
                } elsif ( $tagslib->{$tag}->{$subfield}->{value_builder} ) {
3034
                        # opening plugin
3034
                        # opening plugin
3035
                        my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
3035
                        my $plugin = C4::Context->config('intranetdir') . "/cataloguing/value_builder/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
3036
                        if (do $plugin) {
3036
                        if (do $plugin) {
3037
                            my $extended_param = plugin_parameters( $dbh, undef, $tagslib, $subfield_data{id}, undef );
3037
                            my $extended_param = plugin_parameters( $dbh, undef, $tagslib, $subfield_data{id}, undef );
3038
                            my ( $function_name, $javascript ) = plugin_javascript( $dbh, undef, $tagslib, $subfield_data{id}, undef );
3038
                            my ( $function_name, $javascript ) = plugin_javascript( $dbh, undef, $tagslib, $subfield_data{id}, undef );
(-)a/admin/auth_subfields_structure.pl (-2 / +2 lines)
Lines 108-116 if ($op eq 'add_form') { Link Here
108
	# 2 cases here : on CVS install, $cgidir does not need a /cgi-bin
108
	# 2 cases here : on CVS install, $cgidir does not need a /cgi-bin
109
	# on a standard install, /cgi-bin need to be added. 
109
	# on a standard install, /cgi-bin need to be added. 
110
	# test one, then the other
110
	# test one, then the other
111
	my $cgidir = C4::Context->intranetdir ."/cgi-bin";
111
	my $cgidir = C4::Context->config('intranetdir') ."/cgi-bin";
112
	unless (opendir(DIR, "$cgidir/cataloguing/value_builder")) {
112
	unless (opendir(DIR, "$cgidir/cataloguing/value_builder")) {
113
		$cgidir = C4::Context->intranetdir;
113
		$cgidir = C4::Context->config('intranetdir');
114
		opendir(DIR, "$cgidir/cataloguing/value_builder") || die "can't opendir $cgidir/value_builder: $!";
114
		opendir(DIR, "$cgidir/cataloguing/value_builder") || die "can't opendir $cgidir/value_builder: $!";
115
	} 
115
	} 
116
	while (my $line = readdir(DIR)) {
116
	while (my $line = readdir(DIR)) {
(-)a/admin/marc_subfields_structure.pl (-2 / +2 lines)
Lines 154-162 if ( $op eq 'add_form' ) { Link Here
154
    # 2 cases here : on CVS install, $cgidir does not need a /cgi-bin
154
    # 2 cases here : on CVS install, $cgidir does not need a /cgi-bin
155
    # on a standard install, /cgi-bin need to be added.
155
    # on a standard install, /cgi-bin need to be added.
156
    # test one, then the other
156
    # test one, then the other
157
    my $cgidir = C4::Context->intranetdir . "/cgi-bin";
157
    my $cgidir = C4::Context->config('intranetdir') . "/cgi-bin";
158
    unless ( opendir( DIR, "$cgidir/cataloguing/value_builder" ) ) {
158
    unless ( opendir( DIR, "$cgidir/cataloguing/value_builder" ) ) {
159
        $cgidir = C4::Context->intranetdir;
159
        $cgidir = C4::Context->config('intranetdir');
160
        opendir( DIR, "$cgidir/cataloguing/value_builder" )
160
        opendir( DIR, "$cgidir/cataloguing/value_builder" )
161
          || die "can't opendir $cgidir/value_builder: $!";
161
          || die "can't opendir $cgidir/value_builder: $!";
162
    }
162
    }
(-)a/authorities/authorities.pl (-2 / +2 lines)
Lines 218-226 sub create_input { Link Here
218
218
219
        # opening plugin. Just check whether we are on a developer computer on a production one
219
        # opening plugin. Just check whether we are on a developer computer on a production one
220
        # (the cgidir differs)
220
        # (the cgidir differs)
221
        my $cgidir = C4::Context->intranetdir . "/cgi-bin/cataloguing/value_builder";
221
        my $cgidir = C4::Context->config('intranetdir') . "/cgi-bin/cataloguing/value_builder";
222
        unless (-r $cgidir and -d $cgidir) {
222
        unless (-r $cgidir and -d $cgidir) {
223
            $cgidir = C4::Context->intranetdir . "/cataloguing/value_builder";
223
            $cgidir = C4::Context->config('intranetdir') . "/cataloguing/value_builder";
224
        }
224
        }
225
        my $plugin = $cgidir . "/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
225
        my $plugin = $cgidir . "/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
226
        do $plugin || die "Plugin Failed: ".$plugin;
226
        do $plugin || die "Plugin Failed: ".$plugin;
(-)a/cataloguing/addbiblio.pl (-2 / +2 lines)
Lines 396-404 sub create_input { Link Here
396
396
397
        # opening plugin. Just check whether we are on a developer computer on a production one
397
        # opening plugin. Just check whether we are on a developer computer on a production one
398
        # (the cgidir differs)
398
        # (the cgidir differs)
399
        my $cgidir = C4::Context->intranetdir . "/cgi-bin/cataloguing/value_builder";
399
        my $cgidir = C4::Context->config('intranetdir') . "/cgi-bin/cataloguing/value_builder";
400
        unless ( opendir( DIR, "$cgidir" ) ) {
400
        unless ( opendir( DIR, "$cgidir" ) ) {
401
            $cgidir = C4::Context->intranetdir . "/cataloguing/value_builder";
401
            $cgidir = C4::Context->config('intranetdir') . "/cataloguing/value_builder";
402
            closedir( DIR );
402
            closedir( DIR );
403
        }
403
        }
404
        my $plugin = $cgidir . "/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
404
        my $plugin = $cgidir . "/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
(-)a/cataloguing/additem.pl (-1 / +1 lines)
Lines 269-275 sub generate_subfield_form { Link Here
269
            # it's a plugin field
269
            # it's a plugin field
270
        elsif ( $subfieldlib->{value_builder} ) {
270
        elsif ( $subfieldlib->{value_builder} ) {
271
                # opening plugin
271
                # opening plugin
272
                my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $subfieldlib->{'value_builder'};
272
                my $plugin = C4::Context->config('intranetdir') . "/cataloguing/value_builder/" . $subfieldlib->{'value_builder'};
273
                if (do $plugin) {
273
                if (do $plugin) {
274
                    my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data );
274
                    my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data );
275
                    my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data );
275
                    my ( $function_name, $javascript ) = plugin_javascript( $dbh, $temp, $tagslib, $subfield_data{id}, $loop_data );
(-)a/cataloguing/plugin_launcher.pl (-2 / +2 lines)
Lines 29-38 my $plugin_name="cataloguing/value_builder/".$input->param("plugin_name"); Link Here
29
29
30
# opening plugin. Just check whether we are on a developer computer on a production one
30
# opening plugin. Just check whether we are on a developer computer on a production one
31
# (the cgidir differs)
31
# (the cgidir differs)
32
my $cgidir = C4::Context->intranetdir ."/cgi-bin";
32
my $cgidir = C4::Context->config('intranetdir') ."/cgi-bin";
33
my $vbdir = "$cgidir/cataloguing/value_builder";
33
my $vbdir = "$cgidir/cataloguing/value_builder";
34
unless (-r $vbdir and -d $vbdir) {
34
unless (-r $vbdir and -d $vbdir) {
35
	$cgidir = C4::Context->intranetdir;
35
	$cgidir = C4::Context->config('intranetdir');
36
}
36
}
37
do $cgidir."/".$plugin_name;
37
do $cgidir."/".$plugin_name;
38
&plugin($input);
38
&plugin($input);
(-)a/reports/manager.pl (-1 / +1 lines)
Lines 44-50 $template->param(do_it => $do_it, Link Here
44
		);
44
		);
45
my $cgidir = C4::Context->config('intranetdir')."/cgi-bin/reports/";
45
my $cgidir = C4::Context->config('intranetdir')."/cgi-bin/reports/";
46
unless (-r $cgidir and -d $cgidir) {
46
unless (-r $cgidir and -d $cgidir) {
47
	$cgidir = C4::Context->intranetdir."/reports/";
47
	$cgidir = C4::Context->config('intranetdir')."/reports/";
48
} 
48
} 
49
my $plugin = $cgidir.$report_name.".plugin";
49
my $plugin = $cgidir.$report_name.".plugin";
50
require $plugin;
50
require $plugin;
(-)a/tools/batchMod.pl (-2 / +1 lines)
Lines 415-421 foreach my $tag (sort keys %{$tagslib}) { Link Here
415
    }
415
    }
416
    elsif ( $tagslib->{$tag}->{$subfield}->{value_builder} ) {
416
    elsif ( $tagslib->{$tag}->{$subfield}->{value_builder} ) {
417
        # opening plugin
417
        # opening plugin
418
        my $plugin = C4::Context->intranetdir . "/cataloguing/value_builder/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
418
        my $plugin = C4::Context->config('intranetdir') . "/cataloguing/value_builder/" . $tagslib->{$tag}->{$subfield}->{'value_builder'};
419
        if (do $plugin) {
419
        if (do $plugin) {
420
			my $temp;
420
			my $temp;
421
            my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
421
            my $extended_param = plugin_parameters( $dbh, $temp, $tagslib, $subfield_data{id}, \@loop_data );
422
- 

Return to bug 9006