summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
Diffstat (limited to 'httemplate/edit/process')
-rwxr-xr-xhttemplate/edit/process/REAL_cust_pkg.cgi5
-rw-r--r--httemplate/edit/process/mailinglistmember.html6
-rwxr-xr-xhttemplate/edit/process/rate_region.cgi2
-rwxr-xr-xhttemplate/edit/process/svc_acct.cgi33
-rwxr-xr-xhttemplate/edit/process/svc_domain.cgi30
-rw-r--r--httemplate/edit/process/svc_external.html10
-rw-r--r--httemplate/edit/process/svc_mailinglist.html11
-rw-r--r--httemplate/edit/process/svc_phone.html19
8 files changed, 101 insertions, 15 deletions
diff --git a/httemplate/edit/process/REAL_cust_pkg.cgi b/httemplate/edit/process/REAL_cust_pkg.cgi
index 22aab44e8..b5796ebf5 100755
--- a/httemplate/edit/process/REAL_cust_pkg.cgi
+++ b/httemplate/edit/process/REAL_cust_pkg.cgi
@@ -39,14 +39,15 @@ push @errors, '_setup_areyousure'
&& ! $cgi->param('setup_areyousure'); # and it wasn't confirmed
push @errors, '_start'
- if $hash{'start_date'} && $old->start_date # if a start date was added
- && $hash{'setup'}; # but there's a setup date
+ if $hash{'start_date'} && !$old->start_date # if a start date was added
+ && $hash{'setup'}; # but there's a setup date
my $new;
my $error;
if ( @errors ) {
$error = join(',', @errors);
} else {
+ warn join(',',%hash);
$new = new FS::cust_pkg \%hash;
$error = $new->replace($old);
}
diff --git a/httemplate/edit/process/mailinglistmember.html b/httemplate/edit/process/mailinglistmember.html
new file mode 100644
index 000000000..f1842b8ef
--- /dev/null
+++ b/httemplate/edit/process/mailinglistmember.html
@@ -0,0 +1,6 @@
+<% include( 'elements/process.html',
+ 'table' => 'mailinglistmember',
+ 'popup_reload' => 'Member added',
+ )
+%>
+%#XXX ACL
diff --git a/httemplate/edit/process/rate_region.cgi b/httemplate/edit/process/rate_region.cgi
index 882991e9d..8036f7388 100755
--- a/httemplate/edit/process/rate_region.cgi
+++ b/httemplate/edit/process/rate_region.cgi
@@ -39,7 +39,7 @@ my @dest_detail = map {
new FS::rate_detail {
'ratenum' => $ratenum,
map { $_ => $cgi->param("$_$ratenum") }
- qw( min_included min_charge sec_granularity classnum )
+ qw( min_included conn_charge conn_sec min_charge sec_granularity classnum )
};
} qsearch('rate', {} );
diff --git a/httemplate/edit/process/svc_acct.cgi b/httemplate/edit/process/svc_acct.cgi
index 515d89e91..0d2c007f1 100755
--- a/httemplate/edit/process/svc_acct.cgi
+++ b/httemplate/edit/process/svc_acct.cgi
@@ -11,7 +11,6 @@ die "access denied"
$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
my $svcnum = $1;
-my $error;
my $old;
if ( $svcnum ) {
@@ -32,6 +31,18 @@ foreach (map { $_,$_."_threshold" } qw( upbytes downbytes totalbytes )) {
$cgi->param($_, FS::UI::bytecount::parse_bytecount($cgi->param($_)) );
}
+#unmunge cgp_accessmodes (falze laziness-ish w/part_svc.pm::process &svc_domain)
+unless ( $cgi->param('cgp_accessmodes') ) {
+ $cgi->param('cgp_accessmodes',
+ join(' ',
+ sort map { /^cgp_accessmodes_([\w\/]+)$/ or die "no way"; $1; }
+ grep $cgi->param($_),
+ grep /^cgp_accessmodes_([\w\/]+)$/,
+ $cgi->param()
+ )
+ );
+}
+
my %hash = $svcnum ? $old->hash : ();
map {
$hash{$_} = scalar($cgi->param($_));
@@ -40,27 +51,31 @@ map {
} (fields('svc_acct'), qw ( pkgnum svcpart usergroup ));
my $new = new FS::svc_acct ( \%hash );
+my $error = '';
+
$new->_password($old->_password) if $old;
-if( $cgi->param('clear_password') eq '*HIDDEN*'
- or $cgi->param('clear_password') =~ /^\(.* encrypted\)$/ ) {
+if ( $cgi->param('clear_password') eq '*HIDDEN*'
+ || $cgi->param('clear_password') =~ /^\(.* encrypted\)$/ ) {
die "fatal: no previous account to recall hidden password from!" unless $old;
-}
-else {
+} else {
$error = $new->set_password($cgi->param('clear_password'));
}
if ( $svcnum ) {
- foreach (grep { $old->$_ != $new->$_ } qw( seconds upbytes downbytes totalbytes )) {
+ foreach ( grep { $old->$_ != $new->$_ }
+ qw( seconds upbytes downbytes totalbytes )
+ )
+ {
my %hash = map { $_ => $new->$_ }
grep { $new->$_ }
qw( seconds upbytes downbytes totalbytes );
- $error = $new->set_usage(\%hash); #unoverlimit and trigger radius changes
- last; #once is enough
+ $error ||= $new->set_usage(\%hash); #unoverlimit and trigger radius changes
+ last; #once is enough
}
$error ||= $new->replace($old);
} else {
- $error = $new->insert;
+ $error ||= $new->insert;
$svcnum = $new->svcnum;
}
diff --git a/httemplate/edit/process/svc_domain.cgi b/httemplate/edit/process/svc_domain.cgi
index 59b518097..381339bc8 100755
--- a/httemplate/edit/process/svc_domain.cgi
+++ b/httemplate/edit/process/svc_domain.cgi
@@ -15,6 +15,30 @@ $FS::svc_domain::whois_hack = 1;
$cgi->param('svcnum') =~ /^(\d*)$/ or die "Illegal svcnum!";
my $svcnum = $1;
+#unmunge cgp_accessmodes (falze laziness-ish w/part_svc.pm::process & svc_acct)
+unless ( $cgi->param('cgp_accessmodes') ) {
+ $cgi->param('cgp_accessmodes',
+ join(' ',
+ sort map { /^cgp_accessmodes_([\w\/]+)$/ or die "no way"; $1; }
+ grep $cgi->param($_),
+ grep /^cgp_accessmodes_([\w\/]+)$/,
+ $cgi->param()
+ )
+ );
+}
+
+#unmunge acct_def_cgp_accessmodes (falze laziness-ahoy)
+unless ( $cgi->param('acct_def_cgp_accessmodes') ) {
+ $cgi->param('acct_def_cgp_accessmodes',
+ join(' ',
+ sort map { /^acct_def_cgp_accessmodes_([\w\/]+)$/ or die "no way"; $1; }
+ grep $cgi->param($_),
+ grep /^acct_def_cgp_accessmodes_([\w\/]+)$/,
+ $cgi->param()
+ )
+ );
+}
+
my $new = new FS::svc_domain ( {
map {
$_, scalar($cgi->param($_));
@@ -24,10 +48,10 @@ my $new = new FS::svc_domain ( {
my $error = '';
if ($cgi->param('svcnum')) {
- $error="Can't modify a domain!";
+ $error = $new->replace();
} else {
- $error=$new->insert;
- $svcnum=$new->svcnum;
+ $error = $new->insert;
+ $svcnum = $new->svcnum;
}
</%init>
diff --git a/httemplate/edit/process/svc_external.html b/httemplate/edit/process/svc_external.html
new file mode 100644
index 000000000..3515afc4b
--- /dev/null
+++ b/httemplate/edit/process/svc_external.html
@@ -0,0 +1,10 @@
+<% include( 'elements/svc_Common.html',
+ 'table' => 'svc_external',
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+</%init>
diff --git a/httemplate/edit/process/svc_mailinglist.html b/httemplate/edit/process/svc_mailinglist.html
new file mode 100644
index 000000000..580f6ccbd
--- /dev/null
+++ b/httemplate/edit/process/svc_mailinglist.html
@@ -0,0 +1,11 @@
+<% include( 'elements/svc_Common.html',
+ 'table' => 'svc_mailinglist',
+ 'fields' => [ fields('svc_mailinglist'), 'listname' ],
+ )
+%>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+</%init>
diff --git a/httemplate/edit/process/svc_phone.html b/httemplate/edit/process/svc_phone.html
index 27a703cdf..e02ec5ccc 100644
--- a/httemplate/edit/process/svc_phone.html
+++ b/httemplate/edit/process/svc_phone.html
@@ -1,5 +1,6 @@
<% include( 'elements/svc_Common.html',
'table' => 'svc_phone',
+ 'args_callback' => $args_callback,
)
%>
<%init>
@@ -7,4 +8,22 @@
die "access denied"
unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+my $args_callback = sub {
+ my( $cgi, $object ) = @_;
+
+ my %opt = ();
+ if ( $cgi->param('locationnum') == -1 ) {
+ my $cust_location = new FS::cust_location {
+ map { $_ => scalar($cgi->param($_)) }
+ qw( custnum address1 address2 city county state zip country )
+ };
+ $opt{'cust_location'} = $cust_location;
+ }
+
+ %opt;
+
+};
+
+
+
</%init>