From d878a92b3df1fdaf8c3eff64f215ad6869e18c66 Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Mon, 17 Mar 2008 19:16:39 -0500 Subject: [PATCH] Add MARC preview to Z39.50 search. Also, add title string to MARC editor. Signed-off-by: Joshua Ferraro --- catalogue/showmarc.pl | 15 +++++++++++++-- cataloguing/addbiblio.pl | 1 + .../prog/en/modules/cataloguing/addbiblio.tmpl | 11 ++++------- .../prog/en/modules/cataloguing/z3950_search.tmpl | 7 +++++-- 4 files changed, 23 insertions(+), 11 deletions(-) diff --git a/catalogue/showmarc.pl b/catalogue/showmarc.pl index 6239b7162a..18c1b45041 100755 --- a/catalogue/showmarc.pl +++ b/catalogue/showmarc.pl @@ -35,6 +35,7 @@ use C4::Context; use C4::Output; use C4::Auth; use C4::Biblio; +use C4::ImportBatch; use XML::LibXSLT; use XML::LibXML; @@ -42,6 +43,7 @@ my $userid = $ENV{'REMOTE_USER'}; my $input = new CGI; my $biblionumber = $input->param('id'); +my $importid = $input->param('importid'); my $view = $input->param('viewas'); my ( $template, $loggedinuser, $cookie ) = get_template_and_user( @@ -56,8 +58,17 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user( ); $template->param( SCRIPT_NAME => $ENV{'SCRIPT_NAME'}, ); +my ($record, $xmlrecord); +if($importid) { + my ($marc,$encoding) = GetImportRecordMarc($importid); + $record = MARC::Record->new_from_usmarc($marc) ; + if($view eq 'card') { + $xmlrecord = $record->as_xml(); + } +} + if($view eq 'card') { -my $xmlrecord = GetXmlBiblio($biblionumber); +$xmlrecord = GetXmlBiblio($biblionumber) unless $xmlrecord; my $xslfile = C4::Context->config('intranetdir')."/koha-tmpl/intranet-tmpl/prog/en/xslt/compact.xsl"; my $parser = XML::LibXML->new(); @@ -73,7 +84,7 @@ print $newxmlrecord; } else { -my $record =GetMarcBiblio($biblionumber); +$record =GetMarcBiblio($biblionumber) unless $record; my $formatted = $record->as_formatted; $template->param( MARC_FORMATTED => $formatted ); diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 6a7efe6d8d..4df8d64553 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -785,6 +785,7 @@ $is_a_modif = 0; if ($biblionumber) { $is_a_modif = 1; + $template->param( title => $record->title(), ); # if it's a modif, retrieve bibli and biblioitem numbers for the future modification of old-DB. ( $biblionumbertagfield, $biblionumbertagsubfield ) = diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl index cbf10345f0..e3c7120be9 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tmpl @@ -46,11 +46,8 @@ function Dopop(link,i) { function PopupZ3950() { var strQuery = GetZ3950Terms(); if(strQuery){ - window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber="+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,scrollbars=yes,resize=yes'); - } else { - var strAlert = _("To perform a z39.50 search, you must enter at least one of the following: \n\n ISBN\n ISSN\n Title\n Author\n LCCN\n"); - alert(strAlert); - } + window.open("/cgi-bin/koha/cataloguing/z3950_search.pl?biblionumber="+strQuery,"z3950search",'width=740,height=450,location=yes,toolbar=no,resize=yes'); + } } /** @@ -434,7 +431,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? //]]> - +
@@ -444,7 +441,7 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ? -

Edit MARC Record Number Add MARC Record

+

Edit MARC Record Number

( )

Add MARC Record diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl index 69facff501..847ce0df8c 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/z3950_search.tmpl @@ -1,5 +1,6 @@ Koha › Z39.50 Search Results +