Skip to content
Browse files

Merge pull request #94 from hgq/11_02_pt16152385_4_08

11 02 pt16152385 4 08
  • Loading branch information...
2 parents 362af9c + bc81c1d commit 5e910d7f55c86bb050326f76f25ee3d947de415b @ctfliblime ctfliblime committed Jul 25, 2011
Showing with 26 additions and 23 deletions.
  1. +8 −6 admin/biblio_framework.pl
  2. +18 −17 admin/marctagstructure.pl
View
14 admin/biblio_framework.pl
@@ -29,12 +29,6 @@
use C4::Auth;
use C4::Output;
-sub StringSearch {
- my $dbh = C4::Context->dbh;
- my $sth=$dbh->prepare("Select * from biblio_framework where (frameworkcode like ?) order by frameworktext");
- $sth->execute((shift || '') . '%');
- return $sth->fetchall_arrayref({});
-}
my $input = new CGI;
my $script_name = "/cgi-bin/koha/admin/biblio_framework.pl";
@@ -140,4 +134,12 @@ sub StringSearch {
} #---- END $OP eq DEFAULT
output_html_with_http_headers $input, $cookie, $template->output;
+exit;
+
+sub StringSearch {
+ my $dbh = C4::Context->dbh;
+ my $sth=$dbh->prepare("Select * from biblio_framework where (frameworkcode like ?) order by frameworktext");
+ $sth->execute((shift || '') . '%');
+ return $sth->fetchall_arrayref({});
+}
View
35 admin/marctagstructure.pl
@@ -30,25 +30,25 @@
# retrieve parameters
-my $input = new CGI;
-my $frameworkcode = $input->param('frameworkcode') || ''; # set to select framework
-my $existingframeworkcode = $input->param('existingframeworkcode') || '';
-my $searchfield = $input->param('searchfield') || 0;
+our $input = CGI->new();
+our $frameworkcode = $input->param('frameworkcode') || ''; # set to select framework
+our $existingframeworkcode = $input->param('existingframeworkcode') || '';
+our $searchfield = $input->param('searchfield') || 0;
# set when we have to create a new framework (in frameworkcode) by copying an old one (in existingframeworkcode)
-my $frameworkinfo = getframeworkinfo($frameworkcode);
+our $frameworkinfo = getframeworkinfo($frameworkcode);
$searchfield=~ s/\,//g;
-my $offset = $input->param('offset') || 0;
-my $op = $input->param('op') || '';
-my $dspchoice = $input->param('select_display');
-my $pagesize = 20;
+our $offset = $input->param('offset') || 0;
+our $op = $input->param('op') || '';
+our $dspchoice = $input->param('select_display');
+our $pagesize = 20;
-my $script_name = "/cgi-bin/koha/admin/marctagstructure.pl";
+our $script_name = "/cgi-bin/koha/admin/marctagstructure.pl";
-my $dbh = C4::Context->dbh;
+our $dbh = C4::Context->dbh;
# open template
-my ($template, $loggedinuser, $cookie)
+our ($template, $loggedinuser, $cookie)
= get_template_and_user({template_name => "admin/marctagstructure.tmpl",
query => $input,
type => "intranet",
@@ -58,8 +58,8 @@
});
# get framework list
-my $frameworks = getframeworks();
-my @frameworkloop;
+our $frameworks = getframeworks();
+our @frameworkloop;
foreach my $thisframeworkcode (keys %$frameworks) {
push @frameworkloop, {
value => $thisframeworkcode,
@@ -69,9 +69,9 @@
}
# check that framework is defined in marc_tag_structure
-my $sth=$dbh->prepare("select count(*) from marc_tag_structure where frameworkcode=?");
+our $sth=$dbh->prepare("select count(*) from marc_tag_structure where frameworkcode=?");
$sth->execute($frameworkcode);
-my ($frameworkexist) = $sth->fetchrow;
+our ($frameworkexist) = $sth->fetchrow;
unless ($frameworkexist) {
# if frameworkcode does not exists, then OP must be changed to "create framework" if we are not on the way to create it
# (op = itemtyp_create_confirm)
@@ -177,7 +177,7 @@
);
}
}
- print $input->redirect("/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode");
+ print $input->redirect("marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode");
exit;
# END $OP eq ADD_VALIDATE
################## DELETE_CONFIRM ##################################
@@ -327,6 +327,7 @@
} #---- END $OP eq DEFAULT
output_html_with_http_headers $input, $cookie, $template->output;
+exit;
#
# the sub used for searches

0 comments on commit 5e910d7

Please sign in to comment.
Something went wrong with that request. Please try again.