From rch at liblime.com Tue May 1 17:21:07 2007 From: rch at liblime.com (Ryan Higgins) Date: Tue, 01 May 2007 15:21:07 +0000 Subject: [Koha-cvs] koha/circ circulation.pl [rel_2_2] Message-ID: CVSROOT: /sources/koha Module name: koha Branch: rel_2_2 Changes by: Ryan Higgins 07/05/01 15:21:07 Modified files: circ : circulation.pl Log message: get overdue, issues _after_ issuing. otherwise issuecount is wrong. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/circ/circulation.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.81.2.22&r2=1.81.2.23 Patches: Index: circulation.pl =================================================================== RCS file: /sources/koha/koha/circ/circulation.pl,v retrieving revision 1.81.2.22 retrieving revision 1.81.2.23 diff -u -b -r1.81.2.22 -r1.81.2.23 --- circulation.pl 28 Apr 2007 20:25:01 -0000 1.81.2.22 +++ circulation.pl 1 May 2007 15:21:07 -0000 1.81.2.23 @@ -133,7 +133,6 @@ my $borrower; if ($borrowernumber) { $borrower = getpatroninformation(\%env,$borrowernumber,0); - my ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); #warn $borrower->{'expiry'}; my $warningdate = DateCalc($borrower->{'expiry'},"- ".C4::Context->preference('NotifyBorrowerDeparture')." days"); my $offset = '+ '.$borrower->{'enrolmentperiod'}.' years'; @@ -145,9 +144,6 @@ $template->param(warndeparture=>$warning, renewaldate=>$renewaldate); } - $template->param(overduecount => $od, - issuecount => $issue, - finetotal => $fines); } @@ -189,6 +185,10 @@ # reload the borrower info for the sake of reseting the flags..... if ($borrowernumber) { $borrower = getpatroninformation(\%env,$borrowernumber,0); + my ($od,$issue,$fines)=borrdata2(\%env,$borrowernumber); + $template->param(overduecount => $od, + issuecount => $issue, + finetotal => $fines); } @@ -338,7 +338,6 @@ ); } - if ($branchcookie) { $cookie=[$cookie, $branchcookie, $printercookie]; } From paul at koha-fr.org Wed May 2 13:57:11 2007 From: paul at koha-fr.org (paul poulain) Date: Wed, 02 May 2007 11:57:11 +0000 Subject: [Koha-cvs] koha C4/Search.pm misc/migration_tools/rebuild_... Message-ID: CVSROOT: /sources/koha Module name: koha Changes by: paul poulain 07/05/02 11:57:11 Modified files: C4 : Search.pm misc/migration_tools: rebuild_nozebra.pl Log message: improving NOzebra search : - changing nozebra table to have biblionumber,title-ranking; (; is the entry separator. Now, if a value is several times in an index, it is stored only once, with a higher ranking (the ranking is the number of times the word appeard for this index) - improving search to have ranking value (default order). The ranking is the sum of ranking of all terms. The list is ordered by ranking+title, from most to lower CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&r1=1.133&r2=1.134 http://cvs.savannah.gnu.org/viewcvs/koha/misc/migration_tools/rebuild_nozebra.pl?cvsroot=koha&r1=1.1&r2=1.2 Patches: Index: C4/Search.pm =================================================================== RCS file: /sources/koha/koha/C4/Search.pm,v retrieving revision 1.133 retrieving revision 1.134 diff -u -b -r1.133 -r1.134 --- C4/Search.pm 30 Apr 2007 14:29:21 -0000 1.133 +++ C4/Search.pm 2 May 2007 11:57:11 -0000 1.134 @@ -25,7 +25,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); # set the version for version checking -$VERSION = do { my @v = '$Revision: 1.133 $' =~ /\d+/g; +$VERSION = do { my @v = '$Revision: 1.134 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); }; @@ -1225,11 +1225,11 @@ } # do a AND with existing list if there is one, otherwise, use the biblionumbers list as 1st result list if ($results) { - my @leftresult = split /,/, $biblionumbers; + my @leftresult = split /;/, $biblionumbers; my $temp; foreach (@leftresult) { - if ($results =~ "$_,") { - $temp .= "$_,$_,"; + if ($results =~ "$_;") { + $temp .= "$_;$_;"; } } $results = $temp; @@ -1253,8 +1253,8 @@ my @leftresult = split /,/, $biblionumbers; my $temp; foreach (@leftresult) { - if ($results =~ "$_,") { - $temp .= "$_,$_,"; + if ($results =~ "$_;") { + $temp .= "$_;$_;"; } } $results = $temp; @@ -1270,7 +1270,7 @@ sub NZorder { my ($biblionumbers, $ordering,$results_per_page,$offset) = @_; # order title asc by default - $ordering = '1=36 dbh; @@ -1282,8 +1282,8 @@ my %popularity; # popularity is not in MARC record, it's builded from a specific query my $sth = $dbh->prepare("select sum(issues) from items where biblionumber=?"); - foreach (split /,/,$biblionumbers) { - my ($biblionumber,$title) = split /;/,$_; + foreach (split /;/,$biblionumbers) { + my ($biblionumber,$title) = split /,/,$_; $result{$biblionumber}=GetMarcBiblio($biblionumber); $sth->execute($biblionumber); my $popularity= $sth->fetchrow ||0; @@ -1314,8 +1314,8 @@ # } elsif ($ordering eq '1=1003 preference('marcflavour') eq 'UNIMARC') { @@ -1349,8 +1349,8 @@ # } elsif ($ordering eq '1=20 subfield($publicationyear_tag,$publicationyear_subfield); @@ -1410,13 +1410,11 @@ # # ORDER BY title # - } else { + } elsif ($ordering =~ /1=36/) { # the title is in the biblionumbers string, so we just need to build a hash, sort it and return my %result; -# splice(@X,$results_per_page*(1+$offset)); -# splice(@X,0,$results_per_page*$offset); - foreach (split /,/,$biblionumbers) { - my ($biblionumber,$title) = split /;/,$_; + foreach (split /;/,$biblionumbers) { + my ($biblionumber,$title) = split /,/,$_; # hint : the result is sorted by title.biblionumber because we can have X biblios with the same title # and we don't want to get only 1 result for each of them !!! # hint & speed improvement : we can order without reading the record @@ -1444,8 +1442,52 @@ $result_hash->{'hits'} = $numbers; $finalresult->{'biblioserver'} = $result_hash; return $finalresult; + } else { + # + # order by ranking + # + # we need 2 hashes to order by ranking : the 1st one to count the ranking, the 2nd to order by ranking + my %result; + my %count_ranking; + foreach (split /;/,$biblionumbers) { + my ($biblionumber,$title) = split /,/,$_; + $title =~ /(.*)-(\d)/; + # get weight + my $ranking =$2; + # hint : the result is sorted by title.biblionumber because we can have X biblios with the same title + # and we don't want to get only 1 result for each of them !!! + # note that we + the ranking because ranking is calculated on weight of EACH term requested. + # if we ask for "two towers", and "two" has weight 2 in biblio N, and "towers" has weight 4 in biblio N + # biblio N has ranking = 6 + $count_ranking{$biblionumber}=0 unless $count_ranking{$biblionumber}; + $count_ranking{$biblionumber} =+ $ranking; + } + # build the result by "inverting" the count_ranking hash + # hing : as usual, we don't order by ranking only, to avoid having only 1 result for each rank. We build an hash on concat(ranking,biblionumber) instead +# warn "counting"; + foreach (keys %count_ranking) { + warn "$_ =".sprintf("%10d",$count_ranking{$_}).'-'.$_; + $result{sprintf("%10d",$count_ranking{$_}).'-'.$_} = $_; + } + # sort the hash and return the same structure as GetRecords (Zebra querying) + my $result_hash; + my $numbers=0; + foreach my $key (sort {$b <=> $a} (keys %result)) { + warn "KEY : $key = ".$result{$key}; + $result_hash->{'RECORDS'}[$numbers++] = $result{$key}; + } + # for the requested page, replace biblionumber by the complete record + # speed improvement : avoid reading too much things + for (my $counter=$offset;$counter<=$offset+$results_per_page;$counter++) { + $result_hash->{'RECORDS'}[$counter] = GetMarcBiblio($result_hash->{'RECORDS'}[$counter])->as_usmarc; + } + my $finalresult=(); + $result_hash->{'hits'} = $numbers; + $finalresult->{'biblioserver'} = $result_hash; + return $finalresult; } } + END { } # module clean-up code here (global destructor) 1; Index: misc/migration_tools/rebuild_nozebra.pl =================================================================== RCS file: /sources/koha/koha/misc/migration_tools/rebuild_nozebra.pl,v retrieving revision 1.1 retrieving revision 1.2 diff -u -b -r1.1 -r1.2 --- misc/migration_tools/rebuild_nozebra.pl 25 Apr 2007 16:26:42 -0000 1.1 +++ misc/migration_tools/rebuild_nozebra.pl 2 May 2007 11:57:11 -0000 1.2 @@ -14,7 +14,7 @@ $|=1; # flushes output # limit for database dumping -my $limit = "LIMIT 1000"; +my $limit;# = "LIMIT 1000"; my $directory; my $skip_export; my $keep_export; @@ -32,6 +32,14 @@ $directory = "export" unless $directory; my $dbh=C4::Context->dbh; +$dbh->do("update systempreferences set value=1 where variable='NoZebra'"); +$dbh->do("CREATE TABLE `nozebra` ( + `indexname` varchar(40) character set latin1 NOT NULL, + `value` varchar(250) character set latin1 NOT NULL, + `biblionumbers` longtext character set latin1 NOT NULL, + KEY `indexname` (`indexname`), + KEY `value` (`value`)) + ENGINE=InnoDB DEFAULT CHARSET=utf8"); $dbh->do("truncate nozebra"); my $sth; $sth=$dbh->prepare("select biblionumber from biblioitems order by biblionumber $limit"); @@ -40,8 +48,20 @@ my %result; my %index = ( - 'title' => '200a,200c,200d', - 'author' =>'200f,700*,701*,702*' + 'title' => '200a,200c,200d,200e,225a,225d,225e,225f,225h,225i,225v,500*,501*,503*,510*,512*,513*,514*,515*,516*,517*,518*,519*,520*,530*,531*,532*,540*,541*,545*,604t,610t,605a', + 'author' =>'200f,600a,601a,604a,700a,700b,700c,700d,700a,701b,701c,701d,702a,702b,702c,702d,710a,710b,710c,710d,711a,711b,711c,711d,712a,712b,712c,712d', + 'isbn' => '010a', + 'issn' => '011a', + 'biblionumber' =>'0909', + 'itemtype' => '200b', + 'language' => '010a', + 'publisher' => '210x', + 'date' => '210d', + 'note' => '300a,301a,302a,303a,304a,305a,306az,307a,308a,309a,310a,311a,312a,313a,314a,315a,316a,317a,318a,319a,320a,321a,322a,323a,324a,325a,326a,327a,328a,330a,332a,333a,336a,337a,345a', + 'Koha-Auth-Number' => '6009,6019,6029,6039,6049,6059,6069,6109', + 'subject' => '600*,601*,606*,610*', + 'dewey' => '676a', + 'host-item' => '995a,995c', ); $|=1; @@ -57,8 +77,8 @@ } else { $title = lc($record->subfield('245','a')); } - # remove blancks and comma (that could cause problem when decoding the string for CQL retrieval - $title =~ s/ |,|;//g; + # remove blancks comma (that could cause problem when decoding the string for CQL retrieval) and regexp specific values + $title =~ s/ |,|;|\[|\]|\(|\)|\*//g; # limit to 10 char, should be enough, and limit the DB size $title = substr($title,0,10); #parse each field @@ -77,7 +97,14 @@ my $line= lc $subfield->[1]; $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\// /g; foreach (split / /,$line) { - $result{$key}->{$_}.="$biblionumber;$title," unless $subfield->[0] eq '9'; + # see if the entry is already here + if ($result{$key}->{$_} =~ /$biblionumber,$title\-(\d);/) { + my $weight=$1+1; + $result{$key}->{$_} =~ s/$biblionumber,$title\-(\d);//; + $result{$key}->{$_} .= "$biblionumber,$title-$weight;"; + } else { + $result{$key}->{$_}.="$biblionumber,$title-1;"; + } } } } @@ -86,7 +113,15 @@ my $line= lc $subfield->[1]; $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\// /g; foreach (split / /,$line) { - $result{'__RAW__'}->{$_}.="$biblionumber;$title," unless $subfield->[0] eq '9'; +# warn $record->as_formatted."$_ =>".$title; + if ($result{__RAW__}->{$_} =~ /$biblionumber,$title\-(\d);/) { + my $weight=$1+1; +# $weight++; + $result{__RAW__}->{$_} =~ s/$biblionumber,$title\-(\d);//; + $result{__RAW__}->{$_} .= "$biblionumber,$title-$weight;"; + } else { + $result{__RAW__}->{$_}.="$biblionumber,$title-1;"; + } } } } @@ -96,5 +131,8 @@ foreach my $key (keys %result) { foreach my $index (keys %{$result{$key}}) { $sth->execute($key,$index,$result{$key}->{$index}); + if (length($result{$key}->{$index}) >40000) { + print length($result{$key}->{$index})." for $key / $index"; + } } } From rch at liblime.com Wed May 2 15:59:53 2007 From: rch at liblime.com (Ryan Higgins) Date: Wed, 02 May 2007 13:59:53 +0000 Subject: [Koha-cvs] koha/koha-tmpl/intranet-tmpl/npl/en includes/co... [rel_2_2] Message-ID: CVSROOT: /sources/koha Module name: koha Branch: rel_2_2 Changes by: Ryan Higgins 07/05/02 13:59:53 Modified files: koha-tmpl/intranet-tmpl/npl/en/includes: common.js.inc doc-head-close-calendar.inc koha-tmpl/intranet-tmpl/npl/en/bull: statecollection.tmpl Log message: adding js test for expected dates on add/mod serial CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/includes/common.js.inc?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.1&r2=1.1.2.2 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/includes/doc-head-close-calendar.inc?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.6&r2=1.1.2.7 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/npl/en/bull/statecollection.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.2.2.14&r2=1.2.2.15 Patches: Index: includes/common.js.inc =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/includes/Attic/common.js.inc,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -b -r1.1.2.1 -r1.1.2.2 --- includes/common.js.inc 8 Mar 2006 23:07:05 -0000 1.1.2.1 +++ includes/common.js.inc 2 May 2007 13:59:52 -0000 1.1.2.2 @@ -49,4 +49,26 @@ document.forms['mainform'].elements[0].focus(); } } +function checkExpectedSerial(cnt) { + var success=true; + for (var i = 1; i<=cnt ; i++) { + var plan= document.getElementById('planneddate'+cnt); + var stat= document.getElementById('status'+cnt); + var defstat=0; + for ( var k=0 ; k < stat.options.length ; k++) { + if(stat.options[k].defaultSelected) { + defstat=stat.options[k].value; + } + } + if ((stat.value != defstat)&&(plan.value == '')&&(stat.value != 6)) { + plan.style.backgroundColor = 'red'; + success = false; + } + } + if ( ! success) { + alert("A serial issue is missing the expected date. Please supply a value."); + } + return success; +} + \ No newline at end of file Index: includes/doc-head-close-calendar.inc =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/includes/Attic/doc-head-close-calendar.inc,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -b -r1.1.2.6 -r1.1.2.7 --- includes/doc-head-close-calendar.inc 5 Apr 2006 14:52:52 -0000 1.1.2.6 +++ includes/doc-head-close-calendar.inc 2 May 2007 13:59:52 -0000 1.1.2.7 @@ -12,41 +12,9 @@ - + Index: bull/statecollection.tmpl =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/npl/en/bull/Attic/statecollection.tmpl,v retrieving revision 1.2.2.14 retrieving revision 1.2.2.15 diff -u -b -r1.2.2.14 -r1.2.2.15 --- bull/statecollection.tmpl 4 Dec 2006 05:32:10 -0000 1.2.2.14 +++ bull/statecollection.tmpl 2 May 2007 13:59:53 -0000 1.2.2.15 @@ -1,4 +1,4 @@ -Koha -- Subscription Details for +Koha -- Subscription Details for @@ -33,13 +33,14 @@ -
+ " /> " /> " /> + " /> -

