Lines 41-46
my ( $template, $loggedinuser, $cookie ) = get_template_and_user(
Link Here
|
41 |
); |
41 |
); |
42 |
|
42 |
|
43 |
my $action = $cgi->param('action') || q{}; |
43 |
my $action = $cgi->param('action') || q{}; |
|
|
44 |
my @messages; |
44 |
|
45 |
|
45 |
if ( $action eq 'add' ) { |
46 |
if ( $action eq 'add' ) { |
46 |
my $parent_id = $cgi->param('parent_id') || undef; |
47 |
my $parent_id = $cgi->param('parent_id') || undef; |
Lines 55-73
if ( $action eq 'add' ) {
Link Here
|
55 |
$template->param( error_duplicate_title => $title ); |
56 |
$template->param( error_duplicate_title => $title ); |
56 |
} |
57 |
} |
57 |
else { |
58 |
else { |
58 |
my $group = Koha::Library::Group->new( |
59 |
my $group = eval { |
59 |
{ |
60 |
Koha::Library::Group->new( |
60 |
parent_id => $parent_id, |
61 |
{ |
61 |
title => $title, |
62 |
parent_id => $parent_id, |
62 |
description => $description, |
63 |
title => $title, |
63 |
ft_hide_patron_info => $ft_hide_patron_info, |
64 |
description => $description, |
64 |
ft_search_groups_opac => $ft_search_groups_opac, |
65 |
ft_hide_patron_info => $ft_hide_patron_info, |
65 |
ft_search_groups_staff => $ft_search_groups_staff, |
66 |
ft_search_groups_opac => $ft_search_groups_opac, |
66 |
branchcode => $branchcode, |
67 |
ft_search_groups_staff => $ft_search_groups_staff, |
67 |
} |
68 |
branchcode => $branchcode, |
68 |
)->store(); |
69 |
} |
69 |
|
70 |
)->store(); |
70 |
$template->param( added => $group ); |
71 |
}; |
|
|
72 |
if ($@) { |
73 |
push @messages, { type => 'alert', code => 'error_on_insert' }; |
74 |
} |
75 |
else { |
76 |
$template->param( added => $group ); |
77 |
} |
71 |
} |
78 |
} |
72 |
} |
79 |
} |
73 |
elsif ( $action eq 'edit' ) { |
80 |
elsif ( $action eq 'edit' ) { |
Lines 114-119
elsif ( $action eq 'delete' ) {
Link Here
|
114 |
|
121 |
|
115 |
my $root_groups = Koha::Library::Groups->get_root_groups(); |
122 |
my $root_groups = Koha::Library::Groups->get_root_groups(); |
116 |
|
123 |
|
117 |
$template->param( root_groups => $root_groups, ); |
124 |
$template->param( root_groups => $root_groups, messages => \@messages, ); |
118 |
|
125 |
|
119 |
output_html_with_http_headers $cgi, $cookie, $template->output; |
126 |
output_html_with_http_headers $cgi, $cookie, $template->output; |