Funktion "Als Entwurf speichern" für Dialogbuchungen implementiert.
authorMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 15 May 2009 10:40:24 +0000 (10:40 +0000)
committerMoritz Bunkus <m.bunkus@linet-services.de>
Fri, 15 May 2009 10:40:24 +0000 (10:40 +0000)
Teil eines Fixes für Bug 612.

bin/mozilla/gl.pl
locale/de/gl

index 185e2a5..0bb5274 100644 (file)
@@ -41,6 +41,7 @@ use SL::PE;
 use SL::ReportGenerator;
 
 require "bin/mozilla/common.pl";
+require "bin/mozilla/drafts.pl";
 require "bin/mozilla/reportgenerator.pl";
 
 1;
@@ -80,6 +81,8 @@ sub add {
 
   $auth->assert('general_ledger');
 
+  return $lxdebug->leave_sub() if (load_draft_maybe());
+
   $form->{title} = "Add";
 
   $form->{callback} = "gl.pl?action=add" unless $form->{callback};
@@ -1292,9 +1295,20 @@ $follow_ups_block
       . qq|"> |;
 
   } else {
+    if ($form->{draft_id}) {
+      my $remove_draft_checked = 'checked' if ($form->{remove_draft});
+      print qq|<p>\n|
+        . qq|  <input name="remove_draft" id="remove_draft" type="checkbox" class="checkbox" ${remove_draft_checked}>|
+        . qq|  <label for="remove_draft">| . $locale->text('Remove Draft') . qq|</label>\n|
+        . qq|</p>\n|;
+    }
+
     print qq|
         <input class=submit type=submit name=action id=update_button value="| . $locale->text('Update') . qq|">
-        <input class=submit type=submit name=action value="| . $locale->text('Post') . qq|">|;
+        <input class=submit type=submit name=action value="| . $locale->text('Post') . qq|"> |
+        . NTI($cgi->submit('-name' => 'action', '-value' => $locale->text('Save draft'), '-class' => 'submit'))
+        . $cgi->hidden('-name' => 'draft_id',          '-default' => [$form->{draft_id}])
+        . $cgi->hidden('-name' => 'draft_description', '-default' => [$form->{draft_description}]);
   }
 
   print "
@@ -1519,6 +1533,8 @@ sub post {
 
   post_transaction();
 
+  remove_draft() if $form->{remove_draft};
+
   $form->{callback} = build_std_url("action=add", "show_details");
   $form->redirect($form->{callback});
 
index cae0963..fc9492b 100644 (file)
@@ -95,12 +95,14 @@ $self->{texts} = {
   'Dec'                         => 'Dez',
   'December'                    => 'Dezember',
   'Delete'                      => 'Löschen',
+  'Delete drafts'               => 'Entwürfe löschen',
   'Delivery Order'              => 'Lieferschein',
   'Department'                  => 'Abteilung',
   'Dependency loop detected:'   => 'Schleife in den Abh&auml;ngigkeiten entdeckt:',
   'Description'                 => 'Beschreibung',
   'Description missing!'        => 'Beschreibung fehlt.',
   'Directory'                   => 'Verzeichnis',
+  'Draft saved.'                => 'Entwurf gespeichert.',
   'Dunning'                     => 'Mahnung',
   'ELSE'                        => 'Zusatz',
   'Edit General Ledger Transaction' => 'Buchung im Hauptbuch bearbeiten',
@@ -189,6 +191,7 @@ $self->{texts} = {
   'Receipt, payment, reconciliation' => 'Zahlungseingang, Zahlungsausgang, Kontenabgleich',
   'Reference'                   => 'Referenz',
   'Reference missing!'          => 'Referenz fehlt!',
+  'Remove Draft'                => 'Entwurf l&ouml;schen',
   'Reports'                     => 'Berichte',
   'Request quotation'           => 'Preisanfrage',
   'Revenue'                     => 'Erlöskonto',
@@ -198,6 +201,7 @@ $self->{texts} = {
   'Sales Invoice'               => 'Rechnung',
   'Sales Order'                 => 'Kundenauftrag',
   'Sales quotation'             => 'Angebot',
+  'Save draft'                  => 'Entwurf speichern',
   'Select a Customer'           => 'Endkunde auswählen',
   'Select a customer'           => 'Einen Kunden ausw&auml;hlen',
   'Select a part'               => 'Artikel ausw&auml;hlen',
@@ -205,6 +209,7 @@ $self->{texts} = {
   'Sep'                         => 'Sep',
   'September'                   => 'September',
   'Show details'                => 'Details anzeigen',
+  'Skip'                        => 'Überspringen',
   'Source'                      => 'Beleg',
   'Storno'                      => 'Storno',
   'Storno Invoice'              => 'Stornorechnung',
@@ -285,15 +290,20 @@ $self->{subs} = {
   'cov_selection_internal'      => 'cov_selection_internal',
   'create_subtotal_row'         => 'create_subtotal_row',
   'delete'                      => 'delete',
+  'delete_drafts'               => 'delete_drafts',
   'delivery_customer_selection' => 'delivery_customer_selection',
   'display_form'                => 'display_form',
   'display_rows'                => 'display_rows',
+  'dont_load_draft'             => 'dont_load_draft',
+  'draft_action_dispatcher'     => 'draft_action_dispatcher',
   'edit'                        => 'edit',
   'form_footer'                 => 'form_footer',
   'form_header'                 => 'form_header',
   'format_dates'                => 'format_dates',
   'generate_report'             => 'generate_report',
   'gl_transaction'              => 'gl_transaction',
+  'load_draft'                  => 'load_draft',
+  'load_draft_maybe'            => 'load_draft_maybe',
   'mark_as_paid_common'         => 'mark_as_paid_common',
   'part_selection_internal'     => 'part_selection_internal',
   'post'                        => 'post',
@@ -301,6 +311,7 @@ $self->{subs} = {
   'post_transaction'            => 'post_transaction',
   'prepare_transaction'         => 'prepare_transaction',
   'reformat_numbers'            => 'reformat_numbers',
+  'remove_draft'                => 'remove_draft',
   'report_generator_back'       => 'report_generator_back',
   'report_generator_dispatcher' => 'report_generator_dispatcher',
   'report_generator_do'         => 'report_generator_do',
@@ -309,6 +320,7 @@ $self->{subs} = {
   'report_generator_set_default_sort' => 'report_generator_set_default_sort',
   'retrieve_partunits'          => 'retrieve_partunits',
   'sales_invoice'               => 'sales_invoice',
+  'save_draft'                  => 'save_draft',
   'search'                      => 'search',
   'select_part'                 => 'select_part',
   'select_part_internal'        => 'select_part_internal',
@@ -324,10 +336,13 @@ $self->{subs} = {
   'debitorenbuchung'            => 'ar_transaction',
   'weiter'                      => 'continue',
   'löschen'                     => 'delete',
+  'entwürfe_löschen'            => 'delete_drafts',
   'dialogbuchung'               => 'gl_transaction',
   'neue_ware'                   => 'new_part',
   'buchen'                      => 'post',
   'rechnung'                    => 'sales_invoice',
+  'entwurf_speichern'           => 'save_draft',
+  'Überspringen'                => 'skip',
   'storno'                      => 'storno',
   'erneuern'                    => 'update',
   'einkaufsrechnung'            => 'vendor_invoice',