Lines 48-63
if ( $action eq 'add' ) {
Link Here
|
48 |
my $description = $cgi->param('description') || undef; |
48 |
my $description = $cgi->param('description') || undef; |
49 |
my $branchcode = $cgi->param('branchcode') || undef; |
49 |
my $branchcode = $cgi->param('branchcode') || undef; |
50 |
|
50 |
|
51 |
my $group = Koha::Library::Group->new( |
51 |
if ( Koha::Library::Groups->search( { title => $title } )->count() ) { |
52 |
{ |
52 |
$template->param( error_duplicate_title => $title ); |
53 |
parent_id => $parent_id, |
53 |
} |
54 |
title => $title, |
54 |
else { |
55 |
description => $description, |
55 |
my $group = Koha::Library::Group->new( |
56 |
branchcode => $branchcode, |
56 |
{ |
57 |
} |
57 |
parent_id => $parent_id, |
58 |
)->store(); |
58 |
title => $title, |
59 |
|
59 |
description => $description, |
60 |
$template->param( added => $group ); |
60 |
branchcode => $branchcode, |
|
|
61 |
} |
62 |
)->store(); |
63 |
|
64 |
$template->param( added => $group ); |
65 |
} |
61 |
} |
66 |
} |
62 |
elsif ( $action eq 'edit' ) { |
67 |
elsif ( $action eq 'edit' ) { |
63 |
my $id = $cgi->param('id') || undef; |
68 |
my $id = $cgi->param('id') || undef; |