View | Details | Raw Unified | Return to bug 11559
Collapse All | Expand All

(-)a/C4/Auth.pm (+2 lines)
Lines 359-364 sub get_template_and_user { Link Here
359
        $template->param( dateformat => C4::Context->preference('dateformat') );
359
        $template->param( dateformat => C4::Context->preference('dateformat') );
360
    }
360
    }
361
361
362
    $template->param(auth_forwarded_hash => $in->{'query'}->param('auth_forwarded_hash'));
363
362
    # these template parameters are set the same regardless of $in->{'type'}
364
    # these template parameters are set the same regardless of $in->{'type'}
363
365
364
    # Set the using_https variable for templates
366
    # Set the using_https variable for templates
(-)a/C4/Service.pm (-3 / +14 lines)
Lines 55-60 BEGIN { Link Here
55
55
56
our ( $query, $cookie );
56
our ( $query, $cookie );
57
57
58
sub _output {
59
    my ( $response, $status ) = @_;
60
    binmode STDOUT, ':encoding(UTF-8)';
61
62
    if ( $query->param( 'callback' ) ) {
63
        output_with_http_headers $query, $cookie, $query->param( 'callback' ) . '(' . $response->output . ');', 'js';
64
    } else {
65
        output_with_http_headers $query, $cookie, $response->output, 'json', $status;
66
    }
67
}
68
58
=head1 METHODS
69
=head1 METHODS
59
70
60
=head2 init
71
=head2 init
Lines 113-119 sub return_error { Link Here
113
    $response->param( message => $error ) if ( $error );
124
    $response->param( message => $error ) if ( $error );
114
    $response->param( type => $type, %flags );
125
    $response->param( type => $type, %flags );
115
126
116
    output_with_http_headers $query, $cookie, $response->output, 'json', '400 Bad Request';
127
    _output( $response, '400 Bad Request' );
117
    exit;
128
    exit;
118
}
129
}
119
130
Lines 159-165 sub return_multi { Link Here
159
        }
170
        }
160
171
161
        $response->param( 'multi' => JSON::true, responses => \@responses_formatted, @flags );
172
        $response->param( 'multi' => JSON::true, responses => \@responses_formatted, @flags );
162
        output_with_http_headers $query, $cookie, $response->output, 'json', '207 Multi-Status';
173
        _output( $response, '207 Multi-Status' );
163
    }
174
    }
164
175
165
    exit;
176
    exit;
