From: Sven Schöling Date: Fri, 16 Sep 2011 15:27:47 +0000 (+0200) Subject: delete in oe in templates ausgelgert X-Git-Tag: release-2.7.0beta1~281^2~2 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c97d8162555a82a2ada2b0323fce9b19ae8c3a23;p=kivitendo-erp.git delete in oe in templates ausgelgert --- diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index c243c4803..6b8d30bb0 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -1211,56 +1211,28 @@ sub save { } sub delete { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; + $::lxdebug->enter_sub; check_oe_access(); - $form->header; - - my ($msg, $ordnumber); - if ($form->{type} =~ /_order$/) { - $msg = $locale->text('Are you sure you want to delete Order Number'); - $ordnumber = 'ordnumber'; - } else { - $msg = $locale->text('Are you sure you want to delete Quotation Number'); - $ordnumber = 'quonumber'; - } - - print qq| - - -
{script}> -|; + $::form->header; # delete action variable - map { delete $form->{$_} } qw(action header); + delete $::form->{$_} for qw(action header); - foreach my $key (keys %$form) { - next if (($key eq 'login') || ($key eq 'password') || ('' ne ref $form->{$key})); - $form->{$key} =~ s/\"/"/g; - print qq|\n|; + my @hiddens; + for my $key (keys %$::form) { + next if $key eq 'login' || $key eq 'password' || '' ne ref $::form->{$key}; + push @hiddens, { key => $key, value => $::form->{$key} }; } - print qq| -

| . $locale->text('Confirm!') . qq|

- -

$msg $form->{$ordnumber}

-

- - - -

+ print $::form->parse_html_template('oe/delete', { + hiddens => \@hiddens, + is_order => scalar($::form->{type} =~ /_order$/), + }); - - -|; - $main::lxdebug->leave_sub(); + $::lxdebug->leave_sub; } sub delete_order_quotation { diff --git a/templates/webpages/oe/delete.html b/templates/webpages/oe/delete.html new file mode 100644 index 000000000..5f63afc51 --- /dev/null +++ b/templates/webpages/oe/delete.html @@ -0,0 +1,27 @@ +[%- USE T8 %] +[%- USE L %] +[%- USE LxERP %] + + + +
+ +

[% 'Confirm!' | $T8 %]

+ +[%- IF is_order %] +

[% 'Are you sure you want to delete Order Number' | $T8 %] [% ordnumber %]

+[%- ELSE %] +

[% 'Are you sure you want to delete Quotation Number' | $T8 %] [% quonumber %]

+[%- END %] + +
+ +[% L.hidden_tag(row.key, row.value) FOREACH row = hiddens %] +[% L.hidden_tag('yes_nextsub', 'delete_order_quotation') %] +[% L.submit_tag('action', LxERP.t8('Yes')) %] + + +
+ + +