From 15088957e4d4e97b6479050b92236c8346f7750d Mon Sep 17 00:00:00 2001 From: tipaul Date: Mon, 12 Jan 2004 16:55:48 +0000 Subject: [PATCH] synch'ing with rel_2_0 --- acqui.simple/additem.pl | 8 ++++---- export/marc.pl | 10 +++++----- maint/shiftbib.pl | 5 ++--- value_builder/unimarc_field_60X.pl | 7 +++---- z3950/z3950import.pl | 18 ++++++++++++------ 5 files changed, 26 insertions(+), 22 deletions(-) diff --git a/acqui.simple/additem.pl b/acqui.simple/additem.pl index 7cdbf4089f..3e0afab784 100755 --- a/acqui.simple/additem.pl +++ b/acqui.simple/additem.pl @@ -180,7 +180,7 @@ foreach my $subfield_code (sort keys(%witness)) { # next item form my @loop_data =(); my $i=0; -my $authorised_values_sth = $dbh->prepare("select authorised_value,lib from authorised_values where category=? order by authorised_value"); +my $authorised_values_sth = $dbh->prepare("select authorised_value,lib from authorised_values where category=? order by lib"); foreach my $tag (sort keys %{$tagslib}) { my $previous_tag = ''; @@ -203,7 +203,7 @@ foreach my $tag (sort keys %{$tagslib}) { # builds list, depending on authorised value... #---- branch if ($tagslib->{$tag}->{$subfield}->{'authorised_value'} eq "branches" ) { - my $sth=$dbh->prepare("select branchcode,branchname from branches"); + my $sth=$dbh->prepare("select branchcode,branchname from branches order by branchname"); $sth->execute; push @authorised_values, "" unless ($tagslib->{$tag}->{$subfield}->{mandatory}); while (my ($branchcode,$branchname) = $sth->fetchrow_array) { @@ -212,7 +212,7 @@ foreach my $tag (sort keys %{$tagslib}) { } #----- itemtypes } elsif ($tagslib->{$tag}->{$subfield}->{authorised_value} eq "itemtypes") { - my $sth=$dbh->prepare("select itemtype,description from itemtypes"); + my $sth=$dbh->prepare("select itemtype,description from itemtypes order by description"); $sth->execute; push @authorised_values, "" unless ($tagslib->{$tag}->{$subfield}->{mandatory}); while (my ($itemtype,$description) = $sth->fetchrow_array) { @@ -274,4 +274,4 @@ $template->param(item_loop => \@item_value_loop, foreach my $error (@errors) { $template->param($error => 1); } -output_html_with_http_headers $input, $cookie, $template->output; +output_html_with_http_headers $input, $cookie, $template->output; \ No newline at end of file diff --git a/export/marc.pl b/export/marc.pl index 556db7a6cb..0a2f5ce68d 100755 --- a/export/marc.pl +++ b/export/marc.pl @@ -15,14 +15,14 @@ if ($op eq "export") { my $start_bib = $query->param("start_bib"); my $end_bib = $query->param("end_bib"); my $dbh=C4::Context->dbh; - my $query; + my $sth; if ($start_bib && $end_bib) { - $query = "select bibid from marc_biblio where bibid >=$start_bib and bibid <=$end_bib order by bibid"; + $sth=$dbh->prepare("select bibid from marc_biblio where bibid >=? and bibid <=? order by bibid"); + $sth->execute($start_bib,$end_bib); } else { - $query = "select bibid from marc_biblio order by bibid"; + $sth=$dbh->prepare("select bibid from marc_biblio order by bibid"); + $sth->execute(); } - my $sth=$dbh->prepare($query); - $sth->execute; while (my ($bibid) = $sth->fetchrow) { my $record = MARCgetbiblio($dbh,$bibid); diff --git a/maint/shiftbib.pl b/maint/shiftbib.pl index 8035167877..ae3bfe8886 100755 --- a/maint/shiftbib.pl +++ b/maint/shiftbib.pl @@ -40,9 +40,8 @@ print startmenu('catalog'); if ($type eq 'change'){ my $biblionumber=$input->param('biblionumber'); my $dbh = C4::Context->dbh; - my $query="Select * from biblio where biblionumber=$biblionumber"; - my $sth=$dbh->prepare($query); - $sth->execute; + my $sth=$dbh->prepare("Select * from biblio where biblionumber=?"); + $sth->execute($biblionumber); my $data=$sth->fetchrow_hashref; print "Shifting group $bi to biblio $biblionumber
Title:$data->{'title'}
diff --git a/value_builder/unimarc_field_60X.pl b/value_builder/unimarc_field_60X.pl index 29f6b136eb..26211395e0 100644 --- a/value_builder/unimarc_field_60X.pl +++ b/value_builder/unimarc_field_60X.pl @@ -77,13 +77,12 @@ sub plugin { my $authoritysep = C4::Context->preference('authoritysep'); my @splitted = /$authoritysep/,$search_string; my $level = $#splitted+1; - my $query; + my $sti; if ($search_string) { # if no search pattern, returns only the 50 1st top level values - $query = "select distinct freelib,father,level from bibliothesaurus where category='NC' and freelib like ? order by father,freelib"; + $sti=$dbh->prepare("select distinct freelib,father,level from bibliothesaurus where category='NC' and freelib like ? order by father,freelib"); } else { - $query = "select distinct freelib,father,level from bibliothesaurus where category='NC' and level=0 and freelib like ? order by father,freelib limit 0,50"; + $sti=$dbh->prepare("select distinct freelib,father,level from bibliothesaurus where category='NC' and level=0 and freelib like ? order by father,freelib limit 0,50"); } - my $sti=$dbh->prepare($query); $sti->execute($Rsearch_string); my @results; while (my ($freelib,$father,$level)=$sti->fetchrow) { diff --git a/z3950/z3950import.pl b/z3950/z3950import.pl index 1db1573fd2..053a478b98 100644 --- a/z3950/z3950import.pl +++ b/z3950/z3950import.pl @@ -162,12 +162,12 @@ sub ProcessRecord { if ($file=~/Z-(\d+)/) { my $id=$1; my $resultsid=$input->param('resultsid'); - my $sth=$dbh->prepare("select results from z3950results where id=$resultsid"); - $sth->execute; + my $sth=$dbh->prepare("select results from z3950results where id=?"); + $sth->execute($resultsid); ($data) = $sth->fetchrow; } else { - my $sth=$dbh->prepare("select marc from uploadedmarc where id=$file"); - $sth->execute; + my $sth=$dbh->prepare("select marc from uploadedmarc where id=?"); + $sth->execute($file); ($data) = $sth->fetchrow; } @@ -253,8 +253,8 @@ sub ListFileRecords { # if z3950 results if (not $file=~/Z-(\d+)/) { # This is a Marc upload - $sth=$dbh->prepare("select marc,name from uploadedmarc where id=$file"); - $sth->execute; + $sth=$dbh->prepare("select marc,name from uploadedmarc where id=?"); + $sth->execute($file); ($data, $name) = $sth->fetchrow; $template->param(IS_MARC => 1); $template->param(recordsource => $name); @@ -997,6 +997,12 @@ sub FormatMarcText { #--------------- # $Log$ +# Revision 1.5 2004/01/12 16:56:29 tipaul +# synch'ing with rel_2_0 +# +# Revision 1.4.2.1 2004/01/08 16:31:54 slef +# DBI call fix for bug 662. No syntax check: missing module? +# # Revision 1.4 2003/07/15 00:02:49 slef # Work on bug 515... can we do a single-side rename of notes to bnotes? # -- 2.39.5