summaryrefslogtreecommitdiff
path: root/httemplate/browse/vend_main.html
blob: ef1c06021232e4d45e22e97654090a1b4f751b34 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
<& elements/browse.html,
     'title'              => 'Vendors',
     'html_init'          => $html_init,
     'name'               => 'vendors',
     'disableable'        => 1,
     'disabled_statuspos' => 2,
     'query'              => { 'table'     => 'vend_main',
                               'hashref'   => {},
                               'order_by' => 'ORDER BY vendname',
                             },
     'count_query'        => $count_query,
     'header'             => $header,
     'fields'             => $fields,
     'links'              => $links,
&>
<%init>

die "access denied"
  unless $FS::CurrentUser::CurrentUser->access_right('Configuration');

my $html_init =
  #'Vendors.<BR><BR>'.
  qq!<A HREF="${p}edit/vend_main.html"><I>Add a vendor</I></A><BR><BR>!;

my $count_query = 'SELECT COUNT(*) FROM vend_main';

my $link = [ $p.'edit/vend_main.html?', 'vendnum' ];
my $clink = [ $p.'edit/vend_class.html?', 'classnum' ];

my $header = [ '#', 'Vendor', 'Class', ];
my $fields = [ 'vendnum', 'vendname',
               sub { shift->vend_class->classname; }
             ];
my $links  = [ $link, $link, $clink ];

</%init>