[Koha-cvs] CVS: koha/C4 Biblio.pm,1.115.2.13,1.115.2.14
Henri-Damien LAURENT
hdl at users.sourceforge.net
Tue Jun 28 01:24:10 CEST 2005
Update of /cvsroot/koha/koha/C4
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23754/C4
Modified Files:
Tag: rel_2_2
Biblio.pm
Log Message:
Display dashed ISBN
Index: Biblio.pm
===================================================================
RCS file: /cvsroot/koha/koha/C4/Biblio.pm,v
retrieving revision 1.115.2.13
retrieving revision 1.115.2.14
diff -C2 -r1.115.2.13 -r1.115.2.14
*** Biblio.pm 31 May 2005 12:44:26 -0000 1.115.2.13
--- Biblio.pm 27 Jun 2005 23:24:06 -0000 1.115.2.14
***************
*** 72,75 ****
--- 72,76 ----
&FindDuplicate
+ &DisplayISBN
);
***************
*** 2630,2633 ****
--- 2631,2671 ----
}
+ sub DisplayISBN {
+ my ($isbn)=@_;
+ my $seg1;
+ if(substr($isbn, 0, 1) <=7) {
+ $seg1 = substr($isbn, 0, 1);
+ } elsif(substr($isbn, 0, 2) <= 94) {
+ $seg1 = substr($isbn, 0, 2);
+ } elsif(substr($isbn, 0, 3) <= 995) {
+ $seg1 = substr($isbn, 0, 3);
+ } elsif(substr($isbn, 0, 4) <= 9989) {
+ $seg1 = substr($isbn, 0, 4);
+ } else {
+ $seg1 = substr($isbn, 0, 5);
+ }
+ my $x = substr($isbn, length($seg1));
+ my $seg2;
+ if(substr($x, 0, 2) <= 19) {
+ # if(sTmp2 < 10) sTmp2 = "0" sTmp2;
+ $seg2 = substr($x, 0, 2);
+ } elsif(substr($x, 0, 3) <= 699) {
+ $seg2 = substr($x, 0, 3);
+ } elsif(substr($x, 0, 4) <= 8399) {
+ $seg2 = substr($x, 0, 4);
+ } elsif(substr($x, 0, 5) <= 89999) {
+ $seg2 = substr($x, 0, 5);
+ } elsif(substr($x, 0, 6) <= 9499999) {
+ $seg2 = substr($x, 0, 6);
+ } else {
+ $seg2 = substr($x, 0, 7);
+ }
+ my $seg3=substr($x,length($seg2));
+ $seg3=substr($seg3,0,length($seg3)-1) ;
+ my $seg4 = substr($x, -1, 1);
+ return "$seg1-$seg2-$seg3-$seg4";
+ }
+
+
END { } # module clean-up code here (global destructor)
***************
*** 2644,2647 ****
--- 2682,2688 ----
# $Id$
# $Log$
+ # Revision 1.115.2.14 2005/06/27 23:24:06 hdl
+ # Display dashed ISBN
+ #
# Revision 1.115.2.13 2005/05/31 12:44:26 tipaul
# patch from Genji (Waylon R.) to update subjects in MARC tables when systempref has MARC=OFF
More information about the Koha-cvs
mailing list