kivitendo/bin/mozilla/fu.pl @ 40a94352
7a7f33b5 | Moritz Bunkus | use POSIX qw(strftime);
|
||
use SL::FU;
|
||||
6ebacae9 | Moritz Bunkus | use SL::Locale::String qw(t8);
|
||
7a7f33b5 | Moritz Bunkus | use SL::ReportGenerator;
|
||
3a4d4d4f | Bernd Bleßmann | use SL::DB::AuthGroup;
|
||
4feca419 | Bernd Bleßmann | use SL::DB::Employee;
|
||
7a7f33b5 | Moritz Bunkus | |||
require "bin/mozilla/reportgenerator.pl";
|
||||
883a5485 | Sven Schöling | use strict;
|
||
7a7f33b5 | Moritz Bunkus | sub _collect_links {
|
||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
7a7f33b5 | Moritz Bunkus | |||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
7a7f33b5 | Moritz Bunkus | my $dest = shift;
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
7a7f33b5 | Moritz Bunkus | $dest->{LINKS} = [];
|
||
foreach my $i (1 .. $form->{trans_rowcount}) {
|
||||
next if (!$form->{"trans_id_$i"} || !$form->{"trans_type_$i"});
|
||||
push @{ $dest->{LINKS} }, { map { +"trans_$_" => $form->{"trans_${_}_$i"} } qw(id type info) };
|
||||
}
|
||||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub add {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
my %myconfig = %main::myconfig;
|
||||
my $locale = $main::locale;
|
||||
7a7f33b5 | Moritz Bunkus | |||
_collect_links($form);
|
||||
$form->get_employee($form->get_standard_dbh(\%myconfig));
|
||||
4feca419 | Bernd Bleßmann | |||
push @{$form->{created_for_employees}}, SL::DB::Manager::Employee->current;
|
||||
7a7f33b5 | Moritz Bunkus | |||
7b447b4d | Bernd Bleßmann | $form->{subject} = $form->{trans_subject_1} if $form->{trans_subject_1};
|
||
7a7f33b5 | Moritz Bunkus | my $link_details;
|
||
if (0 < scalar @{ $form->{LINKS} }) {
|
||||
$link_details = FU->link_details(%{ $form->{LINKS}->[0] });
|
||||
}
|
||||
if ($link_details && $link_details->{title}) {
|
||||
$form->{title} = $locale->text('Add Follow-Up for #1', $link_details->{title});
|
||||
} else {
|
||||
$form->{title} = $locale->text('Add Follow-Up');
|
||||
}
|
||||
display_form();
|
||||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub edit {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
my $locale = $main::locale;
|
||||
7a7f33b5 | Moritz Bunkus | |||
my $ref = FU->retrieve('id' => $form->{id});
|
||||
if (!$ref) {
|
||||
$form->error($locale->text("Invalid follow-up ID."));
|
||||
}
|
||||
map { $form->{$_} = $ref->{$_} } keys %{ $ref };
|
||||
if (@{ $form->{LINKS} } && $form->{LINKS}->[0]->{title}) {
|
||||
$form->{title} = $locale->text('Edit Follow-Up for #1', $form->{LINKS}->[0]->{title});
|
||||
} else {
|
||||
$form->{title} = $locale->text('Edit Follow-Up');
|
||||
}
|
||||
be0f02ee | Bernd Bleßmann | $form->{created_for_employees} = SL::DB::FollowUp->new(id => $form->{id})->load->created_for_employees;
|
||
7a7f33b5 | Moritz Bunkus | display_form();
|
||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub display_form {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
7a7f33b5 | Moritz Bunkus | |||
3a4d4d4f | Bernd Bleßmann | $form->{all_employees} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
|
||
$form->{all_auth_groups} = SL::DB::Manager::AuthGroup->get_all_sorted;
|
||||
7a7f33b5 | Moritz Bunkus | |||
my %params;
|
||||
$params{not_id} = $form->{id} if ($form->{id});
|
||||
$params{trans_id} = $form->{LINKS}->[0]->{trans_id} if (@{ $form->{LINKS} });
|
||||
e64015ce | Bernd Bleßmann | |||
$form->{sort} = 'follow_up_date';
|
||||
$form->{FOLLOW_UPS_DONE} = FU->follow_ups(%params, done => 1);
|
||||
$form->{FOLLOW_UPS_PENDING} = FU->follow_ups(%params, not_done => 1);
|
||||
7a7f33b5 | Moritz Bunkus | |||
6ebacae9 | Moritz Bunkus | setup_fu_display_form_action_bar() unless $::form->{POPUP_MODE};
|
||
be0f02ee | Bernd Bleßmann | $form->header(no_layout => $::form->{POPUP_MODE},
|
||
3a4d4d4f | Bernd Bleßmann | use_javascripts => [ qw(follow_up) ],
|
||
be0f02ee | Bernd Bleßmann | );
|
||
7a7f33b5 | Moritz Bunkus | print $form->parse_html_template('fu/add_edit');
|
||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub save_follow_up {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
my $locale = $main::locale;
|
||||
7a7f33b5 | Moritz Bunkus | |||
be0f02ee | Bernd Bleßmann | $form->error( $locale->text('You must chose a user.')) if !$form->{created_for_employees};
|
||
7a7f33b5 | Moritz Bunkus | $form->isblank('follow_up_date', $locale->text('The follow-up date is missing.'));
|
||
$form->isblank('subject', $locale->text('The subject is missing.'));
|
||||
be0f02ee | Bernd Bleßmann | my %params = (map({ $_ => $form->{$_} } qw(id subject body note_id created_for_employees follow_up_date)), 'done' => 0);
|
||
7a7f33b5 | Moritz Bunkus | |||
_collect_links(\%params);
|
||||
FU->save(%params);
|
||||
if ($form->{POPUP_MODE}) {
|
||||
$form->header();
|
||||
print $form->parse_html_template('fu/close_window');
|
||||
09479f02 | Moritz Bunkus | $::dispatcher->end_request;
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
$form->{SAVED_MESSAGE} = $locale->text('Follow-Up saved.');
|
||||
if ($form->{callback}) {
|
||||
$form->redirect();
|
||||
}
|
||||
be0f02ee | Bernd Bleßmann | delete @{$form}{qw(id subject body created_for_employees follow_up_date)};
|
||
7a7f33b5 | Moritz Bunkus | |||
map { $form->{$_} = 1 } qw(due_only all_users not_done);
|
||||
report();
|
||||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub finish {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
my $locale = $main::locale;
|
||||
7a7f33b5 | Moritz Bunkus | |||
if ($form->{id}) {
|
||||
my $ref = FU->retrieve('id' => $form->{id});
|
||||
if (!$ref) {
|
||||
$form->error($locale->text("Invalid follow-up ID."));
|
||||
}
|
||||
FU->finish('id' => $form->{id});
|
||||
} else {
|
||||
foreach my $i (1..$form->{rowcount}) {
|
||||
next unless ($form->{"selected_$i"} && $form->{"follow_up_id_$i"});
|
||||
FU->finish('id' => $form->{"follow_up_id_$i"});
|
||||
}
|
||||
}
|
||||
if ($form->{POPUP_MODE}) {
|
||||
$form->header();
|
||||
print $form->parse_html_template('fu/close_window');
|
||||
09479f02 | Moritz Bunkus | $::dispatcher->end_request;
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
$form->redirect() if ($form->{callback});
|
||||
report();
|
||||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub delete {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
my $locale = $main::locale;
|
||||
7a7f33b5 | Moritz Bunkus | |||
if ($form->{id}) {
|
||||
my $ref = FU->retrieve('id' => $form->{id});
|
||||
if (!$ref) {
|
||||
$form->error($locale->text("Invalid follow-up ID."));
|
||||
}
|
||||
FU->delete('id' => $form->{id});
|
||||
} else {
|
||||
foreach my $i (1..$form->{rowcount}) {
|
||||
next unless ($form->{"selected_$i"} && $form->{"follow_up_id_$i"});
|
||||
FU->delete('id' => $form->{"follow_up_id_$i"});
|
||||
}
|
||||
}
|
||||
if ($form->{POPUP_MODE}) {
|
||||
$form->header();
|
||||
print $form->parse_html_template('fu/close_window');
|
||||
09479f02 | Moritz Bunkus | $::dispatcher->end_request;
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
$form->redirect() if ($form->{callback});
|
||||
report();
|
||||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub search {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
my $locale = $main::locale;
|
||||
7a7f33b5 | Moritz Bunkus | |||
$form->get_lists("employees" => "EMPLOYEES");
|
||||
$form->{title} = $locale->text('Follow-Ups');
|
||||
6ebacae9 | Moritz Bunkus | setup_fu_search_action_bar();
|
||
7a7f33b5 | Moritz Bunkus | $form->header();
|
||
print $form->parse_html_template('fu/search');
|
||||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub report {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
my %myconfig = %main::myconfig;
|
||||
my $locale = $main::locale;
|
||||
5494f687 | Sven Schöling | my $cgi = $::request->{cgi};
|
||
7a7f33b5 | Moritz Bunkus | |||
my @report_params = qw(created_for subject body reference follow_up_date_from follow_up_date_to itime_from itime_to due_only all_users done not_done);
|
||||
e02b6c61 | Moritz Bunkus | report_generator_set_default_sort('follow_up_date', 1);
|
||
7a7f33b5 | Moritz Bunkus | my $follow_ups = FU->follow_ups(map { $_ => $form->{$_} } @report_params);
|
||
$form->{rowcount} = scalar @{ $follow_ups };
|
||||
$form->{title} = $locale->text('Follow-Ups');
|
||||
my %column_defs = (
|
||||
'selected' => { 'text' => '', },
|
||||
'follow_up_date' => { 'text' => $locale->text('Follow-Up Date'), },
|
||||
'created_on' => { 'text' => $locale->text('Created on'), },
|
||||
'title' => { 'text' => $locale->text('Reference'), },
|
||||
'subject' => { 'text' => $locale->text('Subject'), },
|
||||
'created_by_name' => { 'text' => $locale->text('Created by'), },
|
||||
'created_for_user_name' => { 'text' => $locale->text('Follow-up for'), },
|
||||
'done' => { 'text' => $locale->text('Done'), 'visible' => $form->{done} && $form->{not_done} ? 1 : 0 },
|
||||
);
|
||||
my @columns = qw(selected follow_up_date created_on subject title created_by_name created_for_user_name done);
|
||||
e02b6c61 | Moritz Bunkus | my $href = build_std_url('action=report', grep { $form->{$_} } @report_params);
|
||
foreach my $name (qw(follow_up_date created_on title subject)) {
|
||||
my $sortdir = $form->{sort} eq $name ? 1 - $form->{sortdir} : $form->{sortdir};
|
||||
$column_defs{$name}->{link} = $href . "&sort=$name&sortdir=$sortdir";
|
||||
}
|
||||
7a7f33b5 | Moritz Bunkus | |||
my @options;
|
||||
if ($form->{created_for}) {
|
||||
$form->get_lists("employees" => "EMPLOYEES");
|
||||
foreach my $employee (@{ $form->{EMPLOYEES} }) {
|
||||
if ($employee->{id} == $form->{created_for}) {
|
||||
push @options, $locale->text('Created for') . " : " . ($employee->{name} ? "$employee->{name} ($employee->{login})" : $employee->{login});
|
||||
last;
|
||||
}
|
||||
}
|
||||
}
|
||||
push @options, $locale->text('Subject') . " : $form->{subject}" if ($form->{subject});
|
||||
push @options, $locale->text('Body') . " : $form->{body}" if ($form->{body});
|
||||
push @options, $locale->text('Reference') . " : $form->{reference}" if ($form->{reference});
|
||||
push @options, $locale->text('Done') if ($form->{done});
|
||||
push @options, $locale->text('Not done yet') if ($form->{not_done});
|
||||
push @options, $locale->text('Only due follow-ups') if ($form->{due_only});
|
||||
push @options, $locale->text("Other users' follow-ups") if ($form->{all_users});
|
||||
my @hidden_report_params = map { +{ 'key' => $_, 'value' => $form->{$_} } } @report_params;
|
||||
my $report = SL::ReportGenerator->new(\%myconfig, $form, 'std_column_visibility' => 1);
|
||||
$report->set_columns(%column_defs);
|
||||
$report->set_column_order(@columns);
|
||||
19688fca | Moritz Bunkus | $report->set_export_options('report', @report_params, qw(sort sortdir));
|
||
7a7f33b5 | Moritz Bunkus | |||
e02b6c61 | Moritz Bunkus | $report->set_sort_indicator($form->{sort}, $form->{sortdir});
|
||
7a7f33b5 | Moritz Bunkus | |||
$report->set_options('raw_top_info_text' => $form->parse_html_template('fu/report_top', { 'OPTIONS' => \@options }),
|
||||
'raw_bottom_info_text' => $form->parse_html_template('fu/report_bottom', { 'HIDDEN' => \@hidden_report_params }),
|
||||
'output_format' => 'HTML',
|
||||
'title' => $form->{title},
|
||||
'attachment_basename' => $locale->text('follow_up_list') . strftime('_%Y%m%d', localtime time),
|
||||
);
|
||||
$report->set_options_from_form();
|
||||
a873249c | Moritz Bunkus | $locale->set_numberformat_wo_thousands_separator(\%myconfig) if lc($report->{options}->{output_format}) eq 'csv';
|
||
7a7f33b5 | Moritz Bunkus | |||
my $idx = 0;
|
||||
my $callback = build_std_url('action=report', grep { $form->{$_} } @report_params);
|
||||
my $edit_url = build_std_url('action=edit', 'callback=' . E($callback));
|
||||
foreach my $fu (@{ $follow_ups }) {
|
||||
$idx++;
|
||||
$fu->{done} = $fu->{done} ? $locale->text('Yes') : $locale->text('No');
|
||||
my $row = { map { $_ => { 'data' => $fu->{$_} } } keys %{ $fu } };
|
||||
$row->{selected} = {
|
||||
'raw_data' => $cgi->hidden('-name' => "follow_up_id_${idx}", '-value' => $fu->{id})
|
||||
. $cgi->checkbox('-name' => "selected_${idx}", '-value' => 1, '-label' => ''),
|
||||
'valign' => 'center',
|
||||
'align' => 'center',
|
||||
};
|
||||
if (@{ $fu->{LINKS} }) {
|
||||
my $link = $fu->{LINKS}->[0];
|
||||
$row->{title}->{data} = $link->{title};
|
||||
$row->{title}->{link} = $link->{url};
|
||||
}
|
||||
$row->{subject}->{link} = $edit_url . '&id=' . Q($fu->{id});
|
||||
$report->add_data($row);
|
||||
}
|
||||
6ebacae9 | Moritz Bunkus | setup_fu_report_action_bar();
|
||
7a7f33b5 | Moritz Bunkus | $report->generate_with_headers();
|
||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub report_for_todo_list {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
7a7f33b5 | Moritz Bunkus | |||
my @report_params = qw(created_for subject body reference follow_up_date_from follow_up_date_to itime_from itime_to due_only all_users done not_done);
|
||||
my %params = (
|
||||
'due_only' => 1,
|
||||
'not_done' => 1,
|
||||
4bd1e2f8 | Sven Schöling | 'created_for_login' => $::myconfig{login},
|
||
7a7f33b5 | Moritz Bunkus | );
|
||
my $follow_ups = FU->follow_ups(%params);
|
||||
my $content;
|
||||
if (@{ $follow_ups }) {
|
||||
my $callback = build_std_url('action');
|
||||
my $edit_url = build_std_url('script=fu.pl', 'action=edit', 'callback=' . E($callback)) . '&id=';
|
||||
foreach my $fu (@{ $follow_ups }) {
|
||||
if (@{ $fu->{LINKS} }) {
|
||||
my $link = $fu->{LINKS}->[0];
|
||||
$fu->{reference} = $link->{title};
|
||||
$fu->{reference_link} = $link->{url};
|
||||
}
|
||||
}
|
||||
$content = $form->parse_html_template('fu/report_for_todo_list', { 'FOLLOW_UPS' => $follow_ups,
|
||||
'callback' => $callback,
|
||||
'edit_url' => $edit_url, });
|
||||
}
|
||||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | |||
return $content;
|
||||
}
|
||||
sub edit_access_rights {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
my $locale = $main::locale;
|
||||
7a7f33b5 | Moritz Bunkus | |||
my $access = FU->retrieve_access_rights();
|
||||
d139dd31 | Moritz Bunkus | $form->{EMPLOYEES} = SL::DB::Manager::Employee->get_all_sorted(query => [ deleted => 0 ]);
|
||
7a7f33b5 | Moritz Bunkus | |||
map { $_->{access} = $access->{$_->{id}} } @{ $form->{EMPLOYEES} };
|
||||
$form->{title} = $locale->text('Edit Access Rights for Follow-Ups');
|
||||
6ebacae9 | Moritz Bunkus | setup_fu_edit_access_rights_action_bar();
|
||
7a7f33b5 | Moritz Bunkus | $form->header();
|
||
print $form->parse_html_template('fu/edit_access_rights');
|
||||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub save_access_rights {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | my $form = $main::form;
|
||
my $locale = $main::locale;
|
||||
7a7f33b5 | Moritz Bunkus | |||
my %access;
|
||||
foreach my $i (1 .. $form->{rowcount}) {
|
||||
my $id = $form->{"employee_id_$i"};
|
||||
$access{$id} = 1 if ($id && $form->{"access_$id"});
|
||||
}
|
||||
FU->save_access_rights('access' => \%access);
|
||||
$form->{SAVED_MESSAGE} = $locale->text('The access rights have been saved.');
|
||||
edit_access_rights();
|
||||
883a5485 | Sven Schöling | $main::lxdebug->leave_sub();
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub update {
|
||||
883a5485 | Sven Schöling | call_sub($main::form->{nextsub});
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub continue {
|
||||
883a5485 | Sven Schöling | call_sub($main::form->{nextsub});
|
||
7a7f33b5 | Moritz Bunkus | }
|
||
sub save {
|
||||
606032ad | Niclas Zimmermann | $main::auth->assert('productivity');
|
||
883a5485 | Sven Schöling | if ($main::form->{save_nextsub}) {
|
||
call_sub($main::form->{save_nextsub});
|
||||
7a7f33b5 | Moritz Bunkus | } else {
|
||
save_follow_up();
|
||||
}
|
||||
}
|
||||
sub dispatcher {
|
||||
883a5485 | Sven Schöling | $main::lxdebug->enter_sub();
|
||
my $form = $main::form;
|
||||
my $locale = $main::locale;
|
||||
7a7f33b5 | Moritz Bunkus | foreach my $action (qw(finish save delete)) {
|
||
if ($form->{"action_${action}"}) {
|
||||
call_sub($action);
|
||||
return;
|
||||
}
|
||||
}
|
||||
call_sub($form->{default_action}) if ($form->{default_action});
|
||||
$form->error($locale->text('No action defined.'));
|
||||
}
|
||||
6ebacae9 | Moritz Bunkus | sub setup_fu_search_action_bar {
|
||
my %params = @_;
|
||||
for my $bar ($::request->layout->get('actionbar')) {
|
||||
$bar->add(
|
||||
action => [
|
||||
t8('Show'),
|
||||
submit => [ '#form', { action => "report" } ],
|
||||
accesskey => 'enter',
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
sub setup_fu_display_form_action_bar {
|
||||
my %params = @_;
|
||||
for my $bar ($::request->layout->get('actionbar')) {
|
||||
$bar->add(
|
||||
action => [
|
||||
t8('Save'),
|
||||
submit => [ '#form', { action => "save" } ],
|
||||
accesskey => 'enter',
|
||||
],
|
||||
action => [
|
||||
t8('Finish'),
|
||||
submit => [ '#form', { action => "finish" } ],
|
||||
disabled => !$::form->{id} ? t8('The object has not been saved yet.') : undef,
|
||||
],
|
||||
action => [
|
||||
t8('Delete'),
|
||||
submit => [ '#form', { action => "delete" } ],
|
||||
disabled => !$::form->{id} ? t8('The object has not been saved yet.') : undef,
|
||||
confirm => t8('Do you really want to delete this object?'),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
sub setup_fu_report_action_bar {
|
||||
my %params = @_;
|
||||
for my $bar ($::request->layout->get('actionbar')) {
|
||||
$bar->add(
|
||||
action => [
|
||||
t8('Finish'),
|
||||
submit => [ '#form', { action => "finish" } ],
|
||||
checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
|
||||
],
|
||||
action => [
|
||||
t8('Delete'),
|
||||
submit => [ '#form', { action => "delete" } ],
|
||||
checks => [ [ 'kivi.check_if_entries_selected', '[name^=selected_]' ] ],
|
||||
confirm => t8('Do you really want to delete the selected objects?'),
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
sub setup_fu_edit_access_rights_action_bar {
|
||||
my %params = @_;
|
||||
for my $bar ($::request->layout->get('actionbar')) {
|
||||
$bar->add(
|
||||
action => [
|
||||
t8('Save'),
|
||||
submit => [ '#form', { action => "save_access_rights" } ],
|
||||
accesskey => 'enter',
|
||||
],
|
||||
);
|
||||
}
|
||||
}
|
||||
7a7f33b5 | Moritz Bunkus | 1;
|