-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();
-}
-