[Koha-patches] [PATCH] [3.2](bug #4318) remove the confirmation step in validating a form

Alex Arnaud alex.arnaud at biblibre.com
Tue Mar 16 16:13:40 CET 2010


---
 admin/currency.pl                                  |    5 +++--
 .../prog/en/modules/admin/currency.tmpl            |   13 +------------
 2 files changed, 4 insertions(+), 14 deletions(-)

diff --git a/admin/currency.pl b/admin/currency.pl
index 43e08ae..9d82ff0 100755
--- a/admin/currency.pl
+++ b/admin/currency.pl
@@ -96,8 +96,7 @@ if ($op eq 'add_form') {
                                                     # END $OP eq ADD_FORM
 ################## ADD_VALIDATE ##################################
 # called by add_form, used to insert/modify data in DB
-} elsif ($op eq 'add_validate') {
-    $template->param(add_validate => 1);
+} elsif ($op eq 'save') {
     my $dbh = C4::Context->dbh;
     my $check = $dbh->prepare("select count(*) as count from currency where currency = ?");
 
@@ -131,6 +130,8 @@ if ($op eq 'add_form') {
                         $input->param('active')||0,
                         );
     }
+
+print $input->redirect("/cgi-bin/koha/admin/currency.pl");
                                                     # END $OP eq ADD_VALIDATE
 ################## DELETE_CONFIRM ##################################
 # called by default form, used to confirm deletion of data in DB
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl
index a75b675..e9e1c9d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/currency.tmpl
@@ -1,7 +1,6 @@
 <!-- TMPL_INCLUDE NAME="doc-head-open.inc" -->
 <title>Koha &rsaquo; Administration &rsaquo; Currencies &amp; Exchange Rates &rsaquo;
 <!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF NAME="searchfield" -->Modify Currency '<!-- TMPL_VAR NAME="searchfield" -->'<!-- TMPL_ELSE -->New Currency<!-- /TMPL_IF --><!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="add_validate" -->Data Recorded<!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="delete_confirm" -->Confirm Deletion of Currency '<!-- TMPL_VAR NAME="searchfield" -->'<!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="delete_confirmed" -->Currency Deleted<!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="else" -->Currencies<!-- /TMPL_IF --></title>
@@ -58,7 +57,6 @@
 
 
 <div id="breadcrumbs"><a href="/cgi-bin/koha/mainpage.pl">Home</a> &rsaquo; <a href="/cgi-bin/koha/admin/admin-home.pl">Administration</a> &rsaquo;  <a href="/cgi-bin/koha/admin/currency.pl">Currencies &amp; Exchange Rates</a> &rsaquo; <!-- TMPL_IF NAME="add_form" --><!-- TMPL_IF NAME="searchfield" -->Modify Currency '<!-- TMPL_VAR NAME="searchfield" -->'<!-- TMPL_ELSE -->New Currency<!-- /TMPL_IF --><!-- /TMPL_IF -->
-<!-- TMPL_IF NAME="add_validate" -->Data Recorded<!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="delete_confirm" -->Confirm Deletion of Currency '<span class="ex"><!-- TMPL_VAR NAME="searchfield" --></span>'<!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="delete_confirmed" -->Currency Deleted<!-- /TMPL_IF -->
 <!-- TMPL_IF NAME="else" -->Currencies<!-- /TMPL_IF -->
@@ -80,7 +78,7 @@
 <!-- TMPL_IF NAME="add_form" -->
 
 <form action="<!-- TMPL_VAR NAME="script_name" -->" name="Aform" method="post">
-    <input type="hidden" name="op" value="add_validate" />
+    <input type="hidden" name="op" value="save" />
     <fieldset class="rows">
     <legend><!-- TMPL_IF NAME="searchfield" -->
         Modify currency
@@ -129,15 +127,6 @@
 
 <!-- /TMPL_IF -->
 
-<!-- TMPL_IF NAME="add_validate" -->
-<div class="dialog message">
-    <h3>Data Recorded</h3>
-    <form action="<!-- TMPL_VAR NAME="script_name" -->" method="get">
-        <input type="submit" class="approve"  value="OK" />
-    </form>
-</div>
-<!-- /TMPL_IF -->
-
 <!-- TMPL_IF NAME="delete_confirm" -->
     <!-- TMPL_IF NAME="totalgtzero" -->
     <div class="dialog message">
-- 
1.6.3.3




More information about the Koha-patches mailing list