Lines 177-183 exit with HTTP status 200. Link Here
177
sub return_success {
188
sub return_success {
178
    my ( $class, $response ) = @_;
189
    my ( $class, $response ) = @_;
179
190
180
    output_with_http_headers $query, $cookie, $response->output, 'json';
191
    _output( $response );
181
}
192
}
182
193
183
=head2 require_params
194
=head2 require_params
(-)a/koha-tmpl/intranet-tmpl/lib/jquery/plugins/humanmsg.js (-24 / +27 lines)
Lines 21-27 var humanMsg = { Link Here
21
		if (msgOpacity != undefined) humanMsg.msgOpacity = parseFloat(msgOpacity);
21
		if (msgOpacity != undefined) humanMsg.msgOpacity = parseFloat(msgOpacity);
22
22
23
		// Inject the message structure
23
		// Inject the message structure
24
		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>')
24
		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>');
25
25
26
		jQuery('#'+humanMsg.logID+' p').click(
26
		jQuery('#'+humanMsg.logID+' p').click(
27
			function() { jQuery(this).siblings('ul').slideToggle() }
27
			function() { jQuery(this).siblings('ul').slideToggle() }
Lines 29-72 var humanMsg = { Link Here
29
	},
29
	},
30
30
31
	displayAlert: function(msg, options) {
31
	displayAlert: function(msg, options) {
32
		humanMsg.displayMsg(msg, options, true);
32
		humanMsg.displayMsg('<p>' + msg + '</p>', options);
33
	},
33
	},
34
34
35
	displayMsg: function(msg, options, is_alert) {
35
    logMsg: function(msg) {
36
        jQuery('#'+humanMsg.logID)
37
            .show().children('ul').prepend('<li>'+msg+'</li>')	// Prepend message to log
38
            .children('li:first').slideDown(200)				// Slide it down
39
40
        if ( jQuery('#'+humanMsg.logID+' ul').css('display') == 'none') {
41
            jQuery('#'+humanMsg.logID+' p').animate({ bottom: 40 }, 200, 'linear', function() {
42
                jQuery(this).animate({ bottom: 0 }, 300, 'swing', function() { jQuery(this).css({ bottom: 0 }) })
43
            })
44
        }
45
    },
46
47
	displayMsg: function(msg, options) {
36
		if (msg == '')
48
		if (msg == '')
37
			return;
49
			return;
38
50
39
		if (options != undefined) {
51
        options = $.extend({
40
			delay = 'delay' in options ? parseInt(options.delay) * 1000 : 1000
52
            delay: 1000,
41
			life = 'life' in options ? parseInt(options.life) * 1000 : Infinity
53
            life: Infinity,
42
		} else {
54
            log: true,
43
			delay = 1000
55
            className: '',
44
			life = Infinity
56
        }, options);
45
		}
46
57
58
		clearTimeout(humanMsg.t1);
47
		clearTimeout(humanMsg.t2);
59
		clearTimeout(humanMsg.t2);
48
60
49
		// Inject message
61
		// Inject message
50
		jQuery('#'+humanMsg.msgID+'-contents').html(is_alert ? ('<p>' + msg + '</p>') : msg)
62
		jQuery('#'+humanMsg.msgID+'-contents').html(msg);
51
63
52
		// Show message
64
		// Show message
53
		jQuery('#'+humanMsg.msgID).show().animate({ opacity: humanMsg.msgOpacity}, 200, function() {
65
		jQuery('#'+humanMsg.msgID).attr('class', 'humanMsg ' + options.className).show().animate({ opacity: humanMsg.msgOpacity}, 200, function() {
54
			jQuery('#'+humanMsg.logID)
66
            humanMsg.logMsg(msg, options);
55
				.show().children('ul').prepend('<li>'+msg+'</li>')	// Prepend message to log
56
				.children('li:first').slideDown(200)				// Slide it down
57
58
			if ( jQuery('#'+humanMsg.logID+' ul').css('display') == 'none') {
59
				jQuery('#'+humanMsg.logID+' p').animate({ bottom: 40 }, 200, 'linear', function() {
60
					jQuery(this).animate({ bottom: 0 }, 300, 'swing', function() { jQuery(this).css({ bottom: 0 }) })
61
				})
62
			}
63
64
		})
67
		})
65
68
66
		// Watch for mouse & keyboard in `delay`
69
		// Watch for mouse & keyboard in `delay`
67
		humanMsg.t1 = setTimeout("humanMsg.bindEvents()", delay)
70
		humanMsg.t1 = setTimeout("humanMsg.bindEvents()", options.delay)
68
		// Remove message after `life`
71
		// Remove message after `life`
69
		humanMsg.t2 = setTimeout("humanMsg.removeMsg()", life)
72
		humanMsg.t2 = setTimeout("humanMsg.removeMsg()", options.life)
70
	},
73
	},
71
74
72
	bindEvents: function() {
75
	bindEvents: function() {
(-)a/koha-tmpl/intranet-tmpl/prog/en/css/humanmsg.css (-6 / +9 lines)
Lines 9-14 html, body { Link Here
9
}
9
}
10
10
11
.humanMsg {
11
.humanMsg {
12
    border-radius: 5px;
12
	font: normal 20px/50px Helvetica, Arial, Sans-Serif;
13
	font: normal 20px/50px Helvetica, Arial, Sans-Serif;
13
	letter-spacing: -1px;
14
	letter-spacing: -1px;
14
	position: fixed;
15
	position: fixed;
Lines 23-28 html, body { Link Here
23
	z-index: 100000;
24
	z-index: 100000;
24
}
25
}
25
26
27
.humanError {
28
	background-color: #400;
29
}
30
31
.humanSuccess {
32
	background-color: #040;
33
}
34
26
.humanMsg h3 {
35
.humanMsg h3 {
27
	margin: 0.3em;
36
	margin: 0.3em;
28
	margin-top: 0;
37
	margin-top: 0;
Lines 30-41 html, body { Link Here
30
	font-weight: bold;
39
	font-weight: bold;
31
}
40
}
32
41
33
.humanMsg .round {
34
    border-left: solid 2px white;
35
	border-right: solid 2px white;
36
    font-size: 1px; height: 2px;
37
	}
38
39
.humanMsg p {
42
.humanMsg p {
40
	margin: 0.3em;
43
	margin: 0.3em;
41
	}
44
	}
(-)a/koha-tmpl/intranet-tmpl/prog/en/modules/auth.tt (+8 lines)
Lines 103-106 please choose against which one you would like to authenticate: </p> Link Here
103
</div>
103
</div>
104
</div>
104
</div>
105
105
106
<script>
107
$(document).ready( function() {
108
    if ( document.location.hash ) {
109
        $( '#loginform' ).append( '<input name="auth_forwarded_hash" type="hidden" value="' + document.location.hash + '"/>' );
110
    }
111
} );
112
</script>
113
106
[% INCLUDE 'intranet-bottom.inc' %]
114
[% INCLUDE 'intranet-bottom.inc' %]
(-)a/svc/bib (-2 / +1 lines)
Lines 86-92 sub update_bib { Link Here
86
86
87
    my $result = {};
87
    my $result = {};
88
    my $inxml = $query->param('POSTDATA');
88
    my $inxml = $query->param('POSTDATA');
89
    print $query->header(-type => 'text/xml');
89
    print $query->header(-type => 'text/xml', -charset => 'utf-8');
90
90
91
    my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", C4::Context->preference('marcflavour'))};
91
    my $record = eval {MARC::Record::new_from_xml( $inxml, "utf8", C4::Context->preference('marcflavour'))};
92
    my $do_not_escape = 0;
92
    my $do_not_escape = 0;
93
- 

Return to bug 11559