From: Moritz Bunkus Date: Fri, 31 Aug 2007 06:33:33 +0000 (+0000) Subject: Bei den Entwürfen nicht die Variable "stylesheet" speichern. X-Git-Tag: release-2.6.0beta1~511 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c260666f53b243aef7d4d7f71e2caf2999d1b2fa;p=kivitendo-erp.git Bei den Entwürfen nicht die Variable "stylesheet" speichern. --- diff --git a/SL/Drafts.pm b/SL/Drafts.pm index 96d4d913e..44088994b 100644 --- a/SL/Drafts.pm +++ b/SL/Drafts.pm @@ -34,12 +34,14 @@ sub get_module { return ($module, $submodule); } +@dont_save = qw(login password stylesheet action); + sub save { $main::lxdebug->enter_sub(); my ($self, $myconfig, $form, $draft_id, $draft_description) = @_; - my ($dbh, $sth, $query, %saved, @dont_save, $dumped); + my ($dbh, $sth, $query, %saved, $dumped); $dbh = $form->dbconnect_noauto($myconfig); @@ -54,7 +56,6 @@ sub save { do_query($form, $dbh, $query, $draft_id, $module, $submodule); } - @dont_save = qw(login password action); map({ $saved{$_} = $form->{$_}; delete($form->{$_}); } @dont_save); diff --git a/bin/mozilla/drafts.pl b/bin/mozilla/drafts.pl index 1aa34a56f..dbe61ffda 100644 --- a/bin/mozilla/drafts.pl +++ b/bin/mozilla/drafts.pl @@ -103,7 +103,10 @@ sub load_draft { if ($old_form) { $old_form = YAML::Load($old_form); - @{$form}{keys %{ $old_form } } = @{$old_form}{keys %{ $old_form } }; + my %dont_save_vars = map { $_ => 1 } @Drafts::dont_save; + my @restore_vars = grep { !$skip_vars{$_} } keys %{ $old_form }; + + @{$form}{@restore_vars} = @{$old_form}{@restore_vars}; $form->{draft_id} = $id; $form->{draft_description} = $description;