X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Foe.pl;h=ee8eddf17c07924b9880aad6eeca873b20eba555;hb=834bd183522a3b20f8c3e24d3f39c6669543c0fc;hp=0d6c3ce5863fcdc3b897ab33f50cef096f94e850;hpb=cfc6a60d53597f6a879b28af37f84b4b5fa4cc6b;p=kivitendo-erp.git diff --git a/bin/mozilla/oe.pl b/bin/mozilla/oe.pl index 0d6c3ce58..ee8eddf17 100644 --- a/bin/mozilla/oe.pl +++ b/bin/mozilla/oe.pl @@ -110,6 +110,9 @@ sub add { sub edit { $lxdebug->enter_sub(); + # show history button + $form->{javascript} = qq||; + #/show hhistory button $form->{simple_save} = 0; @@ -1111,7 +1114,17 @@ sub form_footer { {path}> {login}> {password}> - +|; +# button for saving history +print qq| + {id} + . qq|); name=history id=history value=| + . $locale->text('history') + . qq|>|; +# /button for saving history + +qq| @@ -1375,6 +1388,19 @@ sub search { |; } + $form->get_lists("projects" => { "key" => "ALL_PROJECTS", + "all" => 1 }); + + my %labels = (); + my @values = (""); + foreach my $item (@{ $form->{"ALL_PROJECTS"} }) { + push(@values, $item->{"id"}); + $labels{$item->{"id"}} = $item->{"projectnumber"}; + } + my $projectnumber = + NTI($cgi->popup_menu('-name' => 'project_id', '-values' => \@values, + '-labels' => \%labels)); + $form->header; print qq| @@ -1399,6 +1425,10 @@ sub search { $ordlabel + + | . $locale->text("Project Number") . qq| + $projectnumber + | . $locale->text('From') . qq| $button1 @@ -1426,6 +1456,7 @@ sub search { $employee | . $locale->text('Ship via') . qq| + $employee | @@ -1434,6 +1465,8 @@ sub search { . $locale->text('Tax') . qq| | . $locale->text('Total') . qq| + | + . $locale->text('Project Number') . qq| | @@ -1499,8 +1532,8 @@ sub orders { @columns = $form->sort_columns("transdate", "reqdate", "id", "$ordnumber", "name", "netamount", "tax", "amount", - "curr", "employee", "shipvia", "open", - "closed", "delivered"); + "curr", "employee", "shipvia", "globalprojectnumber", + "open", "closed", "delivered"); $form->{l_open} = $form->{l_closed} = "Y" if ($form->{open} && $form->{closed}); @@ -1584,6 +1617,8 @@ sub orders { qq|| . $locale->text('Ship via') . qq||; + $column_header{globalprojectnumber} = + qq|| . $locale->text('Project Number') . qq||; $column_header{open} = qq|| . $locale->text('O') . qq||; $column_header{closed} = @@ -1700,6 +1735,7 @@ sub orders { $column_data{employee} = "$oe->{employee} "; $column_data{shipvia} = "$oe->{shipvia} "; + $column_data{globalprojectnumber} = "" . H($oe->{globalprojectnumber}) . ""; if ($oe->{closed}) { $column_data{closed} = "X"; @@ -1898,6 +1934,12 @@ sub save_and_close { } relink_accounts(); + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history $form->redirect( $form->{label} . " $form->{$ordnumber} " . $locale->text('saved!')) @@ -1972,6 +2014,12 @@ sub save { unless $form->{$ordnumber}; relink_accounts(); + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "SAVED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history OE->save(\%myconfig, \%$form); $form->{simple_save} = 1; @@ -2036,8 +2084,15 @@ sub yes { $msg = $locale->text('Quotation deleted!'); $err = $locale->text('Cannot delete quotation!'); } - - $form->redirect($msg) if (OE->delete(\%myconfig, \%$form, $spool)); + if (OE->delete(\%myconfig, \%$form, $spool)){ + $form->redirect($msg); + # saving the history + if(!exists $form->{addition}) { + $form->{addition} = "DELETED"; + $form->save_history($form->dbconnect(\%myconfig)); + } + # /saving the history + } $form->error($err); $lxdebug->leave_sub();