Pflichtenheftzeitschätzung: neuer Menüeintrag "Speichern und geöffnet lassen"
authorMoritz Bunkus <m.bunkus@linet-services.de>
Mon, 2 Sep 2013 09:45:40 +0000 (11:45 +0200)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Tue, 1 Apr 2014 11:10:32 +0000 (13:10 +0200)
SL/Controller/RequirementSpec.pm
js/locale/de.js
js/requirement_spec.js
locale/de/all
templates/webpages/requirement_spec/_show_time_and_cost_estimate.html

index ee0a94f..3fa13c0 100644 (file)
@@ -149,9 +149,12 @@ sub action_ajax_save_time_and_cost_estimate {
 
   $self->requirement_spec(SL::DB::RequirementSpec->new(id => $self->requirement_spec->id)->load);
 
-  my $html = $self->render('requirement_spec/_show_time_and_cost_estimate', { output => 0 });
-  $self->js->replaceWith('#time_cost_estimate', $html)
-           ->remove('#time_cost_estimate_form_container');
+  my $html = $self->render('requirement_spec/_show_time_and_cost_estimate', { output => 0 }, initially_hidden => !!$::form->{keep_open});
+  $self->js->replaceWith('#time_cost_estimate', $html);
+
+  return $self->js->render($self) if $::form->{keep_open};
+
+  $self->js->remove('#time_cost_estimate_form_container');
 
   if ($self->visible_section) {
     $html = $self->render('requirement_spec_item/_section', { output => 0 }, requirement_spec_item => $self->visible_section);
index 9cdf4a8..9c54d61 100644 (file)
@@ -45,6 +45,7 @@ namespace("kivi").setupLocale({
 "Requirement spec template actions":"Pflichtenheftvorlagen-Aktionen",
 "Revert to version":"Auf Version zurücksetzen",
 "Save":"Speichern",
+"Save and keep open":"Speichern und geöffnet lassen",
 "Section/Function block actions":"Abschnitts-/Funktionsblockaktionen",
 "Select template to paste":"Einzufügende Vorlage auswählen",
 "Text block actions":"Textblockaktionen",
index 96a2cba..535c34e 100644 (file)
@@ -469,7 +469,13 @@ ns.standard_time_cost_estimate_ajax_call = function(key, opt) {
     return true;
   }
 
-  var data = "action=RequirementSpec/ajax_" + key + "_time_and_cost_estimate&";
+  var add_data = '';
+  if (key == 'save_keep_open') {
+    key      = 'save';
+    add_data = 'keep_open=1&';
+  }
+
+  var data = "action=RequirementSpec/ajax_" + key + "_time_and_cost_estimate&" + add_data;
 
   if (key == 'save')
     data += $('#edit_time_cost_estimate_form').serialize()
@@ -771,6 +777,7 @@ ns.create_context_menus = function(is_template) {
     items:    $.extend({
         heading: { name: kivi.t8('Time/cost estimate actions'), className: 'context-menu-heading' }
       , save:    { name: kivi.t8('Save'),   icon: "save",  callback: kivi.requirement_spec.standard_time_cost_estimate_ajax_call }
+      , save_keep_open: { name: kivi.t8('Save and keep open'), icon: "save", callback: kivi.requirement_spec.standard_time_cost_estimate_ajax_call }
       , cancel:  { name: kivi.t8('Cancel'), icon: "close", callback: kivi.requirement_spec.standard_time_cost_estimate_ajax_call }
     }, general_actions)
   });
index a8fdb70..1fd0ad6 100755 (executable)
@@ -2000,6 +2000,7 @@ $self->{texts} = {
   'Save and RFQ'                => 'Speichern und Lieferantenanfrage',
   'Save and close'              => 'Speichern und schlie&szlig;en',
   'Save and execute'            => 'Speichern und ausführen',
+  'Save and keep open'          => 'Speichern und geöffnet lassen',
   'Save as new'                 => 'als neu speichern',
   'Save document in WebDAV repository' => 'Dokument in WebDAV-Ablage speichern',
   'Save draft'                  => 'Entwurf speichern',
index 76b7afe..e8e4c3d 100644 (file)
@@ -1,7 +1,7 @@
 [%- USE LxERP -%][%- USE L -%][%- USE HTML -%][%- USE P -%]
 [%- DEFAULT id_prefix = 'time_and_cost_estimate_form' %]
 
-<div id="time_cost_estimate">
+<div id="time_cost_estimate"[% IF initially_hidden %] style="display: none;"[% END %]>
  [%- IF !SELF.requirement_spec.sections.size %]
   <p>[%- LxERP.t8("Neither sections nor function blocks have been created yet.") %]</p>