+
+sub setup_edit_action_bar {
+ my ($self, %params) = @_;
+
+ my $is_new = !$self->project->id;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ combobox => [
+ action => [
+ t8('Save'),
+ submit => [ '#form', { action => 'Project/' . ($is_new ? 'create' : 'update') } ],
+ accesskey => 'enter',
+ ],
+ action => [
+ t8('Save as new'),
+ submit => [ '#form', { action => 'Project/create' }],
+ disabled => $is_new ? t8('The object has not been saved yet.') : undef,
+ ],
+ ], # end of combobox "Save"
+
+ action => [
+ t8('Delete'),
+ submit => [ '#form', { action => 'Project/destroy' } ],
+ confirm => $::locale->text('Do you really want to delete this object?'),
+ disabled => $is_new ? t8('This object has not been saved yet.')
+ : $self->project->is_used ? t8('This object has already been used.')
+ : undef,
+ ],
+
+ link => [
+ t8('Abort'),
+ link => $params{callback} || $self->url_for(action => 'list'),
+ ],
+ );
+ }
+}
+
+sub setup_list_action_bar {
+ my ($self, %params) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Update'),
+ submit => [ '#search_form', { action => 'Project/list' } ],
+ accesskey => 'enter',
+ ],
+ link => [
+ t8('Add'),
+ link => $self->url_for(action => 'new'),
+ ],
+ );
+ }
+}
+