From 71c6403be78e91e34d4124da35c9d0d284ad197d Mon Sep 17 00:00:00 2001 From: Ivan Kohler Date: Sat, 4 May 2013 00:19:30 -0700 Subject: merging is now attaching, RT#22185 --- httemplate/view/cust_main/packages/contact.html | 3 ++- httemplate/view/cust_main/packages/section.html | 12 +++++++++++- httemplate/view/cust_main/packages/status.html | 7 +++---- 3 files changed, 16 insertions(+), 6 deletions(-) (limited to 'httemplate/view') diff --git a/httemplate/view/cust_main/packages/contact.html b/httemplate/view/cust_main/packages/contact.html index 0c81eb39d..fe8b71534 100644 --- a/httemplate/view/cust_main/packages/contact.html +++ b/httemplate/view/cust_main/packages/contact.html @@ -6,6 +6,7 @@ % } % if ( $show_detach_link ) { + ( <%pkg_detach_link($cust_pkg)%> ) % } @@ -70,7 +71,7 @@ sub pkg_detach_link { 'actionlabel' => emt('Detach'), 'cust_pkg' => $cust_pkg, 'width' => 616, - 'height' => 676, + 'height' => 684, ); } diff --git a/httemplate/view/cust_main/packages/section.html b/httemplate/view/cust_main/packages/section.html index 5f54c0a36..391a13b5f 100755 --- a/httemplate/view/cust_main/packages/section.html +++ b/httemplate/view/cust_main/packages/section.html @@ -28,7 +28,7 @@ <& package.html, %iopt &> <& status.html, %iopt &> - <& contact.html, %iopt &> + <& contact.html, %iopt &>
<& location.html, %iopt &> <& services.html, %iopt &> @@ -59,6 +59,15 @@ my $packages = $opt{'packages'}; ( $a->getfield('pkgnum') <=> $b->getfield('pkgnum') ) } @$packages; +my %change_custnum = map { $_->change_custnum => 1 } + grep { $_->change_custnum } + grep { $_->getfield('cancel') } + @$packages; + +my $pkg_attached = ( scalar(keys %change_custnum) == 1 + && ! grep { ! $_->getfield('cancel') } @$packages + ); + my $countrydefault = scalar($conf->config('countrydefault')) || 'US'; my %conf_opt = ( @@ -67,6 +76,7 @@ my %conf_opt = ( || $curuser->option('cust_pkg-display_times')), #for status.html 'cust_pkg-show_autosuspend' => $conf->exists('cust_pkg-show_autosuspend'), + 'pkg_attached' => $pkg_attached, #for status.html pkg-balances 'pkg-balances' => $conf->exists('pkg-balances'), 'money_char' => ( $conf->config('money_char') || '$' ), diff --git a/httemplate/view/cust_main/packages/status.html b/httemplate/view/cust_main/packages/status.html index 24a4dfcd0..c0213e90b 100644 --- a/httemplate/view/cust_main/packages/status.html +++ b/httemplate/view/cust_main/packages/status.html @@ -365,9 +365,6 @@ sub pkg_status_row_changed { sub pkg_status_row_detached { my( $cust_pkg, %opt ) = @_; -warn $cust_pkg->pkgnum; -warn $cust_pkg->change_custnum; - return '' unless $cust_pkg->change_custnum; my $html = ''; @@ -379,8 +376,10 @@ warn $cust_pkg->change_custnum; encode_entities( $cust_main->name ). ''; + my $what = $opt{'pkg_attached'} ? 'Attached' : 'Detached'; + $html .= pkg_status_row_colspan( $cust_pkg, - emt("Detached to customer #[_1]: ", + emt("$what to customer #[_1]: ", $cust_pkg->change_custnum ). $cust_link, -- cgit v1.2.1