diff options
author | ivan <ivan> | 2009-01-10 23:56:59 +0000 |
---|---|---|
committer | ivan <ivan> | 2009-01-10 23:56:59 +0000 |
commit | 705f7d564546e7211844773f3566a89f0ae87a2c (patch) | |
tree | c9210d7215cce0870207f9865dd8e9c981f63037 /httemplate/view/cust_main/packages | |
parent | a661ced3f9f678a645780eaa0b183d2de5f100fa (diff) |
implement package changes w/location change, RT#4499
Diffstat (limited to 'httemplate/view/cust_main/packages')
-rw-r--r-- | httemplate/view/cust_main/packages/location.html | 23 | ||||
-rw-r--r-- | httemplate/view/cust_main/packages/package.html | 12 |
2 files changed, 30 insertions, 5 deletions
diff --git a/httemplate/view/cust_main/packages/location.html b/httemplate/view/cust_main/packages/location.html index 0f58b36fc..3c641304a 100644 --- a/httemplate/view/cust_main/packages/location.html +++ b/httemplate/view/cust_main/packages/location.html @@ -19,17 +19,40 @@ </I> +% if ($FS::CurrentUser::CurrentUser->access_right('Change customer package')) { + <FONT SIZE=-1> + ( <%pkg_change_location_link($cust_pkg)%> ) + </FONT> +% } + </TD> <%init> my %opt = @_; +my $conf = new FS::Conf; + my $bgcolor = $opt{'bgcolor'}; my $cust_pkg = $opt{'cust_pkg'}; my $part_pkg = $opt{'part_pkg'}; my $conf = new FS::Conf; my $countrydefault = $conf->config('countrydefault') || 'US'; +my $statedefault = $conf->config('statedefault') + || ($countrydefault eq 'US' ? 'CA' : ''); my $loc = $cust_pkg->cust_location_or_main; +sub pkg_change_location_link { + my $cust_pkg = shift; + my $pkgpart = $cust_pkg->pkgpart; + include( '/elements/popup_link-cust_pkg.html', + 'action' => $p. "misc/change_pkg.cgi?locationnum=-1;pkgpart=$pkgpart;". + "address1=;address2=;city=;county=;state=$statedefault;". + "zip=;country=$countrydefault", + 'label' => 'Change location', + 'actionlabel' => 'Change', + 'cust_pkg' => $cust_pkg, + ); +} + </%init> diff --git a/httemplate/view/cust_main/packages/package.html b/httemplate/view/cust_main/packages/package.html index 4311d8cf2..b07e1af94 100644 --- a/httemplate/view/cust_main/packages/package.html +++ b/httemplate/view/cust_main/packages/package.html @@ -184,12 +184,14 @@ sub pkg_link { } sub pkg_change_link { + my $cust_pkg = shift; + my $locationnum = $cust_pkg->locationnum; include( '/elements/popup_link-cust_pkg.html', - 'action' => $p. 'misc/change_pkg.cgi?dummy=value', - 'label' => 'Change package', - 'actionlabel' => 'Change', - 'cust_pkg' => shift, - ) + 'action' => $p. "misc/change_pkg.cgi?locationnum=$locationnum", + 'label' => 'Change package', + 'actionlabel' => 'Change', + 'cust_pkg' => $cust_pkg, + ); } sub pkg_dates_link { pkg_link('edit/REAL_cust_pkg', 'Edit dates', @_ ); } |