merging RT 4.0.6
[freeside.git] / httemplate / edit / ftp_target.html
1 <& elements/edit.html,
2   'post_url'    => popurl(1).'process/ftp_target.html',
3   'name'        => 'FTP target',
4   'table'       => 'ftp_target',
5   'viewall_url' => "${p}browse/ftp_target.html",
6   'labels'      => { targetnum => 'Target',
7                      hostname  => 'Server',
8                      username  => 'Username',
9                      password  => 'Password',
10                      path      => 'Directory',
11                      port      => 'Port',
12                      secure    => 'Use SFTP',
13                      handling  => 'Special handling',
14                    },
15   'fields'      => [
16                      { field => 'hostname', size => 40 },
17                      { field => 'port', size => 8 },
18                      { field => 'secure', type => 'checkbox', value => 'Y' },
19                      'username',
20                      'password',
21                      { field => 'path', size => 40 },
22                      { field => 'handling', 
23                        type => 'select',
24                        options => [ FS::ftp_target->handling_types ],
25                      },
26                    ],
27   'menubar'     => \@menubar,
28   'edit_callback' => $edit_callback,
29 &>
30 <%init>
31
32 my $curuser = $FS::CurrentUser::CurrentUser;
33
34 die "access denied"
35   unless $curuser->access_right('Configuration');
36
37 my @menubar = ('View all FTP targets' => $p.'browse/ftp_target.html');
38 my $edit_callback = sub {
39   my ($cgi, $object) = @_;
40   if ( $object->targetnum ) {
41     push @menubar, 'Delete this target', 
42                    $p.'misc/delete-ftp_target.html?'.$object->targetnum;
43   }
44 };
45
46 </%init>