From 4324377c55f3c82f724fc08c364eb678ab0f5ffa Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 25 Aug 2011 15:11:09 -0400 Subject: [PATCH] Fix for Bug 6458 - incorrect parsing result in translation processing Correction for opac-messaging.tt tops tag attribute markup from being passed to the template directly in favor of using template logic. Signed-off-by: Chris Cormack --- C4/Form/MessagingPreferences.pm | 4 +- .../prog/en/modules/opac-messaging.tt | 49 ++++++++++++++----- 2 files changed, 40 insertions(+), 13 deletions(-) diff --git a/C4/Form/MessagingPreferences.pm b/C4/Form/MessagingPreferences.pm index 4bc742defe..85ae9e8ceb 100644 --- a/C4/Form/MessagingPreferences.pm +++ b/C4/Form/MessagingPreferences.pm @@ -140,9 +140,9 @@ sub set_form_values { } ( 0..30 ); # FIXME: 30 is a magic number. } foreach my $transport ( @{$pref->{'transports'}} ) { - $option->{'transport_'.$transport} = 'checked="checked"'; + $option->{'transports_'.$transport} = 1; } - $option->{'digest'} = 'checked="checked"' if $pref->{'wants_digest'}; + $option->{'digest'} = 1 if $pref->{'wants_digest'}; } $template->param(messaging_preferences => $messaging_options); } diff --git a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt index ebb1e264fe..4c51f48a01 100644 --- a/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt +++ b/koha-tmpl/opac-tmpl/prog/en/modules/opac-messaging.tt @@ -59,29 +59,56 @@ - [% END %] [% IF ( messaging_preference.transport_sms ) %] - [% IF ( SMSSendDriver ) %][% END %] + [% IF ( SMSSendDriver ) %] + + [% IF ( messaging_preference.transports_sms ) %] + + [% ELSE %] + + [% END %] + + [% END %] [% ELSE %] - - + - [% END %] [% IF ( messaging_preference.transport_email ) %] - + + [% IF ( messaging_preference.transports_email ) %] + + [% ELSE %] + + [% END %] [% ELSE %] - [% END %] [% IF ( messaging_preference.has_digest ) %] - + [% IF ( messaging_preference.digest ) %] + + name="digest" checked="checked" onclick = "document.opacmessaging.none[% messaging_preference.message_attribute_id %].checked=false;" /> + [% ELSE %] + + [% END %] [% ELSE %] - -- 2.39.5