Skip to content

Commit

Permalink
synch'ing 2.0.0 branch and head
Browse files Browse the repository at this point in the history
  • Loading branch information
tipaul committed Feb 11, 2004
1 parent 6f472db commit 3635a59
Show file tree
Hide file tree
Showing 35 changed files with 352 additions and 746 deletions.
36 changes: 24 additions & 12 deletions C4/Biblio.pm
Expand Up @@ -566,7 +566,6 @@ sub MARCmoditem {
if ($oldrecord eq $record) {
return;
}

# otherwise, skip through each subfield...
my @fields = $record->fields();
# search old MARC item
Expand Down Expand Up @@ -694,7 +693,7 @@ sub MARCdelsubfield {
my ($dbh,$bibid,$tag,$tagorder,$subfield,$subfieldorder) = @_;
$dbh->do("delete from marc_subfield_table where bibid='$bibid' and
tag='$tag' and tagorder='$tagorder'
and subfieldcode='$subfield' and subfieldorder='$subfieldorder
and subfieldcode='$subfield' and subfieldorder='$subfieldorder'
");
}

Expand Down Expand Up @@ -1434,14 +1433,14 @@ sub OLDnewitems {
homebranch = ?, holdingbranch = ?,
price = ?, replacementprice = ?,
replacementpricedate = NOW(), itemnotes = ?,
notforloan = ?
bulk =?, notforloan = ?
");
$sth->execute($itemnumber, $item->{'biblionumber'},
$item->{'biblioitemnumber'},$barcode,
$item->{'booksellerid'},$item->{'dateaccessioned'},
$item->{'homebranch'},$item->{'holdingbranch'},
$item->{'price'},$item->{'replacementprice'},
$item->{'itemnotes'},$item->{'notforloan'});
$item->{'itemnotes'},$item->{'bulk'},$item->{'notforloan'});
} else {
$sth=$dbh->prepare("Insert into items set
itemnumber = ?, biblionumber = ?,
Expand All @@ -1450,14 +1449,14 @@ sub OLDnewitems {
homebranch = ?, holdingbranch = ?,
price = ?, replacementprice = ?,
replacementpricedate = NOW(), itemnotes = ?,
notforloan = ?
bulk = ? , notforloan = ?
");
$sth->execute($itemnumber, $item->{'biblionumber'},
$item->{'biblioitemnumber'},$barcode,
$item->{'booksellerid'},
$item->{'homebranch'},$item->{'holdingbranch'},
$item->{'price'},$item->{'replacementprice'},
$item->{'itemnotes'},$item->{'notforloan'});
$item->{'itemnotes'},$item->{'bulk'},$item->{'notforloan'});
}
if (defined $sth->errstr) {
$error .= $sth->errstr;
Expand All @@ -1471,8 +1470,8 @@ sub OLDmoditem {
# my ($dbh,$loan,$itemnum,$bibitemnum,$barcode,$notes,$homebranch,$lost,$wthdrawn,$replacement)=@_;
# my $dbh=C4Connect;
$item->{'itemnum'}=$item->{'itemnumber'} unless $item->{'itemnum'};
my $query="update items set barcode=?,itemnotes=? where itemnumber=?";
my @bind = ($item->{'barcode'},$item->{'notes'},$item->{'itemnum'});
my $query="update items set barcode=?,itemnotes=?,bulk=?,notforloan=? where itemnumber=?";
my @bind = ($item->{'barcode'},$item->{'notes'},$item->{'bulk'},$item->{'notforloan'},$item->{'itemnum'});
if ($item->{'barcode'} eq ''){
$item->{'notforloan'}=0 unless $item->{'notforloan'};
$query="update items set notforloan=? where itemnumber=?";
Expand All @@ -1484,9 +1483,11 @@ $item->{'itemnum'}=$item->{'itemnumber'} unless $item->{'itemnum'};
itemnotes=?,
homebranch=?,
itemlost=?,
wthdrawn=?
wthdrawn=?,
bulk=?,
notforloan=?,
where itemnumber=?";
@bind = ($item->{'bibitemnum'},$item->{'barcode'},$item->{'notes'},$item->{'homebranch'},$item->{'lost'},$item->{'wthdrawn'},$item->{'itemnum'});
@bind = ($item->{'bibitemnum'},$item->{'barcode'},$item->{'notes'},$item->{'homebranch'},$item->{'lost'},$item->{'wthdrawn'},$item->{'bulk'},$item->{'notforloan'},$item->{'itemnum'});
}
if ($item->{'replacement'} ne ''){
$query=~ s/ where/,replacementprice='$item->{'replacement'}' where/;
Expand Down Expand Up @@ -1556,7 +1557,6 @@ where biblioitemnumber = ?");
push(@bind,$data->{$temp});
}
$query =~ s/\,$//;
warn "Q 1560 : $query";
my $sth2=$dbh->prepare($query);
$sth2->execute(@bind);
} # while
Expand All @@ -1581,7 +1581,6 @@ sub OLDdelbiblio{
}
#replacing the last , by ",?)"
$query=~ s/\,$//;
warn "Q olddelbiblio : $query";
$sth=$dbh->prepare($query);
$sth->execute(@bind);
$sth->finish;
Expand Down Expand Up @@ -2192,6 +2191,19 @@ Paul POULAIN paul.poulain@free.fr

# $Id$
# $Log$
# Revision 1.79 2004/02/11 08:40:09 tipaul
# synch'ing 2.0.0 branch and head
#
# Revision 1.78.2.3 2004/02/10 13:15:46 tipaul
# removing 2 warnings
#
# Revision 1.78.2.2 2004/01/26 10:38:06 tipaul
# dealing correctly "bulk" field
#
# Revision 1.78.2.1 2004/01/13 17:29:53 tipaul
# * minor html fixes
# * adding publisher in acquisition process (& ordering basket by publisher)
#
# Revision 1.78 2003/12/09 15:57:28 tipaul
# rolling back to working char_decode sub
#
Expand Down
28 changes: 15 additions & 13 deletions C4/BookShelves.pm
Expand Up @@ -144,21 +144,17 @@ C<$env> is ignored.
=cut
#'
sub AddToShelf {
my ($env, $itemnumber, $shelfnumber) = @_;
my $sth=$dbh->prepare("select * from shelfcontents
where shelfnumber=? and itemnumber=?");

$sth->execute($shelfnumber, $itemnumber);
if ($sth->rows) {
# already on shelf
} else {
$sth=$dbh->prepare("insert into shelfcontents
(shelfnumber, itemnumber, flags) values (?, ?, 0)");
my ($env, $itemnumber, $shelfnumber) = @_;
return unless $itemnumber;
my $sth=$dbh->prepare("select * from shelfcontents where shelfnumber=? and itemnumber=?");

# FIXME - The default for 'flags' is NULL.
# Why set it to 0?
$sth->execute($shelfnumber, $itemnumber);
}
if ($sth->rows) {
# already on shelf
} else {
$sth=$dbh->prepare("insert into shelfcontents (shelfnumber, itemnumber, flags) values (?, ?, 0)");
$sth->execute($shelfnumber, $itemnumber);
}
}

=item RemoveFromShelf
Expand Down Expand Up @@ -243,6 +239,12 @@ END { } # module clean-up code here (global destructor)

#
# $Log$
# Revision 1.12 2004/02/11 08:40:09 tipaul
# synch'ing 2.0.0 branch and head
#
# Revision 1.11.2.1 2004/02/06 14:16:55 tipaul
# fixing bugs in bookshelves management.
#
# Revision 1.11 2003/12/15 10:57:08 slef
# DBI call fix for bug 662
#
Expand Down
7 changes: 6 additions & 1 deletion C4/Catalogue.pm
Expand Up @@ -111,7 +111,12 @@ sub basket {
} else {
$sth->execute($basketno);
}
my @results = ();
$query.=" order by biblioitems.publishercode";
my $sth=$dbh->prepare($query);
$sth->execute;
my @results;
# print $query;
my $i=0;
while (my $data=$sth->fetchrow_hashref){
push(@results,$data);
}
Expand Down
6 changes: 3 additions & 3 deletions C4/Circulation/Circ2.pm
Expand Up @@ -634,7 +634,7 @@ sub issuebook {
renewbook($env,$dbh, $patroninformation->{'borrowernumber'}, $iteminformation->{'itemnumber'});
$noissue=1;
} else {
$rejected=-1;
$rejected="Item on issue to this borrower, and you have chosen not to renew";
last SWITCH;
}
}
Expand Down Expand Up @@ -668,14 +668,14 @@ sub issuebook {
my ($resborrower, $flags)=getpatroninformation($env, $resbor,0);
my $branches = getbranches();
my $branchname = $branches->{$res->{'branchcode'}}->{'branchname'};
if ($responses->{2} eq '') {
if ($responses->{2} eq '' && $responses->{3} eq '') {
$questionnumber=2;
# FIXME - Assumes HTML
$question="<font color=red>Waiting</font> for $resborrower->{'firstname'} $resborrower->{'surname'} ($resborrower->{'cardnumber'}) at $branchname \nAllow issue?";
$defaultanswer='N';
last SWITCH;
} elsif ($responses->{2} eq 'N') {
$rejected=-1;
$rejected="Issue cancelled";
last SWITCH;
} else {
if ($responses->{3} eq '') {
Expand Down
3 changes: 0 additions & 3 deletions C4/Members.pm
Expand Up @@ -66,9 +66,6 @@ sub fixup_cardnumber ($) {
my($cardnumber) = @_;
my $autonumber_members = C4::Context->boolean_preference('autoMemberNum');
$autonumber_members = 0 unless defined $autonumber_members;

warn "autoMemberNum is $autonumber_members\n";

# Find out whether member numbers should be generated
# automatically. Should be either "1" or something else.
# Defaults to "0", which is interpreted as "no".
Expand Down
2 changes: 1 addition & 1 deletion C4/Output.pm
Expand Up @@ -75,7 +75,7 @@ printable string.

#FIXME: this is a quick fix to stop rc1 installing broken
#Still trying to figure out the correct fix.
my $path = C4::Context->config('intrahtdocs')."/intranet-tmpl/default/en/includes/";
my $path = C4::Context->config('intrahtdocs')."/default/en/includes/";

#---------------------------------------------------------------------------------------------------------
# FIXME - POD
Expand Down
11 changes: 5 additions & 6 deletions C4/Search.pm
Expand Up @@ -1145,7 +1145,7 @@ sub CatSearch {
}
} else {
if ($type eq 'subject'){
$query .= "group by subject order by subject ";
$query .= "order by subject group by subject ";
}
}
my $sth=$dbh->prepare($query);
Expand Down Expand Up @@ -1349,11 +1349,10 @@ sub ItemInfo {
$data->{'branchname'} = $bdata->{'branchname'};
}

my $class = $data->{'classification'};
my $class = $data->{'classification'};# FIXME : $class is useless
my $dewey = $data->{'dewey'};
$dewey =~ s/0+$//;
if ($dewey eq "000.") { $dewey = "";}; # FIXME - "000" is general
# books about computer science
if ($dewey eq "000.") { $dewey = "";}; # FIXME - "000" is general books about computer science
if ($dewey < 10){$dewey='00'.$dewey;}
if ($dewey < 100 && $dewey > 10){$dewey='0'.$dewey;}
if ($dewey <= 0){
Expand All @@ -1377,7 +1376,7 @@ sub ItemInfo {
}
$sth->finish;
#FIXME: ordering/indentation here looks wrong
my $sth2=$dbh->prepare("Select * from aqorders where biblionumber=>");
my $sth2=$dbh->prepare("Select * from aqorders where biblionumber=?");
$sth2->execute($biblionumber);
my $data;
my $ocount;
Expand Down Expand Up @@ -1948,7 +1947,7 @@ sub allissues {
$query.=" limit $limit";
}
#print $query;
my $sth=$dbh->prepare("");
my $sth=$dbh->prepare($query);
$sth->execute($bornum);
my @result;
my $i=0;
Expand Down
15 changes: 8 additions & 7 deletions acqui.simple/addbiblio.pl
Expand Up @@ -160,6 +160,7 @@ ($$$$$)
=cut
sub create_input () {
my ($tag,$subfield,$value,$i,$tabloop,$rec,$authorised_values_sth) = @_;
$value =~ s/"/&quot;/g;
my $dbh = C4::Context->dbh;
my %subfield_data;
$subfield_data{tag}=$tag;
Expand Down Expand Up @@ -196,7 +197,7 @@ ($$$$)
my $i=0;
my $authorised_values_sth = $dbh->prepare("select authorised_value,lib
from authorised_values
where category=? order by authorised_value");
where category=? order by lib");

# loop through each tab 0 through 9
for (my $tabloop = 0; $tabloop <= 9; $tabloop++) {
Expand All @@ -212,8 +213,8 @@ ($$$$)
if ($tag<10) {
my $value=$field->data();
my $subfield="@";
push(@subfields_data, &create_input($tag,$subfield,char_decode($value,$encoding),$i,$tabloop,$record,$authorised_values_sth))
unless ($tagslib->{$tag}->{$subfield}->{tab} ne $tabloop);
next if ($tagslib->{$tag}->{$subfield}->{tab} ne $tabloop);
push(@subfields_data, &create_input($tag,$subfield,char_decode($value,$encoding),$i,$tabloop,$record,$authorised_values_sth));
$i++;
} else {
my @subfields=$field->subfields();
Expand All @@ -230,16 +231,16 @@ ($$$$)
foreach my $subfield (sort( keys %{$tagslib->{$tag}})) {
next if subfield_is_koha_internal_p($subfield);
next if ($tagslib->{$tag}->{$subfield}->{tab} ne $tabloop);
next if ($tag > 10 && defined($record->field($tag)->subfield($subfield)));
next if ($tag < 10 && defined($record->field($tag)->data()));
next if ($tag<10);
next if (defined($record->field($tag)->subfield($subfield)));
push(@subfields_data, &create_input($tag,$subfield,'',$i,$tabloop,$record,$authorised_values_sth));
$i++;
}
if ($#subfields_data >= 0) {
my %tag_data;
$tag_data{tag} = $tag;
$tag_data{tag_lib} = $tagslib->{$tag}->{lib};
$tag_data{indicator} = $indicator;
$tag_data{indicator} = $record->field($tag)->indicator(1). $record->field($tag)->indicator(2) if ($tag>=10);
$tag_data{subfield_loop} = \@subfields_data;
push (@loop_data, \%tag_data);
}
Expand Down Expand Up @@ -324,7 +325,7 @@ ()
query => $input,
type => "intranet",
authnotrequired => 0,
flagsrequired => {catalogue => 1},
flagsrequired => {editcatalogue => 1},
debug => 1,
});

Expand Down
2 changes: 1 addition & 1 deletion acqui.simple/additem.pl
Expand Up @@ -274,4 +274,4 @@ sub find_value {
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;
25 changes: 17 additions & 8 deletions acqui/addorder.pl
Expand Up @@ -48,7 +48,7 @@
my $existing=$input->param('existing');
my $title=$input->param('title');
my $author=$input->param('author');
my $copyright=$input->param('copyright');
my $copyrightdate=$input->param('copyrightdate');
my $isbn=$input->param('ISBN');
my $itemtype=$input->param('format');
my $ordnum=$input->param('ordnum');
Expand All @@ -71,21 +71,22 @@
my $orderexists=$input->param('orderexists');
my $budget=$input->param('budget');
my $cost=$input->param('cost');
my$sub=$input->param('sub');
my $sub=$input->param('sub');
my $invoice=$input->param('invoice');

my $publishercode = $input->param('publishercode');
if ($quantity ne '0'){
#check to see if biblio exists
if ($existing eq 'no'){
#if it doesnt create it
$bibnum = &newbiblio({ title => $title?$title:"",
author => $author?$author:"",
copyright => $copyright?$copyright:"",
copyrightdate => $copyrightdate?$copyrightdate:"",
series => $series?$series:"",
});
$bibitemnum = &newbiblioitem({ biblionumber => $bibnum,
itemtype => $itemtype?$itemtype:"",
isbn => $isbn?$isbn:""
isbn => $isbn?$isbn:"",
publishercode => $publishercode?$publishercode:"",
});
if ($title) {
newsubtitle($bibnum,$title);
Expand All @@ -97,14 +98,22 @@
if ($bibitemnum eq '' || $itemtype ne $oldtype){
$bibitemnum= &newbiblioitem({ biblionumber => $bibnum,
itemtype => $itemtype?$itemtype:"",
isbn => $isbn?$isbn:"" });
isbn => $isbn?$isbn:"" ,
publishercode => $publishercode?$publishercode:"",
});
} else {
&modbibitem({biblioitemnumber => $bibitemnum,
isbn => $isbn,
publishercode => $publishercode,
});
}
&modbiblio({
biblionumber => $bibnum,
title => $title?$title:"",
author => $author?$author:"",
copyrightdate => $copyright?$copyright:"",
series => $series?$series:"" });
copyrightdate => $copyrightdate?$copyrightdate:"",
series => $series?$series:"" },
);
}
if ($orderexists ne '') {
modorder($title,$ordnum,$quantity,$listprice,$bibnum,$basketno,$supplier,$who,$notes,$bookfund,$bibitemnum,$rrp,$ecost,$gst,$budget,$cost,$sub,$invoice);
Expand Down
1 change: 1 addition & 0 deletions acqui/basket.pl
Expand Up @@ -77,6 +77,7 @@
$toggle=0;
}
$line{ordernumber} = $results[$i]->{'ordernumber'};
$line{publishercode} = $results[$i]->{'publishercode'};
$line{isbn} = $results[$i]->{'isbn'};
$line{booksellerid} = $results[$i]->{'booksellerid'};
$line{basket}=$basket;
Expand Down
3 changes: 2 additions & 1 deletion acqui/newbiblio.pl
Expand Up @@ -169,7 +169,8 @@
rrp => $data->{'rrp'},
ecost => $data->{'ecost'},
notes => $data->{'notes'},
barcode => $data->{'barcode'},);
barcode => $data->{'barcode'},
publishercode => $data->{'publishercode'});

output_html_with_http_headers $input, $cookie, $template->output;

0 comments on commit 3635a59

Please sign in to comment.