Fix for Bug 6458 - incorrect parsing result in translation processing / branches
authorOwen Leonard <oleonard@myacpl.org>
Fri, 26 Aug 2011 20:07:46 +0000 (16:07 -0400)
committerChris Cormack <chrisc@catalyst.net.nz>
Tue, 13 Sep 2011 22:08:47 +0000 (10:08 +1200)
Correction for branch admin template stops tag attribute markup from
being passed to the template directly in favor of using template
logic.

Signed-off-by: Katrin Fischer <Katrin.Fischer.83@web.de>
Signed-off-by: Chris Cormack <chrisc@catalyst.net.nz>
admin/branches.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/branches.tt

index d6388f5..12c49e2 100755 (executable)
@@ -254,15 +254,15 @@ sub editbranchform {
     #
     # We export a "categoryloop" array to the template, each element of which
     # contains separate 'categoryname', 'categorycode', 'codedescription', and
-    # 'checked' fields. The $checked field is either '' or 'checked="checked"'
+    # 'checked' fields. The $checked field is either empty or 1'
 
     my $catinfo = GetBranchCategory();
     my @categoryloop = ();
     foreach my $cat (@$catinfo) {
-        my $checked = "";
+        my $checked;
         my $tmp     = quotemeta( $cat->{'categorycode'} );
         if ( grep { /^$tmp$/ } @{ $data->{'categories'} } ) {
-            $checked = "checked=\"checked\"";
+            $checked = 1;
         }
         push @categoryloop, {
             categoryname    => $cat->{'categoryname'},
index 42ddb52..1107624 100644 (file)
         <ol>
                [% FOREACH categoryloo IN categoryloop %]
             <li><label for="[% categoryloo.categorycode %]">[% categoryloo.categoryname %]</label>
-                <input type="checkbox" id="[% categoryloo.categorycode %]" name="[% categoryloo.categorycode %]" [% categoryloo.checked %] /> <span class="hint">[% categoryloo.codedescription %]</span>
+                [% IF ( categoryloo.checked ) %]
+                    <input type="checkbox" id="[% categoryloo.categorycode %]" name="[% categoryloo.categorycode %]" checked="checked" />
+                [% ELSE %]
+                    <input type="checkbox" id="[% categoryloo.categorycode %]" name="[% categoryloo.categorycode %]" />
+                [% END %]
+                <span class="hint">[% categoryloo.codedescription %]</span>
             </li>
         [% END %]
                </ol>