From: Moritz Bunkus Date: Wed, 12 Jun 2013 09:55:51 +0000 (+0200) Subject: SL/Printer.pm wird nicht mehr benötigt X-Git-Tag: release-3.1.0beta1~331^2~37 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=c904f865b0f9d1da094f2ca5198796829277d8e4;p=kivitendo-erp.git SL/Printer.pm wird nicht mehr benötigt --- diff --git a/SL/Printer.pm b/SL/Printer.pm deleted file mode 100644 index 5ed072d81..000000000 --- a/SL/Printer.pm +++ /dev/null @@ -1,91 +0,0 @@ -package SL::Printer; - -use strict; - -use SL::DBUtils; - -sub all_printers { - $::lxdebug->enter_sub; - - my ($self, %params) = @_; - - my $dbh = $::auth->get_user_dbh($params{login}); - - my $query = qq|SELECT * FROM printers ORDER BY printer_description|; - my @printers = selectall_hashref_query($::form, $dbh, $query); - - $dbh->disconnect; - - $::lxdebug->leave_sub; - - return wantarray ? @printers : \@printers; -} - -sub get_printer { - $::lxdebug->enter_sub; - - my ($self, %params) = @_; - - my $dbh = $::auth->get_user_dbh($params{login}); - - my $query = qq|SELECT * FROM printers WHERE id = ?|; - my ($printer) = selectfirst_hashref_query($::form, $dbh, $query, $params{id}); - - $dbh->disconnect; - - $::lxdebug->leave_sub; - - return $printer; -} - -sub save_printer { - $main::lxdebug->enter_sub(); - - my ($self, %params) = @_; - - # connect to database - my $dbh = $::auth->get_user_dbh($params{login}); - my $printer = $params{printer}; - - unless ($printer->{id}) { - ($printer->{id}) = selectfirst_array_query($::form, $dbh, "SELECT nextval('id'::text)"); - do_query($::form, $dbh, "INSERT INTO printers (id, printer_description) VALUES (?, '')", $printer->{id}); - } - - my $query = <{printer_description}, - $printer->{template_code}, - $printer->{printer_command}, - $printer->{id}, - ); - - $dbh->commit; - $dbh->disconnect; - - $::lxdebug->leave_sub; -} - -sub delete_printer { - $::lxdebug->enter_sub; - - my ($self, %params) = @_; - - my $dbh = $::auth->get_user_dbh($params{login}); - - my $query = qq|DELETE FROM printers WHERE id = ?|; - do_query($::form, $dbh, $query, $params{id}); - - $dbh->commit; - $dbh->disconnect; - - $::lxdebug->leave_sub; -} - -1; diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index ebe7ed187..e5be21ecc 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -42,7 +42,7 @@ use SL::User; use SL::USTVA; use SL::Iconv; use SL::TODO; -use SL::Printer; +use SL::DB::Printer; use CGI; require "bin/mozilla/common.pl"; @@ -1059,7 +1059,7 @@ sub config { { 'name' => $locale->text('Queue'), 'value' => 'queue', 'selected' => $selected{queue}, }, ]; - $form->{PRINTERS} = [ SL::Printer->all_printers(%::myconfig) ]; + $form->{PRINTERS} = SL::DB::Manager::Printer->get_all_sorted; my %countrycodes = User->country_codes;