diff --git a/C4/Biblio.pm b/C4/Biblio.pm index b705088957..43a9edfabe 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -566,7 +566,6 @@ sub MARCmoditem { if ($oldrecord eq $record) { return; } - # otherwise, skip through each subfield... my @fields = $record->fields(); # search old MARC item @@ -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' "); } @@ -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 = ?, @@ -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; @@ -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=?"; @@ -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/; @@ -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 @@ -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; @@ -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 # diff --git a/C4/BookShelves.pm b/C4/BookShelves.pm index d545ee200b..55ff16677e 100755 --- a/C4/BookShelves.pm +++ b/C4/BookShelves.pm @@ -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=?"); + my ($env, $itemnumber, $shelfnumber) = @_; + return unless $itemnumber; + 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)"); - - # 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 @@ -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 # diff --git a/C4/Catalogue.pm b/C4/Catalogue.pm index 699e541928..7fbb1bb2fd 100644 --- a/C4/Catalogue.pm +++ b/C4/Catalogue.pm @@ -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); } diff --git a/C4/Circulation/Circ2.pm b/C4/Circulation/Circ2.pm index f7da836574..f2ffa29e6d 100755 --- a/C4/Circulation/Circ2.pm +++ b/C4/Circulation/Circ2.pm @@ -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; } } @@ -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="Waiting 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 '') { diff --git a/C4/Members.pm b/C4/Members.pm index 4fb1f23d5b..dbcb262741 100644 --- a/C4/Members.pm +++ b/C4/Members.pm @@ -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". diff --git a/C4/Output.pm b/C4/Output.pm index 2380af9586..4f308c7604 100644 --- a/C4/Output.pm +++ b/C4/Output.pm @@ -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 diff --git a/C4/Search.pm b/C4/Search.pm index b6244cc228..753ab91d50 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -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); @@ -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){ @@ -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; @@ -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; diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index ac17600ce9..a3960476eb 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -160,6 +160,7 @@ sub build_authorized_values_list ($$$$$) { =cut sub create_input () { my ($tag,$subfield,$value,$i,$tabloop,$rec,$authorised_values_sth) = @_; + $value =~ s/"/"/g; my $dbh = C4::Context->dbh; my %subfield_data; $subfield_data{tag}=$tag; @@ -196,7 +197,7 @@ sub build_tabs ($$$$) { 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++) { @@ -212,8 +213,8 @@ sub build_tabs ($$$$) { 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(); @@ -230,8 +231,8 @@ sub build_tabs ($$$$) { 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++; } @@ -239,7 +240,7 @@ sub build_tabs ($$$$) { 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); } @@ -324,7 +325,7 @@ my ($template, $loggedinuser, $cookie) query => $input, type => "intranet", authnotrequired => 0, - flagsrequired => {catalogue => 1}, + flagsrequired => {editcatalogue => 1}, debug => 1, }); diff --git a/acqui.simple/additem.pl b/acqui.simple/additem.pl index 3e0afab784..b19243ffda 100755 --- a/acqui.simple/additem.pl +++ b/acqui.simple/additem.pl @@ -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; \ No newline at end of file +output_html_with_http_headers $input, $cookie, $template->output; diff --git a/acqui/addorder.pl b/acqui/addorder.pl index 381bb59c13..6bf696b719 100755 --- a/acqui/addorder.pl +++ b/acqui/addorder.pl @@ -48,7 +48,7 @@ my ($template, $loggedinuser, $cookie) 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'); @@ -71,21 +71,22 @@ my $gst=$input->param('GST'); 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); @@ -97,14 +98,22 @@ if ($quantity ne '0'){ 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); diff --git a/acqui/basket.pl b/acqui/basket.pl index b3cfb8405e..e1f4824b4c 100755 --- a/acqui/basket.pl +++ b/acqui/basket.pl @@ -77,6 +77,7 @@ for (my $i=0;$i<$count;$i++){ $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; diff --git a/acqui/newbiblio.pl b/acqui/newbiblio.pl index 90fe406be7..85abcc8f80 100755 --- a/acqui/newbiblio.pl +++ b/acqui/newbiblio.pl @@ -169,7 +169,8 @@ $template->param( existing => $biblio, 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; diff --git a/acqui/order.pl b/acqui/order.pl index 33ce8e883c..e11db2a41c 100755 --- a/acqui/order.pl +++ b/acqui/order.pl @@ -63,6 +63,7 @@ for (my $i=0; $i<$count; $i++) { } $line{id} =$suppliers[$i]->{'id'}; $line{name} = $suppliers[$i]->{'name'}; + $line{active} = $suppliers[$i]->{'active'}; $line{total} = $orders->[0]->{'count(*)'}; $line{authorisedby} = $orders->[0]->{'authorisedby'}; $line{entrydate} = $orders->[0]->{'entrydate'}; diff --git a/admin/branches.pl b/admin/branches.pl index 42c3d66561..808f19a84a 100755 --- a/admin/branches.pl +++ b/admin/branches.pl @@ -78,7 +78,6 @@ if ($op) { else => 1); # we show only the TMPL_VAR names $op } $template->param(action => $script_name); - if ($op eq 'add') { # If the user has pressed the "add new branch" button. heading("Branches: Add Branch"); diff --git a/admin/itemtypes.pl b/admin/itemtypes.pl index bb7a7fb78f..619fbe2e20 100755 --- a/admin/itemtypes.pl +++ b/admin/itemtypes.pl @@ -96,7 +96,7 @@ if ($op eq 'add_form') { my $data; if ($itemtype) { my $dbh = C4::Context->dbh; - my $sth=$dbh->prepare("select itemtype,description,loanlength,renewalsallowed,rentalcharge from itemtypes where itemtype=?"); + my $sth=$dbh->prepare("select itemtype,description,loanlength,renewalsallowed,rentalcharge,notforloan from itemtypes where itemtype=?"); $sth->execute($itemtype); $data=$sth->fetchrow_hashref; $sth->finish; @@ -105,14 +105,16 @@ if ($op eq 'add_form') { description => $data->{'description'}, loanlength => $data->{'loanlength'}, renewalsallowed => $data->{'renewalsallowed'}, - rentalcharge => $data->{'rentalcharge'}); + rentalcharge => $data->{'rentalcharge'}, + notforloan => $data->{'notforloan'} + ); ; # END $OP eq ADD_FORM ################## ADD_VALIDATE ################################## # called by add_form, used to insert/modify data in DB } elsif ($op eq 'add_validate') { my $dbh = C4::Context->dbh; - my $query = "replace itemtypes (itemtype,description,loanlength,renewalsallowed,rentalcharge) values ("; + my $query = "replace itemtypes (itemtype,description,loanlength,renewalsallowed,rentalcharge,notforloan) values ("; $query.= $dbh->quote($input->param('itemtype')).","; $query.= $dbh->quote($input->param('description')).","; $query.= $dbh->quote($input->param('loanlength')).","; @@ -121,7 +123,12 @@ if ($op eq 'add_form') { } else { $query.= "1,"; } - $query.= $dbh->quote($input->param('rentalcharge')).")"; + $query.= $dbh->quote($input->param('rentalcharge')).","; + if ($input->param('notforloan') ne 1) { + $query.= "0)"; + } else { + $query.= "1)"; + } my $sth=$dbh->prepare($query); $sth->execute; $sth->finish; diff --git a/admin/koha2marclinks.pl b/admin/koha2marclinks.pl index 56e0cf9744..0a64bc700f 100755 --- a/admin/koha2marclinks.pl +++ b/admin/koha2marclinks.pl @@ -106,8 +106,8 @@ if ($op eq 'add_form') { $fields{$kohafield}->{liblibrarian} = $liblibrarian; } #XXX: This might not work. Maybe should use a DBI call instead of SHOW COLUMNS - my $sth2=$dbh->prepare("SHOW COLUMNS from ?"); - $sth2->execute($tablename); + my $sth2=$dbh->prepare("SHOW COLUMNS from $tablename"); + $sth2->execute; my $toggle="white"; my @loop_data = (); diff --git a/admin/thesaurus.pl b/admin/thesaurus.pl index 69f7aca1c3..c1aa2181d8 100755 --- a/admin/thesaurus.pl +++ b/admin/thesaurus.pl @@ -257,10 +257,10 @@ if ($op eq 'add_form') { branch => $branch, father => $father); if ($offset>0) { - $template->param(previous => "<< Prev"); + $template->param(previous => "$script_name?branch=$branch&search_category=$search_category&searchstring=$searchstring&offset=$prevpage"); } if ($pagesize<$count) { - $template->param(next => "Next >>"); + $template->param(next => "$script_name?branch=$branch&search_category=$search_category&searchstring=$searchstring&offset=$nextpage"); } } #---- END $OP eq DEFAULT diff --git a/catalogue-home.pl b/catalogue-home.pl index 75d908b0ac..428724c86a 100755 --- a/catalogue-home.pl +++ b/catalogue-home.pl @@ -16,7 +16,7 @@ my ($template, $loggedinuser, $cookie) query => $query, type => "intranet", authnotrequired => 0, - flagsrequired => {parameters => 1}, + flagsrequired => {catalogue => 1}, debug => 1, }); diff --git a/detail.pl b/detail.pl index 82d57e2738..2932a76bce 100755 --- a/detail.pl +++ b/detail.pl @@ -95,7 +95,8 @@ $template->param(startfrom => $startfrom+1, WEB_RESULTS => $webarray, SITE_RESULTS => $sitearray, loggedinuser => $loggedinuser, - biblionumber => $biblionumber); + biblionumber => $biblionumber, + ); output_html_with_http_headers $query, $cookie, $template->output; diff --git a/detailprint.pl b/detailprint.pl new file mode 100755 index 0000000000..dd22665ecd --- /dev/null +++ b/detailprint.pl @@ -0,0 +1,105 @@ +#!/usr/bin/perl +# NOTE: Use standard 8-space tabs for this file (indents are 4 spaces) + +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +use HTML::Template; +use strict; +require Exporter; +use C4::Context; +use C4::Output; # contains gettemplate +use CGI; +use C4::Search; +use C4::Auth; +use C4::Interface::CGI::Output; +use C4::Date; + +my $query=new CGI; +my $type=$query->param('type'); +($type) || ($type='intra'); + +my $biblionumber=$query->param('bib'); + +# change back when ive fixed request.pl +my @items = ItemInfo(undef, $biblionumber, $type); +my $norequests = 1; +foreach my $itm (@items) { + $norequests = 0 unless $itm->{'notforloan'}; +} + + + +my $dat=bibdata($biblionumber); +my ($authorcount, $addauthor)= &addauthor($biblionumber); +my ($webbiblioitemcount, @webbiblioitems) = &getwebbiblioitems($biblionumber); +my ($websitecount, @websites) = &getwebsites($biblionumber); + +$dat->{'count'}=@items; +$dat->{'norequests'} = $norequests; + +$dat->{'additional'}=$addauthor->[0]->{'author'}; +for (my $i = 1; $i < $authorcount; $i++) { + $dat->{'additional'} .= "|" . $addauthor->[$i]->{'author'}; +} # for + +my @results; + +$results[0]=$dat; + +my $resultsarray=\@results; +my $itemsarray=\@items; +my $webarray=\@webbiblioitems; +my $sitearray=\@websites; + +my $startfrom=$query->param('startfrom'); +($startfrom) || ($startfrom=0); + +my ($template, $loggedinuser, $cookie) = get_template_and_user({ + template_name => ('catalogue/detailprint.tmpl'), + query => $query, + type => "intranet", + authnotrequired => ($type eq 'opac'), + flagsrequired => {catalogue => 1}, + }); + +my $count=1; + +# now to get the items into a hash we can use and whack that thru + + +my $nextstartfrom=($startfrom+20<$count-20) ? ($startfrom+20) : ($count-20); +my $prevstartfrom=($startfrom-20>0) ? ($startfrom-20) : (0); +$template->param(startfrom => $startfrom+1, + endat => $startfrom+20, + numrecords => $count, + nextstartfrom => $nextstartfrom, + prevstartfrom => $prevstartfrom, + BIBLIO_RESULTS => $resultsarray, + ITEM_RESULTS => $itemsarray, + WEB_RESULTS => $webarray, + SITE_RESULTS => $sitearray, + loggedinuser => $loggedinuser, + biblionumber => $biblionumber, + ); + +output_html_with_http_headers $query, $cookie, $template->output; + + +# Local Variables: +# tab-width: 8 +# End: diff --git a/insertidata.pl b/insertidata.pl index f2558fe3ea..771331e59d 100755 --- a/insertidata.pl +++ b/insertidata.pl @@ -39,48 +39,69 @@ my $keyfld; my $keyval; my $problems; my $env; +my $sth2; foreach my $key (@names){ $data{$key}=$input->param($key); } my $dbh = C4::Context->dbh; -my $query="Select * from borrowers where borrowernumber=$data{'borrowernumber'}"; -my $sth=$dbh->prepare($query); -$sth->execute; +my $sth=$dbh->prepare("Select * from borrowers where borrowernumber=?"); +$sth->execute($data{'borrowernumber'}); if (my $data2=$sth->fetchrow_hashref){ - $query="update borrowers set title='$data{'title'}',expiry='$data{'expiry'}', - cardnumber='$data{'cardnumber_institution'}',sex='$data{'sex'}',ethnotes='$data{'ethnicnotes'}', - streetaddress='$data{'address'}',faxnumber='$data{'faxnumber'}',firstname='$data{'firstname'}', - altnotes='$data{'altnotes'}',dateofbirth='$data{'dateofbirth'}',contactname='$data{'contactname'}', - emailaddress='$data{'emailaddress'}',dateenrolled='$data{'joining'}',streetcity='$data{'streetcity'}', - altrelationship='$data{'altrelationship'}',othernames='$data{'othernames'}',phoneday='$data{'phoneday'}', - city='$data{'city'}',area='$data{'area'}',phone='$data{'phone'}', - borrowernotes='$data{'borrowernotes'}',altphone='$data{'altphone'}',surname='$data{'institution_name'}', - initials='$data{'initials'}',physstreet='$data{'streetaddress'}',ethnicity='$data{'ethnicity'}', - gonenoaddress='$data{'gna'}',lost='$data{'lost'}',debarred='$data{'debarred'}', - textmessaging='$data{'textmessaging'}', branchcode = '$data{'branchcode'}', - zipcode = '$data{'zipcode'}',homezipcode='$data{'homezipcode'}' - where borrowernumber=$data{'borrowernumber'}"; + $sth2=$dbh->prepare("update borrowers set title=?,expiry=?, + cardnumber=?,sex=?,ethnotes=?, + streetaddress=?,faxnumber=?,firstname=?, + altnotes=?,dateofbirth=?,contactname=?, + emailaddress=?,dateenrolled=?,streetcity=?, + altrelationship=?,othernames=?,phoneday=?, + city=?,area=?,phone=?, + borrowernotes=?,altphone=?,surname=?, + initials=?,physstreet=?,ethnicity=?, + gonenoaddress=?,lost=?,debarred=?, + textmessaging=?, branchcode = ?, + zipcode = ?,homezipcode=? + where borrowernumber=?"); + $sth2->execute($data{'title'},$data{'expiry'}, + $data{'cardnumber_institution'},$data{'sex'},$data{'ethnicnotes'}, + $data{'address'},$data{'faxnumber'},$data{'firstname'}, + $data{'altnotes'},$data{'dateofbirth'},$data{'contactname'}, + $data{'emailaddress'},$data{'joining'},$data{'streetcity'}, + $data{'altrelationship'},$data{'othernames'},$data{'phoneday'}, + $data{'city'},$data{'area'},$data{'phone'}, + $data{'borrowernotes'},$data{'altphone'},$data{'institution_name'}, + $data{'initials'},$data{'streetaddress'},$data{'ethnicity'}, + $data{'gna'},$data{'lost'},$data{'debarred'}, + $data{'textmessaging'},$data{'branchcode'}, + $data{'zipcode'},$data{'homezipcode'}, + $data{'borrowernumber'}); } else { my $surname=$data{'institution_name'}; - $query="insert into borrowers (title,expiry,cardnumber,sex,ethnotes,streetaddress,faxnumber, - firstname,altnotes,dateofbirth,contactname,emailaddress,dateenrolled,streetcity, - altrelationship,othernames,phoneday,categorycode,city,area,phone,borrowernotes,altphone,surname, - initials,ethnicity,borrowernumber,guarantor,school,branchcode,zipcode,homezipcode) - values ('','$data{'expiry'}','$data{'cardnumber_institution'}', - '','$data{'ethnotes'}','$data{'address'}','$data{'faxnumber'}', - '$data{'firstname'}','$data{'altnotes'}','','$data{'contactname'}', - '$data{'emailaddress'}', - now(),'$data{'streetcity'}','$data{'altrelationship'}','$data{'othernames'}', - '$data{'phoneday'}','I','$data{'city'}','$data{'area'}','$data{'phone'}', - '$data{'borrowernotes'}','$data{'altphone'}','$surname','$data{'initials'}', - '$data{'ethnicity'}','$data{'borrowernumber'}','','','$data{'branchcode'}','$data{'zipcode'}','$data{'homezipcode'}')"; + # note for code reading : 5 on each line + $sth2=$dbh->prepare("insert into borrowers ( + title, expiry, cardnumber, sex, ethnotes, + streetaddress, faxnumber, firstname, altnotes, dateofbirth, + contactname, emailaddress, dateenrolled, streetcity, altrelationship, + othernames, phoneday, categorycode, city, area, + phone, borrowernotes, altphone, surname, initials, + ethnicity, borrowernumber,guarantor, school, branchcode, + zipcode, homezipcode) + values ( ?,?,?,?,?, + ?,?,?,?,?, + ?,?,now(),?,?, + ?,?,?,?,?, + ?,?,?,?,?, + ?,?,?,?,?, + ?,? + )"); + $sth2->execute('', $data{'expiry'}, $data{'cardnumber_institution'}, '', $data{'ethnotes'}, + $data{'address'}, $data{'faxnumber'}, $surname, $data{'altnotes'}, '', + $data{'contactname'},$data{'emailaddress'}, $data{'streetcity'}, $data{'altrelationship'}, # only 4 because of now() + $data{'othernames'}, $data{'phoneday'}, 'I', $data{'city'}, $data{'area'}, + ''.$data{'phone'}, $data{'borrowernotes'}, $data{'altphone'}, $surname, ''.$data{'initials'}, + $data{'ethnicity'}, $data{'borrowernumber'}, '', '', $data{'branchcode'}, + $data{'zipcode'}, $data{'homezipcode'}); } -#print $query; -my $sth2=$dbh->prepare($query); -warn "==> $query"; -$sth2->execute; $sth2->finish; -#$sth->finish; +$sth->finish; print $input->redirect("/cgi-bin/koha/moremember.pl?bornum=$data{'borrowernumber'}"); diff --git a/memberentry.pl b/memberentry.pl index 2fcf7fad0c..21b0b3d640 100755 --- a/memberentry.pl +++ b/memberentry.pl @@ -59,10 +59,10 @@ my $delete=$input->param('delete'); if ($delete){ print $input->redirect("/cgi-bin/koha/deletemem.pl?member=$member"); } else { # this else goes down the whole script - if ($type ne 'Add'){ - $template->param( header => 'Update Member Details'); # bad templating style + if ($type eq 'Add'){ + $template->param( addAction => 1); } else { - $template->param( header => 'Add New Member'); + $template->param( addAction =>0); } my $data=borrdata('',$member); diff --git a/newmember.pl b/newmember.pl index 4de8406a97..01aafd434b 100755 --- a/newmember.pl +++ b/newmember.pl @@ -126,9 +126,9 @@ if ($ok == 0) { $name.="$data{'surname'} ( $data{'firstname'}, $data{'initials'})"; my $sex; if ($data{'sex'} eq 'M'){ - $sex="Male"; + $sex=1; } else { - $sex="Female"; + $sex=0; } if ($data{'joining'} eq ''){ $data{'joining'}=ParseDate('today'); diff --git a/release_notes_191.txt b/release_notes_191.txt deleted file mode 100644 index 55ebf93610..0000000000 --- a/release_notes_191.txt +++ /dev/null @@ -1,19 +0,0 @@ -RELEASE NOTES -* standard acquisition and MARC cataloguing now both useable at the same time. -* MANY bugfixes. -* almost everything now templated. A few admin scripts still to template. -* inclusion of some pictures to say "add", "modify", "delete" in many places. -* the koha-html cvs tree is now UNUSED, and no mode included in this release. the koha cvs project contains everything. - -TODO -* z39.50 support. A port from the 1.2.x z39.50 support needs to be done. Should be quick, -* fixing bugs. If you find a bug in this version, please take the plane and go for a trip to : bugs.koha.org - -FEATURE FREEZE -feature freeze is there... only z39.50 will be added until 2.0RC1, which should be the next release ! - -KNOWN BUGS *IMPORTANT* : -* koha does NOT work with MARC::Record 1.12. It works fine with MARC::Record 0.93, and maybe with other versions. -* repeted subfields in MARC/iso2709 works poorly : only the 1st subfield is stored, other are ignored. At least, the 1st is right ! (in the 1.9.0, the 1st was buggied by other subfields too) -* In the MARC search, the "not" flag does not work : the result of the query is very strange ! -* en and fr are the only languages well supported in this version. Other translator teams are waiting for more stable templates :-) \ No newline at end of file diff --git a/release_notes_192.txt b/release_notes_192.txt deleted file mode 100644 index 6dff48c339..0000000000 --- a/release_notes_192.txt +++ /dev/null @@ -1,77 +0,0 @@ -RELEASE NOTES -============= -* koha does NOT work with MARC::Record 1.12. It works fine with MARC::Record 0.93, and maybe with other versions. -* In the MARC search, the "not" flag does not work : the result of the query is very strange ! -* en and fr are the only languages well supported in this version. Other translator teams are waiting for more stable templates. -* see interim.txt, which contains install notes - -BUG FIXED (see bugs.koha.org for more infos) -========= -XXX Error in biblio modification -248 French page titles in English language Koha - Members -227 Confirm newmember lists items you can't enter -254 Next link goes to the wrong page -230 Wrong DOB entry information given in add member -234 The buildrelease script or the installer script does not kno -263 HLT isms still on Add Member page -278 Internal Server Error on Categories -249 Addl. French titles in English language Koha -228 Modifying member info scrambles DOB -255 Form fields too small for text -231 z3950servers.pl mistitled branches admin -260 Error during install - the sample data doesn't load, -235 Koha login link listed twice and I'm already logged in -266 HLT isms on member details page. -244 stats.pl needs to be templated -226 Bookfund admin page - rows not lining up under heading -250 Parameters titled Catalogue -229 Members birth years 1913 and earlier are changed to 2000's -257 Fields named wrong on modify budget page -233 OPAC - User update doesn't work. -262 Ethnicity select list still in add a member page -240 Search results page - has Log In to Koha link - already log -277 Internal Server Error in Add Institution and Add Child -291 Joining date dateformat not consistent -241 Extra td in html creates an extra little rectangle. -259 Enter stopwords field too long -290 Missing image seen briefly on log-in page. - -IMPROVEMENTS -============= -* An About page has been added, showing versions of Koha, Apache, MySQL, Perl -* repetable subfields now correctly stored : enter a repeted subfield in the form, separated by | and watch the result in the catalogue. - -Bugs still opens in bugs.koha.org -======================= -196 user input not checked for HTML tags -293 Error Issuing Book - 1 -191 View Account cannot see charges -264 Day phone not output on confirm record. -208 Confirmation screen for addition of institutional member is -236 Reserve book on future date doesn't work or copy is wrong -242 Current loan output is blank -193 Multiple search criteria in OPAC gives misleading feedback -267 Day phone not displayed on update details -237 Can request to reserve a book with an end reserve date in t -130 Branch data entry form has unlabelled check box -258 Budget treats a comma as a period. -223 Editing budget creates additinal budget for same book fund. -239 Issue limit doesn't work - able to check out more items than -251 Wrong title for image -276 Tables overlap when there are a lot of patron notes. -297 Images missing on View Account page -252 Add category page titled add authorised value -245 No mechanism provided for changing the Locations -275 Wrong size text boxes in admin/itemtypes -300 Reading record - full output same as regular reading record -292 missing image is seen when mousing to the left of search. -298 In circulation Acquistion & MARC links are blue not grey -217 querying with barcode to modify biblio - -TODO -===== -* script for migration from koha 1.2.x -> 2.0.0 -* script to upload MARC datas and items in active DB -* script to upload CSV biblio and items in active DB -* z3950 client - diff --git a/release_notes_193.txt b/release_notes_193.txt deleted file mode 100644 index 6dfb58dba5..0000000000 --- a/release_notes_193.txt +++ /dev/null @@ -1,76 +0,0 @@ -RELEASE NOTES -============= -This release add a lot of bugfixes, a 1st z3950 support, and a script for migration from previous ILS. - -FEATURE FREEZE ! ---------- -This version is the last version with new features before 2.0. -Please, report bugs on bugs.koha.org, and feel free to fix them (through patch or cvs commit) - - -PACKAGE NEEDED : ---------- -Update your MARC::Record to get the latest version (1.26). -Koha won't work with old versions, and bulkmarcimport.pl need MARC::Batch.pm, whichi is recent. -MARC::Record 1.25 works to, but reports hundred of warnings in error_log. pls upgrage to 1.26 ! - - -DB modifications : ---------- -* the marc_breeding table has been modified. A row "encoding" varchar(40) has been added. It's used to manage character encoding. -* the z3950_servers table has been modified. A row "syntax" varchar(40) has been added. It's used to manage character encoding. - -z3950 : ---------- -* the z3950 script in admin part of Koha has been fixed and can be used and translated. -* z3950 cataloguing : when you reach the MARC-cataloguing screen, a new link appear : z3950 search. -* If you click on this link, a popup appears, and the search begins. The window is refreshed every 2 seconds, until all servers answered. -* The avaible records are shown in the popup. Click on the one you want, and... the popup closes and the biblio is copied in the cataloguing screen. - -This works ONLY IF the z3950 daemon is launched. It's located at $kohadir/scripts/z3950daemon/ -* MODIFY the scripts to fit you directory structure. -* Warning : due to a small bug, processqueue is in $kohadir/cgi-bin/z3950/ directory, not in the script one. -* Start daemon in a non-X shell, or launch processqueue in a shell, and KEEP IT OPEN. - -iso2709 file import : ---------- -This tools is very important and was waiting by libraries that plans to migrate from a previous ILS. -VERY IMPORTANT : -BEFORE using this script, take care of your MARC parameters, and check them twice. If they are wrong, you will get wrong results... - -It's located (in CVS tree) at $koharoot/misc/bulkmarcimport.pl - -It loads an iso2709 file into the ACTIVE Database. My 1st tests on sample files shows it works quite fine. -Feel free to try it. -How it works ? enter ./bulkmarcimport in a console, and look. - -KNOWN LIMIT : If the barcode of an item does not exists, the scripts report an SQL error, and continue. BUT the corresponding item is not in the non-marc db, so it can't be requested or loaned. - -sample file : ---------- -The sample file has been removed from this release, as it's buggy (no MARC datas, making it quite useless) - -Templates & translations : ---------- -* Most images have been dropped from templates (all -except bugs- in french templates -* english is uptodate, and french should be too. - -BUG FIXED (see bugs.koha.org for more infos) -========= -A lot... (around 35). -Thanks to Mike that fixed a lot, -Steve that fixes some, -MJ Ray that upgraded the installer for non-root install, -and Chris that fixed some and begins backport of non-marc stuff from 1.2 - -Bugs still open in bugs.koha.org -======================= -A lot... (around 60. some being really trivial to fix, some being more important) - -TODO -===== -* some GUI reordering, as planned with Rachel from Katipo and others (paul & others) -* finishing backport of non-marc cataloguing & non-marc simple acquisition from 1.2 version (chris) -* bug fixes (everybody) -* cleaning z3950 old searches (more than 1 hour/day old ?) (paul) - diff --git a/release_notes_200RC1.txt b/release_notes_200RC1.txt deleted file mode 100644 index e5566be425..0000000000 --- a/release_notes_200RC1.txt +++ /dev/null @@ -1,84 +0,0 @@ -RELEASE NOTES -============= -This version of Koha is the first in the 2.0 "stable" series. -It does not mean that it has no bugs, but least five libraries are using it and don't encounter impossible problems. -If you want to adopt Koha, please do, but you're warned that this release candidate version may still have some bugs and missing features. If you test it and let us know about any we haven't seen yet, it will help us to fix them. - - -INSTALLATION - -* Download the package -* tar xvfz koha-version.tar.gz -* cd koha-version -* ./installer.pl -* Follow the instructions - - -UPGRADE from previous 2.0.0preX version - -* Download the package -* tar xvfz koha-version.tar.gz -* cd koha-version -* ./koha.upgrade -* Follow the instructions - - -UPGRADE from previous 1.2.x version - -This is the first koha 2 version that contains this upgrade. -It may have bugs. Please take backups and be sure that you can go back to your previous version if needed. -Otherwise, WAIT for 2.0.0RC2 or later. - -* Download the package -* tar xvfz koha-version.tar.gz -* cd koha-version -* ./koha.upgrade -* Follow the instructions -* Open a browser to Koha -* Go to Parameters >> Marc structure option and Koha-MARC links option. -* Modify default MARC structure to fit your needs -* Open a command-line on the koha server -* Enter : -cd /path/to/koha/misc -export PERL5LIB=/path/to/koha/modules -./koha2marc.pl -This "copies" the old DB to the new MARC one. -Now Koha 2.0.0RC1 is ready for you to test. - - -BUGFIXES/IMPROVEMENTS - -BUGS FIXED: -* biblio deletion now works in MARC & non MARC tables as well. tools for deletion added in MARCeditor (biblio & item deletion) -* bug in circulation that breaked the 1st circ screen -* biblio subject adding when more than 1 subject. -* bibliothesaurus : a fulltext index was missing. The updatedatabase script now creates it. -* 621 ; Returns not marking reserves waiting -* 649 : french word in english template -* 639 : unclosed