[Patches] [PATCH] Follow-up fixes for Bug 7113, Standardize vendor id name in

koha-patchbot at kohaaloha.com koha-patchbot at kohaaloha.com
Fri Nov 4 22:40:02 NZDT 2011


From: Owen Leonard <oleonard at myacpl.org>
Date: Mon, 31 Oct 2011 10:07:20 -0400
Subject: [PATCH] Follow-up fixes for Bug 7113, Standardize vendor id name in
 templates and scripts

Fixed:

- Edit vendor: redirect after saving
- redirect after saving/editing/adding contract
- edit vendor from toolbar - does not open edit page

Signed-off-by: Katrin Fischer <Katrin.Fischer.83 at web.de>
1) redirect after editing vendor is ok
2) saving and deleting contract is perfect, one little improvement:
The cancel link takes you back to the list of contracts, not to the vendor detail page.
I think it would be a little better if save and cancel redirected to the same page.
3) editing vendor from basket group toolbar works now
---
 acqui/updatesupplier.pl                            |    8 ++++----
 admin/aqcontract.pl                                |    4 ++--
 .../prog/en/modules/acqui/basketgroup.tt           |    2 +-
 3 files changed, 7 insertions(+), 7 deletions(-)

diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl
index 6bc978f..981b5e5 100755
--- a/acqui/updatesupplier.pl
+++ b/acqui/updatesupplier.pl
@@ -69,7 +69,7 @@ my ($template, $loggedinuser, $cookie) = get_template_and_user(
 my $supplier=$input->param('supplier');
 #print startpage;
 my %data;
-$data{'id'}=$input->param('id');
+$data{'booksellerid'}=$input->param('booksellerid');
 
 $data{'name'}=$input->param('company');
 $data{'postal'}=$input->param('company_postal');
@@ -108,13 +108,13 @@ if ($gstrate eq '') {
 $data{'discount'}=$input->param('discount');
 $data{'active'}=$input->param('status');
 if($data{'name'}) {
-	if ($data{'id'}){
+	if ($data{'booksellerid'}){
 	    ModBookseller(\%data);
 	} else {
-	    $data{id}=AddBookseller(\%data);
+	    $data{booksellerid}=AddBookseller(\%data);
 	}
 #redirect to booksellers.pl
-print $input->redirect("booksellers.pl?id=".$data{id});
+print $input->redirect("booksellers.pl?booksellerid=".$data{booksellerid});
 } else {
 print $input->redirect("supplier.pl?op=enter"); # fail silently.
 }
diff --git a/admin/aqcontract.pl b/admin/aqcontract.pl
index 7126c99..9d3f0ac 100755
--- a/admin/aqcontract.pl
+++ b/admin/aqcontract.pl
@@ -111,7 +111,7 @@ elsif ( $op eq 'add_validate' ) {
         });
     }
 
-    print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?supplierid=$booksellerid");
+    print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?booksellerid=$booksellerid");
     exit;
 
     # END $OP eq ADD_VALIDATE
@@ -138,7 +138,7 @@ elsif ( $op eq 'delete_confirmed' ) {
 
     DelContract( { contractnumber => $contractnumber } );
 
-    print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?supplierid=$booksellerid");
+    print $input->redirect("/cgi-bin/koha/acqui/supplier.pl?booksellerid=$booksellerid");
     exit;
 
     # END $OP eq DELETE_CONFIRMED
diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
index 2f55fc6..1ec590d 100644
--- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/basketgroup.tt
@@ -153,7 +153,7 @@ function submitForm(form) {
 					function yuiToolbar() {
 						var booksellermenu = [
 							{ text: _("Vendor"), url: "/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]" },
-							{ text: _("Edit vendor"), url: "/cgi-bin/koha/acqui/booksellers.pl?booksellerid=[% booksellerid %]"},
+							{ text: _("Edit vendor"), url: "/cgi-bin/koha/acqui/supplier.pl?booksellerid=[% booksellerid %]&op=enter"},
 						]
 						var ordersbutton = [
 						         { text: _("Manage orders"), url: "/cgi-bin/koha/acqui/booksellers.pl?booksellerid=[% booksellerid %]" },
-- 
1.7.5.4


More information about the Patches mailing list