summaryrefslogtreecommitdiff
path: root/httemplate/edit
diff options
context:
space:
mode:
authorMark Wells <mark@freeside.biz>2012-06-13 16:18:49 -0700
committerMark Wells <mark@freeside.biz>2012-06-13 16:18:49 -0700
commit9ef78be87df0f0f880ff5d903ed6243b67369cf0 (patch)
treee69278b1e33baf2b9c0356ed31435fc0f0188b01 /httemplate/edit
parentdaa09251fec52517b630b3f6935041dc7c795f90 (diff)
table of FTP targets for invoice spool upload, #17620
Diffstat (limited to 'httemplate/edit')
-rwxr-xr-xhttemplate/edit/ftp_target.html46
-rw-r--r--httemplate/edit/process/ftp_target.html12
2 files changed, 58 insertions, 0 deletions
diff --git a/httemplate/edit/ftp_target.html b/httemplate/edit/ftp_target.html
new file mode 100755
index 000000000..aebf9aaed
--- /dev/null
+++ b/httemplate/edit/ftp_target.html
@@ -0,0 +1,46 @@
+<& elements/edit.html,
+ 'post_url' => popurl(1).'process/ftp_target.html',
+ 'name' => 'FTP target',
+ 'table' => 'ftp_target',
+ 'viewall_url' => "${p}browse/ftp_target.html",
+ 'labels' => { targetnum => 'Target',
+ hostname => 'Server',
+ username => 'Username',
+ password => 'Password',
+ path => 'Directory',
+ port => 'Port',
+ secure => 'Use SFTP',
+ handling => 'Special handling',
+ },
+ 'fields' => [
+ { field => 'hostname', size => 40 },
+ { field => 'port', size => 8 },
+ { field => 'secure', type => 'checkbox', value => 'Y' },
+ 'username',
+ 'password',
+ { field => 'path', size => 40 },
+ { field => 'handling',
+ type => 'select',
+ options => [ FS::ftp_target->handling_types ],
+ },
+ ],
+ 'menubar' => \@menubar,
+ 'edit_callback' => $edit_callback,
+&>
+<%init>
+
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied"
+ unless $curuser->access_right('Configuration');
+
+my @menubar = ('View all FTP targets' => $p.'browse/ftp_target.html');
+my $edit_callback = sub {
+ my ($cgi, $object) = @_;
+ if ( $object->targetnum ) {
+ push @menubar, 'Delete this target',
+ $p.'misc/delete-ftp_target.html?'.$object->targetnum;
+ }
+};
+
+</%init>
diff --git a/httemplate/edit/process/ftp_target.html b/httemplate/edit/process/ftp_target.html
new file mode 100644
index 000000000..35f56c490
--- /dev/null
+++ b/httemplate/edit/process/ftp_target.html
@@ -0,0 +1,12 @@
+<& elements/process.html,
+ 'table' => 'ftp_target',
+ 'viewall_dir' => 'browse',
+ 'agent_null' => 1,
+&>
+<%init>
+my $curuser = $FS::CurrentUser::CurrentUser;
+
+die "access denied"
+ unless $curuser->access_right('Configuration');
+
+</%init>