X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;f=bin%2Fmozilla%2Fam.pl;h=8ef12063a5a2870798c245ffdad189cd2a39762e;hb=22bcb6b18c5832dad188a72ed75cd98c38d299e3;hp=5a3b742230f7ee65a2a1191ef0a97f66d04bef18;hpb=b96aeec0aa41e81c1fce82ba095486b05d601b31;p=kivitendo-erp.git diff --git a/bin/mozilla/am.pl b/bin/mozilla/am.pl index 5a3b74223..8ef12063a 100644 --- a/bin/mozilla/am.pl +++ b/bin/mozilla/am.pl @@ -614,207 +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(); - - my $form = $main::form; - - $main::auth->assert('config'); - - $form->{title} = "Add"; - - $form->{callback} = "am.pl?action=add_language" unless $form->{callback}; - - &language_header; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub edit_language { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - - $main::auth->assert('config'); - - $form->{title} = "Edit"; - - AM->get_language(\%myconfig, \%$form); - - &language_header; - - $form->{orphaned} = 1; - &form_footer; - - $main::lxdebug->leave_sub(); -} - -sub list_language { - $::lxdebug->enter_sub; - $::auth->assert('config'); - - AM->language(\%::myconfig, $::form); - - $::form->{callback} = "am.pl?action=list_language"; - $::form->{title} = $::locale->text('Languages'); - - $::form->header; - - print $::form->parse_html_template('am/language_list'); - - $::lxdebug->leave_sub; -} - -sub language_header { - $::lxdebug->enter_sub; - $::auth->assert('config'); - - # $locale->text('Add Language') - # $locale->text('Edit Language') - $::form->{title} = $::locale->text("$::form->{title} Language"); - - $::form->header; - - print $::form->parse_html_template('am/language_header', { - numberformats => [ '1,000.00', '1000.00', '1.000,00', '1000,00', "1'000.00" ], - dateformats => [ qw(mm/dd/yy dd/mm/yy dd.mm.yy yyyy-mm-dd) ], - }); - - $::lxdebug->leave_sub; -} - -sub save_language { - $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('Language missing!')); - $form->isblank("template_code", $locale->text('Template Code missing!')); - $form->isblank("article_code", $locale->text('Article Code missing!')); - AM->save_language(\%myconfig, \%$form); - $form->redirect($locale->text('Language saved!')); - - $main::lxdebug->leave_sub(); -} - -sub delete_language { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->delete_language(\%myconfig, \%$form); - $form->redirect($locale->text('Language deleted!')); - - $main::lxdebug->leave_sub(); -} - sub _build_cfg_options { my $form = $main::form; my %myconfig = %main::myconfig; @@ -1451,111 +1250,6 @@ sub delete_tax { $main::lxdebug->leave_sub(); } -sub add_price_factor { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->{title} = $locale->text('Add Price Factor'); - $form->{callback} ||= build_std_url('action=add_price_factor'); - - $form->header(); - print $form->parse_html_template('am/edit_price_factor'); - - $main::lxdebug->leave_sub(); -} - -sub edit_price_factor { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - $form->{title} = $locale->text('Edit Price Factor'); - $form->{callback} ||= build_std_url('action=add_price_factor'); - - AM->get_price_factor(\%myconfig, $form); - - $form->{factor} = $form->format_amount(\%myconfig, $form->{factor} * 1); - - $form->header(); - print $form->parse_html_template('am/edit_price_factor'); - - $main::lxdebug->leave_sub(); -} - -sub list_price_factors { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->get_all_price_factors(\%myconfig, \%$form); - - foreach my $current (@{ $form->{PRICE_FACTORS} }) { - $current->{factor} = $form->format_amount(\%myconfig, $current->{factor} * 1); - } - - $form->{callback} = build_std_url('action=list_price_factors'); - $form->{title} = $locale->text('Price Factors'); - $form->{url_base} = build_std_url('callback'); - - $form->header(); - print $form->parse_html_template('am/list_price_factors'); - - $main::lxdebug->leave_sub(); -} - -sub save_price_factor { - $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!')); - $form->isblank("factor", $locale->text('Factor missing!')); - - $form->{factor} = $form->parse_amount(\%myconfig, $form->{factor}); - - AM->save_price_factor(\%myconfig, $form); - - $form->{callback} .= '&MESSAGE=' . $form->escape($locale->text('Price factor saved!')) if ($form->{callback}); - - $form->redirect($locale->text('Price factor saved!')); - - $main::lxdebug->leave_sub(); -} - -sub delete_price_factor { - $main::lxdebug->enter_sub(); - - my $form = $main::form; - my %myconfig = %main::myconfig; - my $locale = $main::locale; - - $main::auth->assert('config'); - - AM->delete_price_factor(\%myconfig, \%$form); - - $form->{callback} .= '&MESSAGE=' . $form->escape($locale->text('Price factor deleted!')) if ($form->{callback}); - - $form->redirect($locale->text('Price factor deleted!')); - - $main::lxdebug->leave_sub(); -} - sub add_warehouse { $main::lxdebug->enter_sub();