commit b8a9076330788981d439d15791d83711057855de
Author: Moritz Bunkus <m.bunkus@linet.de>
Date:   Mon Sep 2 11:45:40 2013 +0200

    Pflichtenheftzeitschätzung: neuer Menüeintrag "Speichern und geöffnet lassen"

diff --git a/SL/Controller/RequirementSpec.pm b/SL/Controller/RequirementSpec.pm
index ee0a94f25..3fa13c0f5 100644
--- a/SL/Controller/RequirementSpec.pm
+++ b/SL/Controller/RequirementSpec.pm
@@ -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);
diff --git a/js/locale/de.js b/js/locale/de.js
index 9cdf4a82d..9c54d6158 100644
--- a/js/locale/de.js
+++ b/js/locale/de.js
@@ -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",
diff --git a/js/requirement_spec.js b/js/requirement_spec.js
index 96a2cba15..535c34eab 100644
--- a/js/requirement_spec.js
+++ b/js/requirement_spec.js
@@ -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)
   });
diff --git a/locale/de/all b/locale/de/all
index a8fdb7015..1fd0ad6da 100755
--- a/locale/de/all
+++ b/locale/de/all
@@ -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',
diff --git a/templates/webpages/requirement_spec/_show_time_and_cost_estimate.html b/templates/webpages/requirement_spec/_show_time_and_cost_estimate.html
index 76b7afe61..e8e4c3d52 100644
--- a/templates/webpages/requirement_spec/_show_time_and_cost_estimate.html
+++ b/templates/webpages/requirement_spec/_show_time_and_cost_estimate.html
@@ -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>
 
