Bugzilla – Attachment 26069 Details for
Bug 11559
Professional cataloger's interface
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Bug 11559 - Supporting changes for Rancor
Bug-11559---Supporting-changes-for-Rancor.patch (text/plain), 13.29 KB, created by
Jesse Weaver
on 2014-03-11 10:54:19 UTC
(
hide
)
Description:
Bug 11559 - Supporting changes for Rancor
Filename:
MIME Type:
Creator:
Jesse Weaver
Created:
2014-03-11 10:54:19 UTC
Size:
13.29 KB
patch
obsolete
>From efecb36499455d67c96130e711634262fe3d4756 Mon Sep 17 00:00:00 2001 >From: Jesse Weaver <pianohacker@gmail.com> >Date: Tue, 11 Mar 2014 11:13:51 +0100 >Subject: [PATCH] Bug 11559 - Supporting changes for Rancor > > * Extends login screen to pass along #hash > * Adds JSONP support to C4::Service > * Allows XSLT filename to be extracted > * Extends humanmsg to allow per-message classes > * Fixes XSLT namespace for in-browser rendering and > * Adds proper charset to results of svc/bib >--- > C4/Auth.pm | 2 ++ > C4/Service.pm | 16 +++++++-- > C4/XSLT.pm | 39 +++++++++++++--------- > koha-tmpl/intranet-tmpl/prog/en/css/humanmsg.css | 15 +++++---- > .../intranet-tmpl/prog/en/css/staff-global.css | 11 ++++-- > .../prog/en/lib/jquery/plugins/humanmsg.js | 29 ++++++++-------- > koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt | 8 +++++ > .../prog/en/xslt/MARC21slim2intranetResults.xsl | 1 + > .../intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl | 2 +- > svc/bib | 2 +- > 10 files changed, 82 insertions(+), 43 deletions(-) > >diff --git a/C4/Auth.pm b/C4/Auth.pm >index 44edf67..bac7748 100644 >--- a/C4/Auth.pm >+++ b/C4/Auth.pm >@@ -302,6 +302,8 @@ sub get_template_and_user { > $template->param(dateformat => C4::Context->preference('dateformat')) > } > >+ $template->param(auth_forwarded_hash => $in->{'query'}->param('auth_forwarded_hash')); >+ > # these template parameters are set the same regardless of $in->{'type'} > $template->param( > "BiblioDefaultView".C4::Context->preference("BiblioDefaultView") => 1, >diff --git a/C4/Service.pm b/C4/Service.pm >index d9990ff..512ed15 100644 >--- a/C4/Service.pm >+++ b/C4/Service.pm >@@ -55,6 +55,16 @@ BEGIN { > > our ( $query, $cookie ); > >+sub _output { >+ my ( $response, $status ) = @_; >+ >+ if ( $query->param( 'callback' ) ) { >+ output_with_http_headers $query, $cookie, $query->param( 'callback' ) . '(' . $response->output . ');', 'js'; >+ } else { >+ output_with_http_headers $query, $cookie, $response->output, 'json', $status; >+ } >+} >+ > =head1 METHODS > > =head2 init >@@ -113,7 +123,7 @@ sub return_error { > $response->param( message => $error ) if ( $error ); > $response->param( type => $type, %flags ); > >- output_with_http_headers $query, $cookie, $response->output, 'json', '400 Bad Request'; >+ _output( $response, '400 Bad Request' ); > exit; > } > >@@ -159,7 +169,7 @@ sub return_multi { > } > > $response->param( 'multi' => JSON::true, responses => \@responses_formatted, @flags ); >- output_with_http_headers $query, $cookie, $response->output, 'json', '207 Multi-Status'; >+ _output( $response, '207 Multi-Status' ); > } > > exit; >@@ -177,7 +187,7 @@ exit with HTTP status 200. > sub return_success { > my ( $class, $response ) = @_; > >- output_with_http_headers $query, $cookie, $response->output, 'json'; >+ _output( $response ); > } > > =head2 require_params >diff --git a/C4/XSLT.pm b/C4/XSLT.pm >index d85b048..ccdf562 100644 >--- a/C4/XSLT.pm >+++ b/C4/XSLT.pm >@@ -42,6 +42,7 @@ BEGIN { > $VERSION = 3.07.00.049; > @ISA = qw(Exporter); > @EXPORT = qw( >+ &XSLTGetFilename > &XSLTParse4Display > &GetURI > ); >@@ -156,33 +157,34 @@ sub _get_best_default_xslt_filename { > return $xslfilename; > } > >-sub XSLTParse4Display { >- my ( $biblionumber, $orig_record, $xslsyspref, $fixamps, $hidden_items ) = @_; >- my $xslfilename = C4::Context->preference($xslsyspref); >+sub XSLTGetFilename { >+ my ( $marcflavour, $xslsyspref ) = @_; >+ >+ my $xslfilename = $marcflavour eq C4::Context->preference('marcflavour') ? C4::Context->preference($xslsyspref) : 'default'; > if ( $xslfilename =~ /^\s*"?default"?\s*$/i ) { > my $htdocs; > my $theme; > my $lang = C4::Templates::_current_language(); > my $xslfile; > if ($xslsyspref eq "XSLTDetailsDisplay") { >- $htdocs = C4::Context->config('intrahtdocs'); >- $theme = C4::Context->preference("template"); >- $xslfile = C4::Context->preference('marcflavour') . >+ $htdocs = C4::Context->config('intrahtdocs'); >+ $theme = C4::Context->preference("template"); >+ $xslfile = $marcflavour . > "slim2intranetDetail.xsl"; > } elsif ($xslsyspref eq "XSLTResultsDisplay") { >- $htdocs = C4::Context->config('intrahtdocs'); >- $theme = C4::Context->preference("template"); >- $xslfile = C4::Context->preference('marcflavour') . >+ $htdocs = C4::Context->config('intrahtdocs'); >+ $theme = C4::Context->preference("template"); >+ $xslfile = $marcflavour . > "slim2intranetResults.xsl"; > } elsif ($xslsyspref eq "OPACXSLTDetailsDisplay") { >- $htdocs = C4::Context->config('opachtdocs'); >- $theme = C4::Context->preference("opacthemes"); >- $xslfile = C4::Context->preference('marcflavour') . >+ $htdocs = C4::Context->config('opachtdocs'); >+ $theme = C4::Context->preference("opacthemes"); >+ $xslfile = $marcflavour . > "slim2OPACDetail.xsl"; > } elsif ($xslsyspref eq "OPACXSLTResultsDisplay") { >- $htdocs = C4::Context->config('opachtdocs'); >- $theme = C4::Context->preference("opacthemes"); >- $xslfile = C4::Context->preference('marcflavour') . >+ $htdocs = C4::Context->config('opachtdocs'); >+ $theme = C4::Context->preference("opacthemes"); >+ $xslfile = $marcflavour . > "slim2OPACResults.xsl"; > } > $xslfilename = _get_best_default_xslt_filename($htdocs, $theme, $lang, $xslfile); >@@ -193,6 +195,13 @@ sub XSLTParse4Display { > $xslfilename =~ s/\{langcode\}/$lang/; > } > >+ return $xslfilename; >+} >+ >+sub XSLTParse4Display { >+ my ( $biblionumber, $orig_record, $xslsyspref, $fixamps, $hidden_items ) = @_; >+ my $xslfilename = XSLTGetFilename( C4::Context->preference( 'marcflavour' ), $xslsyspref ); >+ > # grab the XML, run it through our stylesheet, push it out to the browser > my $record = transformMARCXML4XSLT($biblionumber, $orig_record); > #return $record->as_formatted(); >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/humanmsg.css b/koha-tmpl/intranet-tmpl/prog/en/css/humanmsg.css >index 47eb2e6..f9b0071 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/humanmsg.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/humanmsg.css >@@ -9,6 +9,7 @@ html, body { > } > > .humanMsg { >+ border-radius: 5px; > font: normal 20px/50px Helvetica, Arial, Sans-Serif; > letter-spacing: -1px; > position: fixed; >@@ -23,6 +24,14 @@ html, body { > z-index: 100000; > } > >+.humanError { >+ background-color: #400; >+} >+ >+.humanSuccess { >+ background-color: #040; >+} >+ > .humanMsg h3 { > margin: 0.3em; > margin-top: 0; >@@ -30,12 +39,6 @@ html, body { > font-weight: bold; > } > >-.humanMsg .round { >- border-left: solid 2px white; >- border-right: solid 2px white; >- font-size: 1px; height: 2px; >- } >- > .humanMsg p { > margin: 0.3em; > } >diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >index 685ebef..499af7c 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >+++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css >@@ -395,13 +395,18 @@ dd { > font-weight : normal; > } > >-div#toolbar { >+.btn-toolbar { > background-color : #EDF4F6; > padding: 5px 5px 5px 5px; > border-radius: 5px 5px 0 0; > border: 1px solid #E6F0F2; > } > >+.btn-toolbar .yui-menu-button button, >+.btn-toolbar .yui-button-button button { >+ line-height : 1.7em; >+} >+ > ul.toolbar { > padding-left : 0; > } >@@ -2427,8 +2432,8 @@ video { > background-position:-48px -166px; > } > >-#toolbar .btn, >-#toolbar .dropdown-menu { >+.btn-toolbar .btn, >+.btn-toolbar .dropdown-menu { > font-size: 13px; > } > a.btn:link, >diff --git a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/humanmsg.js b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/humanmsg.js >index 4a2d62c..6b3be81 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/humanmsg.js >+++ b/koha-tmpl/intranet-tmpl/prog/en/lib/jquery/plugins/humanmsg.js >@@ -21,7 +21,7 @@ var humanMsg = { > if (msgOpacity != undefined) humanMsg.msgOpacity = parseFloat(msgOpacity); > > // Inject the message structure >- jQuery(appendTo).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><div class="round"></div><div id="'+humanMsg.msgID+'-contents"></div><div class="round"></div></div> <div id="'+humanMsg.logID+'"><p class="launcher">'+logName+'</p><ul></ul></div>') >+ jQuery(appendTo).append('<div id="'+humanMsg.msgID+'" class="humanMsg"><div id="'+humanMsg.msgID+'-contents"></div></div> <div id="'+humanMsg.logID+'"><p class="launcher">'+logName+'</p><ul></ul></div>'); > > jQuery('#'+humanMsg.logID+' p').click( > function() { jQuery(this).siblings('ul').slideToggle() } >@@ -29,28 +29,29 @@ var humanMsg = { > }, > > displayAlert: function(msg, options) { >- humanMsg.displayMsg(msg, options, true); >+ humanMsg.displayMsg('<p>' + msg + '</p>', $.extend({log: false}, options), true); > }, > >- displayMsg: function(msg, options, is_alert) { >+ displayMsg: function(msg, options) { > if (msg == '') > return; > >- if (options != undefined) { >- delay = 'delay' in options ? parseInt(options.delay) * 1000 : 1000 >- life = 'life' in options ? parseInt(options.life) * 1000 : Infinity >- } else { >- delay = 1000 >- life = Infinity >- } >+ options = $.extend({ >+ delay: 1000, >+ life: Infinity, >+ log: true, >+ className: '', >+ }, options); > >+ clearTimeout(humanMsg.t1); > clearTimeout(humanMsg.t2); > > // Inject message >- jQuery('#'+humanMsg.msgID+'-contents').html(is_alert ? ('<p>' + msg + '</p>') : msg) >+ jQuery('#'+humanMsg.msgID+'-contents').html(msg); > > // Show message >- jQuery('#'+humanMsg.msgID).show().animate({ opacity: humanMsg.msgOpacity}, 200, function() { >+ jQuery('#'+humanMsg.msgID).attr('class', 'humanMsg ' + options.className).show().animate({ opacity: humanMsg.msgOpacity}, 200, function() { >+ if ( !options.log ) return true; > jQuery('#'+humanMsg.logID) > .show().children('ul').prepend('<li>'+msg+'</li>') // Prepend message to log > .children('li:first').slideDown(200) // Slide it down >@@ -64,9 +65,9 @@ var humanMsg = { > }) > > // Watch for mouse & keyboard in `delay` >- humanMsg.t1 = setTimeout("humanMsg.bindEvents()", delay) >+ humanMsg.t1 = setTimeout("humanMsg.bindEvents()", options.delay) > // Remove message after `life` >- humanMsg.t2 = setTimeout("humanMsg.removeMsg()", life) >+ humanMsg.t2 = setTimeout("humanMsg.removeMsg()", options.life) > }, > > bindEvents: function() { >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >index 5f97758..ee4b6ba 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt >@@ -78,4 +78,12 @@ > </div> > </div> > >+<script> >+$(document).ready( function() { >+ if ( document.location.hash ) { >+ $( '#loginform' ).append( '<input name="auth_forwarded_hash" type="hidden" value="' + document.location.hash + '"/>' ); >+ } >+} ); >+</script> >+ > [% INCLUDE 'intranet-bottom.inc' %] >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >index cbc505d..dd2c1a0 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slim2intranetResults.xsl >@@ -5,6 +5,7 @@ > xmlns:marc="http://www.loc.gov/MARC21/slim" > xmlns:items="http://www.koha-community.org/items" > xmlns:xsl="http://www.w3.org/1999/XSL/Transform" >+ xmlns="http://www.w3.org/1999/xhtml" > exclude-result-prefixes="marc items"> > <xsl:import href="MARC21slimUtils.xsl"/> > <xsl:output method = "html" indent="yes" omit-xml-declaration = "yes" encoding="UTF-8"/> >diff --git a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >index 7334d03..2a2e224 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >+++ b/koha-tmpl/intranet-tmpl/prog/en/xslt/MARC21slimUtils.xsl >@@ -1,6 +1,6 @@ > <?xml version='1.0'?> > <!DOCTYPE stylesheet [<!ENTITY nbsp " " >]> >-<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> >+<xsl:stylesheet version="1.0" xmlns:marc="http://www.loc.gov/MARC21/slim" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns="http://www.w3.org/1999/xhtml"> > <xsl:template name="datafield"> > <xsl:param name="tag"/> > <xsl:param name="ind1"><xsl:text> </xsl:text></xsl:param> >diff --git a/svc/bib b/svc/bib >index 8f6a168..5847bbf 100755 >--- a/svc/bib >+++ b/svc/bib >@@ -62,7 +62,7 @@ sub fetch_bib { > my $biblionumber = shift; > my $record = GetMarcBiblio( $biblionumber, $query->url_param('items') ); > if (defined $record) { >- print $query->header(-type => 'text/xml'); >+ print $query->header(-type => 'text/xml', -charset => 'utf-8'); > print $record->as_xml_record(); > } else { > print $query->header(-type => 'text/xml', -status => '404 Not Found'); >-- >1.9.0
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 11559
:
26069
|
26070
|
26071
|
26104
|
26653
|
26654
|
27140
|
27141
|
27142
|
27757
|
27758
|
27759
|
27760
|
27761
|
27900
|
27901
|
27902
|
27993
|
27995
|
34458
|
34459
|
34460
|
34461
|
34462
|
34463
|
36243
|
36244
|
36245
|
36246
|
36247
|
36248
|
36455
|
38533
|
38534
|
38535
|
38536
|
38537
|
38538
|
38539
|
40153
|
40154
|
40155
|
40543
|
40555
|
40556
|
40557
|
40558
|
40811
|
40812
|
40813
|
40814
|
40815
|
41425
|
41453
|
41476
|
42373
|
43261
|
43547
|
43614
|
43615
|
43616
|
43617
|
43618
|
43619
|
43620
|
43621
|
43622
|
43623
|
43703
|
43704
|
43705
|
43706
|
43707
|
43708
|
43709
|
43710
|
43711
|
43712
|
43713
|
43772
|
43790
|
43883
|
43969
|
44016
|
44018
|
44022
|
44023
|
44024
|
44025
|
44026
|
44027
|
44028
|
44029
|
44030
|
44031
|
44032
|
44033
|
44034
|
44035
|
44036