Merge remote-tracking branch 'origin/new/bug_3652'

This commit is contained in:
Paul Poulain 2012-10-24 15:44:33 +02:00
commit 2943530f25
9 changed files with 18 additions and 4 deletions

View file

@ -63,7 +63,7 @@
widgets : ['zebra'],
sortList: [[0,0]]
});
[% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
[% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
q_array = query_desc.split(" ");
highlightOn();
$("#highlight_toggle_on" ).hide().click(function() {highlightOn() ; return false;});

View file

@ -62,7 +62,7 @@ $(document).ready(function(){
return false;
});
[% IF ( query_desc ) %]
var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
q_array = query_desc.split(" ");
// ensure that we don't have "" at the end of the array, which can
// break the highlighter

View file

@ -207,7 +207,7 @@ $(document).ready(function(){
[% END %]
$("#holdDetails").hide();
[% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('"', '\"') |replace('\n', '\\n') |replace('\r', '\\r') %]";
[% IF ( query_desc ) %][% IF ( OpacHighlightedWords ) %]var query_desc = "[% query_desc |replace("'", "\'") |replace('\n', '\\n') |replace('\r', '\\r') |html %]";
q_array = query_desc.split(" ");
// ensure that we don't have "" at the end of the array, which can
// break the highlighter

View file

@ -67,6 +67,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
my $biblionumber = $query->param('biblionumber');
$biblionumber = int($biblionumber);
# get biblionumbers stored in the cart
my @cart_list;

View file

@ -61,6 +61,7 @@ my $biblionumber = $query->param('biblionumber');
my $itemtype = &GetFrameworkCode($biblionumber);
my $tagslib = &GetMarcStructure( 0, $itemtype );
my $biblio = GetBiblioData($biblionumber);
$biblionumber = $biblio->{biblionumber};
my $record = GetMarcBiblio($biblionumber, 1);
if ( ! $record ) {
print $query->redirect("/cgi-bin/koha/errors/404.pl");

View file

@ -67,6 +67,7 @@ my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
);
my $authid = $query->param('authid');
$authid = int($authid);
my $record = GetAuthority( $authid );
if ( ! $record ) {
print $query->redirect("/cgi-bin/koha/errors/404.pl"); # escape early

View file

@ -69,6 +69,7 @@ my ( $template, $borrowernumber, $cookie ) = get_template_and_user(
);
my $biblionumber = $query->param('biblionumber') || $query->param('bib');
$biblionumber = int($biblionumber);
my $record = GetMarcBiblio($biblionumber);
if ( ! $record ) {

View file

@ -32,6 +32,7 @@ my $query = new CGI;
my $op=$query->param("op")||''; #op=export is currently the only use
my $format=$query->param("format")||'utf8';
my $biblionumber = $query->param("bib")||0;
$biblionumber = int($biblionumber);
my ($marc, $error)= ('','');
$marc = GetMarcBiblio($biblionumber, 1) if $biblionumber;
@ -41,18 +42,23 @@ if(!$marc) {
}
elsif ($format =~ /endnote/) {
$marc = marc2endnote($marc);
$format = 'endnote';
}
elsif ($format =~ /marcxml/) {
$marc = marc2marcxml($marc);
$format = 'marcxml';
}
elsif ($format=~ /mods/) {
$marc = marc2modsxml($marc);
$format = 'mods';
}
elsif ($format =~ /ris/) {
$marc = marc2ris($marc);
$format = 'ris';
}
elsif ($format =~ /bibtex/) {
$marc = marc2bibtex(C4::Biblio::GetMarcBiblio($biblionumber),$biblionumber);
$format = 'bibtex';
}
elsif ($format =~ /dc/) {
($error,$marc) = marc2dcxml($marc,1);
@ -61,14 +67,17 @@ elsif ($format =~ /dc/) {
elsif ($format =~ /marc8/) {
($error,$marc) = changeEncoding($marc,"MARC","MARC21","MARC-8");
$marc = $marc->as_usmarc() unless $error;
$format = 'marc8';
}
elsif ($format =~ /utf8/) {
C4::Charset::SetUTF8Flag($marc,1);
$marc = $marc->as_usmarc();
$format = 'utf8';
}
elsif ($format =~ /marcstd/) {
C4::Charset::SetUTF8Flag($marc,1);
($error,$marc) = marc2marc($marc, 'marcstd', C4::Context->preference('marcflavour'));
$format = 'marcstd';
}
else {
$error= "Format $format is not supported.";
@ -78,7 +87,7 @@ if ($error){
print $query->header();
print $query->start_html();
print "<h1>An error occurred </h1>";
print $error;
print $query->escapeHTML("$error");
print $query->end_html();
}
else {

View file

@ -44,6 +44,7 @@ use XML::LibXML;
my $input = new CGI;
my $biblionumber = $input->param('id');
$biblionumber = int($biblionumber);
my $importid = $input->param('importid');
my $view = $input->param('viewas') || 'marc';