From nsr4n at tetra.mail.virginia.edu Fri Feb 1 09:31:17 2002 From: nsr4n at tetra.mail.virginia.edu (Nicholas Stephen Rosasco) Date: Fri Feb 1 09:31:17 2002 Subject: [Koha-devel] Question Message-ID: Besides the FAQ, does anyone want more documentation? The install directions, last I looked, were OK. Do we have notes on how to adjust Koha in appearance and for different databases. Also, I've had a question about installing Koha to use a database (MySQL, as I recall) on a seperate server (that is, distinct from the webserver with Koha/Apache installed). Has anyone done this? Also, what is the situation on the MARC enabled release? Last I heard was an "umm, couple of months" in re to someone elses questions. Nick ...willing to help work on the Koha.org page rework that has been mentioned. From tonnesen at cmsd.bc.ca Fri Feb 1 09:39:45 2002 From: tonnesen at cmsd.bc.ca (Tonnesen Steve) Date: Fri Feb 1 09:39:45 2002 Subject: [Koha-devel] Question In-Reply-To: Message-ID: On Fri, 1 Feb 2002, Nicholas Stephen Rosasco wrote: > Besides the FAQ, does anyone want more documentation? > The install directions, last I looked, were OK. > > Do we have notes on how to adjust Koha in appearance and for different > databases. Also, I've had a question about installing Koha to use a > database (MySQL, as I recall) on a seperate server (that is, distinct from > the webserver with Koha/Apache installed). Has anyone done this? Just change the host= line in /etc/koha.conf. That determines where the mysql data is running. Modifying Koha's appearance isn't my cup of tea. Those who saw my first choice of colours for the circulation interface will likely agree! A lot of Koha's appearance can be modified by changing the HTML templates in the htdocs and htdocs/includes directories. > Also, what is the situation on the MARC enabled release? Last I heard was > an "umm, couple of months" in re to someone elses questions. Ummm, couple of months. I'm thinking for the moment I should concentrate on getting a good MARC importer. I have a MARC importer now, but I have had to modify it for every sample of MARC that I've seen. Who said MARC was a standard? :) I've just started working on the Koha 1.2.0 packages again today. I told Chris I'd have a release today. We'll see how it goes. Hopefully my boss doesn't notice me down here. :) Steve. From tonnesen at users.sourceforge.net Fri Feb 1 10:02:12 2002 From: tonnesen at users.sourceforge.net (Steve Tonnesen) Date: Fri Feb 1 10:02:12 2002 Subject: [Koha-devel] CVS: koha/acqui.simple marcimport.pl,1.5,1.6 processz3950queue,1.2,1.3 Message-ID: Update of /cvsroot/koha/koha/acqui.simple In directory usw-pr-cvs1:/tmp/cvs-serv32238/koha/acqui.simple Modified Files: marcimport.pl processz3950queue Log Message: Changes from a long time ago that I don't even remember anymore. :) Index: marcimport.pl =================================================================== RCS file: /cvsroot/koha/koha/acqui.simple/marcimport.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** marcimport.pl 2001/11/06 18:13:59 1.5 --- marcimport.pl 2002/02/01 18:00:28 1.6 *************** *** 829,839 **** ($author) && ($author="by $author"); if ($isbn) { ! print "
  • $title$subtitle $author $donetext
    \n"; } elsif ($lccn) { ! print "
  • $title$subtitle $author $donetext
    \n"; } elsif ($issn) { ! print "
  • $title$subtitle $author
    $donetext\n"; } elsif ($controlnumber) { ! print "
  • $title $author
    $donetext\n"; } else { print "Error: Contact steve regarding $title by $author
    \n"; --- 829,839 ---- ($author) && ($author="by $author"); if ($isbn) { ! print "
  • $title $subtitle $author $donetext
    \n"; } elsif ($lccn) { ! print "
  • $title $subtitle $author $donetext
    \n"; } elsif ($issn) { ! print "
  • $title $subtitle $author
    $donetext\n"; } elsif ($controlnumber) { ! print "
  • $title $subtitle $author
    $donetext\n"; } else { print "Error: Contact steve regarding $title by $author
    \n"; Index: processz3950queue =================================================================== RCS file: /cvsroot/koha/koha/acqui.simple/processz3950queue,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** processz3950queue 2001/11/06 18:13:59 1.2 --- processz3950queue 2002/02/01 18:00:28 1.3 *************** *** 25,29 **** my $now=time(); $stk=$dbh->prepare("select id,server,startdate,enddate,numrecords,active from z3950results where queryid=$id"); ! $stk->execute; my %serverdone; unless ($stk->rows) { --- 25,29 ---- my $now=time(); $stk=$dbh->prepare("select id,server,startdate,enddate,numrecords,active from z3950results where queryid=$id"); ! ($stk->execute) || (next); my %serverdone; unless ($stk->rows) { *************** *** 82,88 **** ($resultsid) = $stj->fetchrow; } else { ! my $stj=$dbi->prepare("insert into z3950results (server, queryid, startdate) values ($q_serverinfo, $id, $now)"); $stj->execute; ! $resultsid=$dbi->{'mysql_insertid'}; } my $stj=$dbh->prepare("update z3950results set active=1 where id=$resultsid"); --- 82,93 ---- ($resultsid) = $stj->fetchrow; } else { ! my $stj=$dbi->prepare("select id from z3950results where server=$q_serverinfo and queryid=$id"); $stj->execute; ! ($resultsid) = $stj->fetchrow; ! unless ($resultsid) { ! my $stj=$dbi->prepare("insert into z3950results (server, queryid, startdate) values ($q_serverinfo, $id, $now)"); ! $stj->execute; ! $resultsid=$dbi->{'mysql_insertid'}; ! } } my $stj=$dbh->prepare("update z3950results set active=1 where id=$resultsid"); *************** *** 90,168 **** my $conn; my $noconnection=0; if ($user) { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database, user => $user, password => $password); }; if ($@) { $noconnection=1; } - pe(); } else { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database); }; if ($@) { $noconnection=1; } - pe(); } ! if ($noconnection) { } else { my $rs=$conn->search($query); - pe(); - $rs->option(preferredRecordSyntax => Net::Z3950::RecordSyntax::USMARC); - pe(); - my $numresults=$rs->size(); pe(); ! my $i; ! my $result=''; ! my $scantimerstart=time(); ! for ($i=1; $i<=(($numresults<80) ? ($numresults) : (80)); $i++) { ! my $rec=$rs->record($i); ! my $marcdata=$rec->rawdata(); ! $result.=$marcdata; ! } ! my $scantimerend=time(); ! my $numrecords; ! ($numresults<80) ? ($numrecords=$numresults) : ($numrecords=80); ! my $elapsed=$scantimerend-$scantimerstart; ! if ($elapsed) { ! my $speed=int($numresults/$elapsed*100)/100; ! print " SPEED: $speed $server done $numrecords\n"; ! } ! my $q_result=$dbi->quote($result); ! ($q_result) || ($q_result='""'); ! $now=time(); ! my $task="update z3950results set numrecords=$numresults,numdownloaded=$numrecords,highestseen=0,results=$q_result,enddate=$now where id=$resultsid"; ! my $stj=$dbi->prepare($task); ! $stj->execute; ! my $counter=0; ! while ($counter<60 && $numrecords<$numresults) { ! $counter++; ! my $stj=$dbi->prepare("select highestseen from z3950results where id=$resultsid"); $stj->execute; ! my ($highestseen) = $stj->fetchrow; ! if ($highestseen>($numrecords-30)) { ! $counter=0; ! print " $server rescanning\n"; ! my $scantimerstart=time(); ! for ($i=$numrecords+1; $i<=(($numresults<($numrecords+40)) ? ($numresults) : ($numrecords+40)); $i++) { ! my $rec=$rs->record($i); ! my $marcdata=$rec->rawdata(); ! $result.=$marcdata; ! } ! my $scantimerend=time(); ! ($numresults<$numrecords+40) ? ($numrecords=$numresults) : ($numrecords=$numrecords+40); ! my $elapsed=$scantimerend-$scantimerstart; ! if ($elapsed) { ! my $speed=int($numresults/$elapsed*100)/100; ! print " SPEED: $speed $server done $numrecords\n"; ! } ! ! my $q_result=$dbi->quote($result); ! ($q_result) || ($q_result='""'); ! $now=time(); ! my $task="update z3950results set numdownloaded=$numrecords,results=$q_result where id=$resultsid"; ! my $stj=$dbi->prepare($task); $stj->execute; } - sleep 5; } } --- 95,181 ---- my $conn; my $noconnection=0; + my $error=0; if ($user) { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database, user => $user, password => $password); }; if ($@) { $noconnection=1; + } else { + $error=pe(); } } else { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database); }; if ($@) { $noconnection=1; + } else { + $error=pe(); } } ! if ($noconnection || $error) { } else { + print "Q: $query\n"; my $rs=$conn->search($query); pe(); ! eval { $rs->option(preferredRecordSyntax => Net::Z3950::RecordSyntax::USMARC);}; ! if ($@) { ! print "ERROR: $@\n"; ! } else { ! pe(); ! my $numresults=$rs->size(); ! pe(); ! my $i; ! my $result=''; ! my $scantimerstart=time(); ! for ($i=1; $i<=(($numresults<80) ? ($numresults) : (80)); $i++) { ! my $rec=$rs->record($i); ! my $marcdata=$rec->rawdata(); ! $result.=$marcdata; ! } ! my $scantimerend=time(); ! my $numrecords; ! ($numresults<80) ? ($numrecords=$numresults) : ($numrecords=80); ! my $elapsed=$scantimerend-$scantimerstart; ! if ($elapsed) { ! my $speed=int($numresults/$elapsed*100)/100; ! print " SPEED: $speed $server done $numrecords\n"; ! } ! my $q_result=$dbi->quote($result); ! ($q_result) || ($q_result='""'); ! $now=time(); ! my $task="update z3950results set numrecords=$numresults,numdownloaded=$numrecords,highestseen=0,results=$q_result,enddate=$now where id=$resultsid"; ! my $stj=$dbi->prepare($task); $stj->execute; ! my $counter=0; ! while ($counter<60 && $numrecords<$numresults) { ! $counter++; ! my $stj=$dbi->prepare("select highestseen from z3950results where id=$resultsid"); $stj->execute; + my ($highestseen) = $stj->fetchrow; + if ($highestseen>($numrecords-30)) { + $counter=0; + print " $server rescanning\n"; + my $scantimerstart=time(); + for ($i=$numrecords+1; $i<=(($numresults<($numrecords+40)) ? ($numresults) : ($numrecords+40)); $i++) { + my $rec=$rs->record($i); + my $marcdata=$rec->rawdata(); + $result.=$marcdata; + } + my $scantimerend=time(); + ($numresults<$numrecords+40) ? ($numrecords=$numresults) : ($numrecords=$numrecords+40); + my $elapsed=$scantimerend-$scantimerstart; + if ($elapsed) { + my $speed=int($numresults/$elapsed*100)/100; + print " SPEED: $speed $server done $numrecords\n"; + } + + my $q_result=$dbi->quote($result); + ($q_result) || ($q_result='""'); + $now=time(); + my $task="update z3950results set numdownloaded=$numrecords,results=$q_result where id=$resultsid"; + my $stj=$dbi->prepare($task); + $stj->execute; + } + sleep 5; } } } *************** *** 174,178 **** exit; sub pe { ! (return) unless ($code); my $code=$conn->errcode(); my $msg=$conn->errmsg(); --- 187,191 ---- exit; sub pe { ! return 0; my $code=$conn->errcode(); my $msg=$conn->errmsg(); *************** *** 184,187 **** --- 197,204 ---- EOF + # if ($msg =~/not yet available/) { + # return 1; + # } + return 0; } } *************** *** 204,208 **** $lastrun=time(); } ! sleep 1; } --- 221,225 ---- $lastrun=time(); } ! sleep 10; } From nsr4n at tetra.mail.virginia.edu Fri Feb 1 10:06:03 2002 From: nsr4n at tetra.mail.virginia.edu (Nicholas Stephen Rosasco) Date: Fri Feb 1 10:06:03 2002 Subject: [Koha-devel] Question In-Reply-To: Message-ID: > Ummm, couple of months. I'm thinking for the moment I should concentrate > on getting a good MARC importer. I have a MARC importer now, but I have > had to modify it for every sample of MARC that I've seen. Who said MARC > was a standard? :) > > I've just started working on the Koha 1.2.0 packages again today. I told > Chris I'd have a release today. We'll see how it goes. Hopefully my boss > doesn't notice me down here. :) Thanks... I think I'm guilty of quoting the LC docs that called it a standard. You can shoot me later. Would more references help? I can start dredging up more info... Nick From tonnesen at cmsd.bc.ca Fri Feb 1 12:59:41 2002 From: tonnesen at cmsd.bc.ca (Tonnesen Steve) Date: Fri Feb 1 12:59:41 2002 Subject: [Koha-devel] Pending release of 1.2.0 Message-ID: I'm working on a release candidate for Koha 1.2.0. I have a working Debian package, and an untested RPM package. I have no redhat machines to test it on. Are there any volunteers? A volunteer who will install the package and report back to me on the multitude of errors that will invariably result would be okay, a volunteer who has a test machine that I can get root access on would be even better. Big caveat: This package still isn't ready for upgrading production systems. New installs of Koha only for the moment. I need to determine what has changed in the database schema so that production systems can be updated properly. Steve. From nsr4n at tetra.mail.virginia.edu Mon Feb 4 10:32:02 2002 From: nsr4n at tetra.mail.virginia.edu (Nicholas Stephen Rosasco) Date: Mon Feb 4 10:32:02 2002 Subject: [Koha-devel] Is this useful? Message-ID: Some of the items listed have been updated recently... http://search.cpan.org/search?mode=module&query=MARC Nick From rangi at users.sourceforge.net Tue Feb 12 13:32:05 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 12 13:32:05 2002 Subject: [Koha-devel] CVS: koha/C4 Search.pm,1.11,1.12 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv28698/C4 Modified Files: Search.pm Log Message: Fixing bug in subject searching that was causing subjects with ' to break the search Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** Search.pm 12 Dec 2001 02:31:28 -0000 1.11 --- Search.pm 12 Feb 2002 21:31:41 -0000 1.12 *************** *** 9,12 **** --- 9,13 ---- use C4::Database; use C4::Reserves2; + use Set::Scalar; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); *************** *** 261,269 **** my $i=1; my @results; my $query ="Select * from biblio,bibliosubtitle,biblioitems where biblio.biblionumber=biblioitems.biblionumber and biblio.biblionumber=bibliosubtitle.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%')"; - while ($i < $count){ $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')"; --- 262,399 ---- my $i=1; my @results; + my $query="Select biblionumber from biblio + where ((title like '$key[0]%' or title like '% $key[0]%')"; + while ($i < $count){ + $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')"; + $i++; + } + $query.= ") or ((biblio.notes like '$key[0]%' or biblio.notes like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.=" and (biblio.notes like '$key[$i]%' or biblio.notes like '% $key[$i]%')"; + } + $query.= ") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')"; + } + $query.=" )"; + # print $query; + my $sth=$dbh->prepare($query); + $sth->execute; + my $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set1=Set::Scalar->new(@results); + $query="Select biblionumber from bibliosubtitle where + ((subtitle like '$key[0]%' or subtitle like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.= " and (subtitle like '$key[$i]%' or subtitle like '% $key[$i]%')"; + } + $query.=" )"; + # print $query; + $sth=$dbh->prepare($query); + $sth->execute; + $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set2=Set::Scalar->new(@results); + if ($i > 0){ + $set1=$set1+$set2; + } + $query ="Select biblionumber from biblioitems where + ((biblioitems.notes like '$key[0]%' or biblioitems.notes like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.=" and (biblioitems.notes like '$key[$i]%' or biblioitems.notes like '% $key[$i]%')"; + } + $query.=" )"; + # print $query; + $sth=$dbh->prepare($query); + $sth->execute; + $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set3=Set::Scalar->new(@results); + if ($i > 0){ + $set1=$set1+$set3; + } + $sth=$dbh->prepare("Select biblionumber from bibliosubject where subject + like '%$search->{'keyword'}%' group by biblionumber"); + $sth->execute; + $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set4=Set::Scalar->new(@results); + if ($i > 0){ + $set1=$set1+$set4; + } + my $i2=0; + my @res2; + my @res = $set1->members; + $count=@res; + # print $set1; + $i=0; + # print "count $count"; + while ($i2 < $num && $i2 < $count){ + my $query="select * from biblio,biblioitems where + biblio.biblionumber='$res[$i2+$offset]' and + biblio.biblionumber=biblioitems.biblionumber"; + if ($search->{'class'} ne ''){ + my @temp=split(/\|/,$search->{'class'}); + my $count=@temp; + $query.= "and ( itemtype='$temp[0]'"; + for (my $i=1;$i<$count;$i++){ + $query.=" or itemtype='$temp[$i]'"; + } + $query.=")"; + } + if ($search->{'dewey'} ne ''){ + $query.= "and (dewey like '$search->{'dewey'}%') "; + } + + my $sth=$dbh->prepare($query); + # print $query; + $sth->execute; + if (my $data2=$sth->fetchrow_hashref){ + my $dewey= $data2->{'dewey'}; + my $subclass=$data2->{'subclass'}; + $dewey=~s/\.*0*$//; + ($dewey == 0) && ($dewey=''); + ($dewey) && ($dewey.=" $subclass") ; + $sth->finish; + $res2[$i]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data2->{'copyrightdate'}\t$dewey"; + $i++; + } + $i2++; + } + $dbh->disconnect; + + # $count=$i; + return($count, at res2); + } + + sub KeywordSearch2 { + my ($env,$type,$search,$num,$offset)=@_; + my $dbh = &C4Connect; + $search->{'keyword'}=~ s/ +$//; + $search->{'keyword'}=~ s/'/\\'/; + my @key=split(' ',$search->{'keyword'}); + my $count=@key; + my $i=1; + my @results; my $query ="Select * from biblio,bibliosubtitle,biblioitems where biblio.biblionumber=biblioitems.biblionumber and biblio.biblionumber=bibliosubtitle.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%')"; while ($i < $count){ $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')"; *************** *** 377,381 **** my @res; my $count=@results; ! $i=0; if ($count > 0){ $res[0]=$results[0]; --- 507,511 ---- my @res; my $count=@results; ! $i=1; if ($count > 0){ $res[0]=$results[0]; *************** *** 399,402 **** --- 529,533 ---- $dbh->disconnect; # $i--; + # $i++; return($i, at res2); } *************** *** 436,441 **** $query=$query.")"; if ($search->{'title'} ne ''){ ! $query=$query. " and (title like '%$search->{'title'}%' ! or seriestitle like '%$search->{'title'}%')"; } if ($search->{'class'} ne ''){ --- 567,593 ---- $query=$query.")"; if ($search->{'title'} ne ''){ ! my @key=split(' ',$search->{'title'}); ! my $count=@key; ! my $i=0; ! $query.= " and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; ! while ($i<$count){ ! $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%' or title like '% $key[$i]')"; ! $i++; ! } ! # $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0] %' or subtitle like '% $key[0]')"; ! # for ($i=1;$i<$count;$i++){ ! # $query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i] %' or subtitle like '% $key[$i]')"; ! # } ! $query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%' or seriestitle like '% $key[0]')"; ! for ($i=1;$i<$count;$i++){ ! $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')"; ! } ! $query.=") or ((unititle like '$key[0]%' or unititle like '% $key[0]%' or unititle like '% $key[0]')"; ! for ($i=1;$i<$count;$i++){ ! $query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i]%')"; ! } ! $query=$query."))"; ! #$query=$query. " and (title like '%$search->{'title'}%' ! #or seriestitle like '%$search->{'title'}%')"; } if ($search->{'class'} ne ''){ *************** *** 483,497 **** $i++; } ! $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0] %' or subtitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i] %' or subtitle like '% $key[$i]')"; } ! $query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0] %' or seriestitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i] %')"; } ! $query.=") or ((unititle like '$key[0]%' or unititle like '% $key[0] %' or unititle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i] %')"; } $query=$query."))"; --- 635,649 ---- $i++; } ! $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0]%' or subtitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i]%' or subtitle like '% $key[$i]')"; } ! $query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%' or seriestitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')"; } ! $query.=") or ((unititle like '$key[0]%' or unititle like '% $key[0]%' or unititle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i]%')"; } $query=$query."))"; *************** *** 537,541 **** and biblioitems.illus like '%".$search->{'illustrator'}."%'"; } ! } $query .=" group by biblio.biblionumber"; } --- 689,693 ---- and biblioitems.illus like '%".$search->{'illustrator'}."%'"; } ! } $query .=" group by biblio.biblionumber"; } *************** *** 607,610 **** --- 759,763 ---- } } + #print $query; my $sth=$dbh->prepare($query); $sth->execute; *************** *** 648,654 **** my ($env,$subject)=@_; my $dbh=C4Connect(); my $query="Select * from biblio,bibliosubject where biblio.biblionumber=bibliosubject.biblionumber and ! bibliosubject.subject='$subject' group by biblio.biblionumber order by biblio.title"; my $sth=$dbh->prepare($query); --- 801,808 ---- my ($env,$subject)=@_; my $dbh=C4Connect(); + $subject=$dbh->quote($subject); my $query="Select * from biblio,bibliosubject where biblio.biblionumber=bibliosubject.biblionumber and ! bibliosubject.subject=$subject group by biblio.biblionumber order by biblio.title"; my $sth=$dbh->prepare($query); *************** *** 721,725 **** $dewey=~ s/\.$//; $class = $class.$dewey; ! $class = $class.$data->{'subclass'}; # $results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$data->{'dewey'}"; my @temp=split('-',$data->{'datelastseen'}); --- 875,881 ---- $dewey=~ s/\.$//; $class = $class.$dewey; ! if ($dewey ne ''){ ! $class = $class.$data->{'subclass'}; ! } # $results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$data->{'dewey'}"; my @temp=split('-',$data->{'datelastseen'}); *************** *** 791,795 **** my ($bibnum,$type)=@_; my $dbh=C4Connect; ! my $query="Select *,biblio.notes from biblio,biblioitems,bibliosubtitle where biblio.biblionumber=$bibnum and biblioitems.biblionumber=$bibnum and (bibliosubtitle.biblionumber=$bibnum)"; --- 947,951 ---- my ($bibnum,$type)=@_; my $dbh=C4Connect; ! my $query="Select *,biblio.notes from biblio,biblioitems,bibliosubtitle where biblio.biblionumber=$bibnum and biblioitems.biblionumber=$bibnum and (bibliosubtitle.biblionumber=$bibnum)"; *************** *** 815,819 **** my ($bibitem)=@_; my $dbh=C4Connect; ! my $query="Select * from biblio,biblioitems,itemtypes where biblio.biblionumber= biblioitems.biblionumber and biblioitemnumber=$bibitem and biblioitems.itemtype=itemtypes.itemtype"; --- 971,975 ---- my ($bibitem)=@_; my $dbh=C4Connect; ! my $query="Select *,biblioitems.notes as bnotes from biblio,biblioitems,itemtypes where biblio.biblionumber= biblioitems.biblionumber and biblioitemnumber=$bibitem and biblioitems.itemtype=itemtypes.itemtype"; From rangi at users.sourceforge.net Tue Feb 12 13:39:17 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 12 13:39:17 2002 Subject: [Koha-devel] CVS: koha updatebibitem.pl,1.2,1.3 Message-ID: Update of /cvsroot/koha/koha In directory usw-pr-cvs1:/tmp/cvs-serv21412 Modified Files: updatebibitem.pl Log Message: Fixing bug that was duplicating additional authors, and a bug that was breaking the updating classicification field Index: updatebibitem.pl =================================================================== RCS file: /cvsroot/koha/koha/updatebibitem.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** updatebibitem.pl 10 Oct 2001 19:27:00 -0000 1.2 --- updatebibitem.pl 12 Feb 2002 21:07:53 -0000 1.3 *************** *** 10,14 **** my $input= new CGI; #print $input->header; ! #print $input->dump; --- 10,14 ---- my $input= new CGI; #print $input->header; ! #print $input->Dump; *************** *** 41,45 **** }else{ $dewey=''; ! $subclass=$class; } my $illus=checkinp($input->param('Illustrations')); --- 41,45 ---- }else{ $dewey=''; ! $subclass=''; } my $illus=checkinp($input->param('Illustrations')); From rangi at users.sourceforge.net Tue Feb 12 13:40:08 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 12 13:40:08 2002 Subject: [Koha-devel] CVS: koha/C4 Acquisitions.pm,1.1.1.1,1.2 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv21412/C4 Modified Files: Acquisitions.pm Log Message: Fixing bug that was duplicating additional authors, and a bug that was breaking the updating classicification field From paul.poulain at free.fr Thu Feb 14 06:30:26 2002 From: paul.poulain at free.fr (paul POULAIN) Date: Thu Feb 14 06:30:26 2002 Subject: [Koha-devel] Re: [Koha] Pending release of 1.2.0 References: Message-ID: <3C6BCA4F.8000102@free.fr> Tonnesen Steve wrote: >I'm working on a release candidate for Koha 1.2.0. I have a working >Debian package, and an untested RPM package. I have no redhat machines to >test it on. Are there any volunteers? A volunteer who will install the >package and report back to me on the multitude of errors that will >invariably result would be okay, a volunteer who has a test machine that I >can get root access on would be even better. > >Big caveat: > >This package still isn't ready for upgrading production systems. New >installs of Koha only for the moment. I need to determine what has >changed in the database schema so that production systems can be updated >properly. > I've a mandrake runnning machine, so I can test the RPM package. I've no production running machine (just a test installation), and a root access, as it's my desk-PC. If the package is less than 5mb, you can mail it to me. Question : what's new in the 1.2.0 ? -- Paul From rangi at users.sourceforge.net Wed Feb 20 12:56:09 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Wed Feb 20 12:56:09 2002 Subject: [Koha-devel] CVS: koha/C4 Search.pm,1.12,1.13 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv10405/C4 Modified Files: Search.pm Log Message: Playing with keyword search trying to speed it up more Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** Search.pm 12 Feb 2002 21:31:41 -0000 1.12 --- Search.pm 20 Feb 2002 20:53:29 -0000 1.13 *************** *** 339,342 **** --- 339,345 ---- } my $i2=0; + my $i3=0; + my $i4=0; + my @res2; my @res = $set1->members; *************** *** 345,352 **** $i=0; # print "count $count"; while ($i2 < $num && $i2 < $count){ my $query="select * from biblio,biblioitems where biblio.biblionumber='$res[$i2+$offset]' and ! biblio.biblionumber=biblioitems.biblionumber"; if ($search->{'class'} ne ''){ my @temp=split(/\|/,$search->{'class'}); --- 348,399 ---- $i=0; # print "count $count"; + if ($search->{'class'} ne ''){ + while ($i2 <$count){ + my $query="select * from biblio,biblioitems where + biblio.biblionumber='$res[$i2]' and + biblio.biblionumber=biblioitems.biblionumber "; + if ($search->{'class'} ne ''){ + my @temp=split(/\|/,$search->{'class'}); + my $count=@temp; + $query.= "and ( itemtype='$temp[0]'"; + for (my $i=1;$i<$count;$i++){ + $query.=" or itemtype='$temp[$i]'"; + } + $query.=")"; + } + my $sth=$dbh->prepare($query); + # print $query; + $sth->execute; + if (my $data2=$sth->fetchrow_hashref){ + my $dewey= $data2->{'dewey'}; + my $subclass=$data2->{'subclass'}; + $dewey=~s/\.*0*$//; + ($dewey == 0) && ($dewey=''); + ($dewey) && ($dewey.=" $subclass") ; + $sth->finish; + my $end=$offset +$num; + if ($i4 <= $offset){ + $i4++; + } + # print $i4; + if ($i4 <=$end && $i4 > $offset){ + $res2[$i3]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data2->{'copyrightdate'}\t$dewey"; + $i3++; + $i4++; + # print "in here $i3
    "; + } else { + # print $end; + } + $i++; + } + $i2++; + } + $count=$i; + + } else { while ($i2 < $num && $i2 < $count){ my $query="select * from biblio,biblioitems where biblio.biblionumber='$res[$i2+$offset]' and ! biblio.biblionumber=biblioitems.biblionumber "; if ($search->{'class'} ne ''){ my @temp=split(/\|/,$search->{'class'}); *************** *** 376,383 **** } $i2++; } $dbh->disconnect; ! # $count=$i; return($count, at res2); } --- 423,432 ---- } $i2++; + + } } $dbh->disconnect; ! #$count=$i; return($count, at res2); } *************** *** 1174,1200 **** } ! sub allissues { ! my ($bornum)=@_; ! my $dbh=C4Connect; ! my $query; ! $query="Select * from issues,biblio,items where borrowernumber='$bornum' and ! items.itemnumber=issues.itemnumber and ! items.biblionumber=biblio.biblionumber order ! by date_due"; ! #print $query; ! my $sth=$dbh->prepare($query); ! $sth->execute; ! my @result; ! my $i=0; ! while (my $data=$sth->fetchrow_hashref){ ! $result[$i]=$data;; ! $i++; ! } ! $sth->finish; ! $dbh->disconnect; ! return($i,\@result); } - - sub borrdata2 { --- 1223,1252 ---- } ! sub allissues { ! my ($bornum,$order,$limit)=@_; ! my $dbh=C4Connect; ! my $query; ! $query="Select * from issues,biblio,items,biblioitems ! where borrowernumber='$bornum' and ! items.biblioitemnumber=biblioitems.biblioitemnumber and ! items.itemnumber=issues.itemnumber and ! items.biblionumber=biblio.biblionumber"; ! $query.=" order by $order"; ! if ($limit !=0){ ! $query.=" limit $limit"; ! } ! #print $query; ! my $sth=$dbh->prepare($query); ! $sth->execute; ! my @result; ! my $i=0; ! while (my $data=$sth->fetchrow_hashref){ ! $result[$i]=$data;; ! $i++; ! } ! $sth->finish; ! $dbh->disconnect; ! return($i,\@result); } sub borrdata2 { From rangi at users.sourceforge.net Wed Feb 20 13:06:45 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Wed Feb 20 13:06:45 2002 Subject: [Koha-devel] CVS: koha/C4 Search.pm,1.13,1.14 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv15057/C4 Modified Files: Search.pm Log Message: Making a "fix" to normal title search Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** Search.pm 20 Feb 2002 20:53:29 -0000 1.13 --- Search.pm 20 Feb 2002 21:05:19 -0000 1.14 *************** *** 675,682 **** my $count=@key; my $i=1; ! $query="select * from biblio,bibliosubtitle,biblioitems where ! (biblio.biblionumber=bibliosubtitle.biblionumber and ! biblioitems.biblionumber=biblio.biblionumber) and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; while ($i<$count){ --- 675,683 ---- my $count=@key; my $i=1; ! $query="select * from biblio,biblioitems ! left join bibliosubtitle on ! biblio.biblionumber=bibliosubtitle.biblionumber where ! biblioitems.biblionumber=biblio.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; while ($i<$count){ *************** *** 796,800 **** } } ! #print $query; if ($type ne 'precise' && $type ne 'subject'){ if ($search->{'author'} ne ''){ --- 797,801 ---- } } ! print $query; if ($type ne 'precise' && $type ne 'subject'){ if ($search->{'author'} ne ''){ From rangi at users.sourceforge.net Tue Feb 26 01:07:02 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 26 01:07:02 2002 Subject: [Koha-devel] CVS: koha/acqui basket.pl,1.1.1.1,1.2 Message-ID: Update of /cvsroot/koha/koha/acqui In directory usw-pr-cvs1:/tmp/cvs-serv25553/acqui Modified Files: basket.pl Log Message: Fix for displaying prices Index: basket.pl =================================================================== RCS file: /cvsroot/koha/koha/acqui/basket.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** basket.pl 19 Dec 2000 23:45:56 -0000 1.1.1.1 --- basket.pl 26 Feb 2002 09:06:19 -0000 1.2 *************** *** 15,21 **** print startpage; ! print startmenu('acquisitions'); ! #print $count; my ($count2, at booksellers)=bookseller($results[0]->{'booksellerid'}); --- 15,26 ---- print startpage; ! my @inp=startmenu('acquisitions'); ! my $count3=@inp; ! for (my $i=0;$i<$count3;$i++){ ! $inp[$i]=~ s/leftmargin=0 topmargin=0\>/leftmargin=0 topmargin=0 onload='update(orderform)'\>/; ! } ! print @inp; ! # print $count; my ($count2, at booksellers)=bookseller($results[0]->{'booksellerid'}); *************** *** 25,39 **** Authorised By: $results[0]->{'authorisedby'}
    $results[0]->{'entrydate'}; - ! Shopping Basket For: {'booksellerid'}> $booksellers[0]->{'name'} ! ! {'booksellerid'}&basket=$basket>Add more orders ! !
    -
    ! Search ISBN, Title or Author:

    --- 30,39 ---- Authorised By: $results[0]->{'authorisedby'}
    $results[0]->{'entrydate'}; ! Shopping Basket For: {'booksellerid'}> $booksellers[0]->{'name'} ! {'booksellerid'}&basket=$basket>Add more orders

    ! Search ISBN, Title or Author:

    *************** *** 41,124 **** ! ! ! ! ! printend ; for (my $i=0;$i<$count;$i++){ my $rrp=$results[$i]->{'listprice'}; if ($results[$i]->{'currency'} ne 'NZD'){ ! $rrp=curconvert($results[$i]->{'currency'},$rrp); } - print < ! ! ! ! ! ! ! ! ! {'ordernumber'}> ! {'biblionumber'}> - EOP ; } ! # onchange='update(this.form)'> print ""; print < ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
    ORDERISBNTITLEAUTHORRRP\$ESTQUANTITYTOTAL
    $results[$i]->{'ordernumber'}$results[$i]->{'isbn'}$results[$i]->{'title'}$results[$i]->{'author'}\$\${'quantity'}>\$
    ! HELP
    ! To cancel an order, just change the quantity to 0 and click "save changes".
    ! To change any of the catalogue or accounting information attached to an order, click on the title.
    ! To add new orders to this supplier, start with a search.
    SubTotal\$
    GST\$
    TOTAL\$
    !

    ! ! ! EOP ! ; print endmenu('acquisitions'); --- 41,116 ---- ! ! ! ! ! ! ! ! printend ; + + + my $line_total; # total of each line + my $sub_total; # total of line totals + my $gist; # GST + my $grand_total; # $subttotal + $gist + for (my $i=0;$i<$count;$i++){ my $rrp=$results[$i]->{'listprice'}; if ($results[$i]->{'currency'} ne 'NZD'){ ! $rrp=curconvert($results[$i]->{'currency'},$rrp); } + $line_total=$results[$i]->{'quantity'}*$results[$i]->{'ecost'}; + $sub_total+=$line_total; + $gist=sprintf("%.2f",$sub_total*0.125); + $grand_total=$sub_total+$gist; + print < ! ! ! ! ! ! ! ! ! {'ordernumber'}> ! {'biblionumber'}> EOP ; } ! # print ""; print < + + ! ! ! ! ! ! ! ! ! ! !
    ORDERISBNTITLEAUTHORRRP\$ESTQUANTITYTOTAL
    $results[$i]->{'ordernumber'}$results[$i]->{'isbn'}$results[$i]->{'title'}$results[$i]->{'author'}\$\${'quantity'} onchange='update(this.form)'>\$
    + HELP
    + To cancel an order, just change the quantity to 0 and click "save changes".
    + To change any of the catalogue or accounting information attached to an order, click on the title.
    + To add new orders to this supplier, start with a search.
    SubTotal\$
    GST\$
    TOTAL\$
    !
    EOP ! ; print endmenu('acquisitions'); From rangi at users.sourceforge.net Tue Feb 26 01:32:04 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 26 01:32:04 2002 Subject: [Koha-devel] CVS: koha/C4 Maintainance.pm,1.3,1.4 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv31272/C4 Modified Files: Maintainance.pm Log Message: Fixed apostrophe ' handling Index: Maintainance.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Maintainance.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Maintainance.pm 15 Mar 2001 10:15:51 -0000 1.3 --- Maintainance.pm 26 Feb 2002 09:31:14 -0000 1.4 *************** *** 76,80 **** my ($sub,$oldsub)=@_; my $dbh=C4Connect; ! my $query="update bibliosubject set subject='$sub' where subject='$oldsub'"; my $sth=$dbh->prepare($query); $sth->execute; --- 76,82 ---- my ($sub,$oldsub)=@_; my $dbh=C4Connect; ! $sub=$dbh->quote($sub); ! $oldsub=$dbh->quote($oldsub); ! my $query="update bibliosubject set subject=$sub where subject=$oldsub"; my $sth=$dbh->prepare($query); $sth->execute; From rangi at users.sourceforge.net Tue Feb 26 01:32:04 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 26 01:32:04 2002 Subject: [Koha-devel] CVS: koha/maint catmaintain.pl,1.2,1.3 Message-ID: Update of /cvsroot/koha/koha/maint In directory usw-pr-cvs1:/tmp/cvs-serv31272/maint Modified Files: catmaintain.pl Log Message: Fixed apostrophe ' handling Index: catmaintain.pl =================================================================== RCS file: /cvsroot/koha/koha/maint/catmaintain.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** catmaintain.pl 15 Mar 2001 10:15:51 -0000 1.2 --- catmaintain.pl 26 Feb 2002 09:31:15 -0000 1.3 *************** *** 25,28 **** --- 25,29 ---- my $sub2=$results->[$i]->{'subject'}; $sub2=~ s/ /%20/g; + $sub2=~ s/\'/%27/g; print "\"$results->[$i]->{'subject'}\"
    \n"; } *************** *** 85,88 **** --- 86,90 ---- print ""; print "Show all Titles beginning with
    "; + print "Item Number
    "; print ""; print ""; From paul.poulain at free.fr Thu Feb 28 07:03:49 2002 From: paul.poulain at free.fr (paul POULAIN) Date: Thu Feb 28 07:03:49 2002 Subject: [Koha-devel] Primary key does not exist !!!!!!! Message-ID: <3C7E46A3.4090607@free.fr> Hi everybody, This is my 1st message on this list. I'm a new developper of koha. Coming from france. I've almost a half time job to work on koha to help reaching the 1.2 version, with MARC support. When it will be done, we will use it here, in france, in at least 4 libraries with 80 000 books (christian libraries). Presently I'm working on admin tool to administer avery parameter table. It should be released on CVS soon. My fisrt post is to CRY because of a BIG proble in the DB structure: In most tables there is no primary key defined. On some of them there are indexes, but no pk. It's very, very dirty, ugly, infamous, ridiculous (and every -y or -ous term you could find ;-)) from a theoric point of vue, It's the source of perf caveats, (joins make heavy use of primary key. In fact, almost every "join" are usually on a pk of the right part of the expression) It's the cause of some bugs in a practical point of vue : it's not possible to use "append" sql command, which is VERY practical when you have to store datas (the same form is shares for insert and modify actions...) So, unless there is a very important reason to do so (and I don't know what could be such a reason...), I think a primary key must be defined for every table in the DB... Who can include them in the db schema ? If you want a SQL patch to correct the DB, I should be able to spend a few hours to do it. Note : for a 1st post, it may seem to be very critic. As you will see later, I'm usually a happy man ;-))))) It's just that I've work a lot on many DB (mySQL, Interbase, Informix...) and I'm very surprised with this problem. I don't blame anybody. -- Paul From chris at katipo.co.nz Thu Feb 28 11:07:05 2002 From: chris at katipo.co.nz (Chris Cormack) Date: Thu Feb 28 11:07:05 2002 Subject: [Koha-devel] Re: Primary key does not exist !!!!!!! In-Reply-To: <3C7E46A3.4090607@free.fr> References: <3C7E46A3.4090607@free.fr> Message-ID: <1014923223.11184.61.camel@orbweb> On Fri, 2002-03-01 at 04:02, paul POULAIN wrote: > Hi everybody, > > My fisrt post is to CRY because of a BIG proble in the DB structure: > In most tables there is no primary key defined. > On some of them there are indexes, but no pk. > > It's very, very dirty, ugly, infamous, ridiculous (and every -y or -ous > term you could find ;-)) from a theoric point of vue, > It's the source of perf caveats, (joins make heavy use of primary key. > In fact, almost every "join" are usually on a pk of the right part of > the expression) > It's the cause of some bugs in a practical point of vue : it's not > possible to use "append" sql command, which is VERY practical when you > have to store datas (the same form is shares for insert and modify > actions...) > > So, unless there is a very important reason to do so (and I don't know > what could be such a reason...), I think a primary key must be defined > for every table in the DB... > Yep a very valid point > Who can include them in the db schema ? If you want a SQL patch to > correct the DB, I should be able to spend a few hours to do it. > That would be great > Note : for a 1st post, it may seem to be very critic. As you will see > later, I'm usually a happy man ;-))))) It's just that I've work a lot on > many DB (mySQL, Interbase, Informix...) and I'm very surprised with this > problem. I don't blame anybody. Criticism is good :-) As long as its constructive which this is. It makes better solutions. If having primary keys on every table will give a performance increase thats great. Chris -- Chris Cormack Programmer 025 500 789 Katipo Communications Ltd chris at katipo.co.nz www.katipo.co.nz From nsr4n at tetra.mail.virginia.edu Fri Feb 1 09:31:17 2002 From: nsr4n at tetra.mail.virginia.edu (Nicholas Stephen Rosasco) Date: Fri Feb 1 09:31:17 2002 Subject: [Koha-devel] Question Message-ID: Besides the FAQ, does anyone want more documentation? The install directions, last I looked, were OK. Do we have notes on how to adjust Koha in appearance and for different databases. Also, I've had a question about installing Koha to use a database (MySQL, as I recall) on a seperate server (that is, distinct from the webserver with Koha/Apache installed). Has anyone done this? Also, what is the situation on the MARC enabled release? Last I heard was an "umm, couple of months" in re to someone elses questions. Nick ...willing to help work on the Koha.org page rework that has been mentioned. From tonnesen at cmsd.bc.ca Fri Feb 1 09:39:45 2002 From: tonnesen at cmsd.bc.ca (Tonnesen Steve) Date: Fri Feb 1 09:39:45 2002 Subject: [Koha-devel] Question In-Reply-To: Message-ID: On Fri, 1 Feb 2002, Nicholas Stephen Rosasco wrote: > Besides the FAQ, does anyone want more documentation? > The install directions, last I looked, were OK. > > Do we have notes on how to adjust Koha in appearance and for different > databases. Also, I've had a question about installing Koha to use a > database (MySQL, as I recall) on a seperate server (that is, distinct from > the webserver with Koha/Apache installed). Has anyone done this? Just change the host= line in /etc/koha.conf. That determines where the mysql data is running. Modifying Koha's appearance isn't my cup of tea. Those who saw my first choice of colours for the circulation interface will likely agree! A lot of Koha's appearance can be modified by changing the HTML templates in the htdocs and htdocs/includes directories. > Also, what is the situation on the MARC enabled release? Last I heard was > an "umm, couple of months" in re to someone elses questions. Ummm, couple of months. I'm thinking for the moment I should concentrate on getting a good MARC importer. I have a MARC importer now, but I have had to modify it for every sample of MARC that I've seen. Who said MARC was a standard? :) I've just started working on the Koha 1.2.0 packages again today. I told Chris I'd have a release today. We'll see how it goes. Hopefully my boss doesn't notice me down here. :) Steve. From tonnesen at users.sourceforge.net Fri Feb 1 10:02:12 2002 From: tonnesen at users.sourceforge.net (Steve Tonnesen) Date: Fri Feb 1 10:02:12 2002 Subject: [Koha-devel] CVS: koha/acqui.simple marcimport.pl,1.5,1.6 processz3950queue,1.2,1.3 Message-ID: Update of /cvsroot/koha/koha/acqui.simple In directory usw-pr-cvs1:/tmp/cvs-serv32238/koha/acqui.simple Modified Files: marcimport.pl processz3950queue Log Message: Changes from a long time ago that I don't even remember anymore. :) Index: marcimport.pl =================================================================== RCS file: /cvsroot/koha/koha/acqui.simple/marcimport.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** marcimport.pl 2001/11/06 18:13:59 1.5 --- marcimport.pl 2002/02/01 18:00:28 1.6 *************** *** 829,839 **** ($author) && ($author="by $author"); if ($isbn) { ! print "
  • $title$subtitle $author $donetext
    \n"; } elsif ($lccn) { ! print "
  • $title$subtitle $author $donetext
    \n"; } elsif ($issn) { ! print "
  • $title$subtitle $author
    $donetext\n"; } elsif ($controlnumber) { ! print "
  • $title $author
    $donetext\n"; } else { print "Error: Contact steve regarding $title by $author
    \n"; --- 829,839 ---- ($author) && ($author="by $author"); if ($isbn) { ! print "
  • $title $subtitle $author $donetext
    \n"; } elsif ($lccn) { ! print "
  • $title $subtitle $author $donetext
    \n"; } elsif ($issn) { ! print "
  • $title $subtitle $author
    $donetext\n"; } elsif ($controlnumber) { ! print "
  • $title $subtitle $author
    $donetext\n"; } else { print "Error: Contact steve regarding $title by $author
    \n"; Index: processz3950queue =================================================================== RCS file: /cvsroot/koha/koha/acqui.simple/processz3950queue,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** processz3950queue 2001/11/06 18:13:59 1.2 --- processz3950queue 2002/02/01 18:00:28 1.3 *************** *** 25,29 **** my $now=time(); $stk=$dbh->prepare("select id,server,startdate,enddate,numrecords,active from z3950results where queryid=$id"); ! $stk->execute; my %serverdone; unless ($stk->rows) { --- 25,29 ---- my $now=time(); $stk=$dbh->prepare("select id,server,startdate,enddate,numrecords,active from z3950results where queryid=$id"); ! ($stk->execute) || (next); my %serverdone; unless ($stk->rows) { *************** *** 82,88 **** ($resultsid) = $stj->fetchrow; } else { ! my $stj=$dbi->prepare("insert into z3950results (server, queryid, startdate) values ($q_serverinfo, $id, $now)"); $stj->execute; ! $resultsid=$dbi->{'mysql_insertid'}; } my $stj=$dbh->prepare("update z3950results set active=1 where id=$resultsid"); --- 82,93 ---- ($resultsid) = $stj->fetchrow; } else { ! my $stj=$dbi->prepare("select id from z3950results where server=$q_serverinfo and queryid=$id"); $stj->execute; ! ($resultsid) = $stj->fetchrow; ! unless ($resultsid) { ! my $stj=$dbi->prepare("insert into z3950results (server, queryid, startdate) values ($q_serverinfo, $id, $now)"); ! $stj->execute; ! $resultsid=$dbi->{'mysql_insertid'}; ! } } my $stj=$dbh->prepare("update z3950results set active=1 where id=$resultsid"); *************** *** 90,168 **** my $conn; my $noconnection=0; if ($user) { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database, user => $user, password => $password); }; if ($@) { $noconnection=1; } - pe(); } else { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database); }; if ($@) { $noconnection=1; } - pe(); } ! if ($noconnection) { } else { my $rs=$conn->search($query); - pe(); - $rs->option(preferredRecordSyntax => Net::Z3950::RecordSyntax::USMARC); - pe(); - my $numresults=$rs->size(); pe(); ! my $i; ! my $result=''; ! my $scantimerstart=time(); ! for ($i=1; $i<=(($numresults<80) ? ($numresults) : (80)); $i++) { ! my $rec=$rs->record($i); ! my $marcdata=$rec->rawdata(); ! $result.=$marcdata; ! } ! my $scantimerend=time(); ! my $numrecords; ! ($numresults<80) ? ($numrecords=$numresults) : ($numrecords=80); ! my $elapsed=$scantimerend-$scantimerstart; ! if ($elapsed) { ! my $speed=int($numresults/$elapsed*100)/100; ! print " SPEED: $speed $server done $numrecords\n"; ! } ! my $q_result=$dbi->quote($result); ! ($q_result) || ($q_result='""'); ! $now=time(); ! my $task="update z3950results set numrecords=$numresults,numdownloaded=$numrecords,highestseen=0,results=$q_result,enddate=$now where id=$resultsid"; ! my $stj=$dbi->prepare($task); ! $stj->execute; ! my $counter=0; ! while ($counter<60 && $numrecords<$numresults) { ! $counter++; ! my $stj=$dbi->prepare("select highestseen from z3950results where id=$resultsid"); $stj->execute; ! my ($highestseen) = $stj->fetchrow; ! if ($highestseen>($numrecords-30)) { ! $counter=0; ! print " $server rescanning\n"; ! my $scantimerstart=time(); ! for ($i=$numrecords+1; $i<=(($numresults<($numrecords+40)) ? ($numresults) : ($numrecords+40)); $i++) { ! my $rec=$rs->record($i); ! my $marcdata=$rec->rawdata(); ! $result.=$marcdata; ! } ! my $scantimerend=time(); ! ($numresults<$numrecords+40) ? ($numrecords=$numresults) : ($numrecords=$numrecords+40); ! my $elapsed=$scantimerend-$scantimerstart; ! if ($elapsed) { ! my $speed=int($numresults/$elapsed*100)/100; ! print " SPEED: $speed $server done $numrecords\n"; ! } ! ! my $q_result=$dbi->quote($result); ! ($q_result) || ($q_result='""'); ! $now=time(); ! my $task="update z3950results set numdownloaded=$numrecords,results=$q_result where id=$resultsid"; ! my $stj=$dbi->prepare($task); $stj->execute; } - sleep 5; } } --- 95,181 ---- my $conn; my $noconnection=0; + my $error=0; if ($user) { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database, user => $user, password => $password); }; if ($@) { $noconnection=1; + } else { + $error=pe(); } } else { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database); }; if ($@) { $noconnection=1; + } else { + $error=pe(); } } ! if ($noconnection || $error) { } else { + print "Q: $query\n"; my $rs=$conn->search($query); pe(); ! eval { $rs->option(preferredRecordSyntax => Net::Z3950::RecordSyntax::USMARC);}; ! if ($@) { ! print "ERROR: $@\n"; ! } else { ! pe(); ! my $numresults=$rs->size(); ! pe(); ! my $i; ! my $result=''; ! my $scantimerstart=time(); ! for ($i=1; $i<=(($numresults<80) ? ($numresults) : (80)); $i++) { ! my $rec=$rs->record($i); ! my $marcdata=$rec->rawdata(); ! $result.=$marcdata; ! } ! my $scantimerend=time(); ! my $numrecords; ! ($numresults<80) ? ($numrecords=$numresults) : ($numrecords=80); ! my $elapsed=$scantimerend-$scantimerstart; ! if ($elapsed) { ! my $speed=int($numresults/$elapsed*100)/100; ! print " SPEED: $speed $server done $numrecords\n"; ! } ! my $q_result=$dbi->quote($result); ! ($q_result) || ($q_result='""'); ! $now=time(); ! my $task="update z3950results set numrecords=$numresults,numdownloaded=$numrecords,highestseen=0,results=$q_result,enddate=$now where id=$resultsid"; ! my $stj=$dbi->prepare($task); $stj->execute; ! my $counter=0; ! while ($counter<60 && $numrecords<$numresults) { ! $counter++; ! my $stj=$dbi->prepare("select highestseen from z3950results where id=$resultsid"); $stj->execute; + my ($highestseen) = $stj->fetchrow; + if ($highestseen>($numrecords-30)) { + $counter=0; + print " $server rescanning\n"; + my $scantimerstart=time(); + for ($i=$numrecords+1; $i<=(($numresults<($numrecords+40)) ? ($numresults) : ($numrecords+40)); $i++) { + my $rec=$rs->record($i); + my $marcdata=$rec->rawdata(); + $result.=$marcdata; + } + my $scantimerend=time(); + ($numresults<$numrecords+40) ? ($numrecords=$numresults) : ($numrecords=$numrecords+40); + my $elapsed=$scantimerend-$scantimerstart; + if ($elapsed) { + my $speed=int($numresults/$elapsed*100)/100; + print " SPEED: $speed $server done $numrecords\n"; + } + + my $q_result=$dbi->quote($result); + ($q_result) || ($q_result='""'); + $now=time(); + my $task="update z3950results set numdownloaded=$numrecords,results=$q_result where id=$resultsid"; + my $stj=$dbi->prepare($task); + $stj->execute; + } + sleep 5; } } } *************** *** 174,178 **** exit; sub pe { ! (return) unless ($code); my $code=$conn->errcode(); my $msg=$conn->errmsg(); --- 187,191 ---- exit; sub pe { ! return 0; my $code=$conn->errcode(); my $msg=$conn->errmsg(); *************** *** 184,187 **** --- 197,204 ---- EOF + # if ($msg =~/not yet available/) { + # return 1; + # } + return 0; } } *************** *** 204,208 **** $lastrun=time(); } ! sleep 1; } --- 221,225 ---- $lastrun=time(); } ! sleep 10; } From nsr4n at tetra.mail.virginia.edu Fri Feb 1 10:06:03 2002 From: nsr4n at tetra.mail.virginia.edu (Nicholas Stephen Rosasco) Date: Fri Feb 1 10:06:03 2002 Subject: [Koha-devel] Question In-Reply-To: Message-ID: > Ummm, couple of months. I'm thinking for the moment I should concentrate > on getting a good MARC importer. I have a MARC importer now, but I have > had to modify it for every sample of MARC that I've seen. Who said MARC > was a standard? :) > > I've just started working on the Koha 1.2.0 packages again today. I told > Chris I'd have a release today. We'll see how it goes. Hopefully my boss > doesn't notice me down here. :) Thanks... I think I'm guilty of quoting the LC docs that called it a standard. You can shoot me later. Would more references help? I can start dredging up more info... Nick From tonnesen at cmsd.bc.ca Fri Feb 1 12:59:41 2002 From: tonnesen at cmsd.bc.ca (Tonnesen Steve) Date: Fri Feb 1 12:59:41 2002 Subject: [Koha-devel] Pending release of 1.2.0 Message-ID: I'm working on a release candidate for Koha 1.2.0. I have a working Debian package, and an untested RPM package. I have no redhat machines to test it on. Are there any volunteers? A volunteer who will install the package and report back to me on the multitude of errors that will invariably result would be okay, a volunteer who has a test machine that I can get root access on would be even better. Big caveat: This package still isn't ready for upgrading production systems. New installs of Koha only for the moment. I need to determine what has changed in the database schema so that production systems can be updated properly. Steve. From nsr4n at tetra.mail.virginia.edu Mon Feb 4 10:32:02 2002 From: nsr4n at tetra.mail.virginia.edu (Nicholas Stephen Rosasco) Date: Mon Feb 4 10:32:02 2002 Subject: [Koha-devel] Is this useful? Message-ID: Some of the items listed have been updated recently... http://search.cpan.org/search?mode=module&query=MARC Nick From rangi at users.sourceforge.net Tue Feb 12 13:32:05 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 12 13:32:05 2002 Subject: [Koha-devel] CVS: koha/C4 Search.pm,1.11,1.12 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv28698/C4 Modified Files: Search.pm Log Message: Fixing bug in subject searching that was causing subjects with ' to break the search Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** Search.pm 12 Dec 2001 02:31:28 -0000 1.11 --- Search.pm 12 Feb 2002 21:31:41 -0000 1.12 *************** *** 9,12 **** --- 9,13 ---- use C4::Database; use C4::Reserves2; + use Set::Scalar; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); *************** *** 261,269 **** my $i=1; my @results; my $query ="Select * from biblio,bibliosubtitle,biblioitems where biblio.biblionumber=biblioitems.biblionumber and biblio.biblionumber=bibliosubtitle.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%')"; - while ($i < $count){ $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')"; --- 262,399 ---- my $i=1; my @results; + my $query="Select biblionumber from biblio + where ((title like '$key[0]%' or title like '% $key[0]%')"; + while ($i < $count){ + $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')"; + $i++; + } + $query.= ") or ((biblio.notes like '$key[0]%' or biblio.notes like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.=" and (biblio.notes like '$key[$i]%' or biblio.notes like '% $key[$i]%')"; + } + $query.= ") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')"; + } + $query.=" )"; + # print $query; + my $sth=$dbh->prepare($query); + $sth->execute; + my $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set1=Set::Scalar->new(@results); + $query="Select biblionumber from bibliosubtitle where + ((subtitle like '$key[0]%' or subtitle like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.= " and (subtitle like '$key[$i]%' or subtitle like '% $key[$i]%')"; + } + $query.=" )"; + # print $query; + $sth=$dbh->prepare($query); + $sth->execute; + $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set2=Set::Scalar->new(@results); + if ($i > 0){ + $set1=$set1+$set2; + } + $query ="Select biblionumber from biblioitems where + ((biblioitems.notes like '$key[0]%' or biblioitems.notes like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.=" and (biblioitems.notes like '$key[$i]%' or biblioitems.notes like '% $key[$i]%')"; + } + $query.=" )"; + # print $query; + $sth=$dbh->prepare($query); + $sth->execute; + $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set3=Set::Scalar->new(@results); + if ($i > 0){ + $set1=$set1+$set3; + } + $sth=$dbh->prepare("Select biblionumber from bibliosubject where subject + like '%$search->{'keyword'}%' group by biblionumber"); + $sth->execute; + $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set4=Set::Scalar->new(@results); + if ($i > 0){ + $set1=$set1+$set4; + } + my $i2=0; + my @res2; + my @res = $set1->members; + $count=@res; + # print $set1; + $i=0; + # print "count $count"; + while ($i2 < $num && $i2 < $count){ + my $query="select * from biblio,biblioitems where + biblio.biblionumber='$res[$i2+$offset]' and + biblio.biblionumber=biblioitems.biblionumber"; + if ($search->{'class'} ne ''){ + my @temp=split(/\|/,$search->{'class'}); + my $count=@temp; + $query.= "and ( itemtype='$temp[0]'"; + for (my $i=1;$i<$count;$i++){ + $query.=" or itemtype='$temp[$i]'"; + } + $query.=")"; + } + if ($search->{'dewey'} ne ''){ + $query.= "and (dewey like '$search->{'dewey'}%') "; + } + + my $sth=$dbh->prepare($query); + # print $query; + $sth->execute; + if (my $data2=$sth->fetchrow_hashref){ + my $dewey= $data2->{'dewey'}; + my $subclass=$data2->{'subclass'}; + $dewey=~s/\.*0*$//; + ($dewey == 0) && ($dewey=''); + ($dewey) && ($dewey.=" $subclass") ; + $sth->finish; + $res2[$i]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data2->{'copyrightdate'}\t$dewey"; + $i++; + } + $i2++; + } + $dbh->disconnect; + + # $count=$i; + return($count, at res2); + } + + sub KeywordSearch2 { + my ($env,$type,$search,$num,$offset)=@_; + my $dbh = &C4Connect; + $search->{'keyword'}=~ s/ +$//; + $search->{'keyword'}=~ s/'/\\'/; + my @key=split(' ',$search->{'keyword'}); + my $count=@key; + my $i=1; + my @results; my $query ="Select * from biblio,bibliosubtitle,biblioitems where biblio.biblionumber=biblioitems.biblionumber and biblio.biblionumber=bibliosubtitle.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%')"; while ($i < $count){ $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')"; *************** *** 377,381 **** my @res; my $count=@results; ! $i=0; if ($count > 0){ $res[0]=$results[0]; --- 507,511 ---- my @res; my $count=@results; ! $i=1; if ($count > 0){ $res[0]=$results[0]; *************** *** 399,402 **** --- 529,533 ---- $dbh->disconnect; # $i--; + # $i++; return($i, at res2); } *************** *** 436,441 **** $query=$query.")"; if ($search->{'title'} ne ''){ ! $query=$query. " and (title like '%$search->{'title'}%' ! or seriestitle like '%$search->{'title'}%')"; } if ($search->{'class'} ne ''){ --- 567,593 ---- $query=$query.")"; if ($search->{'title'} ne ''){ ! my @key=split(' ',$search->{'title'}); ! my $count=@key; ! my $i=0; ! $query.= " and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; ! while ($i<$count){ ! $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%' or title like '% $key[$i]')"; ! $i++; ! } ! # $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0] %' or subtitle like '% $key[0]')"; ! # for ($i=1;$i<$count;$i++){ ! # $query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i] %' or subtitle like '% $key[$i]')"; ! # } ! $query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%' or seriestitle like '% $key[0]')"; ! for ($i=1;$i<$count;$i++){ ! $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')"; ! } ! $query.=") or ((unititle like '$key[0]%' or unititle like '% $key[0]%' or unititle like '% $key[0]')"; ! for ($i=1;$i<$count;$i++){ ! $query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i]%')"; ! } ! $query=$query."))"; ! #$query=$query. " and (title like '%$search->{'title'}%' ! #or seriestitle like '%$search->{'title'}%')"; } if ($search->{'class'} ne ''){ *************** *** 483,497 **** $i++; } ! $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0] %' or subtitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i] %' or subtitle like '% $key[$i]')"; } ! $query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0] %' or seriestitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i] %')"; } ! $query.=") or ((unititle like '$key[0]%' or unititle like '% $key[0] %' or unititle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i] %')"; } $query=$query."))"; --- 635,649 ---- $i++; } ! $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0]%' or subtitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i]%' or subtitle like '% $key[$i]')"; } ! $query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%' or seriestitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')"; } ! $query.=") or ((unititle like '$key[0]%' or unititle like '% $key[0]%' or unititle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i]%')"; } $query=$query."))"; *************** *** 537,541 **** and biblioitems.illus like '%".$search->{'illustrator'}."%'"; } ! } $query .=" group by biblio.biblionumber"; } --- 689,693 ---- and biblioitems.illus like '%".$search->{'illustrator'}."%'"; } ! } $query .=" group by biblio.biblionumber"; } *************** *** 607,610 **** --- 759,763 ---- } } + #print $query; my $sth=$dbh->prepare($query); $sth->execute; *************** *** 648,654 **** my ($env,$subject)=@_; my $dbh=C4Connect(); my $query="Select * from biblio,bibliosubject where biblio.biblionumber=bibliosubject.biblionumber and ! bibliosubject.subject='$subject' group by biblio.biblionumber order by biblio.title"; my $sth=$dbh->prepare($query); --- 801,808 ---- my ($env,$subject)=@_; my $dbh=C4Connect(); + $subject=$dbh->quote($subject); my $query="Select * from biblio,bibliosubject where biblio.biblionumber=bibliosubject.biblionumber and ! bibliosubject.subject=$subject group by biblio.biblionumber order by biblio.title"; my $sth=$dbh->prepare($query); *************** *** 721,725 **** $dewey=~ s/\.$//; $class = $class.$dewey; ! $class = $class.$data->{'subclass'}; # $results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$data->{'dewey'}"; my @temp=split('-',$data->{'datelastseen'}); --- 875,881 ---- $dewey=~ s/\.$//; $class = $class.$dewey; ! if ($dewey ne ''){ ! $class = $class.$data->{'subclass'}; ! } # $results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$data->{'dewey'}"; my @temp=split('-',$data->{'datelastseen'}); *************** *** 791,795 **** my ($bibnum,$type)=@_; my $dbh=C4Connect; ! my $query="Select *,biblio.notes from biblio,biblioitems,bibliosubtitle where biblio.biblionumber=$bibnum and biblioitems.biblionumber=$bibnum and (bibliosubtitle.biblionumber=$bibnum)"; --- 947,951 ---- my ($bibnum,$type)=@_; my $dbh=C4Connect; ! my $query="Select *,biblio.notes from biblio,biblioitems,bibliosubtitle where biblio.biblionumber=$bibnum and biblioitems.biblionumber=$bibnum and (bibliosubtitle.biblionumber=$bibnum)"; *************** *** 815,819 **** my ($bibitem)=@_; my $dbh=C4Connect; ! my $query="Select * from biblio,biblioitems,itemtypes where biblio.biblionumber= biblioitems.biblionumber and biblioitemnumber=$bibitem and biblioitems.itemtype=itemtypes.itemtype"; --- 971,975 ---- my ($bibitem)=@_; my $dbh=C4Connect; ! my $query="Select *,biblioitems.notes as bnotes from biblio,biblioitems,itemtypes where biblio.biblionumber= biblioitems.biblionumber and biblioitemnumber=$bibitem and biblioitems.itemtype=itemtypes.itemtype"; From rangi at users.sourceforge.net Tue Feb 12 13:39:17 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 12 13:39:17 2002 Subject: [Koha-devel] CVS: koha updatebibitem.pl,1.2,1.3 Message-ID: Update of /cvsroot/koha/koha In directory usw-pr-cvs1:/tmp/cvs-serv21412 Modified Files: updatebibitem.pl Log Message: Fixing bug that was duplicating additional authors, and a bug that was breaking the updating classicification field Index: updatebibitem.pl =================================================================== RCS file: /cvsroot/koha/koha/updatebibitem.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** updatebibitem.pl 10 Oct 2001 19:27:00 -0000 1.2 --- updatebibitem.pl 12 Feb 2002 21:07:53 -0000 1.3 *************** *** 10,14 **** my $input= new CGI; #print $input->header; ! #print $input->dump; --- 10,14 ---- my $input= new CGI; #print $input->header; ! #print $input->Dump; *************** *** 41,45 **** }else{ $dewey=''; ! $subclass=$class; } my $illus=checkinp($input->param('Illustrations')); --- 41,45 ---- }else{ $dewey=''; ! $subclass=''; } my $illus=checkinp($input->param('Illustrations')); From rangi at users.sourceforge.net Tue Feb 12 13:40:08 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 12 13:40:08 2002 Subject: [Koha-devel] CVS: koha/C4 Acquisitions.pm,1.1.1.1,1.2 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv21412/C4 Modified Files: Acquisitions.pm Log Message: Fixing bug that was duplicating additional authors, and a bug that was breaking the updating classicification field From paul.poulain at free.fr Thu Feb 14 06:30:26 2002 From: paul.poulain at free.fr (paul POULAIN) Date: Thu Feb 14 06:30:26 2002 Subject: [Koha-devel] Re: [Koha] Pending release of 1.2.0 References: Message-ID: <3C6BCA4F.8000102@free.fr> Tonnesen Steve wrote: >I'm working on a release candidate for Koha 1.2.0. I have a working >Debian package, and an untested RPM package. I have no redhat machines to >test it on. Are there any volunteers? A volunteer who will install the >package and report back to me on the multitude of errors that will >invariably result would be okay, a volunteer who has a test machine that I >can get root access on would be even better. > >Big caveat: > >This package still isn't ready for upgrading production systems. New >installs of Koha only for the moment. I need to determine what has >changed in the database schema so that production systems can be updated >properly. > I've a mandrake runnning machine, so I can test the RPM package. I've no production running machine (just a test installation), and a root access, as it's my desk-PC. If the package is less than 5mb, you can mail it to me. Question : what's new in the 1.2.0 ? -- Paul From rangi at users.sourceforge.net Wed Feb 20 12:56:09 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Wed Feb 20 12:56:09 2002 Subject: [Koha-devel] CVS: koha/C4 Search.pm,1.12,1.13 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv10405/C4 Modified Files: Search.pm Log Message: Playing with keyword search trying to speed it up more Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** Search.pm 12 Feb 2002 21:31:41 -0000 1.12 --- Search.pm 20 Feb 2002 20:53:29 -0000 1.13 *************** *** 339,342 **** --- 339,345 ---- } my $i2=0; + my $i3=0; + my $i4=0; + my @res2; my @res = $set1->members; *************** *** 345,352 **** $i=0; # print "count $count"; while ($i2 < $num && $i2 < $count){ my $query="select * from biblio,biblioitems where biblio.biblionumber='$res[$i2+$offset]' and ! biblio.biblionumber=biblioitems.biblionumber"; if ($search->{'class'} ne ''){ my @temp=split(/\|/,$search->{'class'}); --- 348,399 ---- $i=0; # print "count $count"; + if ($search->{'class'} ne ''){ + while ($i2 <$count){ + my $query="select * from biblio,biblioitems where + biblio.biblionumber='$res[$i2]' and + biblio.biblionumber=biblioitems.biblionumber "; + if ($search->{'class'} ne ''){ + my @temp=split(/\|/,$search->{'class'}); + my $count=@temp; + $query.= "and ( itemtype='$temp[0]'"; + for (my $i=1;$i<$count;$i++){ + $query.=" or itemtype='$temp[$i]'"; + } + $query.=")"; + } + my $sth=$dbh->prepare($query); + # print $query; + $sth->execute; + if (my $data2=$sth->fetchrow_hashref){ + my $dewey= $data2->{'dewey'}; + my $subclass=$data2->{'subclass'}; + $dewey=~s/\.*0*$//; + ($dewey == 0) && ($dewey=''); + ($dewey) && ($dewey.=" $subclass") ; + $sth->finish; + my $end=$offset +$num; + if ($i4 <= $offset){ + $i4++; + } + # print $i4; + if ($i4 <=$end && $i4 > $offset){ + $res2[$i3]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data2->{'copyrightdate'}\t$dewey"; + $i3++; + $i4++; + # print "in here $i3
    "; + } else { + # print $end; + } + $i++; + } + $i2++; + } + $count=$i; + + } else { while ($i2 < $num && $i2 < $count){ my $query="select * from biblio,biblioitems where biblio.biblionumber='$res[$i2+$offset]' and ! biblio.biblionumber=biblioitems.biblionumber "; if ($search->{'class'} ne ''){ my @temp=split(/\|/,$search->{'class'}); *************** *** 376,383 **** } $i2++; } $dbh->disconnect; ! # $count=$i; return($count, at res2); } --- 423,432 ---- } $i2++; + + } } $dbh->disconnect; ! #$count=$i; return($count, at res2); } *************** *** 1174,1200 **** } ! sub allissues { ! my ($bornum)=@_; ! my $dbh=C4Connect; ! my $query; ! $query="Select * from issues,biblio,items where borrowernumber='$bornum' and ! items.itemnumber=issues.itemnumber and ! items.biblionumber=biblio.biblionumber order ! by date_due"; ! #print $query; ! my $sth=$dbh->prepare($query); ! $sth->execute; ! my @result; ! my $i=0; ! while (my $data=$sth->fetchrow_hashref){ ! $result[$i]=$data;; ! $i++; ! } ! $sth->finish; ! $dbh->disconnect; ! return($i,\@result); } - - sub borrdata2 { --- 1223,1252 ---- } ! sub allissues { ! my ($bornum,$order,$limit)=@_; ! my $dbh=C4Connect; ! my $query; ! $query="Select * from issues,biblio,items,biblioitems ! where borrowernumber='$bornum' and ! items.biblioitemnumber=biblioitems.biblioitemnumber and ! items.itemnumber=issues.itemnumber and ! items.biblionumber=biblio.biblionumber"; ! $query.=" order by $order"; ! if ($limit !=0){ ! $query.=" limit $limit"; ! } ! #print $query; ! my $sth=$dbh->prepare($query); ! $sth->execute; ! my @result; ! my $i=0; ! while (my $data=$sth->fetchrow_hashref){ ! $result[$i]=$data;; ! $i++; ! } ! $sth->finish; ! $dbh->disconnect; ! return($i,\@result); } sub borrdata2 { From rangi at users.sourceforge.net Wed Feb 20 13:06:45 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Wed Feb 20 13:06:45 2002 Subject: [Koha-devel] CVS: koha/C4 Search.pm,1.13,1.14 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv15057/C4 Modified Files: Search.pm Log Message: Making a "fix" to normal title search Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** Search.pm 20 Feb 2002 20:53:29 -0000 1.13 --- Search.pm 20 Feb 2002 21:05:19 -0000 1.14 *************** *** 675,682 **** my $count=@key; my $i=1; ! $query="select * from biblio,bibliosubtitle,biblioitems where ! (biblio.biblionumber=bibliosubtitle.biblionumber and ! biblioitems.biblionumber=biblio.biblionumber) and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; while ($i<$count){ --- 675,683 ---- my $count=@key; my $i=1; ! $query="select * from biblio,biblioitems ! left join bibliosubtitle on ! biblio.biblionumber=bibliosubtitle.biblionumber where ! biblioitems.biblionumber=biblio.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; while ($i<$count){ *************** *** 796,800 **** } } ! #print $query; if ($type ne 'precise' && $type ne 'subject'){ if ($search->{'author'} ne ''){ --- 797,801 ---- } } ! print $query; if ($type ne 'precise' && $type ne 'subject'){ if ($search->{'author'} ne ''){ From rangi at users.sourceforge.net Tue Feb 26 01:07:02 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 26 01:07:02 2002 Subject: [Koha-devel] CVS: koha/acqui basket.pl,1.1.1.1,1.2 Message-ID: Update of /cvsroot/koha/koha/acqui In directory usw-pr-cvs1:/tmp/cvs-serv25553/acqui Modified Files: basket.pl Log Message: Fix for displaying prices Index: basket.pl =================================================================== RCS file: /cvsroot/koha/koha/acqui/basket.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** basket.pl 19 Dec 2000 23:45:56 -0000 1.1.1.1 --- basket.pl 26 Feb 2002 09:06:19 -0000 1.2 *************** *** 15,21 **** print startpage; ! print startmenu('acquisitions'); ! #print $count; my ($count2, at booksellers)=bookseller($results[0]->{'booksellerid'}); --- 15,26 ---- print startpage; ! my @inp=startmenu('acquisitions'); ! my $count3=@inp; ! for (my $i=0;$i<$count3;$i++){ ! $inp[$i]=~ s/leftmargin=0 topmargin=0\>/leftmargin=0 topmargin=0 onload='update(orderform)'\>/; ! } ! print @inp; ! # print $count; my ($count2, at booksellers)=bookseller($results[0]->{'booksellerid'}); *************** *** 25,39 **** Authorised By: $results[0]->{'authorisedby'}
    $results[0]->{'entrydate'}; - ! Shopping Basket For: {'booksellerid'}> $booksellers[0]->{'name'} ! ! {'booksellerid'}&basket=$basket>Add more orders ! !
    -
    ! Search ISBN, Title or Author:

    --- 30,39 ---- Authorised By: $results[0]->{'authorisedby'}
    $results[0]->{'entrydate'}; ! Shopping Basket For: {'booksellerid'}> $booksellers[0]->{'name'} ! {'booksellerid'}&basket=$basket>Add more orders

    ! Search ISBN, Title or Author:

    *************** *** 41,124 **** ! ! ! ! ! printend ; for (my $i=0;$i<$count;$i++){ my $rrp=$results[$i]->{'listprice'}; if ($results[$i]->{'currency'} ne 'NZD'){ ! $rrp=curconvert($results[$i]->{'currency'},$rrp); } - print < ! ! ! ! ! ! ! ! ! {'ordernumber'}> ! {'biblionumber'}> - EOP ; } ! # onchange='update(this.form)'> print ""; print < ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
    ORDERISBNTITLEAUTHORRRP\$ESTQUANTITYTOTAL
    $results[$i]->{'ordernumber'}$results[$i]->{'isbn'}$results[$i]->{'title'}$results[$i]->{'author'}\$\${'quantity'}>\$
    ! HELP
    ! To cancel an order, just change the quantity to 0 and click "save changes".
    ! To change any of the catalogue or accounting information attached to an order, click on the title.
    ! To add new orders to this supplier, start with a search.
    SubTotal\$
    GST\$
    TOTAL\$
    !

    ! ! ! EOP ! ; print endmenu('acquisitions'); --- 41,116 ---- ! ! ! ! ! ! ! ! printend ; + + + my $line_total; # total of each line + my $sub_total; # total of line totals + my $gist; # GST + my $grand_total; # $subttotal + $gist + for (my $i=0;$i<$count;$i++){ my $rrp=$results[$i]->{'listprice'}; if ($results[$i]->{'currency'} ne 'NZD'){ ! $rrp=curconvert($results[$i]->{'currency'},$rrp); } + $line_total=$results[$i]->{'quantity'}*$results[$i]->{'ecost'}; + $sub_total+=$line_total; + $gist=sprintf("%.2f",$sub_total*0.125); + $grand_total=$sub_total+$gist; + print < ! ! ! ! ! ! ! ! ! {'ordernumber'}> ! {'biblionumber'}> EOP ; } ! # print ""; print < + + ! ! ! ! ! ! ! ! ! ! !
    ORDERISBNTITLEAUTHORRRP\$ESTQUANTITYTOTAL
    $results[$i]->{'ordernumber'}$results[$i]->{'isbn'}$results[$i]->{'title'}$results[$i]->{'author'}\$\${'quantity'} onchange='update(this.form)'>\$
    + HELP
    + To cancel an order, just change the quantity to 0 and click "save changes".
    + To change any of the catalogue or accounting information attached to an order, click on the title.
    + To add new orders to this supplier, start with a search.
    SubTotal\$
    GST\$
    TOTAL\$
    !
    EOP ! ; print endmenu('acquisitions'); From rangi at users.sourceforge.net Tue Feb 26 01:32:04 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 26 01:32:04 2002 Subject: [Koha-devel] CVS: koha/C4 Maintainance.pm,1.3,1.4 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv31272/C4 Modified Files: Maintainance.pm Log Message: Fixed apostrophe ' handling Index: Maintainance.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Maintainance.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Maintainance.pm 15 Mar 2001 10:15:51 -0000 1.3 --- Maintainance.pm 26 Feb 2002 09:31:14 -0000 1.4 *************** *** 76,80 **** my ($sub,$oldsub)=@_; my $dbh=C4Connect; ! my $query="update bibliosubject set subject='$sub' where subject='$oldsub'"; my $sth=$dbh->prepare($query); $sth->execute; --- 76,82 ---- my ($sub,$oldsub)=@_; my $dbh=C4Connect; ! $sub=$dbh->quote($sub); ! $oldsub=$dbh->quote($oldsub); ! my $query="update bibliosubject set subject=$sub where subject=$oldsub"; my $sth=$dbh->prepare($query); $sth->execute; From rangi at users.sourceforge.net Tue Feb 26 01:32:04 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 26 01:32:04 2002 Subject: [Koha-devel] CVS: koha/maint catmaintain.pl,1.2,1.3 Message-ID: Update of /cvsroot/koha/koha/maint In directory usw-pr-cvs1:/tmp/cvs-serv31272/maint Modified Files: catmaintain.pl Log Message: Fixed apostrophe ' handling Index: catmaintain.pl =================================================================== RCS file: /cvsroot/koha/koha/maint/catmaintain.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** catmaintain.pl 15 Mar 2001 10:15:51 -0000 1.2 --- catmaintain.pl 26 Feb 2002 09:31:15 -0000 1.3 *************** *** 25,28 **** --- 25,29 ---- my $sub2=$results->[$i]->{'subject'}; $sub2=~ s/ /%20/g; + $sub2=~ s/\'/%27/g; print "\"$results->[$i]->{'subject'}\"
    \n"; } *************** *** 85,88 **** --- 86,90 ---- print ""; print "Show all Titles beginning with
    "; + print "Item Number
    "; print ""; print ""; From paul.poulain at free.fr Thu Feb 28 07:03:49 2002 From: paul.poulain at free.fr (paul POULAIN) Date: Thu Feb 28 07:03:49 2002 Subject: [Koha-devel] Primary key does not exist !!!!!!! Message-ID: <3C7E46A3.4090607@free.fr> Hi everybody, This is my 1st message on this list. I'm a new developper of koha. Coming from france. I've almost a half time job to work on koha to help reaching the 1.2 version, with MARC support. When it will be done, we will use it here, in france, in at least 4 libraries with 80 000 books (christian libraries). Presently I'm working on admin tool to administer avery parameter table. It should be released on CVS soon. My fisrt post is to CRY because of a BIG proble in the DB structure: In most tables there is no primary key defined. On some of them there are indexes, but no pk. It's very, very dirty, ugly, infamous, ridiculous (and every -y or -ous term you could find ;-)) from a theoric point of vue, It's the source of perf caveats, (joins make heavy use of primary key. In fact, almost every "join" are usually on a pk of the right part of the expression) It's the cause of some bugs in a practical point of vue : it's not possible to use "append" sql command, which is VERY practical when you have to store datas (the same form is shares for insert and modify actions...) So, unless there is a very important reason to do so (and I don't know what could be such a reason...), I think a primary key must be defined for every table in the DB... Who can include them in the db schema ? If you want a SQL patch to correct the DB, I should be able to spend a few hours to do it. Note : for a 1st post, it may seem to be very critic. As you will see later, I'm usually a happy man ;-))))) It's just that I've work a lot on many DB (mySQL, Interbase, Informix...) and I'm very surprised with this problem. I don't blame anybody. -- Paul From chris at katipo.co.nz Thu Feb 28 11:07:05 2002 From: chris at katipo.co.nz (Chris Cormack) Date: Thu Feb 28 11:07:05 2002 Subject: [Koha-devel] Re: Primary key does not exist !!!!!!! In-Reply-To: <3C7E46A3.4090607@free.fr> References: <3C7E46A3.4090607@free.fr> Message-ID: <1014923223.11184.61.camel@orbweb> On Fri, 2002-03-01 at 04:02, paul POULAIN wrote: > Hi everybody, > > My fisrt post is to CRY because of a BIG proble in the DB structure: > In most tables there is no primary key defined. > On some of them there are indexes, but no pk. > > It's very, very dirty, ugly, infamous, ridiculous (and every -y or -ous > term you could find ;-)) from a theoric point of vue, > It's the source of perf caveats, (joins make heavy use of primary key. > In fact, almost every "join" are usually on a pk of the right part of > the expression) > It's the cause of some bugs in a practical point of vue : it's not > possible to use "append" sql command, which is VERY practical when you > have to store datas (the same form is shares for insert and modify > actions...) > > So, unless there is a very important reason to do so (and I don't know > what could be such a reason...), I think a primary key must be defined > for every table in the DB... > Yep a very valid point > Who can include them in the db schema ? If you want a SQL patch to > correct the DB, I should be able to spend a few hours to do it. > That would be great > Note : for a 1st post, it may seem to be very critic. As you will see > later, I'm usually a happy man ;-))))) It's just that I've work a lot on > many DB (mySQL, Interbase, Informix...) and I'm very surprised with this > problem. I don't blame anybody. Criticism is good :-) As long as its constructive which this is. It makes better solutions. If having primary keys on every table will give a performance increase thats great. Chris -- Chris Cormack Programmer 025 500 789 Katipo Communications Ltd chris at katipo.co.nz www.katipo.co.nz From nsr4n at tetra.mail.virginia.edu Fri Feb 1 09:31:17 2002 From: nsr4n at tetra.mail.virginia.edu (Nicholas Stephen Rosasco) Date: Fri Feb 1 09:31:17 2002 Subject: [Koha-devel] Question Message-ID: Besides the FAQ, does anyone want more documentation? The install directions, last I looked, were OK. Do we have notes on how to adjust Koha in appearance and for different databases. Also, I've had a question about installing Koha to use a database (MySQL, as I recall) on a seperate server (that is, distinct from the webserver with Koha/Apache installed). Has anyone done this? Also, what is the situation on the MARC enabled release? Last I heard was an "umm, couple of months" in re to someone elses questions. Nick ...willing to help work on the Koha.org page rework that has been mentioned. From tonnesen at cmsd.bc.ca Fri Feb 1 09:39:45 2002 From: tonnesen at cmsd.bc.ca (Tonnesen Steve) Date: Fri Feb 1 09:39:45 2002 Subject: [Koha-devel] Question In-Reply-To: Message-ID: On Fri, 1 Feb 2002, Nicholas Stephen Rosasco wrote: > Besides the FAQ, does anyone want more documentation? > The install directions, last I looked, were OK. > > Do we have notes on how to adjust Koha in appearance and for different > databases. Also, I've had a question about installing Koha to use a > database (MySQL, as I recall) on a seperate server (that is, distinct from > the webserver with Koha/Apache installed). Has anyone done this? Just change the host= line in /etc/koha.conf. That determines where the mysql data is running. Modifying Koha's appearance isn't my cup of tea. Those who saw my first choice of colours for the circulation interface will likely agree! A lot of Koha's appearance can be modified by changing the HTML templates in the htdocs and htdocs/includes directories. > Also, what is the situation on the MARC enabled release? Last I heard was > an "umm, couple of months" in re to someone elses questions. Ummm, couple of months. I'm thinking for the moment I should concentrate on getting a good MARC importer. I have a MARC importer now, but I have had to modify it for every sample of MARC that I've seen. Who said MARC was a standard? :) I've just started working on the Koha 1.2.0 packages again today. I told Chris I'd have a release today. We'll see how it goes. Hopefully my boss doesn't notice me down here. :) Steve. From tonnesen at users.sourceforge.net Fri Feb 1 10:02:12 2002 From: tonnesen at users.sourceforge.net (Steve Tonnesen) Date: Fri Feb 1 10:02:12 2002 Subject: [Koha-devel] CVS: koha/acqui.simple marcimport.pl,1.5,1.6 processz3950queue,1.2,1.3 Message-ID: Update of /cvsroot/koha/koha/acqui.simple In directory usw-pr-cvs1:/tmp/cvs-serv32238/koha/acqui.simple Modified Files: marcimport.pl processz3950queue Log Message: Changes from a long time ago that I don't even remember anymore. :) Index: marcimport.pl =================================================================== RCS file: /cvsroot/koha/koha/acqui.simple/marcimport.pl,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -r1.5 -r1.6 *** marcimport.pl 2001/11/06 18:13:59 1.5 --- marcimport.pl 2002/02/01 18:00:28 1.6 *************** *** 829,839 **** ($author) && ($author="by $author"); if ($isbn) { ! print "
  • $title$subtitle $author $donetext
    \n"; } elsif ($lccn) { ! print "
  • $title$subtitle $author $donetext
    \n"; } elsif ($issn) { ! print "
  • $title$subtitle $author
    $donetext\n"; } elsif ($controlnumber) { ! print "
  • $title $author
    $donetext\n"; } else { print "Error: Contact steve regarding $title by $author
    \n"; --- 829,839 ---- ($author) && ($author="by $author"); if ($isbn) { ! print "
  • $title $subtitle $author $donetext
    \n"; } elsif ($lccn) { ! print "
  • $title $subtitle $author $donetext
    \n"; } elsif ($issn) { ! print "
  • $title $subtitle $author
    $donetext\n"; } elsif ($controlnumber) { ! print "
  • $title $subtitle $author
    $donetext\n"; } else { print "Error: Contact steve regarding $title by $author
    \n"; Index: processz3950queue =================================================================== RCS file: /cvsroot/koha/koha/acqui.simple/processz3950queue,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** processz3950queue 2001/11/06 18:13:59 1.2 --- processz3950queue 2002/02/01 18:00:28 1.3 *************** *** 25,29 **** my $now=time(); $stk=$dbh->prepare("select id,server,startdate,enddate,numrecords,active from z3950results where queryid=$id"); ! $stk->execute; my %serverdone; unless ($stk->rows) { --- 25,29 ---- my $now=time(); $stk=$dbh->prepare("select id,server,startdate,enddate,numrecords,active from z3950results where queryid=$id"); ! ($stk->execute) || (next); my %serverdone; unless ($stk->rows) { *************** *** 82,88 **** ($resultsid) = $stj->fetchrow; } else { ! my $stj=$dbi->prepare("insert into z3950results (server, queryid, startdate) values ($q_serverinfo, $id, $now)"); $stj->execute; ! $resultsid=$dbi->{'mysql_insertid'}; } my $stj=$dbh->prepare("update z3950results set active=1 where id=$resultsid"); --- 82,93 ---- ($resultsid) = $stj->fetchrow; } else { ! my $stj=$dbi->prepare("select id from z3950results where server=$q_serverinfo and queryid=$id"); $stj->execute; ! ($resultsid) = $stj->fetchrow; ! unless ($resultsid) { ! my $stj=$dbi->prepare("insert into z3950results (server, queryid, startdate) values ($q_serverinfo, $id, $now)"); ! $stj->execute; ! $resultsid=$dbi->{'mysql_insertid'}; ! } } my $stj=$dbh->prepare("update z3950results set active=1 where id=$resultsid"); *************** *** 90,168 **** my $conn; my $noconnection=0; if ($user) { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database, user => $user, password => $password); }; if ($@) { $noconnection=1; } - pe(); } else { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database); }; if ($@) { $noconnection=1; } - pe(); } ! if ($noconnection) { } else { my $rs=$conn->search($query); - pe(); - $rs->option(preferredRecordSyntax => Net::Z3950::RecordSyntax::USMARC); - pe(); - my $numresults=$rs->size(); pe(); ! my $i; ! my $result=''; ! my $scantimerstart=time(); ! for ($i=1; $i<=(($numresults<80) ? ($numresults) : (80)); $i++) { ! my $rec=$rs->record($i); ! my $marcdata=$rec->rawdata(); ! $result.=$marcdata; ! } ! my $scantimerend=time(); ! my $numrecords; ! ($numresults<80) ? ($numrecords=$numresults) : ($numrecords=80); ! my $elapsed=$scantimerend-$scantimerstart; ! if ($elapsed) { ! my $speed=int($numresults/$elapsed*100)/100; ! print " SPEED: $speed $server done $numrecords\n"; ! } ! my $q_result=$dbi->quote($result); ! ($q_result) || ($q_result='""'); ! $now=time(); ! my $task="update z3950results set numrecords=$numresults,numdownloaded=$numrecords,highestseen=0,results=$q_result,enddate=$now where id=$resultsid"; ! my $stj=$dbi->prepare($task); ! $stj->execute; ! my $counter=0; ! while ($counter<60 && $numrecords<$numresults) { ! $counter++; ! my $stj=$dbi->prepare("select highestseen from z3950results where id=$resultsid"); $stj->execute; ! my ($highestseen) = $stj->fetchrow; ! if ($highestseen>($numrecords-30)) { ! $counter=0; ! print " $server rescanning\n"; ! my $scantimerstart=time(); ! for ($i=$numrecords+1; $i<=(($numresults<($numrecords+40)) ? ($numresults) : ($numrecords+40)); $i++) { ! my $rec=$rs->record($i); ! my $marcdata=$rec->rawdata(); ! $result.=$marcdata; ! } ! my $scantimerend=time(); ! ($numresults<$numrecords+40) ? ($numrecords=$numresults) : ($numrecords=$numrecords+40); ! my $elapsed=$scantimerend-$scantimerstart; ! if ($elapsed) { ! my $speed=int($numresults/$elapsed*100)/100; ! print " SPEED: $speed $server done $numrecords\n"; ! } ! ! my $q_result=$dbi->quote($result); ! ($q_result) || ($q_result='""'); ! $now=time(); ! my $task="update z3950results set numdownloaded=$numrecords,results=$q_result where id=$resultsid"; ! my $stj=$dbi->prepare($task); $stj->execute; } - sleep 5; } } --- 95,181 ---- my $conn; my $noconnection=0; + my $error=0; if ($user) { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database, user => $user, password => $password); }; if ($@) { $noconnection=1; + } else { + $error=pe(); } } else { eval { $conn= new Net::Z3950::Connection($servername, $port, databaseName => $database); }; if ($@) { $noconnection=1; + } else { + $error=pe(); } } ! if ($noconnection || $error) { } else { + print "Q: $query\n"; my $rs=$conn->search($query); pe(); ! eval { $rs->option(preferredRecordSyntax => Net::Z3950::RecordSyntax::USMARC);}; ! if ($@) { ! print "ERROR: $@\n"; ! } else { ! pe(); ! my $numresults=$rs->size(); ! pe(); ! my $i; ! my $result=''; ! my $scantimerstart=time(); ! for ($i=1; $i<=(($numresults<80) ? ($numresults) : (80)); $i++) { ! my $rec=$rs->record($i); ! my $marcdata=$rec->rawdata(); ! $result.=$marcdata; ! } ! my $scantimerend=time(); ! my $numrecords; ! ($numresults<80) ? ($numrecords=$numresults) : ($numrecords=80); ! my $elapsed=$scantimerend-$scantimerstart; ! if ($elapsed) { ! my $speed=int($numresults/$elapsed*100)/100; ! print " SPEED: $speed $server done $numrecords\n"; ! } ! my $q_result=$dbi->quote($result); ! ($q_result) || ($q_result='""'); ! $now=time(); ! my $task="update z3950results set numrecords=$numresults,numdownloaded=$numrecords,highestseen=0,results=$q_result,enddate=$now where id=$resultsid"; ! my $stj=$dbi->prepare($task); $stj->execute; ! my $counter=0; ! while ($counter<60 && $numrecords<$numresults) { ! $counter++; ! my $stj=$dbi->prepare("select highestseen from z3950results where id=$resultsid"); $stj->execute; + my ($highestseen) = $stj->fetchrow; + if ($highestseen>($numrecords-30)) { + $counter=0; + print " $server rescanning\n"; + my $scantimerstart=time(); + for ($i=$numrecords+1; $i<=(($numresults<($numrecords+40)) ? ($numresults) : ($numrecords+40)); $i++) { + my $rec=$rs->record($i); + my $marcdata=$rec->rawdata(); + $result.=$marcdata; + } + my $scantimerend=time(); + ($numresults<$numrecords+40) ? ($numrecords=$numresults) : ($numrecords=$numrecords+40); + my $elapsed=$scantimerend-$scantimerstart; + if ($elapsed) { + my $speed=int($numresults/$elapsed*100)/100; + print " SPEED: $speed $server done $numrecords\n"; + } + + my $q_result=$dbi->quote($result); + ($q_result) || ($q_result='""'); + $now=time(); + my $task="update z3950results set numdownloaded=$numrecords,results=$q_result where id=$resultsid"; + my $stj=$dbi->prepare($task); + $stj->execute; + } + sleep 5; } } } *************** *** 174,178 **** exit; sub pe { ! (return) unless ($code); my $code=$conn->errcode(); my $msg=$conn->errmsg(); --- 187,191 ---- exit; sub pe { ! return 0; my $code=$conn->errcode(); my $msg=$conn->errmsg(); *************** *** 184,187 **** --- 197,204 ---- EOF + # if ($msg =~/not yet available/) { + # return 1; + # } + return 0; } } *************** *** 204,208 **** $lastrun=time(); } ! sleep 1; } --- 221,225 ---- $lastrun=time(); } ! sleep 10; } From nsr4n at tetra.mail.virginia.edu Fri Feb 1 10:06:03 2002 From: nsr4n at tetra.mail.virginia.edu (Nicholas Stephen Rosasco) Date: Fri Feb 1 10:06:03 2002 Subject: [Koha-devel] Question In-Reply-To: Message-ID: > Ummm, couple of months. I'm thinking for the moment I should concentrate > on getting a good MARC importer. I have a MARC importer now, but I have > had to modify it for every sample of MARC that I've seen. Who said MARC > was a standard? :) > > I've just started working on the Koha 1.2.0 packages again today. I told > Chris I'd have a release today. We'll see how it goes. Hopefully my boss > doesn't notice me down here. :) Thanks... I think I'm guilty of quoting the LC docs that called it a standard. You can shoot me later. Would more references help? I can start dredging up more info... Nick From tonnesen at cmsd.bc.ca Fri Feb 1 12:59:41 2002 From: tonnesen at cmsd.bc.ca (Tonnesen Steve) Date: Fri Feb 1 12:59:41 2002 Subject: [Koha-devel] Pending release of 1.2.0 Message-ID: I'm working on a release candidate for Koha 1.2.0. I have a working Debian package, and an untested RPM package. I have no redhat machines to test it on. Are there any volunteers? A volunteer who will install the package and report back to me on the multitude of errors that will invariably result would be okay, a volunteer who has a test machine that I can get root access on would be even better. Big caveat: This package still isn't ready for upgrading production systems. New installs of Koha only for the moment. I need to determine what has changed in the database schema so that production systems can be updated properly. Steve. From nsr4n at tetra.mail.virginia.edu Mon Feb 4 10:32:02 2002 From: nsr4n at tetra.mail.virginia.edu (Nicholas Stephen Rosasco) Date: Mon Feb 4 10:32:02 2002 Subject: [Koha-devel] Is this useful? Message-ID: Some of the items listed have been updated recently... http://search.cpan.org/search?mode=module&query=MARC Nick From rangi at users.sourceforge.net Tue Feb 12 13:32:05 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 12 13:32:05 2002 Subject: [Koha-devel] CVS: koha/C4 Search.pm,1.11,1.12 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv28698/C4 Modified Files: Search.pm Log Message: Fixing bug in subject searching that was causing subjects with ' to break the search Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -r1.11 -r1.12 *** Search.pm 12 Dec 2001 02:31:28 -0000 1.11 --- Search.pm 12 Feb 2002 21:31:41 -0000 1.12 *************** *** 9,12 **** --- 9,13 ---- use C4::Database; use C4::Reserves2; + use Set::Scalar; use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); *************** *** 261,269 **** my $i=1; my @results; my $query ="Select * from biblio,bibliosubtitle,biblioitems where biblio.biblionumber=biblioitems.biblionumber and biblio.biblionumber=bibliosubtitle.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%')"; - while ($i < $count){ $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')"; --- 262,399 ---- my $i=1; my @results; + my $query="Select biblionumber from biblio + where ((title like '$key[0]%' or title like '% $key[0]%')"; + while ($i < $count){ + $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')"; + $i++; + } + $query.= ") or ((biblio.notes like '$key[0]%' or biblio.notes like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.=" and (biblio.notes like '$key[$i]%' or biblio.notes like '% $key[$i]%')"; + } + $query.= ") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')"; + } + $query.=" )"; + # print $query; + my $sth=$dbh->prepare($query); + $sth->execute; + my $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set1=Set::Scalar->new(@results); + $query="Select biblionumber from bibliosubtitle where + ((subtitle like '$key[0]%' or subtitle like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.= " and (subtitle like '$key[$i]%' or subtitle like '% $key[$i]%')"; + } + $query.=" )"; + # print $query; + $sth=$dbh->prepare($query); + $sth->execute; + $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set2=Set::Scalar->new(@results); + if ($i > 0){ + $set1=$set1+$set2; + } + $query ="Select biblionumber from biblioitems where + ((biblioitems.notes like '$key[0]%' or biblioitems.notes like '% $key[0]%')"; + for ($i=1;$i<$count;$i++){ + $query.=" and (biblioitems.notes like '$key[$i]%' or biblioitems.notes like '% $key[$i]%')"; + } + $query.=" )"; + # print $query; + $sth=$dbh->prepare($query); + $sth->execute; + $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set3=Set::Scalar->new(@results); + if ($i > 0){ + $set1=$set1+$set3; + } + $sth=$dbh->prepare("Select biblionumber from bibliosubject where subject + like '%$search->{'keyword'}%' group by biblionumber"); + $sth->execute; + $i=0; + while (my @res=$sth->fetchrow_array){ + $results[$i]=$res[0]; + $i++; + } + $sth->finish; + my $set4=Set::Scalar->new(@results); + if ($i > 0){ + $set1=$set1+$set4; + } + my $i2=0; + my @res2; + my @res = $set1->members; + $count=@res; + # print $set1; + $i=0; + # print "count $count"; + while ($i2 < $num && $i2 < $count){ + my $query="select * from biblio,biblioitems where + biblio.biblionumber='$res[$i2+$offset]' and + biblio.biblionumber=biblioitems.biblionumber"; + if ($search->{'class'} ne ''){ + my @temp=split(/\|/,$search->{'class'}); + my $count=@temp; + $query.= "and ( itemtype='$temp[0]'"; + for (my $i=1;$i<$count;$i++){ + $query.=" or itemtype='$temp[$i]'"; + } + $query.=")"; + } + if ($search->{'dewey'} ne ''){ + $query.= "and (dewey like '$search->{'dewey'}%') "; + } + + my $sth=$dbh->prepare($query); + # print $query; + $sth->execute; + if (my $data2=$sth->fetchrow_hashref){ + my $dewey= $data2->{'dewey'}; + my $subclass=$data2->{'subclass'}; + $dewey=~s/\.*0*$//; + ($dewey == 0) && ($dewey=''); + ($dewey) && ($dewey.=" $subclass") ; + $sth->finish; + $res2[$i]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data2->{'copyrightdate'}\t$dewey"; + $i++; + } + $i2++; + } + $dbh->disconnect; + + # $count=$i; + return($count, at res2); + } + + sub KeywordSearch2 { + my ($env,$type,$search,$num,$offset)=@_; + my $dbh = &C4Connect; + $search->{'keyword'}=~ s/ +$//; + $search->{'keyword'}=~ s/'/\\'/; + my @key=split(' ',$search->{'keyword'}); + my $count=@key; + my $i=1; + my @results; my $query ="Select * from biblio,bibliosubtitle,biblioitems where biblio.biblionumber=biblioitems.biblionumber and biblio.biblionumber=bibliosubtitle.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%')"; while ($i < $count){ $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%')"; *************** *** 377,381 **** my @res; my $count=@results; ! $i=0; if ($count > 0){ $res[0]=$results[0]; --- 507,511 ---- my @res; my $count=@results; ! $i=1; if ($count > 0){ $res[0]=$results[0]; *************** *** 399,402 **** --- 529,533 ---- $dbh->disconnect; # $i--; + # $i++; return($i, at res2); } *************** *** 436,441 **** $query=$query.")"; if ($search->{'title'} ne ''){ ! $query=$query. " and (title like '%$search->{'title'}%' ! or seriestitle like '%$search->{'title'}%')"; } if ($search->{'class'} ne ''){ --- 567,593 ---- $query=$query.")"; if ($search->{'title'} ne ''){ ! my @key=split(' ',$search->{'title'}); ! my $count=@key; ! my $i=0; ! $query.= " and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; ! while ($i<$count){ ! $query=$query." and (title like '$key[$i]%' or title like '% $key[$i]%' or title like '% $key[$i]')"; ! $i++; ! } ! # $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0] %' or subtitle like '% $key[0]')"; ! # for ($i=1;$i<$count;$i++){ ! # $query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i] %' or subtitle like '% $key[$i]')"; ! # } ! $query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%' or seriestitle like '% $key[0]')"; ! for ($i=1;$i<$count;$i++){ ! $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')"; ! } ! $query.=") or ((unititle like '$key[0]%' or unititle like '% $key[0]%' or unititle like '% $key[0]')"; ! for ($i=1;$i<$count;$i++){ ! $query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i]%')"; ! } ! $query=$query."))"; ! #$query=$query. " and (title like '%$search->{'title'}%' ! #or seriestitle like '%$search->{'title'}%')"; } if ($search->{'class'} ne ''){ *************** *** 483,497 **** $i++; } ! $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0] %' or subtitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i] %' or subtitle like '% $key[$i]')"; } ! $query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0] %' or seriestitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i] %')"; } ! $query.=") or ((unititle like '$key[0]%' or unititle like '% $key[0] %' or unititle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i] %')"; } $query=$query."))"; --- 635,649 ---- $i++; } ! $query.=") or ((subtitle like '$key[0]%' or subtitle like '% $key[0]%' or subtitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (subtitle like '$key[$i]%' or subtitle like '% $key[$i]%' or subtitle like '% $key[$i]')"; } ! $query.=") or ((seriestitle like '$key[0]%' or seriestitle like '% $key[0]%' or seriestitle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (seriestitle like '$key[$i]%' or seriestitle like '% $key[$i]%')"; } ! $query.=") or ((unititle like '$key[0]%' or unititle like '% $key[0]%' or unititle like '% $key[0]')"; for ($i=1;$i<$count;$i++){ ! $query.=" and (unititle like '$key[$i]%' or unititle like '% $key[$i]%')"; } $query=$query."))"; *************** *** 537,541 **** and biblioitems.illus like '%".$search->{'illustrator'}."%'"; } ! } $query .=" group by biblio.biblionumber"; } --- 689,693 ---- and biblioitems.illus like '%".$search->{'illustrator'}."%'"; } ! } $query .=" group by biblio.biblionumber"; } *************** *** 607,610 **** --- 759,763 ---- } } + #print $query; my $sth=$dbh->prepare($query); $sth->execute; *************** *** 648,654 **** my ($env,$subject)=@_; my $dbh=C4Connect(); my $query="Select * from biblio,bibliosubject where biblio.biblionumber=bibliosubject.biblionumber and ! bibliosubject.subject='$subject' group by biblio.biblionumber order by biblio.title"; my $sth=$dbh->prepare($query); --- 801,808 ---- my ($env,$subject)=@_; my $dbh=C4Connect(); + $subject=$dbh->quote($subject); my $query="Select * from biblio,bibliosubject where biblio.biblionumber=bibliosubject.biblionumber and ! bibliosubject.subject=$subject group by biblio.biblionumber order by biblio.title"; my $sth=$dbh->prepare($query); *************** *** 721,725 **** $dewey=~ s/\.$//; $class = $class.$dewey; ! $class = $class.$data->{'subclass'}; # $results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$data->{'dewey'}"; my @temp=split('-',$data->{'datelastseen'}); --- 875,881 ---- $dewey=~ s/\.$//; $class = $class.$dewey; ! if ($dewey ne ''){ ! $class = $class.$data->{'subclass'}; ! } # $results[$i]="$data->{'title'}\t$data->{'barcode'}\t$datedue\t$data->{'branchname'}\t$data->{'dewey'}"; my @temp=split('-',$data->{'datelastseen'}); *************** *** 791,795 **** my ($bibnum,$type)=@_; my $dbh=C4Connect; ! my $query="Select *,biblio.notes from biblio,biblioitems,bibliosubtitle where biblio.biblionumber=$bibnum and biblioitems.biblionumber=$bibnum and (bibliosubtitle.biblionumber=$bibnum)"; --- 947,951 ---- my ($bibnum,$type)=@_; my $dbh=C4Connect; ! my $query="Select *,biblio.notes from biblio,biblioitems,bibliosubtitle where biblio.biblionumber=$bibnum and biblioitems.biblionumber=$bibnum and (bibliosubtitle.biblionumber=$bibnum)"; *************** *** 815,819 **** my ($bibitem)=@_; my $dbh=C4Connect; ! my $query="Select * from biblio,biblioitems,itemtypes where biblio.biblionumber= biblioitems.biblionumber and biblioitemnumber=$bibitem and biblioitems.itemtype=itemtypes.itemtype"; --- 971,975 ---- my ($bibitem)=@_; my $dbh=C4Connect; ! my $query="Select *,biblioitems.notes as bnotes from biblio,biblioitems,itemtypes where biblio.biblionumber= biblioitems.biblionumber and biblioitemnumber=$bibitem and biblioitems.itemtype=itemtypes.itemtype"; From rangi at users.sourceforge.net Tue Feb 12 13:39:17 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 12 13:39:17 2002 Subject: [Koha-devel] CVS: koha updatebibitem.pl,1.2,1.3 Message-ID: Update of /cvsroot/koha/koha In directory usw-pr-cvs1:/tmp/cvs-serv21412 Modified Files: updatebibitem.pl Log Message: Fixing bug that was duplicating additional authors, and a bug that was breaking the updating classicification field Index: updatebibitem.pl =================================================================== RCS file: /cvsroot/koha/koha/updatebibitem.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** updatebibitem.pl 10 Oct 2001 19:27:00 -0000 1.2 --- updatebibitem.pl 12 Feb 2002 21:07:53 -0000 1.3 *************** *** 10,14 **** my $input= new CGI; #print $input->header; ! #print $input->dump; --- 10,14 ---- my $input= new CGI; #print $input->header; ! #print $input->Dump; *************** *** 41,45 **** }else{ $dewey=''; ! $subclass=$class; } my $illus=checkinp($input->param('Illustrations')); --- 41,45 ---- }else{ $dewey=''; ! $subclass=''; } my $illus=checkinp($input->param('Illustrations')); From rangi at users.sourceforge.net Tue Feb 12 13:40:08 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 12 13:40:08 2002 Subject: [Koha-devel] CVS: koha/C4 Acquisitions.pm,1.1.1.1,1.2 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv21412/C4 Modified Files: Acquisitions.pm Log Message: Fixing bug that was duplicating additional authors, and a bug that was breaking the updating classicification field From paul.poulain at free.fr Thu Feb 14 06:30:26 2002 From: paul.poulain at free.fr (paul POULAIN) Date: Thu Feb 14 06:30:26 2002 Subject: [Koha-devel] Re: [Koha] Pending release of 1.2.0 References: Message-ID: <3C6BCA4F.8000102@free.fr> Tonnesen Steve wrote: >I'm working on a release candidate for Koha 1.2.0. I have a working >Debian package, and an untested RPM package. I have no redhat machines to >test it on. Are there any volunteers? A volunteer who will install the >package and report back to me on the multitude of errors that will >invariably result would be okay, a volunteer who has a test machine that I >can get root access on would be even better. > >Big caveat: > >This package still isn't ready for upgrading production systems. New >installs of Koha only for the moment. I need to determine what has >changed in the database schema so that production systems can be updated >properly. > I've a mandrake runnning machine, so I can test the RPM package. I've no production running machine (just a test installation), and a root access, as it's my desk-PC. If the package is less than 5mb, you can mail it to me. Question : what's new in the 1.2.0 ? -- Paul From rangi at users.sourceforge.net Wed Feb 20 12:56:09 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Wed Feb 20 12:56:09 2002 Subject: [Koha-devel] CVS: koha/C4 Search.pm,1.12,1.13 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv10405/C4 Modified Files: Search.pm Log Message: Playing with keyword search trying to speed it up more Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -r1.12 -r1.13 *** Search.pm 12 Feb 2002 21:31:41 -0000 1.12 --- Search.pm 20 Feb 2002 20:53:29 -0000 1.13 *************** *** 339,342 **** --- 339,345 ---- } my $i2=0; + my $i3=0; + my $i4=0; + my @res2; my @res = $set1->members; *************** *** 345,352 **** $i=0; # print "count $count"; while ($i2 < $num && $i2 < $count){ my $query="select * from biblio,biblioitems where biblio.biblionumber='$res[$i2+$offset]' and ! biblio.biblionumber=biblioitems.biblionumber"; if ($search->{'class'} ne ''){ my @temp=split(/\|/,$search->{'class'}); --- 348,399 ---- $i=0; # print "count $count"; + if ($search->{'class'} ne ''){ + while ($i2 <$count){ + my $query="select * from biblio,biblioitems where + biblio.biblionumber='$res[$i2]' and + biblio.biblionumber=biblioitems.biblionumber "; + if ($search->{'class'} ne ''){ + my @temp=split(/\|/,$search->{'class'}); + my $count=@temp; + $query.= "and ( itemtype='$temp[0]'"; + for (my $i=1;$i<$count;$i++){ + $query.=" or itemtype='$temp[$i]'"; + } + $query.=")"; + } + my $sth=$dbh->prepare($query); + # print $query; + $sth->execute; + if (my $data2=$sth->fetchrow_hashref){ + my $dewey= $data2->{'dewey'}; + my $subclass=$data2->{'subclass'}; + $dewey=~s/\.*0*$//; + ($dewey == 0) && ($dewey=''); + ($dewey) && ($dewey.=" $subclass") ; + $sth->finish; + my $end=$offset +$num; + if ($i4 <= $offset){ + $i4++; + } + # print $i4; + if ($i4 <=$end && $i4 > $offset){ + $res2[$i3]="$data2->{'author'}\t$data2->{'title'}\t$data2->{'biblionumber'}\t$data2->{'copyrightdate'}\t$dewey"; + $i3++; + $i4++; + # print "in here $i3
    "; + } else { + # print $end; + } + $i++; + } + $i2++; + } + $count=$i; + + } else { while ($i2 < $num && $i2 < $count){ my $query="select * from biblio,biblioitems where biblio.biblionumber='$res[$i2+$offset]' and ! biblio.biblionumber=biblioitems.biblionumber "; if ($search->{'class'} ne ''){ my @temp=split(/\|/,$search->{'class'}); *************** *** 376,383 **** } $i2++; } $dbh->disconnect; ! # $count=$i; return($count, at res2); } --- 423,432 ---- } $i2++; + + } } $dbh->disconnect; ! #$count=$i; return($count, at res2); } *************** *** 1174,1200 **** } ! sub allissues { ! my ($bornum)=@_; ! my $dbh=C4Connect; ! my $query; ! $query="Select * from issues,biblio,items where borrowernumber='$bornum' and ! items.itemnumber=issues.itemnumber and ! items.biblionumber=biblio.biblionumber order ! by date_due"; ! #print $query; ! my $sth=$dbh->prepare($query); ! $sth->execute; ! my @result; ! my $i=0; ! while (my $data=$sth->fetchrow_hashref){ ! $result[$i]=$data;; ! $i++; ! } ! $sth->finish; ! $dbh->disconnect; ! return($i,\@result); } - - sub borrdata2 { --- 1223,1252 ---- } ! sub allissues { ! my ($bornum,$order,$limit)=@_; ! my $dbh=C4Connect; ! my $query; ! $query="Select * from issues,biblio,items,biblioitems ! where borrowernumber='$bornum' and ! items.biblioitemnumber=biblioitems.biblioitemnumber and ! items.itemnumber=issues.itemnumber and ! items.biblionumber=biblio.biblionumber"; ! $query.=" order by $order"; ! if ($limit !=0){ ! $query.=" limit $limit"; ! } ! #print $query; ! my $sth=$dbh->prepare($query); ! $sth->execute; ! my @result; ! my $i=0; ! while (my $data=$sth->fetchrow_hashref){ ! $result[$i]=$data;; ! $i++; ! } ! $sth->finish; ! $dbh->disconnect; ! return($i,\@result); } sub borrdata2 { From rangi at users.sourceforge.net Wed Feb 20 13:06:45 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Wed Feb 20 13:06:45 2002 Subject: [Koha-devel] CVS: koha/C4 Search.pm,1.13,1.14 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv15057/C4 Modified Files: Search.pm Log Message: Making a "fix" to normal title search Index: Search.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Search.pm,v retrieving revision 1.13 retrieving revision 1.14 diff -C2 -r1.13 -r1.14 *** Search.pm 20 Feb 2002 20:53:29 -0000 1.13 --- Search.pm 20 Feb 2002 21:05:19 -0000 1.14 *************** *** 675,682 **** my $count=@key; my $i=1; ! $query="select * from biblio,bibliosubtitle,biblioitems where ! (biblio.biblionumber=bibliosubtitle.biblionumber and ! biblioitems.biblionumber=biblio.biblionumber) and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; while ($i<$count){ --- 675,683 ---- my $count=@key; my $i=1; ! $query="select * from biblio,biblioitems ! left join bibliosubtitle on ! biblio.biblionumber=bibliosubtitle.biblionumber where ! biblioitems.biblionumber=biblio.biblionumber and (((title like '$key[0]%' or title like '% $key[0]%' or title like '% $key[0]')"; while ($i<$count){ *************** *** 796,800 **** } } ! #print $query; if ($type ne 'precise' && $type ne 'subject'){ if ($search->{'author'} ne ''){ --- 797,801 ---- } } ! print $query; if ($type ne 'precise' && $type ne 'subject'){ if ($search->{'author'} ne ''){ From rangi at users.sourceforge.net Tue Feb 26 01:07:02 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 26 01:07:02 2002 Subject: [Koha-devel] CVS: koha/acqui basket.pl,1.1.1.1,1.2 Message-ID: Update of /cvsroot/koha/koha/acqui In directory usw-pr-cvs1:/tmp/cvs-serv25553/acqui Modified Files: basket.pl Log Message: Fix for displaying prices Index: basket.pl =================================================================== RCS file: /cvsroot/koha/koha/acqui/basket.pl,v retrieving revision 1.1.1.1 retrieving revision 1.2 diff -C2 -r1.1.1.1 -r1.2 *** basket.pl 19 Dec 2000 23:45:56 -0000 1.1.1.1 --- basket.pl 26 Feb 2002 09:06:19 -0000 1.2 *************** *** 15,21 **** print startpage; ! print startmenu('acquisitions'); ! #print $count; my ($count2, at booksellers)=bookseller($results[0]->{'booksellerid'}); --- 15,26 ---- print startpage; ! my @inp=startmenu('acquisitions'); ! my $count3=@inp; ! for (my $i=0;$i<$count3;$i++){ ! $inp[$i]=~ s/leftmargin=0 topmargin=0\>/leftmargin=0 topmargin=0 onload='update(orderform)'\>/; ! } ! print @inp; ! # print $count; my ($count2, at booksellers)=bookseller($results[0]->{'booksellerid'}); *************** *** 25,39 **** Authorised By: $results[0]->{'authorisedby'}
    $results[0]->{'entrydate'}; - ! Shopping Basket For: {'booksellerid'}> $booksellers[0]->{'name'} ! ! {'booksellerid'}&basket=$basket>Add more orders ! !
    -
    ! Search ISBN, Title or Author:

    --- 30,39 ---- Authorised By: $results[0]->{'authorisedby'}
    $results[0]->{'entrydate'}; ! Shopping Basket For: {'booksellerid'}> $booksellers[0]->{'name'} ! {'booksellerid'}&basket=$basket>Add more orders

    ! Search ISBN, Title or Author:

    *************** *** 41,124 **** ! ! ! ! ! printend ; for (my $i=0;$i<$count;$i++){ my $rrp=$results[$i]->{'listprice'}; if ($results[$i]->{'currency'} ne 'NZD'){ ! $rrp=curconvert($results[$i]->{'currency'},$rrp); } - print < ! ! ! ! ! ! ! ! ! {'ordernumber'}> ! {'biblionumber'}> - EOP ; } ! # onchange='update(this.form)'> print ""; print < ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
    ORDERISBNTITLEAUTHORRRP\$ESTQUANTITYTOTAL
    $results[$i]->{'ordernumber'}$results[$i]->{'isbn'}$results[$i]->{'title'}$results[$i]->{'author'}\$\${'quantity'}>\$
    ! HELP
    ! To cancel an order, just change the quantity to 0 and click "save changes".
    ! To change any of the catalogue or accounting information attached to an order, click on the title.
    ! To add new orders to this supplier, start with a search.
    SubTotal\$
    GST\$
    TOTAL\$
    !

    ! ! ! EOP ! ; print endmenu('acquisitions'); --- 41,116 ---- ! ! ! ! ! ! ! ! printend ; + + + my $line_total; # total of each line + my $sub_total; # total of line totals + my $gist; # GST + my $grand_total; # $subttotal + $gist + for (my $i=0;$i<$count;$i++){ my $rrp=$results[$i]->{'listprice'}; if ($results[$i]->{'currency'} ne 'NZD'){ ! $rrp=curconvert($results[$i]->{'currency'},$rrp); } + $line_total=$results[$i]->{'quantity'}*$results[$i]->{'ecost'}; + $sub_total+=$line_total; + $gist=sprintf("%.2f",$sub_total*0.125); + $grand_total=$sub_total+$gist; + print < ! ! ! ! ! ! ! ! ! {'ordernumber'}> ! {'biblionumber'}> EOP ; } ! # print ""; print < + + ! ! ! ! ! ! ! ! ! ! !
    ORDERISBNTITLEAUTHORRRP\$ESTQUANTITYTOTAL
    $results[$i]->{'ordernumber'}$results[$i]->{'isbn'}$results[$i]->{'title'}$results[$i]->{'author'}\$\${'quantity'} onchange='update(this.form)'>\$
    + HELP
    + To cancel an order, just change the quantity to 0 and click "save changes".
    + To change any of the catalogue or accounting information attached to an order, click on the title.
    + To add new orders to this supplier, start with a search.
    SubTotal\$
    GST\$
    TOTAL\$
    !
    EOP ! ; print endmenu('acquisitions'); From rangi at users.sourceforge.net Tue Feb 26 01:32:04 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 26 01:32:04 2002 Subject: [Koha-devel] CVS: koha/C4 Maintainance.pm,1.3,1.4 Message-ID: Update of /cvsroot/koha/koha/C4 In directory usw-pr-cvs1:/tmp/cvs-serv31272/C4 Modified Files: Maintainance.pm Log Message: Fixed apostrophe ' handling Index: Maintainance.pm =================================================================== RCS file: /cvsroot/koha/koha/C4/Maintainance.pm,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -r1.3 -r1.4 *** Maintainance.pm 15 Mar 2001 10:15:51 -0000 1.3 --- Maintainance.pm 26 Feb 2002 09:31:14 -0000 1.4 *************** *** 76,80 **** my ($sub,$oldsub)=@_; my $dbh=C4Connect; ! my $query="update bibliosubject set subject='$sub' where subject='$oldsub'"; my $sth=$dbh->prepare($query); $sth->execute; --- 76,82 ---- my ($sub,$oldsub)=@_; my $dbh=C4Connect; ! $sub=$dbh->quote($sub); ! $oldsub=$dbh->quote($oldsub); ! my $query="update bibliosubject set subject=$sub where subject=$oldsub"; my $sth=$dbh->prepare($query); $sth->execute; From rangi at users.sourceforge.net Tue Feb 26 01:32:04 2002 From: rangi at users.sourceforge.net (Chris Cormack) Date: Tue Feb 26 01:32:04 2002 Subject: [Koha-devel] CVS: koha/maint catmaintain.pl,1.2,1.3 Message-ID: Update of /cvsroot/koha/koha/maint In directory usw-pr-cvs1:/tmp/cvs-serv31272/maint Modified Files: catmaintain.pl Log Message: Fixed apostrophe ' handling Index: catmaintain.pl =================================================================== RCS file: /cvsroot/koha/koha/maint/catmaintain.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -r1.2 -r1.3 *** catmaintain.pl 15 Mar 2001 10:15:51 -0000 1.2 --- catmaintain.pl 26 Feb 2002 09:31:15 -0000 1.3 *************** *** 25,28 **** --- 25,29 ---- my $sub2=$results->[$i]->{'subject'}; $sub2=~ s/ /%20/g; + $sub2=~ s/\'/%27/g; print "\"$results->[$i]->{'subject'}\"
    \n"; } *************** *** 85,88 **** --- 86,90 ---- print ""; print "Show all Titles beginning with
    "; + print "Item Number
    "; print ""; print ""; From paul.poulain at free.fr Thu Feb 28 07:03:49 2002 From: paul.poulain at free.fr (paul POULAIN) Date: Thu Feb 28 07:03:49 2002 Subject: [Koha-devel] Primary key does not exist !!!!!!! Message-ID: <3C7E46A3.4090607@free.fr> Hi everybody, This is my 1st message on this list. I'm a new developper of koha. Coming from france. I've almost a half time job to work on koha to help reaching the 1.2 version, with MARC support. When it will be done, we will use it here, in france, in at least 4 libraries with 80 000 books (christian libraries). Presently I'm working on admin tool to administer avery parameter table. It should be released on CVS soon. My fisrt post is to CRY because of a BIG proble in the DB structure: In most tables there is no primary key defined. On some of them there are indexes, but no pk. It's very, very dirty, ugly, infamous, ridiculous (and every -y or -ous term you could find ;-)) from a theoric point of vue, It's the source of perf caveats, (joins make heavy use of primary key. In fact, almost every "join" are usually on a pk of the right part of the expression) It's the cause of some bugs in a practical point of vue : it's not possible to use "append" sql command, which is VERY practical when you have to store datas (the same form is shares for insert and modify actions...) So, unless there is a very important reason to do so (and I don't know what could be such a reason...), I think a primary key must be defined for every table in the DB... Who can include them in the db schema ? If you want a SQL patch to correct the DB, I should be able to spend a few hours to do it. Note : for a 1st post, it may seem to be very critic. As you will see later, I'm usually a happy man ;-))))) It's just that I've work a lot on many DB (mySQL, Interbase, Informix...) and I'm very surprised with this problem. I don't blame anybody. -- Paul From chris at katipo.co.nz Thu Feb 28 11:07:05 2002 From: chris at katipo.co.nz (Chris Cormack) Date: Thu Feb 28 11:07:05 2002 Subject: [Koha-devel] Re: Primary key does not exist !!!!!!! In-Reply-To: <3C7E46A3.4090607@free.fr> References: <3C7E46A3.4090607@free.fr> Message-ID: <1014923223.11184.61.camel@orbweb> On Fri, 2002-03-01 at 04:02, paul POULAIN wrote: > Hi everybody, > > My fisrt post is to CRY because of a BIG proble in the DB structure: > In most tables there is no primary key defined. > On some of them there are indexes, but no pk. > > It's very, very dirty, ugly, infamous, ridiculous (and every -y or -ous > term you could find ;-)) from a theoric point of vue, > It's the source of perf caveats, (joins make heavy use of primary key. > In fact, almost every "join" are usually on a pk of the right part of > the expression) > It's the cause of some bugs in a practical point of vue : it's not > possible to use "append" sql command, which is VERY practical when you > have to store datas (the same form is shares for insert and modify > actions...) > > So, unless there is a very important reason to do so (and I don't know > what could be such a reason...), I think a primary key must be defined > for every table in the DB... > Yep a very valid point > Who can include them in the db schema ? If you want a SQL patch to > correct the DB, I should be able to spend a few hours to do it. > That would be great > Note : for a 1st post, it may seem to be very critic. As you will see > later, I'm usually a happy man ;-))))) It's just that I've work a lot on > many DB (mySQL, Interbase, Informix...) and I'm very surprised with this > problem. I don't blame anybody. Criticism is good :-) As long as its constructive which this is. It makes better solutions. If having primary keys on every table will give a performance increase thats great. Chris -- Chris Cormack Programmer 025 500 789 Katipo Communications Ltd chris at katipo.co.nz www.katipo.co.nz