From 94036d849054ba7167fd7c06a86106e12606e3aa Mon Sep 17 00:00:00 2001 From: Ryan Higgins Date: Tue, 1 Jan 2008 15:36:34 -0600 Subject: [PATCH] Fix for bug 1251 (blank supplier name) Signed-off-by: Joshua Ferraro --- acqui/updatesupplier.pl | 15 +++++++++------ .../prog/en/modules/acqui/supplier.tmpl | 15 +++++++++++---- 2 files changed, 20 insertions(+), 10 deletions(-) diff --git a/acqui/updatesupplier.pl b/acqui/updatesupplier.pl index 2a10238045..419cc9e0a6 100755 --- a/acqui/updatesupplier.pl +++ b/acqui/updatesupplier.pl @@ -85,11 +85,14 @@ $data{'gstreg'}=$input->param('gst'); $data{'listincgst'}=$input->param('list_gst'); $data{'invoiceincgst'}=$input->param('invoice_gst'); $data{'discount'}=$input->param('discount'); -if ($data{'id'}){ - ModBookseller(\%data); -} else { - $data{id}=AddBookseller(\%data); -} - +if($data{'name'}) { + if ($data{'id'}){ + ModBookseller(\%data); + } else { + $data{id}=AddBookseller(\%data); + } #redirect to booksellers.pl print $input->redirect("booksellers.pl?supplier=".$data{id}); +} else { +print $input->redirect("supplier.pl?op=enter"); # fail silently. +} diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tmpl index 44aa598bd2..6a1064e7e4 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/acqui/supplier.tmpl @@ -8,6 +8,13 @@ function confirm_deletion() { window.location="/cgi-bin/koha/acqui/supplier.pl?supplierid=&op=delete"; } } +function check(f) { +if (f.company.value == "") { + alert("You must specify a name for this supplier."); + return false; +} + f.submit(); +} //]]> @@ -30,13 +37,13 @@ function confirm_deletion() { -
+
" />
Company details -
  1. +
    1. " />
    2. @@ -133,7 +140,7 @@ function confirm_deletion() {
-
">Cancel
+
">Cancel
@@ -200,4 +207,4 @@ function confirm_deletion() {
- \ No newline at end of file + -- 2.39.5