From 4324377c55f3c82f724fc08c364eb678ab0f5ffa Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 25 Aug 2011 15:11:09 -0400 Subject: [PATCH 1/4] 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 %] - From 143e3e6541b829c8c7e476526348502b05b204ee Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Tue, 13 Sep 2011 08:57:25 -0400 Subject: [PATCH 2/4] Fix for Bug 6458 - incorrect parsing result in translation processing Correcting doc-head-open.inc (again?). Signed-off-by: Chris Cormack --- koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc index ea87535446..b8aa2ad246 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc +++ b/koha-tmpl/intranet-tmpl/prog/en/includes/doc-head-open.inc @@ -1,4 +1,4 @@ - +[% IF ( bidi ) %][% ELSE %][% END %] From 7e8381c78c6ccffbe6d41d700fa46aa3ed8025ff Mon Sep 17 00:00:00 2001 From: Owen Leonard Date: Thu, 1 Sep 2011 11:14:50 -0400 Subject: [PATCH 3/4] Fix for Bug 6458 - incorrect parsing result in translation processing Fixing improperly nested template logic inside HTML tags in MARC editor. Modifying script to stop tag attribute markup from being passed to the template directly in favor of using template logic. Signed-off-by: Chris Cormack --- cataloguing/addbiblio.pl | 2 +- .../prog/en/modules/cataloguing/addbiblio.tt | 8 ++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/cataloguing/addbiblio.pl b/cataloguing/addbiblio.pl index 637d82dffd..21601e9464 100755 --- a/cataloguing/addbiblio.pl +++ b/cataloguing/addbiblio.pl @@ -874,7 +874,7 @@ foreach my $thisframeworkcode ( keys %$frameworks ) { frameworktext => $frameworks->{$thisframeworkcode}->{'frameworktext'}, ); if ($frameworkcode eq $thisframeworkcode){ - $row{'selected'}="selected=\"selected\""; + $row{'selected'} = 1; } push @frameworkcodeloop, \%row; } diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt index 09bf2d6499..baa84c723a 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/cataloguing/addbiblio.tt @@ -778,8 +778,12 @@ function unHideSubfield(index,labelindex) { // FIXME :: is it used ?
  • + value="sms" checked="checked" disabled="disabled" /> + [% ELSE %] + + [% END %] [% ELSE %] + [% IF ( messaging_preference.transports_sms ) %] + value="sms" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" /> + [% ELSE %] + + [% END %] [% END %] [% END %] [% ELSE %] @@ -72,15 +86,29 @@ [% IF ( messaging_preference.transport_email ) %] [% IF ( messaging_form_inactive ) %] - + [% IF ( messaging_preference.transports_email ) %] + + [% ELSE %] + + [% END %] [% ELSE %] + [% IF ( messaging_preference.transports_email ) %] + value="email" checked="checked" onclick = "$('#none'+'[% messaging_preference.message_attribute_id %]').attr('checked','');" /> + [% ELSE %] + + [% END %] [% END %] [% ELSE %] @@ -90,15 +118,29 @@ [% IF ( messaging_preference.has_digest ) %] [% IF ( messaging_form_inactive ) %] - + [% IF ( messaging_preference.digest ) %] + + [% ELSE %] + + [% END %] [% ELSE %] - + [% IF ( messaging_preference.digest ) %] + + [% ELSE %] + + [% END %] [% END %] [% ELSE %]