summaryrefslogtreecommitdiff
path: root/httemplate/edit/process
diff options
context:
space:
mode:
authorIvan Kohler <ivan@freeside.biz>2014-12-04 10:37:16 -0800
committerIvan Kohler <ivan@freeside.biz>2014-12-04 10:37:16 -0800
commit8dd41f364aaba88969dfd0908feb22709025e7f6 (patch)
tree471cb3796019d873da648413d88ca70a657414ed /httemplate/edit/process
parenta2df4ef9575be1ae2f1f5b9089f121316f796bac (diff)
parentbf50a8356a7344b4f75c7bc7f952019b98867f26 (diff)
Merge branch 'master' of git.freeside.biz:/home/git/freeside
Diffstat (limited to 'httemplate/edit/process')
-rw-r--r--httemplate/edit/process/bulk-part_pkg-fcc.html6
-rw-r--r--httemplate/edit/process/circuit_provider.html11
-rw-r--r--httemplate/edit/process/circuit_termination.html11
-rw-r--r--httemplate/edit/process/circuit_type.html11
-rw-r--r--httemplate/edit/process/credit-cust_bill_pkg.html26
-rwxr-xr-xhttemplate/edit/process/cust_credit.cgi17
-rw-r--r--httemplate/edit/process/elements/svc_Common.html2
-rw-r--r--httemplate/edit/process/part_event.html15
-rw-r--r--httemplate/edit/process/svc_circuit.html11
9 files changed, 85 insertions, 25 deletions
diff --git a/httemplate/edit/process/bulk-part_pkg-fcc.html b/httemplate/edit/process/bulk-part_pkg-fcc.html
index 4a0fb2a22..8ef330829 100644
--- a/httemplate/edit/process/bulk-part_pkg-fcc.html
+++ b/httemplate/edit/process/bulk-part_pkg-fcc.html
@@ -17,7 +17,7 @@
% }
<% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?redirect='.$session) %>
% } else {
-<% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?classnum='.$classnum) %>
+<% $cgi->redirect($fsurl.'browse/part_pkg-fcc.html?classnum='.$classnum.$jump) %>
% }
<%init>
my $curuser = $FS::CurrentUser::CurrentUser;
@@ -40,4 +40,8 @@ foreach my $param ($cgi->param) {
my $classnum = $cgi->param('classnum');
+my $jump = '';
+if ( $cgi->param('jump') =~ /^pkgpart(\d+)$/ ) {
+ $jump = '#'.$1;
+}
</%init>
diff --git a/httemplate/edit/process/circuit_provider.html b/httemplate/edit/process/circuit_provider.html
new file mode 100644
index 000000000..0a91a178d
--- /dev/null
+++ b/httemplate/edit/process/circuit_provider.html
@@ -0,0 +1,11 @@
+<& elements/process.html,
+ 'table' => 'circuit_provider',
+ 'viewall_dir' => 'browse',
+ 'popup_reload' => 'Updating',
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/process/circuit_termination.html b/httemplate/edit/process/circuit_termination.html
new file mode 100644
index 000000000..94d29c05c
--- /dev/null
+++ b/httemplate/edit/process/circuit_termination.html
@@ -0,0 +1,11 @@
+<& elements/process.html,
+ 'table' => 'circuit_termination',
+ 'viewall_dir' => 'browse',
+ 'popup_reload' => 'Updating',
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/process/circuit_type.html b/httemplate/edit/process/circuit_type.html
new file mode 100644
index 000000000..58f461e2c
--- /dev/null
+++ b/httemplate/edit/process/circuit_type.html
@@ -0,0 +1,11 @@
+<& elements/process.html,
+ 'table' => 'circuit_type',
+ 'viewall_dir' => 'browse',
+ 'popup_reload' => 'Updating',
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Configuration');
+
+</%init>
diff --git a/httemplate/edit/process/credit-cust_bill_pkg.html b/httemplate/edit/process/credit-cust_bill_pkg.html
index 8e66368d4..75900bde5 100644
--- a/httemplate/edit/process/credit-cust_bill_pkg.html
+++ b/httemplate/edit/process/credit-cust_bill_pkg.html
@@ -27,19 +27,35 @@ foreach my $billpkgnum_setuprecur (@billpkgnum_setuprecurs) {
push @amounts, $amount;
}
-my $error = FS::cust_credit->credit_lineitems(
+my $reasonnum = $cgi->param('reasonnum');
+$reasonnum =~ /^(-?\d+)$/ or die "Illegal reasonnum";
+$reasonnum = $1;
+
+my $error;
+if ($reasonnum == -1) {
+ my $new_reason = FS::reason->new({
+ map { $_ => scalar( $cgi->param("select_reason_new_$_") ) }
+ qw( reason_type reason )
+ });
+ $error = $new_reason->insert;
+ $reasonnum = $new_reason->reasonnum;
+}
+
+if ( !$reasonnum ) {
+ $error ||= 'Reason required'
+}
+
+$error ||= FS::cust_credit->credit_lineitems(
#the lineitems to credit
'billpkgnums' => \@billpkgnums,
'setuprecurs' => \@setuprecurs,
'amounts' => \@amounts,
'apply' => ( $cgi->param('apply') eq 'yes' ),
+ 'reasonnum' => $reasonnum,
- #the credit
- 'newreasonnum' => scalar($cgi->param('newreasonnum')),
- 'newreasonnum_type' => scalar($cgi->param('newreasonnumT')),
map { $_ => scalar($cgi->param($_)) }
#fields('cust_credit')
- qw( custnum _date amount reason reasonnum addlinfo ), #pkgnum eventnum
+ qw( custnum _date amount addlinfo ), #pkgnum eventnum
);
</%init>
diff --git a/httemplate/edit/process/cust_credit.cgi b/httemplate/edit/process/cust_credit.cgi
index 245f31af7..e442d7fa6 100755
--- a/httemplate/edit/process/cust_credit.cgi
+++ b/httemplate/edit/process/cust_credit.cgi
@@ -1,5 +1,4 @@
%if ( $error ) {
-% $cgi->param('reasonnum', $reasonnum);
% $cgi->param('error', $error);
% $dbh->rollback if $oldAutoCommit;
%
@@ -37,19 +36,11 @@ my $oldAutoCommit = $FS::UID::AutoCommit;
local $FS::UID::AutoCommit = 0;
my $dbh = dbh;
-my $error = '';
-if ($reasonnum == -1) {
-
- $error = 'Enter a new reason (or select an existing one)'
- unless $cgi->param('newreasonnum') !~ /^\s*$/;
- my $reason = new FS::reason {
- 'reason_type' => scalar($cgi->param('newreasonnumT')),
- 'reason' => scalar($cgi->param('newreasonnum')),
- };
- $error ||= $reason->insert;
- $cgi->param('reasonnum', $reason->reasonnum)
- unless $error;
+my ($reasonnum, $error) = $m->comp('/misc/process/elements/reason');
+if (!$reasonnum) {
+ $error ||= 'Reason required'
}
+$cgi->param('reasonnum', $reasonnum) unless $error;
unless ($error) {
my $new = new FS::cust_credit ( {
diff --git a/httemplate/edit/process/elements/svc_Common.html b/httemplate/edit/process/elements/svc_Common.html
index 55ecc5f79..ca336a126 100644
--- a/httemplate/edit/process/elements/svc_Common.html
+++ b/httemplate/edit/process/elements/svc_Common.html
@@ -29,7 +29,7 @@ my $args_callback = sub {
map { $_ => $cgi->param("router_$_") }
qw( routernum routername blocknum )
});
- if (length($router->routername) == 0) {
+ if ($router->blocknum and length($router->routername) == 0) {
#sensible default
$router->set('routername', $svc->label);
}
diff --git a/httemplate/edit/process/part_event.html b/httemplate/edit/process/part_event.html
index 481439d53..bac69241c 100644
--- a/httemplate/edit/process/part_event.html
+++ b/httemplate/edit/process/part_event.html
@@ -62,12 +62,17 @@
my $value = join(',', $cgi->param( "$prefix$option" ) );
if ( $option eq 'reasonnum' && $value == -1 ) {
- $value = {
- 'typenum' => scalar( $cgi->param( "new$prefix${option}T" ) ),
- 'reason' => scalar( $cgi->param( "new$prefix${option}" ) ),
- };
+ my $reason_prefix = $object->action . '_' . $option . '_new_';
+ my $new_reason = FS::reason->new;
+ foreach ( qw( reason_type reason unsuspend pkgpart
+ unsuspend_hold unused_credit ) ) {
+ $new_reason->set($_, $cgi->param("$reason_prefix$_"));
+ }
+ warn Dumper $new_reason;
+ my $error = $new_reason->insert;
+ die "error creating reason: $error" if $error;
+ $value = $new_reason->reasonnum;
}
-
( $option => $value );
}
@{ $object->option_fields_listref };
diff --git a/httemplate/edit/process/svc_circuit.html b/httemplate/edit/process/svc_circuit.html
new file mode 100644
index 000000000..d28f91329
--- /dev/null
+++ b/httemplate/edit/process/svc_circuit.html
@@ -0,0 +1,11 @@
+<& elements/svc_Common.html,
+ table => 'svc_circuit',
+ edit_ext => 'html',
+ redirect => popurl(3)."view/svc_circuit.html?",
+&>
+<%init>
+
+die "access denied"
+ unless $FS::CurrentUser::CurrentUser->access_right('Provision customer service'); #something else more specific?
+
+</%init>