Awaited or Late Subscription Issues

+

Expected or Late Subscription Issues

@@ -48,17 +49,38 @@ " size="30" maxlength="100" /> - + + - - From paul at koha-fr.org Wed May 2 18:44:31 2007 From: paul at koha-fr.org (paul poulain) Date: Wed, 02 May 2007 16:44:31 +0000 Subject: [Koha-cvs] koha C4/Biblio.pm C4/Search.pm updater/updateda... Message-ID: CVSROOT: /sources/koha Module name: koha Changes by: paul poulain 07/05/02 16:44:31 Modified files: C4 : Biblio.pm Search.pm updater : updatedatabase misc/migration_tools: rebuild_nozebra.pl Log message: NoZebra SQL index management : * adding 3 subs in Biblio.pm - GetNoZebraIndexes, that get the index structure in a new systempreference (added with this commit) - _DelBiblioNoZebra, that retrieve all index entries for a biblio and remove in a variable the biblio reference - _AddBiblioNoZebra, that add index entries for a biblio. Note that the 2 _Add and _Del subs work only in a hash variable, to speed up things in case of a modif (ie : delete+add). The effective SQL update is done in the ModZebra sub (that existed before, and dealed with zebra index). I think the code has to be more deeply tested, but it works at least partially. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&r1=1.201&r2=1.202 http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&r1=1.134&r2=1.135 http://cvs.savannah.gnu.org/viewcvs/koha/updater/updatedatabase?cvsroot=koha&r1=1.162&r2=1.163 http://cvs.savannah.gnu.org/viewcvs/koha/misc/migration_tools/rebuild_nozebra.pl?cvsroot=koha&r1=1.2&r2=1.3 Patches: Index: C4/Biblio.pm =================================================================== RCS file: /sources/koha/koha/C4/Biblio.pm,v retrieving revision 1.201 retrieving revision 1.202 diff -u -b -r1.201 -r1.202 --- C4/Biblio.pm 27 Apr 2007 14:00:49 -0000 1.201 +++ C4/Biblio.pm 2 May 2007 16:44:31 -0000 1.202 @@ -33,7 +33,7 @@ use vars qw($VERSION @ISA @EXPORT); # set the version for version checking -$VERSION = do { my @v = '$Revision: 1.201 $' =~ /\d+/g; shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); }; +$VERSION = do { my @v = '$Revision: 1.202 $' =~ /\d+/g; shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); }; @ISA = qw( Exporter ); @@ -113,6 +113,7 @@ &TransformHtmlToXml &PrepareItemrecordDisplay &char_decode + &GetNoZebraIndexes ); =head1 NAME @@ -607,7 +608,11 @@ } return $error if $error; - # Delete in Zebra + # Delete in Zebra. Be careful NOT to move this line after _koha_delete_biblio + # for at least 2 reasons : + # - we need to read the biblio if NoZebra is set (to remove it from the indexes + # - if something goes wrong, the biblio may be deleted from Koha but not from zebra + # and we would have no way to remove it (except manually in zebra, but I bet it would be very hard to handle the problem) ModZebra($biblionumber,"delete_record","biblioserver"); # delete biblio from Koha tables and save in deletedbiblio @@ -2705,97 +2710,254 @@ # replaced by a zebraqueue table, that is filled with ModZebra to run. # the table is emptied by misc/cronjobs/zebraqueue_start.pl script -my $sth=$dbh->prepare("insert into zebraqueue (biblio_auth_number ,server,operation) values(?,?,?)"); -$sth->execute($biblionumber,$server,$op); -$sth->finish; - -# -# my @Zconnbiblio; -# my $tried = 0; -# my $recon = 0; -# my $reconnect = 0; -# my $record; -# my $shadow; -# -# reconnect: -# $Zconnbiblio[0] = C4::Context->Zconn( $server, 0, 1 ); -# -# if ( $server eq "biblioserver" ) { -# -# # it's unclear to me whether this should be in xml or MARC format -# # but it is clear it should be nabbed from zebra rather than from -# # the koha tables -# $record = GetMarcBiblio($biblionumber); -# $record = $record->as_xml_record() if $record; -# # warn "RECORD $biblionumber => ".$record; -# $shadow="biblioservershadow"; -# -# # warn "RECORD $biblionumber => ".$record; -# $shadow = "biblioservershadow"; -# -# } -# elsif ( $server eq "authorityserver" ) { -# $record = C4::AuthoritiesMarc::XMLgetauthority( $dbh, $biblionumber ); -# $shadow = "authorityservershadow"; -# } ## Add other servers as necessary -# -# my $Zpackage = $Zconnbiblio[0]->package(); -# $Zpackage->option( action => $op ); -# $Zpackage->option( record => $record ); -# -# retry: -# $Zpackage->send("update"); -# my $i; -# my $event; -# -# while ( ( $i = ZOOM::event( \@Zconnbiblio ) ) != 0 ) { -# $event = $Zconnbiblio[0]->last_event(); -# last if $event == ZOOM::Event::ZEND; -# } -# -# my ( $error, $errmsg, $addinfo, $diagset ) = $Zconnbiblio[0]->error_x(); -# if ( $error == 10000 && $reconnect == 0 ) -# { ## This is serious ZEBRA server is not available -reconnect -# warn "problem with zebra server connection"; -# $reconnect = 1; -# my $res = system('sc start "Z39.50 Server" >c:/zebraserver/error.log'); -# -# #warn "Trying to restart ZEBRA Server"; -# #goto "reconnect"; -# } -# elsif ( $error == 10007 && $tried < 2 ) -# { ## timeout --another 30 looonng seconds for this update -# $tried = $tried + 1; -# warn "warn: timeout, trying again"; -# goto "retry"; -# } -# elsif ( $error == 10004 && $recon == 0 ) { ##Lost connection -reconnect -# $recon = 1; -# warn "error: reconnecting to zebra"; -# goto "reconnect"; -# -# # as a last resort, we save the data to the filesystem to be indexed in batch -# } -# elsif ($error) { -# warn -# "Error-$server $op $biblionumber /errcode:, $error, /MSG:,$errmsg,$addinfo \n"; -# $Zpackage->destroy(); -# $Zconnbiblio[0]->destroy(); -# ModZebrafiles( $dbh, $biblionumber, $record, $op, $server ); -# return; -# } -# if ( C4::Context->$shadow ) { -# $Zpackage->send('commit'); -# while ( ( $i = ZOOM::event( \@Zconnbiblio ) ) != 0 ) { -# -# #waiting zebra to finish; -# } -# } -# $Zpackage->destroy(); + if (C4::Context->preference("NoZebra")) { + # lock the nozebra table : we will read index lines, update them in Perl process + # and write everything in 1 transaction. + # lock the table to avoid someone else overwriting what we are doing + $dbh->do('LOCK TABLES nozebra WRITE,biblio WRITE,biblioitems WRITE, systempreferences WRITE'); + my %result; # the result hash that will be builded by deletion / add, and written on mySQL at the end, to improve speed + my $record= GetMarcBiblio($biblionumber); + if ($op eq 'specialUpdate') { + # OK, we have to add or update the record + # 1st delete (virtually, in indexes) ... + %result = _DelBiblioNoZebra($biblionumber,$record); + # ... add the record + %result=_AddBiblioNoZebra($biblionumber,$record, %result); + } else { + # it's a deletion, delete the record... + %result=_DelBiblioNoZebra($biblionumber,$record); + } + # ok, now update the database... + my $sth = $dbh->prepare("UPDATE nozebra SET biblionumbers=? WHERE indexname=? AND value=?"); + foreach my $key (keys %result) { + foreach my $index (keys %{$result{$key}}) { + $sth->execute($result{$key}->{$index},$key,$index); + } + } + $dbh->do('UNLOCK TABLES'); + + } else { + # + # we use zebra, just fill zebraqueue table + # + my $sth=$dbh->prepare("insert into zebraqueue (biblio_auth_number ,server,operation) values(?,?,?)"); + $sth->execute($biblionumber,$server,$op); + $sth->finish; + } +} + +=head2 GetNoZebraIndexes + +=cut + +sub GetNoZebraIndexes { + my $index = C4::Context->preference('NoZebraIndexes'); + my %indexes; + foreach my $line (split /('|"),/,$index) { + $line =~ /(.*)=>(.*)/; + my $index = substr($1,1); # get the index, don't forget to remove initial ' or " + my $fields = $2; + $index =~ s/'|"| //g; + $fields =~ s/'|"| //g; + $indexes{$index}=$fields; + } + return %indexes; } =head1 INTERNAL FUNCTIONS +=head2 _DelBiblioNoZebra($biblionumber,$record); + + function to delete a biblio in NoZebra indexes + This function does NOT delete anything in database : it reads all the indexes entries + that have to be deleted & delete them in the hash + The SQL part is done either : + - after the Add if we are modifying a biblio (delete + add again) + - immediatly after this sub if we are doing a true deletion. + +=cut + + +sub _DelBiblioNoZebra { + my ($biblionumber,$record)=@_; + # Get the indexes + my $dbh = C4::Context->dbh; + # Get the indexes + my %index=GetNoZebraIndexes; + # get title of the record (to store the 10 first letters with the index) + my ($titletag,$titlesubfield) = GetMarcFromKohaField('biblio.title'); + my $title = lc($record->subfield($titletag,$titlesubfield)); + + my %result; + # remove blancks comma (that could cause problem when decoding the string for CQL retrieval) and regexp specific values + $title =~ s/ |,|;|\[|\]|\(|\)|\*|-|'|=//g; + # limit to 10 char, should be enough, and limit the DB size + $title = substr($title,0,10); + #parse each field + my $sth2=$dbh->prepare('SELECT biblionumbers FROM nozebra WHERE indexname=? AND value=?'); + foreach my $field ($record->fields()) { + #parse each subfield + next if $field->tag <10; + foreach my $subfield ($field->subfields()) { + my $tag = $field->tag(); + my $subfieldcode = $subfield->[0]; + my $indexed=0; + # check each index to see if the subfield is stored somewhere + # otherwise, store it in __RAW__ index + foreach my $key (keys %index) { +# warn "examining $key index : ".$index{$key}." for $tag $subfieldcode"; + if ($index{$key} =~ /$tag\*/ or $index{$key} =~ /$tag$subfieldcode/) { + $indexed=1; + my $line= lc $subfield->[1]; + # remove meaningless value in the field... + $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\/|=/ /g; + # ... and split in words + foreach (split / /,$line) { + next unless $_; # skip empty values (multiple spaces) + # if the entry is already here, do nothing, the biblionumber has already be removed + unless ($result{$key}->{$_} =~ /$biblionumber,$title\-(\d);/) { + # get the index value if it exist in the nozebra table and remove the entry, otherwise, do nothing + $sth2->execute($key,$_); + my $existing_biblionumbers = $sth2->fetchrow; + # it exists + if ($existing_biblionumbers) { + warn " existing for $key $_: $existing_biblionumbers"; + $result{$key}->{$_} =$existing_biblionumbers; + $result{$key}->{$_} =~ s/$biblionumber,$title\-(\d);//; + } + } + } + } + } + # the subfield is not indexed, store it in __RAW__ index anyway + unless ($indexed) { + my $line= lc $subfield->[1]; + $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\/|=/ /g; + # ... and split in words + foreach (split / /,$line) { + next unless $_; # skip empty values (multiple spaces) + # if the entry is already here, do nothing, the biblionumber has already be removed + unless ($result{'__RAW__'}->{$_} =~ /$biblionumber,$title\-(\d);/) { + # get the index value if it exist in the nozebra table and remove the entry, otherwise, do nothing + $sth2->execute('__RAW__',$_); + my $existing_biblionumbers = $sth2->fetchrow; + # it exists + if ($existing_biblionumbers) { + warn " existing for __RAW__ $_ : $existing_biblionumbers"; + $result{'__RAW__'}->{$_} =$existing_biblionumbers; + $result{'__RAW__'}->{$_} =~ s/$biblionumber,$title\-(\d);//; + } + } + } + } + } + } + return %result; +} + +=head2 _DelBiblioNoZebra($biblionumber,$record); + + function to delete a biblio in NoZebra indexes + +=cut + + +sub _AddBiblioNoZebra { + my ($biblionumber,$record,%result)=@_; + my $dbh = C4::Context->dbh; + # Get the indexes + my %index=GetNoZebraIndexes; + # get title of the record (to store the 10 first letters with the index) + my ($titletag,$titlesubfield) = GetMarcFromKohaField('biblio.title'); + my $title = lc($record->subfield($titletag,$titlesubfield)); + + # remove blancks comma (that could cause problem when decoding the string for CQL retrieval) and regexp specific values + $title =~ s/ |,|;|\[|\]|\(|\)|\*|-|'|=//g; + # limit to 10 char, should be enough, and limit the DB size + $title = substr($title,0,10); + #parse each field + my $sth2=$dbh->prepare('SELECT biblionumbers FROM nozebra WHERE indexname=? AND value=?'); + foreach my $field ($record->fields()) { + #parse each subfield + next if $field->tag <10; + foreach my $subfield ($field->subfields()) { + my $tag = $field->tag(); + my $subfieldcode = $subfield->[0]; + my $indexed=0; + # check each index to see if the subfield is stored somewhere + # otherwise, store it in __RAW__ index + foreach my $key (keys %index) { +# warn "examining $key index : ".$index{$key}." for $tag $subfieldcode"; + if ($index{$key} =~ /$tag\*/ or $index{$key} =~ /$tag$subfieldcode/) { + $indexed=1; + my $line= lc $subfield->[1]; + # remove meaningless value in the field... + $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\/|=/ /g; + # ... and split in words + foreach (split / /,$line) { + next unless $_; # skip empty values (multiple spaces) + # if the entry is already here, improve weight +# warn "managing $_"; + if ($result{$key}->{$_} =~ /$biblionumber,$title\-(\d);/) { + my $weight=$1+1; + $result{$key}->{$_} =~ s/$biblionumber,$title\-(\d);//; + $result{$key}->{$_} .= "$biblionumber,$title-$weight;"; + } else { + # get the value if it exist in the nozebra table, otherwise, create it + $sth2->execute($key,$_); + my $existing_biblionumbers = $sth2->fetchrow; + # it exists + if ($existing_biblionumbers) { + warn" existing : $existing_biblionumbers"; + $result{$key}->{$_} =$existing_biblionumbers; + my $weight=$1+1; + $result{$key}->{$_} =~ s/$biblionumber,$title\-(\d);//; + $result{$key}->{$_} .= "$biblionumber,$title-$weight;"; + # create a new ligne for this entry + } else { + $dbh->do('INSERT INTO nozebra SET indexname='.$dbh->quote($key).',value='.$dbh->quote($_)); + $result{$key}->{$_}.="$biblionumber,$title-1;"; + } + } + } + } + } + # the subfield is not indexed, store it in __RAW__ index anyway + unless ($indexed) { + my $line= lc $subfield->[1]; + $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\/|=/ /g; + # ... and split in words + foreach (split / /,$line) { + next unless $_; # skip empty values (multiple spaces) + # if the entry is already here, improve weight + if ($result{'__RAW__'}->{$_} =~ /$biblionumber,$title\-(\d);/) { + my $weight=$1+1; + $result{'__RAW__'}->{$_} =~ s/$biblionumber,$title\-(\d);//; + $result{'__RAW__'}->{$_} .= "$biblionumber,$title-$weight;"; + } else { + # get the value if it exist in the nozebra table, otherwise, create it + $sth2->execute('__RAW__',$_); + my $existing_biblionumbers = $sth2->fetchrow; + # it exists + if ($existing_biblionumbers) { + $result{'__RAW__'}->{$_} =$existing_biblionumbers; + my $weight=$1+1; + $result{'__RAW__'}->{$_} =~ s/$biblionumber,$title\-(\d);//; + $result{'__RAW__'}->{$_} .= "$biblionumber,$title-$weight;"; + # create a new ligne for this entry + } else { + $dbh->do('INSERT INTO nozebra SET indexname="__RAW__",value='.$dbh->quote($_)); + $result{'__RAW__'}->{$_}.="$biblionumber,$title-1;"; + } + } + } + } + } + } + return %result; +} + + =head2 MARCitemchange =over 4 @@ -3505,7 +3667,7 @@ # deal with UNIMARC field 100 (encoding) : create it if needed & set encoding to unicode if ( $encoding eq "UNIMARC" ) { my $string; - if ( $record->subfield( 100, "a" ) ) { + if ( length($record->subfield( 100, "a" )) == 35 ) { $string = $record->subfield( 100, "a" ); my $f100 = $record->field(100); $record->delete_field($f100); @@ -3689,8 +3851,17 @@ =cut -# $Id: Biblio.pm,v 1.201 2007/04/27 14:00:49 hdl Exp $ +# $Id: Biblio.pm,v 1.202 2007/05/02 16:44:31 tipaul Exp $ # $Log: Biblio.pm,v $ +# Revision 1.202 2007/05/02 16:44:31 tipaul +# NoZebra SQL index management : +# * adding 3 subs in Biblio.pm +# - GetNoZebraIndexes, that get the index structure in a new systempreference (added with this commit) +# - _DelBiblioNoZebra, that retrieve all index entries for a biblio and remove in a variable the biblio reference +# - _AddBiblioNoZebra, that add index entries for a biblio. +# Note that the 2 _Add and _Del subs work only in a hash variable, to speed up things in case of a modif (ie : delete+add). The effective SQL update is done in the ModZebra sub (that existed before, and dealed with zebra index). +# I think the code has to be more deeply tested, but it works at least partially. +# # Revision 1.201 2007/04/27 14:00:49 hdl # Removing $dbh from GetMarcFromKohaField (dbh is not used in this function.) # Index: C4/Search.pm =================================================================== RCS file: /sources/koha/koha/C4/Search.pm,v retrieving revision 1.134 retrieving revision 1.135 diff -u -b -r1.134 -r1.135 --- C4/Search.pm 2 May 2007 11:57:11 -0000 1.134 +++ C4/Search.pm 2 May 2007 16:44:31 -0000 1.135 @@ -25,7 +25,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); # set the version for version checking -$VERSION = do { my @v = '$Revision: 1.134 $' =~ /\d+/g; +$VERSION = do { my @v = '$Revision: 1.135 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); }; @@ -1454,26 +1454,21 @@ $title =~ /(.*)-(\d)/; # get weight my $ranking =$2; - # hint : the result is sorted by title.biblionumber because we can have X biblios with the same title - # and we don't want to get only 1 result for each of them !!! # note that we + the ranking because ranking is calculated on weight of EACH term requested. # if we ask for "two towers", and "two" has weight 2 in biblio N, and "towers" has weight 4 in biblio N # biblio N has ranking = 6 - $count_ranking{$biblionumber}=0 unless $count_ranking{$biblionumber}; $count_ranking{$biblionumber} =+ $ranking; } # build the result by "inverting" the count_ranking hash # hing : as usual, we don't order by ranking only, to avoid having only 1 result for each rank. We build an hash on concat(ranking,biblionumber) instead # warn "counting"; foreach (keys %count_ranking) { - warn "$_ =".sprintf("%10d",$count_ranking{$_}).'-'.$_; $result{sprintf("%10d",$count_ranking{$_}).'-'.$_} = $_; } # sort the hash and return the same structure as GetRecords (Zebra querying) my $result_hash; my $numbers=0; foreach my $key (sort {$b <=> $a} (keys %result)) { - warn "KEY : $key = ".$result{$key}; $result_hash->{'RECORDS'}[$numbers++] = $result{$key}; } # for the requested page, replace biblionumber by the complete record Index: updater/updatedatabase =================================================================== RCS file: /sources/koha/koha/updater/updatedatabase,v retrieving revision 1.162 retrieving revision 1.163 diff -u -b -r1.162 -r1.163 --- updater/updatedatabase 30 Apr 2007 16:16:50 -0000 1.162 +++ updater/updatedatabase 2 May 2007 16:44:31 -0000 1.163 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: updatedatabase,v 1.162 2007/04/30 16:16:50 tipaul Exp $ +# $Id: updatedatabase,v 1.163 2007/05/02 16:44:31 tipaul Exp $ # Database Updater # This script checks for required updates to the database. @@ -530,6 +530,14 @@ explanation => 'Active this if you want NOT to use zebra (large libraries should avoid this parameters)', type => 'YesNo', }, + { + uniquefieldrequired => 'variable', + variable => 'NoZebraIndexes', + value => '0', + forceupdate => {'explanation' => 1, 'type' => 1}, + explanation => "Enter a specific hash for NoZebra indexes. Enter : 'indexname' => '100a,245a,500*','index2' => '...'", + type => 'Free', + }, ], userflags => [ { @@ -1993,6 +2001,15 @@ exit; # $Log: updatedatabase,v $ +# Revision 1.163 2007/05/02 16:44:31 tipaul +# NoZebra SQL index management : +# * adding 3 subs in Biblio.pm +# - GetNoZebraIndexes, that get the index structure in a new systempreference (added with this commit) +# - _DelBiblioNoZebra, that retrieve all index entries for a biblio and remove in a variable the biblio reference +# - _AddBiblioNoZebra, that add index entries for a biblio. +# Note that the 2 _Add and _Del subs work only in a hash variable, to speed up things in case of a modif (ie : delete+add). The effective SQL update is done in the ModZebra sub (that existed before, and dealed with zebra index). +# I think the code has to be more deeply tested, but it works at least partially. +# # Revision 1.162 2007/04/30 16:16:50 tipaul # bugfix for updatedatabase : when there is no default value (NULL fields) + removing bibliothesaurus table+adding NoZebra systempref (False by default) # Index: misc/migration_tools/rebuild_nozebra.pl =================================================================== RCS file: /sources/koha/koha/misc/migration_tools/rebuild_nozebra.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- misc/migration_tools/rebuild_nozebra.pl 2 May 2007 11:57:11 -0000 1.2 +++ misc/migration_tools/rebuild_nozebra.pl 2 May 2007 16:44:31 -0000 1.3 @@ -14,7 +14,7 @@ $|=1; # flushes output # limit for database dumping -my $limit;# = "LIMIT 1000"; +my $limit = "LIMIT 100"; my $directory; my $skip_export; my $keep_export; @@ -47,22 +47,7 @@ my $i=0; my %result; -my %index = ( - 'title' => '200a,200c,200d,200e,225a,225d,225e,225f,225h,225i,225v,500*,501*,503*,510*,512*,513*,514*,515*,516*,517*,518*,519*,520*,530*,531*,532*,540*,541*,545*,604t,610t,605a', - 'author' =>'200f,600a,601a,604a,700a,700b,700c,700d,700a,701b,701c,701d,702a,702b,702c,702d,710a,710b,710c,710d,711a,711b,711c,711d,712a,712b,712c,712d', - 'isbn' => '010a', - 'issn' => '011a', - 'biblionumber' =>'0909', - 'itemtype' => '200b', - 'language' => '010a', - 'publisher' => '210x', - 'date' => '210d', - 'note' => '300a,301a,302a,303a,304a,305a,306az,307a,308a,309a,310a,311a,312a,313a,314a,315a,316a,317a,318a,319a,320a,321a,322a,323a,324a,325a,326a,327a,328a,330a,332a,333a,336a,337a,345a', - 'Koha-Auth-Number' => '6009,6019,6029,6039,6049,6059,6069,6109', - 'subject' => '600*,601*,606*,610*', - 'dewey' => '676a', - 'host-item' => '995a,995c', - ); +my %index = GetNoZebraIndexes(); $|=1; while (my ($biblionumber) = $sth->fetchrow) { @@ -71,14 +56,11 @@ my $record = GetMarcBiblio($biblionumber); # get title of the record (to store the 10 first letters with the index) - my $title; - if (C4::Context->preference('marcflavour') eq 'UNIMARC') { - $title = lc($record->subfield('200','a')); - } else { - $title = lc($record->subfield('245','a')); - } + my ($titletag,$titlesubfield) = GetMarcFromKohaField('biblio.title'); + my $title = lc($record->subfield($titletag,$titlesubfield)); + # remove blancks comma (that could cause problem when decoding the string for CQL retrieval) and regexp specific values - $title =~ s/ |,|;|\[|\]|\(|\)|\*//g; + $title =~ s/ |,|;|\[|\]|\(|\)|\*|-|'|=//g; # limit to 10 char, should be enough, and limit the DB size $title = substr($title,0,10); #parse each field @@ -92,16 +74,20 @@ # check each index to see if the subfield is stored somewhere # otherwise, store it in __RAW__ index foreach my $key (keys %index) { - if ($index{$key} =~ /$tag\*/ or $index{$key} =~ /$tag$subfield/) { + if ($index{$key} =~ /$tag\*/ or $index{$key} =~ /$tag$subfieldcode/) { $indexed=1; my $line= lc $subfield->[1]; - $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\// /g; + # remove meaningless value in the field... + $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\/|=/ /g; + # ... and split in words foreach (split / /,$line) { - # see if the entry is already here + next unless $_; # skip empty values (multiple spaces) + # if the entry is already here, improve weight if ($result{$key}->{$_} =~ /$biblionumber,$title\-(\d);/) { my $weight=$1+1; $result{$key}->{$_} =~ s/$biblionumber,$title\-(\d);//; $result{$key}->{$_} .= "$biblionumber,$title-$weight;"; + # otherwise, create it, with weight=1 } else { $result{$key}->{$_}.="$biblionumber,$title-1;"; } @@ -111,8 +97,9 @@ # the subfield is not indexed, store it in __RAW__ index anyway unless ($indexed) { my $line= lc $subfield->[1]; - $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\// /g; + $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\/|=/ /g; foreach (split / /,$line) { + next unless $_; # warn $record->as_formatted."$_ =>".$title; if ($result{__RAW__}->{$_} =~ /$biblionumber,$title\-(\d);/) { my $weight=$1+1; @@ -131,8 +118,8 @@ foreach my $key (keys %result) { foreach my $index (keys %{$result{$key}}) { $sth->execute($key,$index,$result{$key}->{$index}); - if (length($result{$key}->{$index}) >40000) { - print length($result{$key}->{$index})." for $key / $index"; + if (length($result{$key}->{$index}) > 40000) { + print length($result{$key}->{$index})."\n for $key / $index\n"; } } } From crc at liblime.com Thu May 3 02:57:16 2007 From: crc at liblime.com (Chris Cormack) Date: Thu, 03 May 2007 00:57:16 +0000 Subject: [Koha-cvs] koha/reports inventory.pl [rel_2_2] Message-ID: CVSROOT: /sources/koha Module name: koha Branch: rel_2_2 Changes by: Chris Cormack 07/05/03 00:57:16 Modified files: reports : inventory.pl Log message: Fix for catching windows linefeeds CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/reports/inventory.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.4.4&r2=1.1.4.5 Patches: Index: inventory.pl =================================================================== RCS file: /sources/koha/koha/reports/inventory.pl,v retrieving revision 1.1.4.4 retrieving revision 1.1.4.5 diff -u -b -r1.1.4.4 -r1.1.4.5 --- inventory.pl 5 Feb 2006 21:59:21 -0000 1.1.4.4 +++ inventory.pl 3 May 2007 00:57:16 -0000 1.1.4.5 @@ -81,8 +81,9 @@ my @errorloop; my $count=0; while (my $barcode=<$uploadbarcodes>){ + $barcode =~ s/\r//g; # clear out windows line feeds, otherwise things go badly if ppl upload a file made on windows chomp $barcode; -# warn "$barcode"; + if ($qwthdrawn->execute($barcode) &&$qwthdrawn->rows){ push @errorloop, {'barcode'=>$barcode,'ERR_WTHDRAWN'=>1}; }else{ From kyle.m.hall at gmail.com Thu May 3 15:11:08 2007 From: kyle.m.hall at gmail.com (Kyle Hall) Date: Thu, 03 May 2007 13:11:08 +0000 Subject: [Koha-cvs] koha/members memberentry.pl [dev_week] Message-ID: CVSROOT: /sources/koha Module name: koha Branch: dev_week Changes by: Kyle Hall 07/05/03 13:11:08 Modified files: members : memberentry.pl Log message: If editing member, branchcode defaults to members.branchcode, if new member, branchcode pulldown defaults to logged in branch. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/members/memberentry.pl?cvsroot=koha&only_with_tag=dev_week&r1=1.5.2.13.2.1&r2=1.5.2.13.2.2 Patches: Index: memberentry.pl =================================================================== RCS file: /sources/koha/koha/members/memberentry.pl,v retrieving revision 1.5.2.13.2.1 retrieving revision 1.5.2.13.2.2 diff -u -b -r1.5.2.13.2.1 -r1.5.2.13.2.2 --- memberentry.pl 17 Apr 2007 15:18:37 -0000 1.5.2.13.2.1 +++ memberentry.pl 3 May 2007 13:11:08 -0000 1.5.2.13.2.2 @@ -2,7 +2,7 @@ # NOTE: This file uses standard 8-space tabs # DO NOT SET TAB SIZE TO 4 -# $Id: memberentry.pl,v 1.5.2.13.2.1 2007/04/17 15:18:37 kylemhall Exp $ +# $Id: memberentry.pl,v 1.5.2.13.2.2 2007/05/03 13:11:08 kylemhall Exp $ #script to set up screen for modification of borrower details #written 20/12/99 by chris at katipo.co.nz @@ -89,10 +89,12 @@ push @errors, "ERROR_invalid_cardnumber"; } } + if ($data{'sex'} eq '' && $categorycode ne "I"){ push @errors, "ERROR_gender"; $nok=1; } + if ($data{'firstname'} eq '' && $categorycode ne "I"){ push @errors,"ERROR_firstname"; $nok=1; @@ -122,7 +124,24 @@ if ($data{'expiry'} && format_date_in_iso($data{'joining'}) > format_date_in_iso($data{'expiry'})) { push @errors, "ERROR_date"; warn "ERROR DATE"; + $nok=1; } + # TEST +# if ($data{'expiry'} eq ''){ +# push @errors, "ERROR_expiry"; +# $nok=1; +# } +# if ($data{'expiry'} eq '0000-00-00'){ +# push @errors, "ERROR_expiry"; +# $nok=1; +# } +# if ($data{'expiry'} eq 'NULL'){ +# push @errors, "ERROR_expiry"; +# $nok=1; +# } + + + if ($nok) { foreach my $error (@errors) { $template->param( $error => 1); @@ -196,11 +215,13 @@ ($categories,$labels)=borrowercategories(); my $catcodepopup = CGI::popup_menu(-name=>'categorycode', -id => 'categorycode', + -class => 'focus', + -tabindex => '6', -values=>$categories, -default=>$data->{'categorycode'}, -labels=>$labels); - my @relationships = ('','workplace', 'relative','friend', 'neighbour'); + my @relationships = ('','parent', 'guardian', 'grandparent', 'relative','friend', 'neighbour'); my @relshipdata; while (@relationships) { my $relship = shift @relationships; @@ -215,8 +236,8 @@ # %flags: keys=$data-keys, datas=[formname, HTML-explanation] my %flags = ('gonenoaddress' => ['gna', 'Gone no address'], - 'lost' => ['lost', 'Lost'], - 'debarred' => ['debarred', 'Debarred']); + 'lost' => ['lost', 'Lost Card'], + 'debarred' => ['debarred', 'Restricted']); my @flagdata; foreach (keys(%flags)) { @@ -257,13 +278,29 @@ $default = C4::Context->userenv->{'branch'}; } } - my $CGIbranch=CGI::scrolling_list( -name => 'branchcode', + + my $CGIbranch; + if ( $modify eq 'edit' ) { + $CGIbranch=CGI::scrolling_list( -name => 'branchcode', -id => 'branchcode', + -class => 'focus', + -tabindex => '7', + -values => \@select_branch, + -default => $data->{'branchcode'}, + -labels => \%select_branches, + -size => 1, + -multiple => 0 ); + } else { + $CGIbranch=CGI::scrolling_list( -name => 'branchcode', + -id => 'branchcode', + -class => 'focus', + -tabindex => '7', -values => \@select_branch, -default => $loggedInBranchcode, -labels => \%select_branches, -size => 1, -multiple => 0 ); + } my $CGIsort1 = buildCGIsort("Bsort1","sort1",$data->{'sort1'}); if ($CGIsort1) { From paul at koha-fr.org Thu May 3 17:16:02 2007 From: paul at koha-fr.org (paul poulain) Date: Thu, 03 May 2007 15:16:02 +0000 Subject: [Koha-cvs] koha/C4 Biblio.pm Message-ID: CVSROOT: /sources/koha Module name: koha Changes by: paul poulain 07/05/03 15:16:02 Modified files: C4 : Biblio.pm Log message: BUGFIX for : NoZebra - NoZebra features : seems they work fine now (adding, modifying, deleting) - Biblio edition major bugfix : before this commit editing a biblio resulted in an item removal in marcxml field CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/C4/Biblio.pm?cvsroot=koha&r1=1.202&r2=1.203 Patches: Index: Biblio.pm =================================================================== RCS file: /sources/koha/koha/C4/Biblio.pm,v retrieving revision 1.202 retrieving revision 1.203 diff -u -b -r1.202 -r1.203 --- Biblio.pm 2 May 2007 16:44:31 -0000 1.202 +++ Biblio.pm 3 May 2007 15:16:02 -0000 1.203 @@ -33,7 +33,7 @@ use vars qw($VERSION @ISA @EXPORT); # set the version for version checking -$VERSION = do { my @v = '$Revision: 1.202 $' =~ /\d+/g; shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); }; +$VERSION = do { my @v = '$Revision: 1.203 $' =~ /\d+/g; shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); }; @ISA = qw( Exporter ); @@ -371,7 +371,13 @@ $frameworkcode = "" unless $frameworkcode; - # update the MARC record with the new record data + # get the items before and append them to the biblio before updating the record, atm we just have the biblio + my ( $itemtag, $itemsubfield ) = GetMarcFromKohaField("items.itemnumber",$frameworkcode); + my $oldRecord = GetMarcBiblio($biblionumber); + my @fields = $oldRecord->field($itemtag); + $record->append_fields(@fields); + + # update the MARC record (that now contains biblio and items) with the new record data &ModBiblioMarc($record, $biblionumber, $frameworkcode ); # load the koha-table data object @@ -545,7 +551,7 @@ my $sth = $dbh->prepare("update biblioitems set marc=?,marcxml=? where biblionumber=?"); $sth->execute( $completeRecord->as_usmarc(), $completeRecord->as_xml_record(),$biblionumber ); $sth->finish; - ModZebra($biblionumber,"specialUpdate","biblioserver"); + ModZebra($biblionumber,"specialUpdate","biblioserver",$completeRecord); } =head2 ModDateLastSeen @@ -590,11 +596,11 @@ # First make sure there are no items with issues are still attached my $sth = $dbh->prepare( - "SELECT biblioitemnumber FROM biblioitems WHERE biblionumber=?"); + "SELECT itemnumber FROM items WHERE biblionumber=?"); $sth->execute($biblionumber); - while ( my $biblioitemnumber = $sth->fetchrow ) { - my @issues = C4::Circulation::Circ2::itemissues($biblioitemnumber); - foreach my $issue (@issues) { + while ( my $itemnumber = $sth->fetchrow ) { + my $issues = GetItemIssues($itemnumber); + foreach my $issue (@$issues) { if ( ( $issue->{date_due} ) && ( $issue->{date_due} ne "Available" ) ) { @@ -613,7 +619,7 @@ # - we need to read the biblio if NoZebra is set (to remove it from the indexes # - if something goes wrong, the biblio may be deleted from Koha but not from zebra # and we would have no way to remove it (except manually in zebra, but I bet it would be very hard to handle the problem) - ModZebra($biblionumber,"delete_record","biblioserver"); + ModZebra($biblionumber, "delete_record", "biblioserver", undef); # delete biblio from Koha tables and save in deletedbiblio $error = &_koha_delete_biblio( $dbh, $biblionumber ); @@ -2693,15 +2699,19 @@ =over 4 -ModZebra( $dbh, $biblionumber, $op, $server ); +ModZebra( $biblionumber, $op, $server, $newRecord ); + $biblionumber is the biblionumber we want to index + $op is specialUpdate or delete, and is used to know what we want to do + $server is the server that we want to update + $newRecord is the MARC::Record containing the new record. It is usefull only when NoZebra=1, and is used to know what to add to the nozebra database. (the record in mySQL being, if it exist, the previous record, the one just before the modif. We need both : the previous and the new one. =back =cut sub ModZebra { ###Accepts a $server variable thus we can use it for biblios authorities or other zebra dbs - my ( $biblionumber, $op, $server ) = @_; + my ( $biblionumber, $op, $server, $newRecord ) = @_; my $dbh=C4::Context->dbh; #warn "SERVER:".$server; # @@ -2722,7 +2732,7 @@ # 1st delete (virtually, in indexes) ... %result = _DelBiblioNoZebra($biblionumber,$record); # ... add the record - %result=_AddBiblioNoZebra($biblionumber,$record, %result); + %result=_AddBiblioNoZebra($biblionumber,$newRecord, %result); } else { # it's a deletion, delete the record... %result=_DelBiblioNoZebra($biblionumber,$record); @@ -2731,6 +2741,7 @@ my $sth = $dbh->prepare("UPDATE nozebra SET biblionumbers=? WHERE indexname=? AND value=?"); foreach my $key (keys %result) { foreach my $index (keys %{$result{$key}}) { + warn "UPDATING : $key , $index with :".$result{$key}->{$index}; $sth->execute($result{$key}->{$index},$key,$index); } } @@ -2780,6 +2791,8 @@ sub _DelBiblioNoZebra { my ($biblionumber,$record)=@_; + + warn "DELETING".$record->as_formatted; # Get the indexes my $dbh = C4::Context->dbh; # Get the indexes @@ -2812,6 +2825,7 @@ # remove meaningless value in the field... $line =~ s/-|\.|\?|,|;|!|'|\(|\)|\[|\]|{|}|"|<|>|&|\+|\*|\/|=/ /g; # ... and split in words + warn "DELETING : $key / $tag / $subfieldcode / $line"; foreach (split / /,$line) { next unless $_; # skip empty values (multiple spaces) # if the entry is already here, do nothing, the biblionumber has already be removed @@ -2821,9 +2835,10 @@ my $existing_biblionumbers = $sth2->fetchrow; # it exists if ($existing_biblionumbers) { - warn " existing for $key $_: $existing_biblionumbers"; +# warn " existing for $key $_: $existing_biblionumbers"; $result{$key}->{$_} =$existing_biblionumbers; $result{$key}->{$_} =~ s/$biblionumber,$title\-(\d);//; + warn "after cleaning : $key / $_ = ".$result{$key}->{$_}; } } } @@ -3651,7 +3666,7 @@ sub ModBiblioMarc { -# pass the MARC::Record to this function, and it will create the records in the marc tables +# pass the MARC::Record to this function, and it will create the records in the marc field my ( $record, $biblionumber, $frameworkcode ) = @_; my $dbh = C4::Context->dbh; my @fields = $record->fields(); @@ -3684,6 +3699,7 @@ } } # warn "biblionumber : ".$biblionumber; + ModZebra($biblionumber,"specialUpdate","biblioserver",$record); $sth = $dbh->prepare( "update biblioitems set marc=?,marcxml=? where biblionumber=?"); @@ -3691,7 +3707,6 @@ $biblionumber ); # warn $record->as_xml_record(); $sth->finish; - ModZebra($biblionumber,"specialUpdate","biblioserver"); return $biblionumber; } @@ -3851,8 +3866,13 @@ =cut -# $Id: Biblio.pm,v 1.202 2007/05/02 16:44:31 tipaul Exp $ +# $Id: Biblio.pm,v 1.203 2007/05/03 15:16:02 tipaul Exp $ # $Log: Biblio.pm,v $ +# Revision 1.203 2007/05/03 15:16:02 tipaul +# BUGFIX for : NoZebra +# - NoZebra features : seems they work fine now (adding, modifying, deleting) +# - Biblio edition major bugfix : before this commit editing a biblio resulted in an item removal in marcxml field +# # Revision 1.202 2007/05/02 16:44:31 tipaul # NoZebra SQL index management : # * adding 3 subs in Biblio.pm From alaurin at ouestprovence.fr Fri May 4 12:18:00 2007 From: alaurin at ouestprovence.fr (LAURIN arnaud) Date: Fri, 04 May 2007 10:18:00 +0000 Subject: [Koha-cvs] koha/circ circulation.pl transferstodo.pl trans... Message-ID: CVSROOT: /sources/koha Module name: koha Changes by: LAURIN arnaud 07/05/04 10:18:00 Modified files: circ : circulation.pl transferstodo.pl transferstoreceive.pl waitingreserves.pl Log message: bugfixing for circulation. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/circ/circulation.pl?cvsroot=koha&r1=1.112&r2=1.113 http://cvs.savannah.gnu.org/viewcvs/koha/circ/transferstodo.pl?cvsroot=koha&r1=1.2&r2=1.3 http://cvs.savannah.gnu.org/viewcvs/koha/circ/transferstoreceive.pl?cvsroot=koha&r1=1.2&r2=1.3 http://cvs.savannah.gnu.org/viewcvs/koha/circ/waitingreserves.pl?cvsroot=koha&r1=1.3&r2=1.4 Patches: Index: circulation.pl =================================================================== RCS file: /sources/koha/koha/circ/circulation.pl,v retrieving revision 1.112 retrieving revision 1.113 diff -u -b -r1.112 -r1.113 --- circulation.pl 25 Apr 2007 14:07:34 -0000 1.112 +++ circulation.pl 4 May 2007 10:18:00 -0000 1.113 @@ -266,7 +266,7 @@ # new op dev # now we show the status of the borrower's reservations - my @borrowerreserv = GetReservesFromBorrowernumber$borrowernumber ); + my @borrowerreserv = GetReservesFromBorrowernumber($borrowernumber ); my @reservloop; my @WaitingReserveLoop; Index: transferstodo.pl =================================================================== RCS file: /sources/koha/koha/circ/transferstodo.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- transferstodo.pl 24 Apr 2007 09:07:53 -0000 1.2 +++ transferstodo.pl 4 May 2007 10:18:00 -0000 1.3 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: transferstodo.pl,v 1.2 2007/04/24 09:07:53 tipaul Exp $ +# $Id: transferstodo.pl,v 1.3 2007/05/04 10:18:00 alaurin Exp $ # Copyright 2000-2002 Katipo Communications # @@ -85,7 +85,6 @@ my $gettitle = GetBiblioFromItemNumber( $num->{'itemnumber'} ); # use Data::Dumper; # warn Dumper($gettitle); - warn "ITEM : ".$gettitle->{'title'}; my $itemtypeinfo = getitemtypeinfo( $gettitle->{'itemtype'} ); if ( $gettitle->{'holdingbranch'} eq $default ) { my $getborrower = @@ -118,7 +117,6 @@ $getreserv{'borrowermail'} = $getborrower->{'emailaddress'}; $getreserv{'borrowerphone'} = $getborrower->{'phone'}; push( @reservloop, \%getreserv ); - warn "=".$getreserv{'title'}.">>".$gettitle->{'title'}; } } Index: transferstoreceive.pl =================================================================== RCS file: /sources/koha/koha/circ/transferstoreceive.pl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- transferstoreceive.pl 24 Apr 2007 16:10:36 -0000 1.2 +++ transferstoreceive.pl 4 May 2007 10:18:00 -0000 1.3 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: transferstoreceive.pl,v 1.2 2007/04/24 16:10:36 tipaul Exp $ +# $Id: transferstoreceive.pl,v 1.3 2007/05/04 10:18:00 alaurin Exp $ # Copyright 2000-2002 Katipo Communications # @@ -29,7 +29,7 @@ use C4::Biblio; use C4::Circulation; use C4::Members; -use C4::Interface::CGI::Output; +#use C4::Interface::CGI::Output; use Date::Calc qw( Today Add_Delta_Days Index: waitingreserves.pl =================================================================== RCS file: /sources/koha/koha/circ/waitingreserves.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- waitingreserves.pl 24 Apr 2007 16:10:36 -0000 1.3 +++ waitingreserves.pl 4 May 2007 10:18:00 -0000 1.4 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: waitingreserves.pl,v 1.3 2007/04/24 16:10:36 tipaul Exp $ +# $Id: waitingreserves.pl,v 1.4 2007/05/04 10:18:00 alaurin Exp $ # Copyright 2000-2002 Katipo Communications # @@ -20,9 +20,9 @@ # Suite 330, Boston, MA 02111-1307 USA use strict; +use CGI; use C4::Context; use C4::Output; -use CGI; use C4::Branch; # GetBranchName use C4::Auth; use C4::Date; @@ -37,7 +37,7 @@ ); use C4::Reserves; use C4::Koha; -use C4::Interface::CGI::Output; +# use C4::Interface::CGI::Output; my $input = new CGI; From paul at koha-fr.org Fri May 4 15:59:16 2007 From: paul at koha-fr.org (paul poulain) Date: Fri, 04 May 2007 13:59:16 +0000 Subject: [Koha-cvs] koha/C4 Search.pm Message-ID: CVSROOT: /sources/koha Module name: koha Changes by: paul poulain 07/05/04 13:59:16 Modified files: C4 : Search.pm Log message: bugfixes for NoZebra : handling results_per_page and adding NoZebra support to SimpleSearch CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&r1=1.135&r2=1.136 Patches: Index: Search.pm =================================================================== RCS file: /sources/koha/koha/C4/Search.pm,v retrieving revision 1.135 retrieving revision 1.136 diff -u -b -r1.135 -r1.136 --- Search.pm 2 May 2007 16:44:31 -0000 1.135 +++ Search.pm 4 May 2007 13:59:16 -0000 1.136 @@ -25,7 +25,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); # set the version for version checking -$VERSION = do { my @v = '$Revision: 1.135 $' =~ /\d+/g; +$VERSION = do { my @v = '$Revision: 1.136 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); }; @@ -181,6 +181,14 @@ sub SimpleSearch { my $query = shift; + if (C4::Context->preference('NoZebra')) { + my $result = NZorder(NZanalyse($query))->{'biblioserver'}->{'RECORDS'}; + use Data::Dumper; + foreach (@$result) { + warn "$query :". at _; + } + return (undef,$result); + } else { my @servers = @_; my @results; my @tmpresults; @@ -223,6 +231,7 @@ } } return ( undef, \@results ); + } } # performs the search @@ -1433,6 +1442,8 @@ $result_hash->{'RECORDS'}[$numbers++] = $result{$key}; } } + # limit the $results_per_page to result size if it's more + $results_per_page = $numbers-1 if $numbers < $results_per_page; # for the requested page, replace biblionumber by the complete record # speed improvement : avoid reading too much things for (my $counter=$offset;$counter<=$offset+$results_per_page;$counter++) { @@ -1471,6 +1482,8 @@ foreach my $key (sort {$b <=> $a} (keys %result)) { $result_hash->{'RECORDS'}[$numbers++] = $result{$key}; } + # limit the $results_per_page to result size if it's more + $results_per_page = $numbers-1 if $numbers < $results_per_page; # for the requested page, replace biblionumber by the complete record # speed improvement : avoid reading too much things for (my $counter=$offset;$counter<=$offset+$results_per_page;$counter++) { From paul at koha-fr.org Fri May 4 15:59:54 2007 From: paul at koha-fr.org (paul poulain) Date: Fri, 04 May 2007 13:59:54 +0000 Subject: [Koha-cvs] koha C4/Members.pm acqui/neworderempty.pl acqui... Message-ID: CVSROOT: /sources/koha Module name: koha Changes by: paul poulain 07/05/04 13:59:54 Modified files: C4 : Members.pm acqui : neworderempty.pl parcel.pl koha-tmpl/intranet-tmpl/prog/en/acqui: histsearch.tmpl parcels.tmpl Log message: bugfixes for acquisition module CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/C4/Members.pm?cvsroot=koha&r1=1.51&r2=1.52 http://cvs.savannah.gnu.org/viewcvs/koha/acqui/neworderempty.pl?cvsroot=koha&r1=1.6&r2=1.7 http://cvs.savannah.gnu.org/viewcvs/koha/acqui/parcel.pl?cvsroot=koha&r1=1.6&r2=1.7 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/acqui/histsearch.tmpl?cvsroot=koha&r1=1.7&r2=1.8 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/acqui/parcels.tmpl?cvsroot=koha&r1=1.5&r2=1.6 Patches: Index: C4/Members.pm =================================================================== RCS file: /sources/koha/koha/C4/Members.pm,v retrieving revision 1.51 retrieving revision 1.52 diff -u -b -r1.51 -r1.52 --- C4/Members.pm 25 Apr 2007 14:07:34 -0000 1.51 +++ C4/Members.pm 4 May 2007 13:59:53 -0000 1.52 @@ -17,7 +17,7 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA -# $Id: Members.pm,v 1.51 2007/04/25 14:07:34 hdl Exp $ +# $Id: Members.pm,v 1.52 2007/05/04 13:59:53 tipaul Exp $ use strict; require Exporter; @@ -31,7 +31,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK); -$VERSION = do { my @v = '$Revision: 1.51 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); }; +$VERSION = do { my @v = '$Revision: 1.52 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); }; =head1 NAME @@ -1637,7 +1637,7 @@ my $dbh = C4::Context->dbh; unless ($date){ $date=POSIX::strftime("%Y-%m-%d",localtime(time)); - my $borrower = GetBorrower($borrowerid,'borrowernumber'); + my $borrower = GetMember($borrowerid,'borrowernumber'); $date = GetExpiryDate( $borrower->{'categorycode'}, $date ); } my $sth = $dbh->do(<param( branchloop => \@branchloop ); # build bookfund list -my $borrower= GetBorrower($loggedinuser); +my $borrower= GetMember($loggedinuser); my ( $flags, $homebranch )= ($borrower->{'flags'},$borrower->{'branchcode'}); my $count2; Index: acqui/parcel.pl =================================================================== RCS file: /sources/koha/koha/acqui/parcel.pl,v retrieving revision 1.6 retrieving revision 1.7 diff -u -b -r1.6 -r1.7 --- acqui/parcel.pl 24 Apr 2007 13:54:28 -0000 1.6 +++ acqui/parcel.pl 4 May 2007 13:59:54 -0000 1.7 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: parcel.pl,v 1.6 2007/04/24 13:54:28 hdl Exp $ +# $Id: parcel.pl,v 1.7 2007/05/04 13:59:54 tipaul Exp $ #script to recieve orders #written by chris at katipo.co.nz 24/2/2000 @@ -73,7 +73,7 @@ my $invoice=$input->param('invoice') || ''; my $freight=$input->param('freight'); my $gst=$input->param('gst'); -my $datereceived=$input->param('datereceived') || format_date(join "-",Date::Calc::Today()); +my $datereceived=format_date_in_iso($input->param('datereceived')) || format_date(join "-",Date::Calc::Today()); my $code=$input->param('code'); my ($template, $loggedinuser, $cookie) Index: koha-tmpl/intranet-tmpl/prog/en/acqui/histsearch.tmpl =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/acqui/histsearch.tmpl,v retrieving revision 1.7 retrieving revision 1.8 diff -u -b -r1.7 -r1.8 --- koha-tmpl/intranet-tmpl/prog/en/acqui/histsearch.tmpl 11 Mar 2007 21:08:11 -0000 1.7 +++ koha-tmpl/intranet-tmpl/prog/en/acqui/histsearch.tmpl 4 May 2007 13:59:54 -0000 1.8 @@ -92,7 +92,7 @@ From antoine at koha-fr.org Fri May 4 17:50:54 2007 From: antoine at koha-fr.org (Antoine Farnault) Date: Fri, 04 May 2007 15:50:54 +0000 Subject: [Koha-cvs] koha/bull acqui-search.pl claims.pl statecollec... [rel_2_2] Message-ID: CVSROOT: /sources/koha Module name: koha Branch: rel_2_2 Changes by: Antoine Farnault 07/05/04 15:50:54 Modified files: bull : acqui-search.pl claims.pl statecollection.pl subscription-add.pl Log message: - GPL added. - commenting some Data::Dumper - removing some syspref already writed on auth.pm. CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/bull/acqui-search.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.2.2.3&r2=1.2.2.4 http://cvs.savannah.gnu.org/viewcvs/koha/bull/claims.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.1&r2=1.1.2.2 http://cvs.savannah.gnu.org/viewcvs/koha/bull/statecollection.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.3.2.27&r2=1.3.2.28 http://cvs.savannah.gnu.org/viewcvs/koha/bull/subscription-add.pl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.5.2.11&r2=1.5.2.12 Patches: Index: acqui-search.pl =================================================================== RCS file: /sources/koha/koha/bull/Attic/acqui-search.pl,v retrieving revision 1.2.2.3 retrieving revision 1.2.2.4 diff -u -b -r1.2.2.3 -r1.2.2.4 --- acqui-search.pl 5 Feb 2006 21:59:21 -0000 1.2.2.3 +++ acqui-search.pl 4 May 2007 15:50:54 -0000 1.2.2.4 @@ -1,12 +1,30 @@ #!/usr/bin/perl +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +# $Id: acqui-search.pl,v 1.2.2.4 2007/05/04 15:50:54 toins Exp $ + use strict; use CGI; use C4::Auth; use C4::Output; use C4::Interface::CGI::Output; use C4::Database; -use HTML::Template; use C4::Acquisition; my $query = new CGI; my ($template, $loggedinuser, $cookie) @@ -58,9 +76,6 @@ totspent => sprintf("%.2f",$totspent), totcomtd => sprintf("%.2f",$totcomtd), totavail => sprintf("%.2f",$totavail), - intranetcolorstylesheet => C4::Context->preference("intranetcolorstylesheet"), - intranetstylesheet => C4::Context->preference("intranetstylesheet"), - IntranetNav => C4::Context->preference("IntranetNav"), ); output_html_with_http_headers $query, $cookie, $template->output; Index: claims.pl =================================================================== RCS file: /sources/koha/koha/bull/Attic/claims.pl,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -u -b -r1.1.2.1 -r1.1.2.2 --- claims.pl 24 Nov 2006 00:18:05 -0000 1.1.2.1 +++ claims.pl 4 May 2007 15:50:54 -0000 1.1.2.2 @@ -1,5 +1,24 @@ #!/usr/bin/perl +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +# $Id: claims.pl,v 1.1.2.2 2007/05/04 15:50:54 toins Exp $ + use strict; use CGI; use C4::Auth; @@ -8,8 +27,6 @@ use C4::Output; use C4::Interface::CGI::Output; use C4::Context; -use HTML::Template; -use Data::Dumper; my $query = new CGI; @@ -52,7 +69,7 @@ $missingissues[$i]->{'supplierid'} = getsupplierbyserialid($missingissues[$i]->{'serialid'}); } } - warn Dumper(\@missingissues); +# warn Dumper(\@missingissues); my $preview=0; if($op eq 'preview'){ Index: statecollection.pl =================================================================== RCS file: /sources/koha/koha/bull/Attic/statecollection.pl,v retrieving revision 1.3.2.27 retrieving revision 1.3.2.28 diff -u -b -r1.3.2.27 -r1.3.2.28 --- statecollection.pl 26 Apr 2007 01:05:05 -0000 1.3.2.27 +++ statecollection.pl 4 May 2007 15:50:54 -0000 1.3.2.28 @@ -1,5 +1,24 @@ #!/usr/bin/perl +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +# $Id: statecollection.pl,v 1.3.2.28 2007/05/04 15:50:54 toins Exp $ + use strict; use CGI; use C4::Auth; @@ -10,7 +29,6 @@ use C4::Interface::CGI::Output; use C4::Context; use C4::Bull; -use HTML::Template; use Date::Calc qw(:all); my $query = new CGI; Index: subscription-add.pl =================================================================== RCS file: /sources/koha/koha/bull/Attic/subscription-add.pl,v retrieving revision 1.5.2.11 retrieving revision 1.5.2.12 diff -u -b -r1.5.2.11 -r1.5.2.12 --- subscription-add.pl 30 Apr 2007 03:34:34 -0000 1.5.2.11 +++ subscription-add.pl 4 May 2007 15:50:54 -0000 1.5.2.12 @@ -1,5 +1,23 @@ #!/usr/bin/perl +# Copyright 2000-2002 Katipo Communications +# +# This file is part of Koha. +# +# Koha is free software; you can redistribute it and/or modify it under the +# terms of the GNU General Public License as published by the Free Software +# Foundation; either version 2 of the License, or (at your option) any later +# version. +# +# Koha is distributed in the hope that it will be useful, but WITHOUT ANY +# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR +# A PARTICULAR PURPOSE. See the GNU General Public License for more details. +# +# You should have received a copy of the GNU General Public License along with +# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, +# Suite 330, Boston, MA 02111-1307 USA + +# $Id: subscription-add.pl,v 1.5.2.12 2007/05/04 15:50:54 toins Exp $ use strict; use CGI; @@ -10,7 +28,6 @@ use C4::Acquisition; use C4::Interface::CGI::Output; use C4::Context; -use HTML::Template; use C4::Bull; use Date::Calc qw(:all); @@ -35,7 +52,6 @@ debug => 1, }); - my $weekarrayjs=''; my $count = 0; my ($year, $month, $day) = Date::Calc::Today; @@ -183,7 +199,6 @@ $add3,$every3,$whenmorethan3,$setto3,$lastvalue3,$innerloop3, "$numberingmethod", "$status", $notes ); - } print $query->redirect("/cgi-bin/koha/bull/subscription-detail.pl?subscriptionid=$subscriptionid"); } else { @@ -207,7 +222,8 @@ } else { $dateformat = '%d/%m/%Y'; } - $template->param(subtype => \@sub_type_data, + $template->param( + subtype => \@sub_type_data, weekarrayjs => $weekarrayjs, weekno => $weekno, dateformat => $dateformat, From antoine at koha-fr.org Fri May 4 17:57:43 2007 From: antoine at koha-fr.org (Antoine Farnault) Date: Fri, 04 May 2007 15:57:43 +0000 Subject: [Koha-cvs] koha/koha-tmpl/intranet-tmpl/default/en/export ... [rel_2_2] Message-ID: CVSROOT: /sources/koha Module name: koha Branch: rel_2_2 Changes by: Antoine Farnault 07/05/04 15:57:43 Added files: koha-tmpl/intranet-tmpl/default/en/export: export-holdings.tmpl Log message: synch default & npl template: adding export-holdings.tmpl to default CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/export/export-holdings.tmpl?cvsroot=koha&only_with_tag=rel_2_2&rev=1.1.2.1 Patches: Index: export-holdings.tmpl =================================================================== RCS file: export-holdings.tmpl diff -N export-holdings.tmpl --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ export-holdings.tmpl 4 May 2007 15:57:43 -0000 1.1.2.1 @@ -0,0 +1,54 @@ + +Koha -- Cataloging: MARC Export + + + + + + + + +
+
+

MARC biblio export

+

Select start and End dates for holdings export

+ +
" size="10" maxlength="15" /> + " value="" size="10" maxlength="15" /> + /includes/calendar/cal.gif" border="0" id="CalendarPubDate" style="cursor: pointer;" valign="top" /> +
- " size="10" maxlength="15" /> + " value="" size="10" maxlength="15" /> + /includes/calendar/cal.gif" border="0" id="CalendarPlanDate" style="cursor: pointer;" valign="top" /> +
" /> - " name="status" size="1"> @@ -146,7 +168,7 @@
" size="10" maxlength="15" /> + " size="10" maxlength="15" />
- &supplierid=&datereceived=">Parcel + &supplierid=&datereceived=">Parcel   Index: koha-tmpl/intranet-tmpl/prog/en/acqui/parcels.tmpl =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/acqui/parcels.tmpl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- koha-tmpl/intranet-tmpl/prog/en/acqui/parcels.tmpl 11 Mar 2007 21:08:11 -0000 1.5 +++ koha-tmpl/intranet-tmpl/prog/en/acqui/parcels.tmpl 4 May 2007 13:59:54 -0000 1.6 @@ -84,7 +84,7 @@ - &datereceived=&code="> + &datereceived=&invoice=">
+ + + + + + + +
From " > + /includes/calendar/cal.gif" id="buttonfrom1" style="cursor: pointer;" /> + + To " > + /includes/calendar/cal.gif" id="buttonto1" style="cursor: pointer;" /> + + + +
+
+ + + + From antoine at koha-fr.org Fri May 4 18:19:29 2007 From: antoine at koha-fr.org (Antoine Farnault) Date: Fri, 04 May 2007 16:19:29 +0000 Subject: [Koha-cvs] koha/koha-tmpl/intranet-tmpl/default/en include... [rel_2_2] Message-ID: CVSROOT: /sources/koha Module name: koha Branch: rel_2_2 Changes by: Antoine Farnault 07/05/04 16:19:29 Modified files: koha-tmpl/intranet-tmpl/default/en/includes: menus.inc koha-tmpl/intranet-tmpl/default/en/parameters: admin-home.tmpl Added files: koha-tmpl/intranet-tmpl/default/en/includes: holidays-bottom.inc holidays-top.inc koha-tmpl/intranet-tmpl/default/en/tools: holidays.tmpl Log message: synchronizing default & npl CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/includes/menus.inc?cvsroot=koha&only_with_tag=rel_2_2&r1=1.1.2.6&r2=1.1.2.7 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/includes/holidays-bottom.inc?cvsroot=koha&only_with_tag=rel_2_2&rev=1.1.4.1 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/includes/holidays-top.inc?cvsroot=koha&only_with_tag=rel_2_2&rev=1.1.4.1 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/parameters/admin-home.tmpl?cvsroot=koha&only_with_tag=rel_2_2&r1=1.34.2.3&r2=1.34.2.4 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/default/en/tools/holidays.tmpl?cvsroot=koha&only_with_tag=rel_2_2&rev=1.1.4.1 Patches: Index: includes/menus.inc =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/default/en/includes/Attic/menus.inc,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -u -b -r1.1.2.6 -r1.1.2.7 --- includes/menus.inc 10 Aug 2006 12:39:38 -0000 1.1.2.6 +++ includes/menus.inc 4 May 2007 16:19:29 -0000 1.1.2.7 @@ -55,7 +55,9 @@ Add biblio
Subscriptions + Claims Late issues + Routing List
Virtual shelves Index: parameters/admin-home.tmpl =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/default/en/parameters/Attic/admin-home.tmpl,v retrieving revision 1.34.2.3 retrieving revision 1.34.2.4 diff -u -b -r1.34.2.3 -r1.34.2.4 --- parameters/admin-home.tmpl 6 Feb 2006 21:28:24 -0000 1.34.2.3 +++ parameters/admin-home.tmpl 4 May 2007 16:19:29 -0000 1.34.2.4 @@ -117,6 +117,10 @@ Exporting in MARC format. + Export Holdings to CSV or XML + Export Holdings to CSV or XML. + + Import @@ -132,6 +136,11 @@ the barcode generator deals with generating barcodes for items you acquire + Holidays + + Holidays + Holidays management + Index: includes/holidays-bottom.inc =================================================================== RCS file: includes/holidays-bottom.inc diff -N includes/holidays-bottom.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ includes/holidays-bottom.inc 4 May 2007 16:19:29 -0000 1.1.4.1 @@ -0,0 +1,4 @@ + + + + Index: includes/holidays-top.inc =================================================================== RCS file: includes/holidays-top.inc diff -N includes/holidays-top.inc --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ includes/holidays-top.inc 4 May 2007 16:19:29 -0000 1.1.4.1 @@ -0,0 +1,5 @@ + + + + + Index: tools/holidays.tmpl =================================================================== RCS file: tools/holidays.tmpl diff -N tools/holidays.tmpl --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ tools/holidays.tmpl 4 May 2007 16:19:29 -0000 1.1.4.1 @@ -0,0 +1,377 @@ + + + + + + + + + + + + +/includes/calendar/calendar-system.css"> + + + + + + + +
+
+
+

+ Hide Details + /images/signClose.gif" hspace="0" vspace="0" border="0" style="vertical-align:middle"> +

+

+ + + +

+

+ + +

+
+ Day + Month + Year +
+

Add a description to holiday day.

+

+ +

+
+ Generate an exception to this holiday + /images/more.gif" hspace="0" vspace="0" border="0" style="vertical-align:middle;cursor:pointer" + onclick="javascript: additionalInformation('You can make an exception for this holiday rule. This means that you will be able to say for a repeatable holiday, that there is one of those days that is going to be an exception.')"> +
+
+ Delete this holiday. + /images/more.gif" hspace="0" vspace="0" border="0" style="vertical-align:middle;cursor:pointer" + onclick="javascript: additionalInformation('This will delete this holiday rule. In case it is a repeatable holiday, this option checks for posible exceptions. In case those exists, this option take care of set this exceptions to regular holidays.')"> +

+ + +

+
+
+ + +
+
+

+ Add new holiday +

+

+ + + +

+

+ + +

+
+ Day + Month + Year +
+

+ + +

+ Holiday only on this day. + /images/more.gif" hspace="0" vspace="0" border="0" style="vertical-align:middle;cursor:pointer" + onclick="javascript: additionalInformation('This will take this date to make it holiday just for this time. Through this option, you can set a single holiday. For example, suppose you are in August 1st, and only for this year you want to make it holiday.')"> +
+ Holiday repeated every same day of the week + /images/more.gif" hspace="0" vspace="0" border="0" style="vertical-align:middle;cursor:pointer" onclick="javascript: additionalInformation('This will take this week day and make it holiday. No matter what date it is, this option will repeat this rule for every week. For example, if this date correspond to a saturday, every saturdays will be holidays.')"> +
+ Holiday repeated yearly on the same date. + /images/more.gif" hspace="0" vspace="0" border="0" style="vertical-align:middle;cursor:pointer" onclick="javascript: additionalInformation('This will take this day and month as a reference to make it holiday. Through this option, you can repeat this rule for every year. For example, if this date correspond to a August 1st, every August 1st will be holiday, no matter what year you are.')"> +

+ + +

+
+
+ + + + + + + + + + + + +
+ + + + + +
+ /images/info.gif" hspace="0" vspace="0" border="0" style="vertical-align:middle"> + +

+
+
+ + + + + + + +

Define the holidays for branch

+
    +
  • Search in the calendar the day you want to set as holiday.
  • +
  • Complete the information in the right area.
  • +
  • Once you finish the steps above, click Save.
  • +
+

+ Working day + Unique holiday + Repeatable holiday + Holiday exception +

+ + + + +

Calendar information

+
+ +
+
+ From paul at koha-fr.org Fri May 4 18:24:09 2007 From: paul at koha-fr.org (paul poulain) Date: Fri, 04 May 2007 16:24:09 +0000 Subject: [Koha-cvs] koha C4/Branch.pm C4/Search.pm admin/branches.p... Message-ID: CVSROOT: /sources/koha Module name: koha Changes by: paul poulain 07/05/04 16:24:09 Modified files: C4 : Branch.pm Search.pm admin : branches.pl checkmarc.pl marc_subfields_structure.pl systempreferences.pl cataloguing/value_builder: unimarc_field_210c.pl koha-tmpl/intranet-tmpl/prog/en/admin: admin-home.tmpl currency.tmpl marc_subfields_structure.tmpl misc/migration_tools: rebuild_nozebra.pl misc/migration_tools/22_to_30: rebuild_unimarc_100.pl updater : updatedatabase Log message: various bugfixes on parameters modules + adding default NoZebraIndexes systempreference if it's empty CVSWeb URLs: http://cvs.savannah.gnu.org/viewcvs/koha/C4/Branch.pm?cvsroot=koha&r1=1.2&r2=1.3 http://cvs.savannah.gnu.org/viewcvs/koha/C4/Search.pm?cvsroot=koha&r1=1.136&r2=1.137 http://cvs.savannah.gnu.org/viewcvs/koha/admin/branches.pl?cvsroot=koha&r1=1.40&r2=1.41 http://cvs.savannah.gnu.org/viewcvs/koha/admin/checkmarc.pl?cvsroot=koha&r1=1.12&r2=1.13 http://cvs.savannah.gnu.org/viewcvs/koha/admin/marc_subfields_structure.pl?cvsroot=koha&r1=1.43&r2=1.44 http://cvs.savannah.gnu.org/viewcvs/koha/admin/systempreferences.pl?cvsroot=koha&r1=1.39&r2=1.40 http://cvs.savannah.gnu.org/viewcvs/koha/cataloguing/value_builder/unimarc_field_210c.pl?cvsroot=koha&r1=1.3&r2=1.4 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/admin/admin-home.tmpl?cvsroot=koha&r1=1.10&r2=1.11 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/admin/currency.tmpl?cvsroot=koha&r1=1.2&r2=1.3 http://cvs.savannah.gnu.org/viewcvs/koha/koha-tmpl/intranet-tmpl/prog/en/admin/marc_subfields_structure.tmpl?cvsroot=koha&r1=1.5&r2=1.6 http://cvs.savannah.gnu.org/viewcvs/koha/misc/migration_tools/rebuild_nozebra.pl?cvsroot=koha&r1=1.3&r2=1.4 http://cvs.savannah.gnu.org/viewcvs/koha/misc/migration_tools/22_to_30/rebuild_unimarc_100.pl?cvsroot=koha&r1=1.2&r2=1.3 http://cvs.savannah.gnu.org/viewcvs/koha/updater/updatedatabase?cvsroot=koha&r1=1.163&r2=1.164 Patches: Index: C4/Branch.pm =================================================================== RCS file: /sources/koha/koha/C4/Branch.pm,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- C4/Branch.pm 9 Mar 2007 15:35:32 -0000 1.2 +++ C4/Branch.pm 4 May 2007 16:24:08 -0000 1.3 @@ -15,7 +15,7 @@ # Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place, # Suite 330, Boston, MA 02111-1307 USA -# $Id: Branch.pm,v 1.2 2007/03/09 15:35:32 tipaul Exp $ +# $Id: Branch.pm,v 1.3 2007/05/04 16:24:08 tipaul Exp $ use strict; require Exporter; @@ -25,7 +25,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); # set the version for version checking -$VERSION = do { my @v = '$Revision: 1.2 $' =~ /\d+/g; shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); }; +$VERSION = do { my @v = '$Revision: 1.3 $' =~ /\d+/g; shift(@v).".".join( "_", map { sprintf "%03d", $_ } @v ); }; =head1 NAME @@ -56,6 +56,7 @@ &GetBranchInfo &ModBranchCategoryInfo &DelBranch + &DelBranchCategory ); =head2 GetBranches @@ -407,7 +408,7 @@ =cut -sub DeleteBranchCategory { +sub DelBranchCategory { my ($categorycode) = @_; my $dbh = C4::Context->dbh; my $sth = $dbh->prepare("delete from branchcategories where categorycode = ?"); Index: C4/Search.pm =================================================================== RCS file: /sources/koha/koha/C4/Search.pm,v retrieving revision 1.136 retrieving revision 1.137 diff -u -b -r1.136 -r1.137 --- C4/Search.pm 4 May 2007 13:59:16 -0000 1.136 +++ C4/Search.pm 4 May 2007 16:24:08 -0000 1.137 @@ -25,7 +25,7 @@ use vars qw($VERSION @ISA @EXPORT @EXPORT_OK %EXPORT_TAGS); # set the version for version checking -$VERSION = do { my @v = '$Revision: 1.136 $' =~ /\d+/g; +$VERSION = do { my @v = '$Revision: 1.137 $' =~ /\d+/g; shift(@v) . "." . join( "_", map { sprintf "%03d", $_ } @v ); }; @@ -1221,6 +1221,9 @@ my $results; if ($operator) { #do a specific search + # automatic replace for short operator + $operator='title' if $operator eq 'ti'; + $operator='author' if $operator eq 'au'; my $dbh = C4::Context->dbh; $operator='LIKE' if $operator eq '=' and $right=~ /%/; my $sth = $dbh->prepare("SELECT biblionumbers FROM nozebra WHERE indexname=? AND value $operator ?"); Index: admin/branches.pl =================================================================== RCS file: /sources/koha/koha/admin/branches.pl,v retrieving revision 1.40 retrieving revision 1.41 diff -u -b -r1.40 -r1.41 --- admin/branches.pl 24 Apr 2007 13:54:28 -0000 1.40 +++ admin/branches.pl 4 May 2007 16:24:08 -0000 1.41 @@ -183,7 +183,7 @@ elsif ( $op eq 'categorydelete_confirmed' ) { # actually delete branch and return to the main screen.... - DeleteBranchCategory($categorycode); + DelBranchCategory($categorycode); $template->param( else => 1 ); default("MESSAGE6",$template); Index: admin/checkmarc.pl =================================================================== RCS file: /sources/koha/koha/admin/checkmarc.pl,v retrieving revision 1.12 retrieving revision 1.13 diff -u -b -r1.12 -r1.13 --- admin/checkmarc.pl 24 Apr 2007 13:54:28 -0000 1.12 +++ admin/checkmarc.pl 4 May 2007 16:24:08 -0000 1.13 @@ -67,7 +67,7 @@ # checks all item fields are in the same tag and in tab 10 -$sth = $dbh->prepare("select tagfield,tab,kohafield from marc_subfield_structure where kohafield like \"items.%\""); +$sth = $dbh->prepare("select tagfield,tab,kohafield from marc_subfield_structure where kohafield like \"items.%\" and tab >=0"); $sth->execute; my $field; ($res,$res2,$field) = $sth->fetchrow; @@ -77,7 +77,7 @@ #warn "TAGF : $tagfield"; while (($res,$res2,$field) = $sth->fetchrow) { # (ignore itemnumber, that must be in -1 tab) - if (($res ne $tagfield or $res2 ne $tab ) && $res2 ne -1) { + if (($res ne $tagfield) or ($res2 ne $tab)) { $subtotal++; } } @@ -89,7 +89,7 @@ $subtotal++; } } -if ($subtotal eq 0) { +if ($subtotal == 0) { $template->param(itemfields => 0); } else { $template->param(itemfields => 1); Index: admin/marc_subfields_structure.pl =================================================================== RCS file: /sources/koha/koha/admin/marc_subfields_structure.pl,v retrieving revision 1.43 retrieving revision 1.44 diff -u -b -r1.43 -r1.44 --- admin/marc_subfields_structure.pl 24 Apr 2007 13:54:28 -0000 1.43 +++ admin/marc_subfields_structure.pl 4 May 2007 16:24:08 -0000 1.44 @@ -277,8 +277,10 @@ } # add more_subfields empty lines for add if needed - for ( my $j = $i ; $j <= $more_subfields + $i ; $j++ ) { + for ( my $j = 1 ; $j <= 1 ; $j++ ) { my %row_data; # get a fresh hash for the row data + $row_data{'subfieldcode'} = ''; + $row_data{tab} = CGI::scrolling_list( -name => 'tab', -id => "tab$j", @@ -373,6 +375,8 @@ $row_data{toggle} = $toggle; $row_data{row} = $j; push( @loop_data, \%row_data ); + use Data::Dumper; + warn "push : ".Dumper(%row_data); } $template->param( 'use-heading-flags-p' => 1 ); $template->param( 'heading-edit-subfields-p' => 1 ); @@ -468,8 +472,7 @@ "select * from marc_subfield_structure where tagfield=? and tagsubfield=? and frameworkcode=?" ); - #FIXME : called with 2 bind variables when 3 are needed - $sth->execute( $tagfield, $tagsubfield ); + $sth->execute( $tagfield, $tagsubfield, $frameworkcode ); my $data = $sth->fetchrow_hashref; $sth->finish; $template->param( Index: admin/systempreferences.pl =================================================================== RCS file: /sources/koha/koha/admin/systempreferences.pl,v retrieving revision 1.39 retrieving revision 1.40 diff -u -b -r1.39 -r1.40 --- admin/systempreferences.pl 24 Apr 2007 13:54:28 -0000 1.39 +++ admin/systempreferences.pl 4 May 2007 16:24:08 -0000 1.40 @@ -90,6 +90,9 @@ $tabsysprefs{Stemming}="Catalogue"; $tabsysprefs{WeightFields}="Catalogue"; $tabsysprefs{expandedSearchOption}="Catalogue"; + $tabsysprefs{NoZebra}="Catalogue"; + $tabsysprefs{NoZebraIndexes}="Catalogue"; + $tabsysprefs{ReceiveBackIssues}="Catalogue"; # Circulation $tabsysprefs{maxoutstanding}="Circulation"; @@ -123,6 +126,7 @@ $tabsysprefs{borrowerRelationship}="Members"; $tabsysprefs{BorrowersTitles}="Members"; $tabsysprefs{patronimages}="Members"; + $tabsysprefs{MinPasswordLength}="Members"; # OPAC $tabsysprefs{AmazonAssocTag}="OPAC"; Index: cataloguing/value_builder/unimarc_field_210c.pl =================================================================== RCS file: /sources/koha/koha/cataloguing/value_builder/unimarc_field_210c.pl,v retrieving revision 1.3 retrieving revision 1.4 diff -u -b -r1.3 -r1.4 --- cataloguing/value_builder/unimarc_field_210c.pl 24 Apr 2007 13:54:29 -0000 1.3 +++ cataloguing/value_builder/unimarc_field_210c.pl 4 May 2007 16:24:08 -0000 1.4 @@ -1,6 +1,6 @@ #!/usr/bin/perl -# $Id: unimarc_field_210c.pl,v 1.3 2007/04/24 13:54:29 hdl Exp $ +# $Id: unimarc_field_210c.pl,v 1.4 2007/05/04 16:24:08 tipaul Exp $ # Copyright 2000-2002 Katipo Communications # @@ -63,12 +63,12 @@ #---- 200$a for isbn #---- 200$b for editor #---- 200$c (repeated) for collections - my $sth; -#= $dbh->prepare("select auth_subfield_table.authid,subfieldvalue from auth_subfield_table -# left join auth_header on auth_subfield_table.authid=auth_header.authid -# where authtypecode='EDITORS' and tag='200' and subfieldcode='a'"); - my $sth2; - # = $dbh->prepare("select subfieldvalue from auth_subfield_table where tag='200' and subfieldcode='b' and authid=?"); + my $sth += $dbh->prepare("select auth_subfield_table.authid,subfieldvalue from auth_subfield_table + left join auth_header on auth_subfield_table.authid=auth_header.authid + where authtypecode='EDITORS' and tag='200' and subfieldcode='a'"); + my $sth2 + = $dbh->prepare("select subfieldvalue from auth_subfield_table where tag='200' and subfieldcode='b' and authid=?"); $sth->execute; my @editors; my $authoritysep = C4::Context->preference("authoritysep"); Index: koha-tmpl/intranet-tmpl/prog/en/admin/admin-home.tmpl =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/admin/admin-home.tmpl,v retrieving revision 1.10 retrieving revision 1.11 diff -u -b -r1.10 -r1.11 --- koha-tmpl/intranet-tmpl/prog/en/admin/admin-home.tmpl 18 Mar 2007 02:46:21 -0000 1.10 +++ koha-tmpl/intranet-tmpl/prog/en/admin/admin-home.tmpl 4 May 2007 16:24:08 -0000 1.11 @@ -57,6 +57,10 @@ Define issuing rules in a matrix for branches / borrowers / item types (number of issues, duration, cost...). + Fines rules + Define fines in a matrix for branches / borrowers / item types (cost, grace period...). + + Catalogue Index: koha-tmpl/intranet-tmpl/prog/en/admin/currency.tmpl =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/admin/currency.tmpl,v retrieving revision 1.2 retrieving revision 1.3 diff -u -b -r1.2 -r1.3 --- koha-tmpl/intranet-tmpl/prog/en/admin/currency.tmpl 11 Mar 2007 21:08:12 -0000 1.2 +++ koha-tmpl/intranet-tmpl/prog/en/admin/currency.tmpl 4 May 2007 16:24:09 -0000 1.3 @@ -98,7 +98,7 @@ - '; return false;" /> + '; return false;" /> Index: koha-tmpl/intranet-tmpl/prog/en/admin/marc_subfields_structure.tmpl =================================================================== RCS file: /sources/koha/koha/koha-tmpl/intranet-tmpl/prog/en/admin/marc_subfields_structure.tmpl,v retrieving revision 1.5 retrieving revision 1.6 diff -u -b -r1.5 -r1.6 --- koha-tmpl/intranet-tmpl/prog/en/admin/marc_subfields_structure.tmpl 19 Mar 2007 18:35:12 -0000 1.5 +++ koha-tmpl/intranet-tmpl/prog/en/admin/marc_subfields_structure.tmpl 4 May 2007 16:24:09 -0000 1.6 @@ -20,12 +20,13 @@ " /> -

Tag

- Edit subfields : +

Tag

+

Edit subfield - +