projects
/
freeside.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
e92c3b7
)
RT# 73993 - Updated process to display only packages customer has access to.
author
Christopher Burger
<burgerc@freeside.biz>
Thu, 1 Jun 2017 14:21:48 +0000
(10:21 -0400)
committer
Christopher Burger
<burgerc@freeside.biz>
Thu, 1 Jun 2017 14:21:48 +0000
(10:21 -0400)
FS/FS/ClientAPI/MyAccount.pm
patch
|
blob
|
history
ng_selfservice/packages_change.php
patch
|
blob
|
history
ng_selfservice/process_packages_change.php
patch
|
blob
|
history
ng_selfservice/services.php
patch
|
blob
|
history
diff --git
a/FS/FS/ClientAPI/MyAccount.pm
b/FS/FS/ClientAPI/MyAccount.pm
index
7df481e
..
8c082ec
100644
(file)
--- a/
FS/FS/ClientAPI/MyAccount.pm
+++ b/
FS/FS/ClientAPI/MyAccount.pm
@@
-2581,10
+2581,14
@@
sub change_pkg {
my $err_or_cust_pkg = $cust_pkg->change( 'pkgpart' => $p->{'pkgpart'},
'quantity' => $p->{'quantity'} || 1,
);
my $err_or_cust_pkg = $cust_pkg->change( 'pkgpart' => $p->{'pkgpart'},
'quantity' => $p->{'quantity'} || 1,
);
+
+ my $new_pkg = qsearchs('part_pkg', { 'pkgpart' => $p->{pkgpart} } )
+ or return { 'error' => "unknown package $p->{pkgpart}" };
return { error=>$err_or_cust_pkg, pkgnum=>$cust_pkg->pkgnum }
unless ref($err_or_cust_pkg);
return { error=>$err_or_cust_pkg, pkgnum=>$cust_pkg->pkgnum }
unless ref($err_or_cust_pkg);
+
if ( $conf->exists('signup_server-realtime') ) {
my $bill_error = _do_bop_realtime( $cust_main, $status, 'no_invoice_void'=>1 );
if ( $conf->exists('signup_server-realtime') ) {
my $bill_error = _do_bop_realtime( $cust_main, $status, 'no_invoice_void'=>1 );
@@
-2600,7
+2604,7
@@
sub change_pkg {
$err_or_cust_pkg->reexport;
}
$err_or_cust_pkg->reexport;
}
- return { error => '', pkg
num => $
cust_pkg->pkgnum };
+ return { error => '', pkg
=> $new_pkg->pkg, pkgnum => $err_or_
cust_pkg->pkgnum };
}
}
diff --git
a/ng_selfservice/packages_change.php
b/ng_selfservice/packages_change.php
index
8b4386c
..
876f6cd
100644
(file)
--- a/
ng_selfservice/packages_change.php
+++ b/
ng_selfservice/packages_change.php
@@
-6,32
+6,20
@@
$customer_info = $freeside->customer_info_short( array(
'session_id' => $_COOKIE['session_id'],
) );
'session_id' => $_COOKIE['session_id'],
) );
-$list_pkgs = $freeside->list_pkgs( array(
- 'session_id' => $_COOKIE['session_id'],
-) );
-
-if ( isset($list_pkgs['error']) && $list_pkgs['error'] ) {
- $error = $list_pkgs['error'];
- header('Location:index.php?error='. urlencode($error));
- die();
+foreach ( $cust_pkg AS $pkg ) {
+ $part_pkg .= $pkg[pkgpart];
+ $class_num .= $pkg[classnum];
}
}
-extract($list_pkgs);
-
-$get_params = array( 'pkgnum', 'pkg' );
+$get_params = array( 'pkgnum', 'pkg', 'classnum', 'pkgpart' );
foreach ( $get_params AS $param ) {
$params[$param] = $_GET[$param];
}
foreach ( $get_params AS $param ) {
$params[$param] = $_GET[$param];
}
-$pkgnum = $_GET['pkgnum'];
-$pkg = $_GET['pkg'];
-
$pkgselect = $freeside->mason_comp( array(
'session_id' => $_COOKIE['session_id'],
'comp' => '/elements/select-part_pkg.html',
$pkgselect = $freeside->mason_comp( array(
'session_id' => $_COOKIE['session_id'],
'comp' => '/elements/select-part_pkg.html',
- 'args' => array( 'custnum' => $customer_info['custnum'],
- 'curr_value' => 'current_value',
- ),
+ 'args' => [ 'classnum', $params['classnum'], 'curr_value', $params['pkgpart'], ],
)
);
)
);
@@
-53,7
+41,7
@@
function enable_change_pkg () {
}
</SCRIPT>
}
</SCRIPT>
-<FONT SIZE=4>Purchase replacement package for "<? echo $p
kg
; ?>"</FONT><BR><BR>
+<FONT SIZE=4>Purchase replacement package for "<? echo $p
arams['pkg']
; ?>"</FONT><BR><BR>
<? include('elements/error.php'); ?>
<? include('elements/error.php'); ?>
diff --git
a/ng_selfservice/process_packages_change.php
b/ng_selfservice/process_packages_change.php
index
114cc6b
..
3ea655e
100644
(file)
--- a/
ng_selfservice/process_packages_change.php
+++ b/
ng_selfservice/process_packages_change.php
@@
-53,8
+53,6
@@
if ( ! $results['error'] ) {
$results = $freeside->change_pkg($change_pkg);
$results = $freeside->change_pkg($change_pkg);
- echo $results;
-
}
# if ( $results->{'error'} ) {
}
# if ( $results->{'error'} ) {
@@
-83,7
+81,7
@@
if ( isset($results['error']) && $results['error'] ) {
?>
<? include('elements/error.php'); ?>
?>
<? include('elements/error.php'); ?>
-<FONT SIZE=4>Package
Changed Su for "<? echo $pkg
; ?>"</FONT><BR><BR>
+<FONT SIZE=4>Package
Successfully Changed To "<? echo $results['pkg']
; ?>"</FONT><BR><BR>
<? include('elements/menu_footer.php'); ?>
<? include('elements/footer.php'); ?>
\ No newline at end of file
<? include('elements/menu_footer.php'); ?>
<? include('elements/footer.php'); ?>
\ No newline at end of file
diff --git
a/ng_selfservice/services.php
b/ng_selfservice/services.php
index
25fbdde
..
987e582
100644
(file)
--- a/
ng_selfservice/services.php
+++ b/
ng_selfservice/services.php
@@
-33,7
+33,7
@@
extract($list_pkgs);
$change_link = '';
if ( in_array("Change packages", $menu_disable) == 0) {
$change_link = '';
if ( in_array("Change packages", $menu_disable) == 0) {
- $change_link = '<a href="packages_change.php?pkgnum=' . $pkg['pkgnum'] . '&pkg=' . $pkg['pkg_label'] . '">[change]</a>';
+ $change_link = '<a href="packages_change.php?pkgnum=' . $pkg['pkgnum'] . '&pkg=' . $pkg['pkg_label'] . '
&pkgpart=' . $pkg['pkgpart'] . '&classnum=' . $pkg['classnum'] . '
">[change]</a>';
}
?>
<TR>
}
?>
<TR>