$self->render('requirement_spec/new', title => $self->requirement_spec->is_template ? t8('Create a new requirement spec template') : t8('Create a new requirement spec'));
}
+sub action_ajax_show_basic_settings {
+ my ($self) = @_;
+
+ $self->render('requirement_spec/_show_basic_settings', { layout => 0 });
+}
+
sub action_ajax_edit {
my ($self) = @_;
- $self->render('requirement_spec/_form', { layout => 0 }, submit_as => 'ajax');
+ my $html = $self->render('requirement_spec/_form', { output => 0 }, submit_as => 'ajax');
+
+ $self->js
+ ->hide('#basic_settings')
+ ->after('#basic_settings', $html)
+ ->render($self);
}
sub action_ajax_show_time_and_cost_estimate {
my $info = $self->requirement_spec->is_template ? t8('The requirement spec template has been saved.') : t8('The requirement spec has been saved.');
if ($::request->is_ajax) {
- my $html = $self->render('requirement_spec/_header', { output => 0 });
+ my $header_html = $self->render('requirement_spec/_header', { output => 0 });
+ my $basics_html = $self->render('requirement_spec/_show_basic_settings', { output => 0 });
return $self->invalidate_version
- ->replaceWith('#requirement-spec-header', $html)
+ ->replaceWith('#requirement-spec-header', $header_html)
+ ->replaceWith('#basic_settings', $basics_html)
+ ->remove('#basic_settings_form')
->flash('info', $info)
->render($self);
}
"The name must only consist of letters, numbers and underscores and start with a letter.":"Der Name darf nur aus Buchstaben (keine Umlaute), Ziffern und Unterstrichen bestehen und muss mit einem Buchstaben beginnen.",
"The option field is empty.":"Das Optionsfeld ist leer.",
"The selected database is still configured for client \"#1\". If you delete the database that client will stop working until you re-configure it. Do you still want to delete the database?":"Die auswählte Datenbank ist noch für Mandant \"#1\" konfiguriert. Wenn Sie die Datenbank löschen, wird der Mandanten nicht mehr funktionieren, bis er anders konfiguriert wurde. Wollen Sie die Datenbank trotzdem löschen?",
+"There is one or more sections for which no part has been assigned yet; therefore creating the new record is not possible yet.":"Es gibt einen oder mehrere Abschnitte ohne Artikelzuweisung; daher kann der neue Beleg noch nicht erstellt werden.",
"Time/cost estimate actions":"Aktionen für Kosten-/Zeitabschätzung",
"Toggle marker":"Markierung umschalten",
"Update":"Erneuern",
return true;
};
+// -------------------------------------------------------------------------
+// ---------------------------- basic settings -----------------------------
+// -------------------------------------------------------------------------
+ns.standard_basic_settings_ajax_call = function(key, opt) {
+ if (key == 'cancel') {
+ if (confirm(kivi.t8('Do you really want to cancel?'))) {
+ $('#basic_settings').show();
+ $('#basic_settings_form').remove();
+ }
+ return true;
+ }
+
+ var data = 'action=RequirementSpec/ajax_' + key + '&id=' + encodeURIComponent($('#requirement_spec_id').val());
+
+ $.post("controller.pl", data, kivi.eval_json_result);
+
+ return true;
+};
+
// -------------------------------------------------------------------------
// -------------------------- time/cost estimate ---------------------------
// -------------------------------------------------------------------------
}, general_actions)
});
+ $.contextMenu({
+ selector: '.basic-settings-context-menu',
+ items: $.extend({
+ heading: { name: kivi.t8('Basic settings actions'), className: 'context-menu-heading' }
+ , edit: { name: kivi.t8('Edit'), icon: "edit", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
+ }, general_actions)
+ });
+
+ $.contextMenu({
+ selector: '.edit-basic-settings-context-menu',
+ items: $.extend({
+ heading: { name: kivi.t8('Basic settings actions'), className: 'context-menu-heading' }
+ , save: { name: kivi.t8('Save'), icon: "save", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
+ , cancel: { name: kivi.t8('Cancel'), icon: "close", callback: kivi.requirement_spec.standard_basic_settings_ajax_call }
+ }, general_actions)
+ });
+
$.contextMenu({
selector: '.time-cost-estimate-context-menu',
items: $.extend({
'Bank transfers via SEPA' => 'Überweisungen via SEPA',
'Base unit' => 'Basiseinheit',
'Basic Data' => 'Basisdaten',
+ 'Basic Settings for the Requirement Spec' => 'Grundeinstellungen des Pflichtenheftes',
+ 'Basic Settings for the Requirement Spec Template' => 'Grundeinstellungen der Pflichtenheftvorlage',
'Basic settings' => 'Grundeinstellungen',
'Batch Printing' => 'Druck',
'Bcc' => 'Bcc',
[%- DEFAULT id_prefix = 'basic_settings_form'
submit_as = 'post'
%]
-<form method="post" action="controller.pl" id="[% id_prefix %]">
+<form method="post" action="controller.pl" id="[% id_prefix %]"[% UNLESS submit_as == 'post' %] class="edit-basic-settings-context-menu"[% END %]>
[% L.hidden_tag("id", SELF.requirement_spec.id, id=id_prefix _ '_id') %]
[% L.hidden_tag("requirement_spec.is_template", SELF.requirement_spec.is_template, id=id_prefix _ '_is_template') %]
--- /dev/null
+[%- USE HTML -%][%- USE LxERP -%]
+<div id="basic_settings" class="basic-settings-context-menu">
+ <table>
+ <tr class="listheading">
+ <th colspan="2">
+ [% IF SELF.requirement_spec.is_template %]
+ [% LxERP.t8("Basic Settings for the Requirement Spec Template") %]
+ [% ELSE %]
+ [% LxERP.t8("Basic Settings for the Requirement Spec") %]
+ [% END %]
+ </th>
+ </tr>
+
+ <tr class="listrow">
+ <td>[% LxERP.t8("Title") %]:</td>
+ <td>[% HTML.escape(SELF.requirement_spec.title) %]</td>
+ </tr>
+
+[%- UNLESS SELF.requirement_spec.is_template %]
+
+ <tr class="listrow">
+ <td>[% LxERP.t8("Requirement Spec Type") %]:</td>
+ <td>[% HTML.escape(SELF.requirement_spec.type.description) %]</td>
+ </tr>
+
+ <tr class="listrow">
+ <td>[% LxERP.t8("Requirement Spec Status") %]:</td>
+ <td>[% HTML.escape(SELF.requirement_spec.status.description) %]</td>
+ </tr>
+
+ <tr class="listrow">
+ <td>[% LxERP.t8("Customer") %]:</td>
+ <td>[% HTML.escape(SELF.requirement_spec.customer.name) %]</td>
+ </tr>
+
+ <tr class="listrow">
+ <td>[% LxERP.t8("Hourly Rate") %]:</td>
+ <td>[% HTML.escape(SELF.requirement_spec.hourly_rate_as_number) %]</td>
+ </tr>
+
+[%- END %]
+
+ </table>
+</div>
<div class="tabwidget">
<ul>
<li><a href="#function-blocks-tab">[%- LxERP.t8("Content") %]</a></li>
- <li><a href="controller.pl?action=RequirementSpec/ajax_edit&id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Basic settings") %]</a></li>
+ <li><a href="controller.pl?action=RequirementSpec/ajax_show_basic_settings&id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Basic settings") %]</a></li>
<li><a href="controller.pl?action=RequirementSpec/ajax_show_time_and_cost_estimate&id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Time and cost estimate") %]</a></li>
[%- UNLESS SELF.requirement_spec.is_template %]
<li><a href="controller.pl?action=RequirementSpecVersion/list&requirement_spec_id=[% HTML.url(SELF.requirement_spec.id) %]">[%- LxERP.t8("Versions") %]</a></li>