- $template->param(authtypecode => $authtypecode,
- authtypetext => $data->{'authtypetext'},
- summary => $data->{'summary'},
- total => $total);
- # END $OP eq DELETE_CONFIRM
-################## DELETE_CONFIRMED ##################################
-# called by delete_confirm, used to effectively confirm deletion of data in DB
-} elsif ($op eq 'delete_confirmed') {
- #start the page and read in includes
- my $sth=$dbh->prepare("DELETE FROM auth_types WHERE authtypecode=?");
- $sth->execute(uc $input->param('authtypecode'));
- print $input->redirect($script_name); # FIXME: unnecessary redirect
- exit;
- # END $OP eq DELETE_CONFIRMED
-################## DEFAULT ##################################
-} else { # DEFAULT
- my $results = StringSearch($searchfield);
- my $count = scalar @$results;
- my @loop_data;
- for (my $i=$offset; $i < ($offset+$pagesize<$count?$offset+$pagesize:$count); $i++){
- push @loop_data, {
- authtypecode => $results->[$i]{'authtypecode'},
- authtypetext => $results->[$i]{'authtypetext'},
- auth_tag_to_report => $results->[$i]{'auth_tag_to_report'},
- summary => $results->[$i]{'summary'},
- };
- }
- $template->param(loop => \@loop_data);
- if ($offset>0) {
- my $prevpage = $offset-$pagesize;
- $template->param(previous => "$script_name?offset=".$prevpage);
+ if ( $@ or not $deleted ) {
+ push @messages, { type => 'error', code => 'error_on_delete' };
+ } else {
+ push @messages, { type => 'message', code => 'success_on_delete' };
+ }
+ } else {
+ push @messages, { type => 'error', code => 'error_on_delete' };