From 2e3bdf1ae149f89f0cd9dbdda70372de38247f77 Mon Sep 17 00:00:00 2001 From: Moritz Bunkus Date: Tue, 31 Jan 2017 16:23:21 +0100 Subject: [PATCH] Verwaltung von Kundenquellen entfernt MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Diese Funktionalität wird in der ERP nicht genutzt. --- SL/AM.pm | 86 ----------------------- bin/mozilla/am.pl | 97 -------------------------- locale/de/all | 6 -- menus/user/00-erp.yaml | 7 -- templates/webpages/am/lead_header.html | 17 ----- templates/webpages/am/lead_list.html | 23 ------ 6 files changed, 236 deletions(-) delete mode 100644 templates/webpages/am/lead_header.html delete mode 100644 templates/webpages/am/lead_list.html diff --git a/SL/AM.pm b/SL/AM.pm index 7818fb18e..2aa1ad2b6 100644 --- a/SL/AM.pm +++ b/SL/AM.pm @@ -410,92 +410,6 @@ sub _delete_account { return 1; } -sub lead { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - my $dbh = SL::DB->client->dbh; - - my $query = qq|SELECT id, lead - FROM leads - ORDER BY 2|; - - my $sth = $dbh->prepare($query); - $sth->execute || $form->dberror($query); - - while (my $ref = $sth->fetchrow_hashref("NAME_lc")) { - push @{ $form->{ALL} }, $ref; - } - - $sth->finish; - - $main::lxdebug->leave_sub(); -} - -sub get_lead { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - - my $dbh = SL::DB->client->dbh; - - my $query = - qq|SELECT l.id, l.lead | . - qq|FROM leads l | . - qq|WHERE l.id = ?|; - my $sth = $dbh->prepare($query); - $sth->execute($form->{id}) || $form->dberror($query . " ($form->{id})"); - - my $ref = $sth->fetchrow_hashref("NAME_lc"); - - map { $form->{$_} = $ref->{$_} } keys %$ref; - - $sth->finish; - - $main::lxdebug->leave_sub(); -} - -sub save_lead { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - my ($query); - - my $dbh = SL::DB->client->dbh; - - my @values = ($form->{description}); - # id is the old record - if ($form->{id}) { - $query = qq|UPDATE leads SET - lead = ? - WHERE id = ?|; - push(@values, $form->{id}); - } else { - $query = qq|INSERT INTO leads - (lead) - VALUES (?)|; - } - do_query($form, $dbh, $query, @values); - - $main::lxdebug->leave_sub(); -} - -sub delete_lead { - $main::lxdebug->enter_sub(); - - my ($self, $myconfig, $form) = @_; - my ($query); - - SL::DB->client->with_transaction(sub { - $query = qq|DELETE FROM leads WHERE id = ?|; - do_query($form, SL::DB->client->dbh, $query, $form->{id}); - 1; - }) or do { die SL::DB->client->error }; - - $main::lxdebug->leave_sub(); -} - sub language { $main::lxdebug->enter_sub(); diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 5a3b74223..7f0441d04 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -614,103 +614,6 @@ sub delete_account { $main::lxdebug->leave_sub(); } -sub add_lead { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - - $main::auth->assert('config'); - - $form->{title} = "Add"; - - $form->{callback} = "am.pl?action=add_lead" unless $form->{callback}; - - &lead_header; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub edit_lead { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - $form->{title} = "Edit"; - - AM->get_lead(\%myconfig, \%$form); - - &lead_header; - - $form->{orphaned} = 1; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub list_lead { - $::lxdebug->enter_sub; - $::auth->assert('config'); - - AM->lead(\%::myconfig, $::form); - - $::form->{callback} = "am.pl?action=list_lead"; - $::form->{title} = $::locale->text('Lead'); - - $::form->header; - print $::form->parse_html_template('am/lead_list'); - - $::lxdebug->leave_sub; -} - -sub lead_header { - $::lxdebug->enter_sub; - $::auth->assert('config'); - - # $locale->text('Add Lead') - # $locale->text('Edit Lead') - $::form->{title} = $::locale->text("$::form->{title} Lead"); - - $::form->header; - print $::form->parse_html_template('am/lead_header'); - - $::lxdebug->leave_sub; -} - -sub save_lead { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->isblank("description", $locale->text('Description missing!')); - AM->save_lead(\%myconfig, \%$form); - $form->redirect($locale->text('lead saved!')); - - $main::lxdebug->leave_sub(); -} - -sub delete_lead { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->delete_lead(\%myconfig, \%$form); - $form->redirect($locale->text('lead deleted!')); - - $main::lxdebug->leave_sub(); -} - sub add_language { $main::lxdebug->enter_sub(); diff --git a/locale/de/all b/locale/de/all index 8ac98c2f9..6ab574684 100755 --- a/locale/de/all +++ b/locale/de/all @@ -161,7 +161,6 @@ $self->{texts} = { 'Add Follow-Up for #1' => 'Wiedervorlage für #1 erstellen', 'Add General Ledger Transaction' => 'Dialogbuchen', 'Add Language' => 'Sprache hinzufügen', - 'Add Lead' => 'Kundenquelle erfassen', 'Add Letter' => 'Brief hinzufügen', 'Add Part' => 'Ware erfassen', 'Add Price Factor' => 'Preisfaktor erfassen', @@ -1068,7 +1067,6 @@ $self->{texts} = { 'Edit Follow-Up for #1' => 'Wiedervorlage für #1 bearbeiten', 'Edit General Ledger Transaction' => 'Buchung im Hauptbuch bearbeiten', 'Edit Language' => 'Sprache bearbeiten', - 'Edit Lead' => 'Kundenquelle bearbeiten', 'Edit Letter' => 'Brief bearbeiten', 'Edit Part' => 'Ware bearbeiten', 'Edit Preferences for #1' => 'Einstellungen von #1 bearbeiten', @@ -1627,8 +1625,6 @@ $self->{texts} = { 'Last transaction' => 'Letzte Buchung', 'Lastcost' => 'Einkaufspreis', 'Lastcost (with X being a number)' => 'Einkaufspreis (X ist eine fortlaufende Zahl)', - 'Lead' => 'Kundenquelle', - 'Leads' => 'Kundenquellen', 'Left' => 'Links', 'Letter' => 'Brief', 'Letter Draft' => 'Briefentwurf', @@ -3668,8 +3664,6 @@ $self->{texts} = { 'kivitendo v#1 administration' => 'kivitendo v#1 Administration', 'kivitendo website (external)' => 'kivitendo-Webseite (extern)', 'kivitendo will then update the database automatically.' => 'kivitendo wird die Datenbank daraufhin automatisch aktualisieren.', - 'lead deleted!' => 'Kundenquelle gelöscht', - 'lead saved!' => 'Kundenquelle geichert', 'letters_list' => 'briefliste', 'list_of_payments' => 'zahlungsausgaenge', 'list_of_receipts' => 'zahlungseingaenge', diff --git a/menus/user/00-erp.yaml b/menus/user/00-erp.yaml index aaa3e8e1b..1b99707f4 100644 --- a/menus/user/00-erp.yaml +++ b/menus/user/00-erp.yaml @@ -1110,13 +1110,6 @@ order: 1400 params: action: Business/list -- parent: system - id: system_leads - name: Leads - order: 1500 - module: am.pl - params: - action: list_lead - parent: system id: system_project_types name: Project Types diff --git a/templates/webpages/am/lead_header.html b/templates/webpages/am/lead_header.html deleted file mode 100644 index f29b0ec5e..000000000 --- a/templates/webpages/am/lead_header.html +++ /dev/null @@ -1,17 +0,0 @@ -[%- USE HTML %] -[%- USE T8 %] -

[% title | html %]

- -
- - - - - - - - - - - -
[% 'Description' | $T8 %]

diff --git a/templates/webpages/am/lead_list.html b/templates/webpages/am/lead_list.html deleted file mode 100644 index 1bdac5a29..000000000 --- a/templates/webpages/am/lead_list.html +++ /dev/null @@ -1,23 +0,0 @@ -[%- USE T8 %] -[%- USE HTML %] -[%- USE LxERP %] -[%- USE L %] -

[% title | html %]

- - - - - -[%- FOREACH row = ALL %] - - - -[%- END %] - - - -
[% 'Description' | $T8 %]
[% row.lead | html %]

- -
- - [%- 'Add' | $T8 %] -- 2.20.1