From bb7fecd7455fb2775cd4d3efddb4a2d0ebe4c3d2 Mon Sep 17 00:00:00 2001 From: tipaul Date: Tue, 17 Jun 2003 11:21:12 +0000 Subject: [PATCH] improvments/fixes for z3950 support. * Works now even on ADD, not only on MODIFY * able to search on ISBN, author, title --- C4/Biblio.pm | 11 ++++-- C4/Search.pm | 1 + acqui.simple/addbiblio.pl | 2 ++ .../default/en/acqui.simple/addbiblio.tmpl | 32 +++++++++++++++-- .../default/fr/acqui.simple/addbiblio.tmpl | 36 ++++++++++++++++--- 5 files changed, 74 insertions(+), 8 deletions(-) diff --git a/C4/Biblio.pm b/C4/Biblio.pm index 8ca8af7e8a..6a150ceb5f 100644 --- a/C4/Biblio.pm +++ b/C4/Biblio.pm @@ -1,6 +1,11 @@ package C4::Biblio; # $Id$ # $Log$ +# Revision 1.49 2003/06/17 11:21:13 tipaul +# improvments/fixes for z3950 support. +# * Works now even on ADD, not only on MODIFY +# * able to search on ISBN, author, title +# # Revision 1.48 2003/06/16 09:22:53 rangi # Just added an order clause to getitemtypes # @@ -478,14 +483,15 @@ sub MARCgettagslib { $res->{$tag}->{mandatory}=$mandatory; } - $sth=$dbh->prepare("select tagfield,tagsubfield,$libfield as lib,tab, mandatory, repeatable,authorised_value,thesaurus_category,value_builder from marc_subfield_structure order by tagfield,tagsubfield"); + $sth=$dbh->prepare("select tagfield,tagsubfield,$libfield as lib,tab, mandatory, repeatable,authorised_value,thesaurus_category,value_builder,kohafield from marc_subfield_structure order by tagfield,tagsubfield"); $sth->execute; my $subfield; my $authorised_value; my $thesaurus_category; my $value_builder; - while ( ($tag, $subfield, $lib, $tab, $mandatory, $repeatable,$authorised_value,$thesaurus_category,$value_builder) = $sth->fetchrow) { + my $kohafield; + while ( ($tag, $subfield, $lib, $tab, $mandatory, $repeatable,$authorised_value,$thesaurus_category,$value_builder,$kohafield) = $sth->fetchrow) { $res->{$tag}->{$subfield}->{lib}=$lib; $res->{$tag}->{$subfield}->{tab}=$tab; $res->{$tag}->{$subfield}->{mandatory}=$mandatory; @@ -493,6 +499,7 @@ sub MARCgettagslib { $res->{$tag}->{$subfield}->{authorised_value}=$authorised_value; $res->{$tag}->{$subfield}->{thesaurus_category}=$thesaurus_category; $res->{$tag}->{$subfield}->{value_builder}=$value_builder; + $res->{$tag}->{$subfield}->{kohafield}=$kohafield; } return $res; } diff --git a/C4/Search.pm b/C4/Search.pm index 0522fa9529..d252268953 100755 --- a/C4/Search.pm +++ b/C4/Search.pm @@ -2414,6 +2414,7 @@ sub breedingsearch { $query .= "isbn like \"$isbn%\""; } } + warn "Q : $query"; $sth = $dbh->prepare($query); $sth->execute; while (my $data = $sth->fetchrow_hashref) { diff --git a/acqui.simple/addbiblio.pl b/acqui.simple/addbiblio.pl index 0a799a81db..54b96e6126 100755 --- a/acqui.simple/addbiblio.pl +++ b/acqui.simple/addbiblio.pl @@ -190,6 +190,7 @@ sub build_tabs ($$$$) { $subfield_data{tag_mandatory}=$tagslib->{$tag}->{mandatory}; $subfield_data{mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory}; $subfield_data{repeatable}=$tagslib->{$tag}->{$subfield}->{repeatable}; + $subfield_data{kohafield}=$tagslib->{$tag}->{$subfield}->{kohafield}; $value=char_decode($value) unless ($is_a_modif); $indicator = $x if $x; #XXX if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { @@ -220,6 +221,7 @@ sub build_tabs ($$$$) { $subfield_data{tag_mandatory}=$tagslib->{$tag}->{mandatory}; $subfield_data{mandatory}=$tagslib->{$tag}->{$subfield}->{mandatory}; $subfield_data{repeatable}=$tagslib->{$tag}->{$subfield}->{repeatable}; + $subfield_data{kohafield}=$tagslib->{$tag}->{$subfield}->{kohafield}; if ($tagslib->{$tag}->{$subfield}->{authorised_value}) { $subfield_data{marc_value}= build_authorized_values_list($tag, $subfield, $value, $dbh, $authorised_values_sth); } elsif ($tagslib->{$tag}->{$subfield}->{thesaurus_category}) { diff --git a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl index 64d76317f3..497610c315 100644 --- a/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/en/acqui.simple/addbiblio.tmpl @@ -50,6 +50,7 @@ "> "> "> + "> "> @@ -72,6 +73,7 @@ "> "> "> + "> "> @@ -94,6 +96,7 @@ "> "> "> + "> "> @@ -116,6 +119,7 @@ "> "> "> + "> "> @@ -138,6 +142,7 @@ "> "> "> + "> "> @@ -160,6 +165,7 @@ "> "> "> + "> "> @@ -182,6 +188,7 @@ "> "> "> + "> "> @@ -204,6 +211,7 @@ "> "> "> + "> "> @@ -226,6 +234,7 @@ "> "> "> + "> "> @@ -248,6 +257,7 @@ "> "> "> + "> "> @@ -268,6 +278,7 @@ "> "> "> + "> "> @@ -279,11 +290,13 @@ "> "> + "> "> "> "> - "> + "> + "> @@ -365,7 +378,22 @@ function Dopop(link,i) { } function PopupZ3950(link,i) { - newin=window.open("../z3950/search.pl?bibid=","z3950 search",'width=500,height=400,toolbar=false,scrollbars=yes'); + var strQuery=""; + for (i=0 ; i0) { + strQuery += "&isbn="+document.forms[0].field_value[i].value; + } + if (document.forms[0].kohafield[i].value == "biblio.title" && document.forms[0].field_value[i].value.length>0) { + strQuery += "&title="+document.forms[0].field_value[i].value; + } + if (document.forms[0].kohafield[i].value == "biblio.author" &&document.forms[0].field_value[i].value.length>0) { + strQuery += "&author="+document.forms[0].field_value[i].value; + } + if (document.forms[0].kohafield[i].value == "biblioitems.issn" && document.forms[0].field_value[i].value.length>0) { + strQuery += "&issn="+document.forms[0].field_value[i].value; + } + } + newin=window.open("../z3950/search.pl?bibid="+strQuery,"z3950 search",'width=500,height=400,toolbar=false,scrollbars=yes'); } diff --git a/koha-tmpl/intranet-tmpl/default/fr/acqui.simple/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/default/fr/acqui.simple/addbiblio.tmpl index a5faad64b7..1aa4be02c5 100644 --- a/koha-tmpl/intranet-tmpl/default/fr/acqui.simple/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/default/fr/acqui.simple/addbiblio.tmpl @@ -49,6 +49,7 @@ "> "> "> + "> "> @@ -71,6 +72,7 @@ "> "> "> + "> "> @@ -93,6 +95,7 @@ "> "> "> + "> "> @@ -115,6 +118,7 @@ "> "> "> + "> "> @@ -137,6 +141,7 @@ "> "> "> + "> "> @@ -159,6 +164,7 @@ "> "> "> + "> "> @@ -181,6 +187,7 @@ "> "> "> + "> "> @@ -203,6 +210,7 @@ "> "> "> + "> "> @@ -225,6 +233,7 @@ "> "> "> + "> "> @@ -247,6 +256,7 @@ "> "> "> + "> "> @@ -267,6 +277,7 @@ "> "> "> + "> "> @@ -277,12 +288,14 @@ "> "> "> + "> "> "> "> - "> + "> + "> @@ -358,9 +371,24 @@ function Check(f) { document.f.submit(); } } -function Dopop(link,i) { - defaultvalue=document.forms[0].field_value[i].value; - newin=window.open(link+"&result="+defaultvalue,"value builder",'width=500,height=400,toolbar=false,scrollbars=yes'); + +function PopupZ3950(link,i) { + var strQuery=""; + for (i=0 ; i0) { + strQuery += "&isbn="+document.forms[0].field_value[i].value; + } + if (document.forms[0].kohafield[i].value == "biblio.title" && document.forms[0].field_value[i].value.length>0) { + strQuery += "&title="+document.forms[0].field_value[i].value; + } + if (document.forms[0].kohafield[i].value == "biblio.author" &&document.forms[0].field_value[i].value.length>0) { + strQuery += "&author="+document.forms[0].field_value[i].value; + } + if (document.forms[0].kohafield[i].value == "biblioitems.issn" && document.forms[0].field_value[i].value.length>0) { + strQuery += "&issn="+document.forms[0].field_value[i].value; + } + } + newin=window.open("../z3950/search.pl?bibid="+strQuery,"z3950 search",'width=500,height=400,toolbar=false,scrollbars=yes'); } -- 2.39.5