use C4::Output;
use C4::Auth;
use C4::Biblio;
+use C4::ImportBatch;
use XML::LibXSLT;
use XML::LibXML;
-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(
query => $input,
type => "intranet",
authnotrequired => 0,
- flagsrequired => { acquisition => 1 },
+ flagsrequired => { catalogue => 1 },
debug => 1,
}
);
$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 $xslfile = C4::Context->config('intrahtdocs')."/prog/en/xslt/compact.xsl";
my $parser = XML::LibXML->new();
my $xslt = XML::LibXSLT->new();
my $source = $parser->parse_string($xmlrecord);
} else {
-my $record =GetMarcBiblio($biblionumber);
+$record =GetMarcBiblio($biblionumber) unless $record;
my $formatted = $record->as_formatted;
$template->param( MARC_FORMATTED => $formatted );