From 73f6453e0208e54238cf60bc37f7a4133d6596e2 Mon Sep 17 00:00:00 2001 From: Thomas Kasulke Date: Mon, 14 May 2007 14:25:17 +0000 Subject: [PATCH] =?utf8?q?sub=20get=5Fhistory()=20an=20die=20neuen=20Histo?= =?utf8?q?rienm=C3=B6glichkeiten=20angepasst?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- SL/Form.pm | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/SL/Form.pm b/SL/Form.pm index 62be081c1..a10880d56 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -2477,10 +2477,9 @@ sub save_history { sub get_history { $main::lxdebug->enter_sub(); - my $self = shift(); - my $dbh = shift(); - my $trans_id = shift(); - my $restriction = shift(); + my ($self, $dbh, $trans_id, $restriction, $order) = @_; + my ($orderBy, $desc) = split(/\-\-/, $order); + $order = " ORDER BY " . ($order eq "" ? " h.itime " : ($desc == 1 ? $orderBy . " DESC " : $orderBy . " ")); my @tempArray; my $i = 0; if ($trans_id ne "") { @@ -2488,7 +2487,7 @@ sub get_history { qq|SELECT h.employee_id, h.itime::timestamp(0) AS itime, h.addition, h.what_done, emp.name, h.snumbers, h.trans_id AS id | . qq|FROM history_erp h | . qq|LEFT JOIN employee emp ON (emp.id = h.employee_id) | . - qq|WHERE trans_id = ? | + qq|WHERE trans_id = ? |. $order . $restriction; my $sth = $dbh->prepare($query) || $self->dberror($query); -- 2.20.1