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 56-75
if ( $action eq 'add' ) {
Link Here
|
56 |
$template->param( error_duplicate_title => $title ); |
57 |
$template->param( error_duplicate_title => $title ); |
57 |
} |
58 |
} |
58 |
else { |
59 |
else { |
59 |
my $group = Koha::Library::Group->new( |
60 |
my $group = eval { |
60 |
{ |
61 |
Koha::Library::Group->new( |
61 |
parent_id => $parent_id, |
62 |
{ |
62 |
title => $title, |
63 |
parent_id => $parent_id, |
63 |
description => $description, |
64 |
title => $title, |
64 |
ft_hide_patron_info => $ft_hide_patron_info, |
65 |
description => $description, |
65 |
ft_search_groups_opac => $ft_search_groups_opac, |
66 |
ft_hide_patron_info => $ft_hide_patron_info, |
66 |
ft_search_groups_staff => $ft_search_groups_staff, |
67 |
ft_search_groups_opac => $ft_search_groups_opac, |
67 |
ft_local_hold_group => $ft_local_hold_group, |
68 |
ft_search_groups_staff => $ft_search_groups_staff, |
68 |
branchcode => $branchcode, |
69 |
ft_local_hold_group => $ft_local_hold_group, |
69 |
} |
70 |
branchcode => $branchcode, |
70 |
)->store(); |
71 |
} |
71 |
|
72 |
)->store(); |
72 |
$template->param( added => $group ); |
73 |
}; |
|
|
74 |
if ($@) { |
75 |
push @messages, { type => 'alert', code => 'error_on_insert' }; |
76 |
} |
77 |
else { |
78 |
$template->param( added => $group ); |
79 |
} |
73 |
} |
80 |
} |
74 |
} |
81 |
} |
75 |
elsif ( $action eq 'edit' ) { |
82 |
elsif ( $action eq 'edit' ) { |
Lines 118-123
elsif ( $action eq 'delete' ) {
Link Here
|
118 |
|
125 |
|
119 |
my $root_groups = Koha::Library::Groups->get_root_groups(); |
126 |
my $root_groups = Koha::Library::Groups->get_root_groups(); |
120 |
|
127 |
|
121 |
$template->param( root_groups => $root_groups, ); |
128 |
$template->param( root_groups => $root_groups, messages => \@messages, ); |
122 |
|
129 |
|
123 |
output_html_with_http_headers $cgi, $cookie, $template->output; |
130 |
output_html_with_http_headers $cgi, $cookie, $template->output; |