$self->requirement_spec->$_($self->copy_source->$_) for qw(type_id status_id customer_id title hourly_rate is_template)
}
+ $self->_setup_form_action_bar;
+
$self->render('requirement_spec/new', title => $self->requirement_spec->is_template ? t8('Create a new requirement spec template') : t8('Create a new requirement spec'));
}
return !!$template;
}
+sub _setup_form_action_bar {
+ my ($self) = @_;
+
+ for my $bar ($::request->layout->get('actionbar')) {
+ $bar->add(
+ action => [
+ t8('Save'),
+ submit => [ '#basic_settings_form', { action => 'RequirementSpec/' . ($self->requirement_spec->id ? 'update' : 'create') } ],
+ accesskey => 'enter',
+ ],
+
+ link => [
+ t8('Abort'),
+ link => $self->url_for(action => 'list', is_template => $self->requirement_spec->is_template),
+ ],
+ );
+ }
+}
+
1;
[%- END %]
<p>
-[% IF submit_as == 'post' %]
- [% L.hidden_tag("action", "RequirementSpec/dispatch", id=id_prefix _ '_action') %]
- [% L.submit_tag("action_" _ (SELF.requirement_spec.id ? "update" : "create"), LxERP.t8('Save'), id=id_prefix _ '_action_update') %]
- <a href="[% SELF.url_for(action="list", is_template=SELF.requirement_spec.is_template) %]">[% LxERP.t8('Abort') %]</a>
-[% ELSE %]
+[% IF submit_as != 'post' %]
[% L.ajax_submit_tag("controller.pl?action=RequirementSpec/update", "#" _ id_prefix, LxERP.t8("Save"), id=id_prefix _ '_submit') %]
<script type="text/javascript"><!--
$(function() {