table of FTP targets for invoice spool upload, #17620
[freeside.git] / httemplate / browse / ftp_target.html
1 <& elements/browse.html,
2   'title'       => 'FTP targets',
3   'menubar'     => [ 'Add a target' => $p.'edit/ftp_target.html', ],
4   'name'        => 'FTP targets',
5   'query'       => { 'table'   => 'ftp_target',
6                      'hashref' => {},
7                    },
8   'count_query' => $count_query,
9   'header'      => [ '#',
10                      'Server',
11                      'Username',
12                      'Password',
13                      'Path',
14                      'Protocol',
15                      '', #handling
16                    ],
17   'fields'      => [ 'targetnum',
18                      'hostname',
19                      'username',
20                      'password',
21                      'path',
22                      sub { 
23                        my $ftp_target = shift;
24                        my $label;
25                        if ($ftp_target->secure) {
26                          $label = 'SFTP';
27                          $label .= ' (port '.$ftp_target->port.')'
28                            if $ftp_target->port != 22;
29                        }
30                        else {
31                          $label = 'FTP';
32                          $label .= ' (port '.$ftp_target->port.')'
33                            if $ftp_target->port != 21;
34                        }
35                        $label;
36                      },
37                      'handling',
38                    ],
39   'links'       => [ $link, $link ],
40 &>
41 </TABLE>
42
43 <% include('/elements/footer.html') %>
44
45 <%once>
46
47 my $count_query = 'SELECT COUNT(*) FROM ftp_target';
48
49 </%once>
50 <%init>
51
52 die "access denied"
53   unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
54
55 my $link = [ $p.'edit/ftp_target.html?', 'targetnum' ];
56 </%init>