From: Moritz Bunkus Date: Mon, 18 Apr 2016 09:37:10 +0000 (+0200) Subject: SL::Common: unbenutzte Funktionen retrieve_{projects,employees} entfernt X-Git-Tag: release-3.4.1~217 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=9ebaa094105fc893633f2dca829424d33500f90c;p=kivitendo-erp.git SL::Common: unbenutzte Funktionen retrieve_{projects,employees} entfernt --- diff --git a/SL/Common.pm b/SL/Common.pm index dfdf3c5d4..b977c0059 100644 --- a/SL/Common.pm +++ b/SL/Common.pm @@ -100,80 +100,6 @@ sub retrieve_parts { return $parts; } -sub retrieve_projects { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form, $order_by, $order_dir) = @_; - - my $dbh = $form->dbconnect($myconfig); - - my (@filter_values, $filter); - if ($form->{"projectnumber"}) { - $filter .= qq| AND (projectnumber ILIKE ?)|; - push(@filter_values, '%' . $form->{"projectnumber"} . '%'); - } - if ($form->{"description"}) { - $filter .= qq| AND (description ILIKE ?)|; - push(@filter_values, '%' . $form->{"description"} . '%'); - } - substr($filter, 1, 3) = "WHERE" if ($filter); - - $order_by =~ s/[^a-zA-Z_]//g; - $order_dir = $order_dir ? "ASC" : "DESC"; - - my $query = - qq|SELECT id, projectnumber, description | . - qq|FROM project $filter | . - qq|ORDER BY $order_by $order_dir|; - my $sth = $dbh->prepare($query); - $sth->execute(@filter_values) || $form->dberror($query . " (" . join(", ", @filter_values) . ")"); - my $projects = []; - while (my $ref = $sth->fetchrow_hashref()) { - push(@{$projects}, $ref); - } - $sth->finish(); - $dbh->disconnect(); - - $main::lxdebug->leave_sub(); - - return $projects; -} - -sub retrieve_employees { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form, $order_by, $order_dir) = @_; - - my $dbh = $form->dbconnect($myconfig); - - my (@filter_values, $filter); - if ($form->{"name"}) { - $filter .= qq| AND (name ILIKE ?)|; - push(@filter_values, '%' . $form->{"name"} . '%'); - } - substr($filter, 1, 3) = "WHERE" if ($filter); - - $order_by =~ s/[^a-zA-Z_]//g; - $order_dir = $order_dir ? "ASC" : "DESC"; - - my $query = - qq|SELECT id, name | . - qq|FROM employee $filter | . - qq|ORDER BY $order_by $order_dir|; - my $sth = $dbh->prepare($query); - $sth->execute(@filter_values) || $form->dberror($query . " (" . join(", ", @filter_values) . ")"); - my $employees = []; - while (my $ref = $sth->fetchrow_hashref()) { - push(@{$employees}, $ref); - } - $sth->finish(); - $dbh->disconnect(); - - $main::lxdebug->leave_sub(); - - return $employees; -} - sub retrieve_customers_or_vendors { $main::lxdebug->enter_sub();