From 70b776fe47aaeea842051f1b52735af18a212f55 Mon Sep 17 00:00:00 2001 From: Alex Arnaud Date: Wed, 19 May 2010 16:48:03 +0200 Subject: [PATCH] admin/aqbookfund.pl: prevents the creation of funds with the same code --- admin/aqbookfund.pl | 5 ++--- .../intranet-tmpl/prog/en/css/staff-global.css | 4 ++++ .../prog/en/modules/admin/aqbookfund.tmpl | 16 ++++++++++++---- 3 files changed, 18 insertions(+), 7 deletions(-) diff --git a/admin/aqbookfund.pl b/admin/aqbookfund.pl index 604ae08c1b..31c5d3db0b 100755 --- a/admin/aqbookfund.pl +++ b/admin/aqbookfund.pl @@ -126,7 +126,7 @@ if ($op eq 'add_form') { elsif ($op eq 'add_validate') { my $bookfundname = $input->param('bookfundname'); my $branchcode = $input->param('branchcode') || undef; - my $number = Countbookfund($bookfundid,$branchcodeid); + my $number = Countbookfund($bookfundid); if ($number == 0 ) { NewBookFund( $bookfundid, @@ -134,8 +134,7 @@ elsif ($op eq 'add_validate') { $input->param('branchcode')||'' ); } - print $input->redirect('aqbookfund.pl'); # FIXME: unnecessary redirect - exit; + $template->param(error_bookfundid_exist => $number); # END $OP eq ADD_VALIDATE } diff --git a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css index ce264d2044..2729567c46 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css +++ b/koha-tmpl/intranet-tmpl/prog/en/css/staff-global.css @@ -1670,3 +1670,7 @@ span.permissiondesc { color: black; } +.error-adding-fund { + color: red; +} + diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbookfund.tmpl b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbookfund.tmpl index eb75a67a74..3bb13af5e0 100644 --- a/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbookfund.tmpl +++ b/koha-tmpl/intranet-tmpl/prog/en/modules/admin/aqbookfund.tmpl @@ -152,10 +152,18 @@ -

Fund added

-

- ">Return to fund list -

+ +

Fund added

+

+ ">Return to fund list +

+ +

Cannot adding this fund

+

This fund code already exist and can't be added

+

+ ">Return to fund list +

+

Fund modified

-- 2.39.5