X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=inline;f=bin%2Fmozilla%2Fam.pl;h=368a627161bddaa0d5491dfa512db952e2dd7b74;hb=4aa816112a8b9f2d2959c92cfaa2f2954bdeceb2;hp=c6586af5bd47e031afcce7a550a56be1e95dd214;hpb=05c6840d4fbb90cbe81e14427617793c45ba4714;p=kivitendo-erp.git
diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl
index c6586af5b..368a62716 100644
--- a/bin/mozilla/am.pl
+++ b/bin/mozilla/am.pl
@@ -34,6 +34,7 @@
use utf8;
use SL::Auth;
+use SL::Auth::PasswordPolicy;
use SL::AM;
use SL::CA;
use SL::Form;
@@ -45,8 +46,6 @@ use SL::Printer;
use CGI::Ajax;
use CGI;
-use Data::Dumper;
-
require "bin/mozilla/common.pl";
use strict;
@@ -503,7 +502,7 @@ sub list_account {
push(@ { $form->{AJAX} }, $pjx);
- $form->{stylesheets} = "list_accounts.css";
+ $form->use_stylesheet("list_accounts.css");
$form->{title} = $locale->text('Chart of Accounts');
$form->header;
@@ -619,7 +618,7 @@ sub delete_account {
$main::lxdebug->leave_sub();
}
-sub add_department {
+sub add_lead {
$main::lxdebug->enter_sub();
my $form = $main::form;
@@ -627,17 +626,16 @@ sub add_department {
$main::auth->assert('config');
$form->{title} = "Add";
- $form->{role} = "P";
- $form->{callback} = "am.pl?action=add_department" unless $form->{callback};
+ $form->{callback} = "am.pl?action=add_lead" unless $form->{callback};
- &department_header;
+ &lead_header;
&form_footer;
$main::lxdebug->leave_sub();
}
-sub edit_department {
+sub edit_lead {
$main::lxdebug->enter_sub();
my $form = $main::form;
@@ -647,15 +645,17 @@ sub edit_department {
$form->{title} = "Edit";
- AM->get_department(\%myconfig, \%$form);
+ AM->get_lead(\%myconfig, \%$form);
+
+ &lead_header;
- &department_header;
+ $form->{orphaned} = 1;
&form_footer;
$main::lxdebug->leave_sub();
}
-sub list_department {
+sub list_lead {
$main::lxdebug->enter_sub();
my $form = $main::form;
@@ -664,28 +664,20 @@ sub list_department {
$main::auth->assert('config');
- AM->departments(\%myconfig, \%$form);
+ AM->lead(\%myconfig, \%$form);
- $form->{callback} = "am.pl?action=list_department";
+ $form->{callback} = "am.pl?action=list_lead";
my $callback = $form->escape($form->{callback});
- $form->{title} = $locale->text('Departments');
+ $form->{title} = $locale->text('Lead');
my @column_index = qw(description cost profit);
my %column_header;
$column_header{description} =
- qq|
|
+ qq| | |
. $locale->text('Description')
. qq| | |;
- $column_header{cost} =
- qq||
- . $locale->text('Cost Center')
- . qq| | |;
- $column_header{profit} =
- qq||
- . $locale->text('Profit Center')
- . qq| | |;
$form->header;
@@ -697,16 +689,13 @@ sub list_department {
$form->{title} |
-
-
-
-
+
|;
map { print "$column_header{$_}\n" } @column_index;
print qq|
-
+
|;
my ($i, %column_data);
@@ -716,28 +705,21 @@ sub list_department {
$i %= 2;
print qq|
-
+
|;
- my $costcenter = ($ref->{role} eq "C") ? "X" : "";
- my $profitcenter = ($ref->{role} eq "P") ? "X" : "";
+# $lead = $ref->{lead};
- $column_data{description} =
- qq|$ref->{description} | |;
- $column_data{cost} = qq|$costcenter | |;
- $column_data{profit} = qq|$profitcenter | |;
+ $column_data{description} = qq|$ref->{lead} | |;
map { print "$column_data{$_}\n" } @column_index;
print qq|
-
+
|;
}
print qq|
-
- |
-
|
@@ -748,7 +730,7 @@ sub list_department {
-
+
@@ -762,7 +744,7 @@ sub list_department {
$main::lxdebug->leave_sub();
}
-sub department_header {
+sub lead_header {
$main::lxdebug->enter_sub();
my $form = $main::form;
@@ -770,24 +752,15 @@ sub department_header {
$main::auth->assert('config');
- $form->{title} = $locale->text("$form->{title} Department");
+ $form->{title} = $locale->text("$form->{title} Lead");
- # $locale->text('Add Department')
- # $locale->text('Edit Department')
+ # $locale->text('Add Lead')
+ # $locale->text('Edit Lead')
$form->{description} =~ s/\"/"/g;
- my ($rows, $description);
- if (($rows = $form->numtextrows($form->{description}, 60)) > 1) {
- $description =
- qq||;
- } else {
- $description =
- qq||;
- }
-
- my $costcenter = "checked" if $form->{role} eq "C";
- my $profitcenter = "checked" if $form->{role} eq "P";
+ my $description =
+ qq||;
$form->header;
@@ -797,7 +770,7 @@ sub department_header {
-
-
-
-|;
-
- $main::lxdebug->leave_sub();
-}
-
-sub business_header {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->{title} = $locale->text("$form->{title} Business");
-
- # $locale->text('Add Business')
- # $locale->text('Edit Business')
-
- $form->{description} =~ s/\"/"/g;
- $form->{discount} =
- $form->format_amount(\%myconfig, $form->{discount} * 100);
-
- my $salesman_code;
- if ($::vertreter) {
- $salesman_code = qq|
-
- | . $locale->text('Representative') . qq| |
- | . $::cgi->checkbox(-name => "salesman", -value => 1, -label => '', 'checked' => $form->{salesman} ? 1 : 0) . qq| |
-
-|;
- } else {
- $salesman_code = $::cgi->hidden(-name => 'salesman', -value => $form->{salesman} ? 1 : 0);
- }
-
- $form->header;
-
- print qq|
-
-
-
-
-
-
-|;
-
- $main::lxdebug->leave_sub();
-}
-
-sub language_header {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->{title} = $locale->text("$form->{title} Language");
-
- # $locale->text('Add Language')
- # $locale->text('Edit Language')
-
- $form->{description} =~ s/\"/"/g;
- $form->{template_code} =~ s/\"/"/g;
- $form->{article_code} =~ s/\"/"/g;
-
-
- $form->header;
-
- my $numberformat =
- qq||;
- foreach my $item (('1,000.00', '1000.00', '1.000,00', '1000,00')) {
- $numberformat .=
- ($item eq $form->{output_numberformat})
- ? "";
- }
-
- my $dateformat =
- qq||;
- foreach my $item (qw(mm-dd-yy mm/dd/yy dd-mm-yy dd/mm/yy dd.mm.yy yyyy-mm-dd)) {
- $dateformat .=
- ($item eq $form->{output_dateformat})
- ? "";
- }
-
- print qq|
-
-
-
-
-
-
-|;
-
- $main::lxdebug->leave_sub();
-}
-
-sub buchungsgruppe_header {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- $form->{title} = $locale->text("$form->{title} Buchungsgruppe");
-
- # $locale->text('Add Accounting Group')
- # $locale->text('Edit Accounting Group')
-
- my ($acc_inventory, $acc_income, $acc_expense) = ({}, {}, {});
- my %acc_type_map = (
- "IC" => $acc_inventory,
- "IC_income" => $acc_income,
- "IC_sale" => $acc_income,
- "IC_expense" => $acc_expense,
- "IC_cogs" => $acc_expense,
- );
-
- foreach my $key (keys(%acc_type_map)) {
- foreach my $ref (@{ $form->{IC_links}{$key} }) {
- $acc_type_map{$key}->{$ref->{"id"}} = $ref;
- }
- }
-
- foreach my $type (qw(IC IC_income IC_expense)) {
- $form->{"select$type"} =
- join("",
- map({ "" }
- sort({ $a->{"accno"} cmp $b->{"accno"} }
- values(%{$acc_type_map{$type}}))));
- }
-
- if ($form->{id}) {
- $form->{selectIC} =~ s/selected//g;
- $form->{selectIC} =~ s/ value=\Q$form->{inventory_accno_id}\E/ value=$form->{inventory_accno_id} selected/;
- $form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_0}\E/ value=$form->{income_accno_id_0} selected/;
- $form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_0}\E/ value=$form->{expense_accno_id_0} selected/;
- }
-
- my $linkaccounts;
- if (!$main::eur) {
- $linkaccounts = qq|
-
- | . $locale->text('Inventory') . qq| |
- |
-
-
|;
- } else {
- $linkaccounts = qq|
- {inventory_accno_id}>|;
- }
-
-
- $linkaccounts .= qq|
-
- | . $locale->text('National Revenues') . qq| |
- |
-
-
- | . $locale->text('National Expenses') . qq| |
- |
-
|;
- if ($form->{id}) {
- $form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_1}\E/ value=$form->{income_accno_id_1} selected/;
- $form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_1}\E/ value=$form->{expense_accno_id_1} selected/;
- }
- $linkaccounts .= qq|
- | . $locale->text('Revenues EU with UStId') . qq| |
- |
-
-
- | . $locale->text('Expenses EU with UStId') . qq| |
- |
-
|;
-
- if ($form->{id}) {
- $form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_2}\E/ value=$form->{income_accno_id_2} selected/;
- $form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_2}\E/ value=$form->{expense_accno_id_2} selected/;
- }
-
- $linkaccounts .= qq|
- | . $locale->text('Revenues EU without UStId') . qq| |
- |
-
-
- | . $locale->text('Expenses EU without UStId') . qq| |
- |
-
|;
-
- if ($form->{id}) {
- $form->{selectIC_income} =~ s/selected//g;
- $form->{selectIC_income} =~ s/ value=\Q$form->{income_accno_id_3}\E/ value=$form->{income_accno_id_3} selected/;
- $form->{selectIC_expense} =~ s/selected//g;
- $form->{selectIC_expense} =~ s/ value=\Q$form->{expense_accno_id_3}\E/ value=$form->{expense_accno_id_3} selected/;
- }
-
- $linkaccounts .= qq|
- | . $locale->text('Foreign Revenues') . qq| |
- |
-
-
- | . $locale->text('Foreign Expenses') . qq| |
- |
-
-|;
-
-
- $form->header;
-
- print qq|
-
-
-