Projekt

Allgemein

Profil

« Zurück | Weiter » 

Revision fb6468fc

Von Sven Schöling vor fast 13 Jahren hinzugefügt

  • ID fb6468fcbb2662efb5f7490867417b735feb4d8a
  • Vorgänger 11549495
  • Nachfolger 99e420aa

am/list_lead nach template portiert

Unterschiede anzeigen:

bin/mozilla/am.pl
618 618
}
619 619

  
620 620
sub list_lead {
621
  $main::lxdebug->enter_sub();
622

  
623
  my $form     = $main::form;
624
  my %myconfig = %main::myconfig;
625
  my $locale   = $main::locale;
626

  
627
  $main::auth->assert('config');
628

  
629
  AM->lead(\%myconfig, \%$form);
630

  
631
  $form->{callback} = "am.pl?action=list_lead";
632

  
633
  my $callback = $form->escape($form->{callback});
634

  
635
  $form->{title} = $locale->text('Lead');
636

  
637
  my @column_index = qw(description cost profit);
638
  my %column_header;
639
  $column_header{description} =
640
      qq|<th class=listheading width=100%>|
641
    . $locale->text('Description')
642
    . qq|</th>|;
643

  
644
  $form->header;
645

  
646
  print qq|
647
<body>
648

  
649
<table width=100%>
650
  <tr>
651
    <th class=listtop>$form->{title}</th>
652
  </tr>
653
  <tr height="5"></tr>
654
  <tr class=listheading>
655
|;
656

  
657
  map { print "$column_header{$_}\n" } @column_index;
658

  
659
  print qq|
660
  </tr>
661
|;
662

  
663
  my ($i, %column_data);
664
  foreach my $ref (@{ $form->{ALL} }) {
665

  
666
    $i++;
667
    $i %= 2;
668

  
669
    print qq|
670
  <tr valign=top class=listrow$i>
671
|;
672

  
673
#    $lead = $ref->{lead};
674

  
675
    $column_data{description} = qq|<td><a href="am.pl?action=edit_lead&id=$ref->{id}&callback=$callback">$ref->{lead}</td>|;
676

  
677
    map { print "$column_data{$_}\n" } @column_index;
678

  
679
    print qq|
680
  </tr>
681
|;
682
  }
683

  
684
  print qq|
685
  <tr>
686
  <td><hr size=3 noshade></td>
687
  </tr>
688
</table>
689

  
690
<br>
691
<form method=post action=am.pl>
621
  $::lxdebug->enter_sub;
622
  $::auth->assert('config');
692 623

  
693
<input name=callback type=hidden value="$form->{callback}">
624
  AM->lead(\%::myconfig, $::form);
694 625

  
695
<input type=hidden name=type value=lead>
626
  $::form->{callback} = "am.pl?action=list_lead";
627
  $::form->{title}    = $::locale->text('Lead');
696 628

  
697
<input class=submit type=submit name=action value="|
698
    . $locale->text('Add') . qq|">
699

  
700
  </form>
701

  
702
  </body>
703
  </html>
704
|;
629
  $::form->header;
630
  print $::form->parse_html_template('am/lead_list');
705 631

  
706
  $main::lxdebug->leave_sub();
632
  $::lxdebug->leave_sub;
707 633
}
708 634

  
709 635
sub lead_header {
templates/webpages/am/lead_list.html
1
[%- USE T8 %]
2
[%- USE HTML %]
3
[%- USE LxERP %]
4
[%- USE L %]
5
<body>
6

  
7
<table width=100%>
8
  <tr>
9
    <th class=listtop>[% title | html %]</th>
10
  </tr>
11
  <tr height="5"></tr>
12
  <tr class=listheading>
13
    <th class=listheading width=100%>[% 'Description' | $T8 %]</th>
14
  </tr>
15
[%- FOREACH row = ALL  %]
16
  <tr valign=top class=listrow[% loop.count % 2 %]>
17
    <td><a href="am.pl?action=edit_lead&id=[% row.id | html %]&callback=[% callback | html %]">[% row.lead | html %]</a></td>
18
  </tr>
19
[%- END %]
20
  <tr>
21
  <td><hr size=3 noshade></td>
22
  </tr>
23
</table>
24

  
25
<br>
26
<form method=post action=am.pl>
27

  
28
<input name=callback type=hidden value="[% callback | html %]">
29
<input type=hidden name=type value=lead>
30
<input class=submit type=submit name=action value="[% 'Add' | $T8 %]">
31

  
32
  </form>
33

  
34
  </body>
35
  </html>

Auch abrufbar als: Unified diff