From edf99afa63e2c57fcda3f39ef36a651ac109d643 Mon Sep 17 00:00:00 2001 From: Tomas Cohen Arazi Date: Sun, 28 Oct 2018 09:56:17 -0300 Subject: [PATCH] Bug 21704: (follow-up) Remove unused 'frameworkcode' template param 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 Signed-off-by: Michal Denar Signed-off-by: Katrin Fischer Signed-off-by: Nick Clemens --- admin/marctagstructure.pl | 22 ++++++------------- .../prog/en/modules/admin/marctagstructure.tt | 2 +- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index e42ce4fa48..ba9ea33f70 100755 --- a/admin/marctagstructure.pl +++ b/admin/marctagstructure.pl @@ -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 diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt index 1910451ff5..8d21ec534e 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/marctagstructure.tt @@ -131,7 +131,7 @@
- Create framework for [% frameworkcode | html %] ([% framework.frameworktext | html %]) using + Create framework for [% framework.frameworkcode | html %] ([% framework.frameworktext | html %]) using