Bug 21704: (follow-up) Remove unused 'frameworkcode' template param
authorTomas Cohen Arazi <tomascohen@theke.io>
Sun, 28 Oct 2018 12:56:17 +0000 (09:56 -0300)
committerNick Clemens <nick@bywatersolutions.com>
Mon, 29 Oct 2018 00:17:33 +0000 (00:17 +0000)
This patch removes the 'frameworkcode' template parameter. Now the
'framework' object is passed, and everytime the frameworkcode is needed
on the template, framework.frameworkcode is called.

To test:
- Apply this patch
- Run:
  $ grep ' frameworkcode ' koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt
=> SUCCESS: There's no use of 'frameworkcode' in the template
- Sign off :-D

Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Michal Denar <black23@gmail.com>
Signed-off-by: Katrin Fischer <katrin.fischer.83@web.de>
Signed-off-by: Nick Clemens <nick@bywatersolutions.com>
admin/marctagstructure.pl
koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt

index e42ce4f..ba9ea33 100755 (executable)
@@ -109,8 +109,7 @@ if ($op eq 'add_form') {
             mandatory => $data->{'mandatory'},
             authorised_value => $data->{authorised_value},
             ind1_defaultvalue => $data->{'ind1_defaultvalue'},
-            ind2_defaultvalue => $data->{'ind2_defaultvalue'},
-                       frameworkcode => $frameworkcode,
+            ind2_defaultvalue => $data->{'ind2_defaultvalue'}
     );  # FIXME: move checkboxes to presentation layer
                                                                                                        # END $OP eq ADD_FORM
 ################## ADD_VALIDATE ##################################
@@ -168,8 +167,7 @@ if ($op eq 'add_form') {
     my $data = $sth->fetchrow_hashref;
        $template->param(
          liblibrarian => $data->{'liblibrarian'},
-          searchfield => $searchfield,
-        frameworkcode => $frameworkcode,
+          searchfield => $searchfield
     );
                                                                                                        # END $OP eq DELETE_CONFIRM
 ################## DELETE_CONFIRMED ##################################
@@ -183,10 +181,7 @@ if ($op eq 'add_form') {
     $cache->clear_from_cache("MarcStructure-1-$frameworkcode");
     $cache->clear_from_cache("default_value_for_mod_marc-");
     $cache->clear_from_cache("MarcSubfieldStructure-$frameworkcode");
-       $template->param(
-          searchfield => $searchfield,
-        frameworkcode => $frameworkcode,
-    );
+       $template->param( searchfield => $searchfield );
                                                                                                        # END $OP eq DELETE_CONFIRMED
 ################## ITEMTYPE_CREATE ##################################
 # called automatically if an unexisting  frameworkis selected
@@ -202,9 +197,8 @@ if ($op eq 'add_form') {
             };
                }
        }
-       $template->param(existingframeworkloop => \@existingframeworkloop,
-                                       frameworkcode => $frameworkcode,
-                                       );
+       $template->param( existingframeworkloop => \@existingframeworkloop );
+
 ################## DEFAULT ##################################
 } else { # DEFAULT
        # here, $op can be unset or set to "framework_create_confirm".
@@ -300,15 +294,13 @@ if ($op eq 'add_form') {
                $template->param(isprevpage => $offset,
                                                prevpage=> $offset-$pagesize,
                                                searchfield => $searchfield,
-                                               script_name => $script_name,
-                                               frameworkcode => $frameworkcode,
+                                               script_name => $script_name
                );
        }
        if ($offset+$pagesize<$cnt) {
                $template->param(nextpage =>$offset+$pagesize,
                                                searchfield => $searchfield,
-                                               script_name => $script_name,
-                                               frameworkcode => $frameworkcode,
+                                               script_name => $script_name
                );
        }
 } #---- END $OP eq DEFAULT
index 1910451..8d21ec5 100644 (file)
     <form action="[% script_name | html %]" method="post">
         <input type="hidden" name="op" value="framework_create_confirm" />
         <input type="hidden" name="frameworkcode" value="[% framework.frameworkcode | html %]" />
-        Create framework for [% frameworkcode | html %] ([% framework.frameworktext | html %]) using
+        Create framework for [% framework.frameworkcode | html %] ([% framework.frameworktext | html %]) using
         <select name="existingframeworkcode">
             <option value="">Default</option>
         [% FOREACH existingframeworkloo IN existingframeworkloop %]