[Koha-cvs] CVS: koha/C4 Biblio.pm,1.105,1.106
Paul POULAIN
tipaul at users.sourceforge.net
Tue Nov 2 17:44:48 CET 2004
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv8389/C4
Modified Files:
Biblio.pm
Log Message:
new feature : checking for duplicate biblio.
For instance, it's only done on ISBN only. Will be improved soon.
When a duplicate is detected, the biblio is not saved, but the user is asked for a confirmations.
Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.105
retrieving revision 1.106
diff -C2 -r1.105 -r1.106
*** Biblio.pm 23 Sep 2004 16:15:37 -0000 1.105
--- Biblio.pm 2 Nov 2004 16:44:45 -0000 1.106
***************
*** 68,71 ****
--- 68,73 ----
&MARCaddword &MARCdelword
&char_decode
+
+ &FindDuplicate
);
***************
*** 1095,1099 ****
$sth2->execute;
while (($field)=$sth2->fetchrow) {
- # warn "X";
$result=&MARCmarc2kohaOneField($sth,"items",$field,$record,$result,$frameworkcode);
}
--- 1097,1100 ----
***************
*** 2529,2532 ****
--- 2530,2543 ----
}
+ sub FindDuplicate {
+ my ($record)=@_;
+ my $dbh = C4::Context->dbh;
+ my $result = MARCmarc2koha($dbh,$record,'');
+ my $sth = $dbh->prepare("select biblio.biblionumber,bibid,title from biblio,biblioitems,marc_biblio where biblio.biblionumber=biblioitems.biblionumber and marc_biblio.biblionumber=biblioitems.biblionumber and isbn=?");
+ $sth->execute($result->{'isbn'});
+ my ($biblionumber,$bibid,$title) = $sth->fetchrow;
+ return $biblionumber,$bibid,$title;
+ }
+
END { } # module clean-up code here (global destructor)
***************
*** 2543,2546 ****
--- 2554,2564 ----
# $Id$
# $Log$
+ # Revision 1.106 2004/11/02 16:44:45 tipaul
+ # new feature : checking for duplicate biblio.
+ #
+ # For instance, it's only done on ISBN only. Will be improved soon.
+ #
+ # When a duplicate is detected, the biblio is not saved, but the user is asked for a confirmations.
+ #
# Revision 1.105 2004/09/23 16:15:37 tipaul
# indenting diff
More information about the Koha-cvs
mailing list