Managing absolute url instead of relative ones, for plugins (for mod_perl compliance).
Note that the absolute url differs between developper & production servers.
This commit is contained in:
parent
823e86e7c4
commit
ce3273c590
|
|
@ -179,7 +179,13 @@ sub create_input () {
|
|||
$subfield_data{marc_value}="<input type=\"text\" name=\"field_value\" value=\"$value\" size=\"47\" maxlength=\"255\" DISABLE READONLY> <a href=\"javascript:Dopop('../authorities/auth_finder.pl?category=".$tagslib->{$tag}->{$subfield}->{authtypecode}."&index=$i',$i)\">...</a>";
|
||||
# it's a plugin field
|
||||
} elsif ($tagslib->{$tag}->{$subfield}->{'value_builder'}) {
|
||||
my $plugin="../value_builder/".$tagslib->{$tag}->{$subfield}->{'value_builder'};
|
||||
# opening plugin. Just check wether we are on a developper computer on a production one
|
||||
# (the cgidir differs)
|
||||
my $cgidir = C4::Context->intranetdir ."/cgi-bin";
|
||||
unless (opendir(DIR, "$cgidir/value_builder")) {
|
||||
$cgidir = C4::Context->intranetdir."/value_builder";
|
||||
}
|
||||
my $plugin=$cgidir."/".$tagslib->{$tag}->{$subfield}->{'value_builder'};
|
||||
require $plugin;
|
||||
my $extended_param = plugin_parameters($dbh,$rec,$tagslib,$i,$tabloop);
|
||||
my ($function_name,$javascript) = plugin_javascript($dbh,$rec,$tagslib,$i,$tabloop);
|
||||
|
|
|
|||
|
|
@ -29,5 +29,12 @@ use C4::Output;
|
|||
my $input = new CGI;
|
||||
my $plugin_name=$input->param("plugin_name");
|
||||
my $plugin_name="value_builder/".$input->param("plugin_name");
|
||||
require $plugin_name;
|
||||
|
||||
# opening plugin. Just check wether we are on a developper computer on a production one
|
||||
# (the cgidir differs)
|
||||
my $cgidir = C4::Context->intranetdir ."/cgi-bin";
|
||||
unless (opendir(DIR, "$cgidir/value_builder")) {
|
||||
$cgidir = C4::Context->intranetdir;
|
||||
}
|
||||
require $cgidir."/".$plugin_name;
|
||||
&plugin($input);
|
||||
|
|
|
|||
|
|
@ -41,7 +41,11 @@ my ($template, $borrowernumber, $cookie)
|
|||
});
|
||||
$template->param(do_it => $do_it,
|
||||
report_name => $report_name);
|
||||
my $plugin = "./".$report_name.".plugin";
|
||||
my $cgidir = C4::Context->config('intranetdir')."/cgi-bin/reports/";
|
||||
unless (opendir(DIR, "$cgidir")) {
|
||||
$cgidir = C4::Context->intranetdir."/reports/";
|
||||
}
|
||||
my $plugin = $cgidir.$report_name.".plugin";
|
||||
require $plugin;
|
||||
if ($do_it) {
|
||||
my $results = calculate(\@values);
|
||||
|
|
|
|||
Loading…
Reference in New Issue