}
sub list_lead {
- $main::lxdebug->enter_sub();
-
- my $form = $main::form;
- my %myconfig = %main::myconfig;
- my $locale = $main::locale;
-
- $main::auth->assert('config');
-
- AM->lead(\%myconfig, \%$form);
-
- $form->{callback} = "am.pl?action=list_lead";
-
- my $callback = $form->escape($form->{callback});
-
- $form->{title} = $locale->text('Lead');
-
- my @column_index = qw(description cost profit);
- my %column_header;
- $column_header{description} =
- qq|<th class=listheading width=100%>|
- . $locale->text('Description')
- . qq|</th>|;
-
- $form->header;
-
- print qq|
-<body>
-
-<table width=100%>
- <tr>
- <th class=listtop>$form->{title}</th>
- </tr>
- <tr height="5"></tr>
- <tr class=listheading>
-|;
-
- map { print "$column_header{$_}\n" } @column_index;
-
- print qq|
- </tr>
-|;
-
- my ($i, %column_data);
- foreach my $ref (@{ $form->{ALL} }) {
-
- $i++;
- $i %= 2;
-
- print qq|
- <tr valign=top class=listrow$i>
-|;
-
-# $lead = $ref->{lead};
-
- $column_data{description} = qq|<td><a href="am.pl?action=edit_lead&id=$ref->{id}&callback=$callback">$ref->{lead}</td>|;
-
- map { print "$column_data{$_}\n" } @column_index;
-
- print qq|
- </tr>
-|;
- }
-
- print qq|
- <tr>
- <td><hr size=3 noshade></td>
- </tr>
-</table>
-
-<br>
-<form method=post action=am.pl>
+ $::lxdebug->enter_sub;
+ $::auth->assert('config');
-<input name=callback type=hidden value="$form->{callback}">
+ AM->lead(\%::myconfig, $::form);
-<input type=hidden name=type value=lead>
+ $::form->{callback} = "am.pl?action=list_lead";
+ $::form->{title} = $::locale->text('Lead');
-<input class=submit type=submit name=action value="|
- . $locale->text('Add') . qq|">
-
- </form>
-
- </body>
- </html>
-|;
+ $::form->header;
+ print $::form->parse_html_template('am/lead_list');
- $main::lxdebug->leave_sub();
+ $::lxdebug->leave_sub;
}
sub lead_header {
--- /dev/null
+[%- USE T8 %]
+[%- USE HTML %]
+[%- USE LxERP %]
+[%- USE L %]
+<body>
+
+<table width=100%>
+ <tr>
+ <th class=listtop>[% title | html %]</th>
+ </tr>
+ <tr height="5"></tr>
+ <tr class=listheading>
+ <th class=listheading width=100%>[% 'Description' | $T8 %]</th>
+ </tr>
+[%- FOREACH row = ALL %]
+ <tr valign=top class=listrow[% loop.count % 2 %]>
+ <td><a href="am.pl?action=edit_lead&id=[% row.id | html %]&callback=[% callback | html %]">[% row.lead | html %]</a></td>
+ </tr>
+[%- END %]
+ <tr>
+ <td><hr size=3 noshade></td>
+ </tr>
+</table>
+
+<br>
+<form method=post action=am.pl>
+
+<input name=callback type=hidden value="[% callback | html %]">
+<input type=hidden name=type value=lead>
+<input class=submit type=submit name=action value="[% 'Add' | $T8 %]">
+
+ </form>
+
+ </body>
+ </html>