From 64a86b35c1e0517466df6102f8df290de3f245b6 Mon Sep 17 00:00:00 2001 From: Jonathan Druart Date: Thu, 3 Apr 2014 15:54:30 +0200 Subject: [PATCH] Bug 11944: Some refresh don't indicate the charset to use This patch replaces occurrences of META HTTP-EQUIV=Refresh with a redirection. Note: The list of modified files has been got with the following grep: git grep Content-Type | grep -v -i utf | grep Refresh | grep -v translator | grep -v \.js Test plan: 1) admin/auth_tag_structure.pl - Go on an authority MARC framework for an authority type (admin/auth_tag_structure.pl?authtypecode=CO for instance) - Click on the "Add a new tag" button - Fill fields - Save - You should be redirected on the auth_tag_structure.pl page - Try to modify an existing tag - The redirection should be done 2) admin/auth_subfields_structure.pl - From the previous page, click on a "subfields" link - Edit/Add a new subfields - Save - You should be redirected to the subfield list - Delete a subfield - You should be redirected to the subfield list 3) admin/authorised_values.pl - Add/Edit an authorised value - Save - You should be redirected to the authorised value list (with the right category selected) 4) admin/categorie.pl - Add/Edit a patron category - Save - You should be redirected to the category list - Delete a patron category - You should be redirected to the category list 5) admin/koha2marclinks.pl - Go on the Koha to MARC mapping configuration page - Edit a field - Map a field and click on "OK" - You should be redirected to the list 6) admin/marc_subfields_structure.pl - Go on the MARC frameworks page - Click on "MARC structure" for one on the list - Click on "Subfields" for one on the list - Add/Edit a subfield - Save - You should be redirected to the subfield list 7) admin/systempreferences.pl - Go on the system preferences admin page - Click on the "Local use" tab - Add/Edit a pref - Save - You shold be redirected to the Local use preference list 8) serials/subscription-detail.pl - Go on a subscription detail page - Delete the subscription (using Edit > Delete subscription) - You should be redirected on the serials home page --- admin/auth_subfields_structure.pl | 9 ++++----- admin/auth_tag_structure.pl | 5 +++-- admin/authorised_values.pl | 11 ++++++----- admin/categorie.pl | 8 ++++---- admin/koha2marclinks.pl | 3 +-- admin/marc_subfields_structure.pl | 7 ++----- admin/marctagstructure.pl | 4 ++-- admin/systempreferences.pl | 2 +- serials/subscription-detail.pl | 4 ++-- 9 files changed, 25 insertions(+), 28 deletions(-) diff --git a/admin/auth_subfields_structure.pl b/admin/auth_subfields_structure.pl index 245d41f..4f66373 100755 --- a/admin/auth_subfields_structure.pl +++ b/admin/auth_subfields_structure.pl @@ -473,8 +473,8 @@ if ($op eq 'add_form') { } } } - print "Content-Type: text/html\n\n"; - exit; + print $input->redirect("/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=$tagfield&authtypecode=$authtypecode"); + exit; # END $OP eq ADD_VALIDATE ################## DELETE_CONFIRM ################################## @@ -498,9 +498,8 @@ if ($op eq 'add_form') { my $sth=$dbh->prepare("delete from auth_subfield_structure where tagfield=? and tagsubfield=? and authtypecode=?"); $sth->execute($tagfield,$tagsubfield,$authtypecode); } - print "Content-Type: text/html\n\n"; - exit; - $template->param(tagfield => $tagfield); + print $input->redirect("/cgi-bin/koha/admin/auth_subfields_structure.pl?tagfield=$tagfield&authtypecode=$authtypecode"); + exit; # END $OP eq DELETE_CONFIRMED ################## DEFAULT ################################## } else { # DEFAULT diff --git a/admin/auth_tag_structure.pl b/admin/auth_tag_structure.pl index fa8da77..521afad 100755 --- a/admin/auth_tag_structure.pl +++ b/admin/auth_tag_structure.pl @@ -165,7 +165,7 @@ if ($op eq 'add_form') { ); } } - print "Content-Type: text/html\n\nparam('tagfield')."&authtypecode=$authtypecode\">"; + print $input->redirect("/cgi-bin/koha/admin/auth_tag_structure.pl?searchfield=$tagfield&authtypecode=$authtypecode"); exit; # END $OP eq ADD_VALIDATE ################## DELETE_CONFIRM ################################## @@ -188,7 +188,8 @@ if ($op eq 'add_form') { my $sth = $dbh->prepare("delete from auth_subfield_structure where tagfield=? and authtypecode=?"); $sth->execute($searchfield,$authtypecode); } - print "Content-Type: text/html\n\nparam('tagfield')."&authtypecode=$authtypecode\">"; + my $tagfield = $input->param('tagfield'); + print $input->redirect("/cgi-bin/koha/admin/auth_tag_structure.pl?searchfield=$tagfield&authtypecode=$authtypecode"); exit; # END $OP eq DELETE_CONFIRMED ################## ITEMTYPE_CREATE ################################## diff --git a/admin/authorised_values.pl b/admin/authorised_values.pl index fb83fd3..3e43378 100755 --- a/admin/authorised_values.pl +++ b/admin/authorised_values.pl @@ -162,7 +162,7 @@ if ($op eq 'add_form') { } } $sth->finish; - print "Content-Type: text/html\n\n"; + print $input->redirect("/cgi-bin/koha/admin/authorised_values.pl?searchfield=$new_category&offset=$offset"); exit; } } @@ -192,8 +192,9 @@ if ($op eq 'add_form') { $sth->execute($id, $branchcode); } } - print "Content-Type: text/html\n\nparam('category')."&offset=$offset\">"; - exit; + my $category = $input->param('category'); + print $input->redirect("/cgi-bin/koha/admin/authorised_values.pl?searchfield=$category&offset=$offset"); + exit; } } if ( $duplicate_entry ) { @@ -224,8 +225,8 @@ if ($op eq 'add_form') { my $id = $input->param('id'); my $sth=$dbh->prepare("delete from authorised_values where id=?"); $sth->execute($id); - print "Content-Type: text/html\n\n"; - exit; + print $input->redirect("/cgi-bin/koha/admin/authorised_values.pl?searchfield=$searchfield&offset=$offset"); + exit; # END $OP eq DELETE_CONFIRMED ################## DEFAULT ################################## } else { # DEFAULT diff --git a/admin/categorie.pl b/admin/categorie.pl index d459fbe..e1c5bd5 100755 --- a/admin/categorie.pl +++ b/admin/categorie.pl @@ -183,8 +183,8 @@ if ($op eq 'add_form') { C4::Form::MessagingPreferences::handle_form_action($input, { categorycode => $input->param('categorycode') }, $template); } - print "Content-Type: text/html\n\n"; - exit; + print $input->redirect("/cgi-bin/koha/admin/categorie.pl"); + exit; # END $OP eq ADD_VALIDATE ################## DELETE_CONFIRM ################################## @@ -232,8 +232,8 @@ if ($op eq 'add_form') { my $sth=$dbh->prepare("delete from categories where categorycode=?"); $sth->execute($categorycode); $sth->finish; - print "Content-Type: text/html\n\n"; - exit; + print $input->redirect("/cgi-bin/koha/admin/categorie.pl"); + exit; # END $OP eq DELETE_CONFIRMED } else { # DEFAULT diff --git a/admin/koha2marclinks.pl b/admin/koha2marclinks.pl index 1bc988a..e99aa41 100755 --- a/admin/koha2marclinks.pl +++ b/admin/koha2marclinks.pl @@ -116,8 +116,7 @@ elsif ( $op eq 'add_validate' ) { $dbh->do( "update marc_subfield_structure set kohafield='$tablename.$kohafield' where tagfield='$temp[0]' and tagsubfield='$temp[1]'" ); - print -"Content-Type: text/html\n\n"; + print $input->redirect("/cgi-bin/koha/admin/koha2marclinks.pl?tablename=$tablename"); exit; # END $OP eq ADD_VALIDATE diff --git a/admin/marc_subfields_structure.pl b/admin/marc_subfields_structure.pl index 9687bff..85b2a1d 100755 --- a/admin/marc_subfields_structure.pl +++ b/admin/marc_subfields_structure.pl @@ -483,8 +483,7 @@ elsif ( $op eq 'add_validate' ) { } $sth_insert->finish; $sth_update->finish; - print -"Content-Type: text/html\n\n"; + print $input->redirect("/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=$tagfield&frameworkcode=$frameworkcode"); exit; # END $OP eq ADD_VALIDATE @@ -524,10 +523,8 @@ elsif ( $op eq 'delete_confirmed' ) { $sth->execute( $tagfield, $tagsubfield, $frameworkcode ); $sth->finish; } - print -"Content-Type: text/html\n\n"; + print $input->redirect("/cgi-bin/koha/admin/marc_subfields_structure.pl?tagfield=$tagfield&frameworkcode=$frameworkcode"); exit; - $template->param( tagfield => $tagfield ); # END $OP eq DELETE_CONFIRMED ################## DEFAULT ################################## diff --git a/admin/marctagstructure.pl b/admin/marctagstructure.pl index 4e6de4c..fea3e21 100755 --- a/admin/marctagstructure.pl +++ b/admin/marctagstructure.pl @@ -167,9 +167,9 @@ if ($op eq 'add_form') { $frameworkcode ); } - } + } print $input->redirect("/cgi-bin/koha/admin/marctagstructure.pl?searchfield=$tagfield&frameworkcode=$frameworkcode"); - exit; + exit; # END $OP eq ADD_VALIDATE ################## DELETE_CONFIRM ################################## # called by default form, used to confirm deletion of data in DB diff --git a/admin/systempreferences.pl b/admin/systempreferences.pl index 63fc0ae..e23e840 100755 --- a/admin/systempreferences.pl +++ b/admin/systempreferences.pl @@ -357,7 +357,7 @@ if ( $op eq 'add_form' ) { logaction( 'SYSTEMPREFERENCE', 'ADD', undef, $input->param('variable') . " | " . $value ); } } - print "Content-Type: text/html\n\n"; + print $input->redirect("/cgi-bin/koha/admin/systempreferences.pl?tab="); exit; ################## DELETE_CONFIRM ################################## # called by default form, used to confirm deletion of data in DB diff --git a/serials/subscription-detail.pl b/serials/subscription-detail.pl index 212d8c5..7b9bcfd 100755 --- a/serials/subscription-detail.pl +++ b/serials/subscription-detail.pl @@ -86,8 +86,8 @@ if ($op eq 'del') { # If it's ok to delete the subscription, we do so if ($issueconfirmed eq "1") { &DelSubscription($subscriptionid); - print "Content-Type: text/html\n\n"; - exit; + print $query->redirect("/cgi-bin/koha/serials/serials-home.pl"); + exit; } } my $hasRouting = check_routing($subscriptionid); -- 1.7.10.4