From: ivan Date: Mon, 22 Mar 2004 10:16:43 +0000 (+0000) Subject: yay! remove package view entirely (closes: Bug#569) X-Git-Tag: NET_WHOIS_RAW_0_31~50 X-Git-Url: http://git.freeside.biz/gitweb/?p=freeside.git;a=commitdiff_plain;h=351b0af13ba6c449151c1bec2303294051c073d1;hp=5a5242465520ef7a64a715496c31a3c17c95cc57 yay! remove package view entirely (closes: Bug#569) --- diff --git a/httemplate/misc/expire_pkg.cgi b/httemplate/misc/expire_pkg.cgi index 9e4ce8b62..b59674a69 100755 --- a/httemplate/misc/expire_pkg.cgi +++ b/httemplate/misc/expire_pkg.cgi @@ -1,25 +1,55 @@ + <% -#untaint date & pkgnum - -my $date; -if ( $cgi->param('date') ) { - str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; - $date=$1; -} else { - $date=''; -} - -$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; +my($query) = $cgi->keywords; +$query =~ /^(\d+)$/; my $pkgnum = $1; +#get package record my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); -my %hash = $cust_pkg->hash; -$hash{expire}=$date; -my $new = new FS::cust_pkg ( \%hash ); -my $error = $new->replace($cust_pkg); -&eidiot($error) if $error; +die "Unknown pkgnum $pkgnum" unless $cust_pkg; +my $part_pkg = $cust_pkg->part_pkg; + +my $custnum = $cust_pkg->getfield('custnum'); -print $cgi->redirect(popurl(2). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); +my $date = $cust_pkg->expire ? time2str('%D', $cust_pkg->expire) : ''; %> + +<%= header('Expire package', menubar( + "View this customer (#$custnum)" => "${p}view/cust_main.cgi?$custnum", + 'Main Menu' => popurl(2) +)) %> + + + + + + +<%= $pkgnum %>: <%= $part_pkg->pkg. ' - '. $part_pkg->comment %> + +
+ + + + + + +
Cancel package on + +
m/d/y +
+ + + + +
+ + diff --git a/httemplate/misc/process/expire_pkg.cgi b/httemplate/misc/process/expire_pkg.cgi new file mode 100755 index 000000000..dc35592ce --- /dev/null +++ b/httemplate/misc/process/expire_pkg.cgi @@ -0,0 +1,25 @@ +<% + +#untaint date & pkgnum + +my $date; +if ( $cgi->param('date') ) { + str2time($cgi->param('date')) =~ /^(\d+)$/ or die "Illegal date"; + $date=$1; +} else { + $date=''; +} + +$cgi->param('pkgnum') =~ /^(\d+)$/ or die "Illegal pkgnum"; +my $pkgnum = $1; + +my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +my %hash = $cust_pkg->hash; +$hash{expire}=$date; +my $new = new FS::cust_pkg ( \%hash ); +my $error = $new->replace($cust_pkg); +&eidiot($error) if $error; + +print $cgi->redirect(popurl(3). "view/cust_main.cgi?".$cust_pkg->getfield('custnum')); + +%> diff --git a/httemplate/view/cust_main.cgi b/httemplate/view/cust_main.cgi index 229362e6c..8d8af63d6 100755 --- a/httemplate/view/cust_main.cgi +++ b/httemplate/view/cust_main.cgi @@ -20,7 +20,6 @@ print header("Customer View", menubar( @@ -382,7 +381,7 @@ if ( @$packages ) { %> - + @@ -402,9 +401,9 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { %> - \n! if ($cnt > 0); - print qq! \n\n!; + print qq! \n\n!; } } } @@ -946,13 +945,21 @@ sub svc_label_link { } sub svc_provision_link { - my ($pkg, $svcpart) = (shift,shift) or return ''; + my ($pkg, $svcpart, $conf) = @_; ( my $svc_nbsp = $svcpart->{svc} ) =~ s/\s+/ /g; - return qq!! . - "Provision $svc_nbsp (". - ($svcpart->{quantity} - $svcpart->{count}). - ')'; + my $pkgnum_svcpart = "pkgnum$pkg->{pkgnum}-svcpart$svcpart->{svcpart}"; + my $num_left = $svcpart->{quantity} - $svcpart->{count}; + + my $link = qq!!. + "Provision $svc_nbsp ($num_left)"; + if ( $conf->exists('legacy_link') ) { + $link .= '
'. + qq!!. + "Link to legacy $svc_nbsp ($num_left)"; + } + $link; } sub svc_unprovision_link { @@ -983,10 +990,10 @@ sub pkg_datestr { $strip; } -sub pkg_details_link { - my $pkg = shift or return ''; - return qq!Details!; -} +#sub pkg_details_link { +# my $pkg = shift or return ''; +# return qq!Details!; +#} sub pkg_change_link { my $pkg = shift or return ''; @@ -1005,7 +1012,8 @@ sub pkg_unsuspend_link { sub pkg_cancel_link { my $pkg = shift or return ''; - return qq!Cancel!; + qq!Cancel now | !. + qq!Cancel later!; } sub pkg_dates_link {
PackagePackage Status Services
CLASS="pkgnum"><%=$pkg->{pkgnum}%> > - <%=$pkg->{pkg}%> - <%=$pkg->{comment}%> ( <%=pkg_details_link($pkg)%> )
+ <%=$pkg->{pkgnum}%>: + <%=$pkg->{pkg}%> - <%=$pkg->{comment}%>
<% unless ($pkg->{cancel}) { %> ( <%=pkg_change_link($pkg)%> ) ( <%=pkg_dates_link($pkg)%> | <%=pkg_customize_link($pkg,$custnum)%> ) @@ -538,7 +537,7 @@ foreach my $pkg (sort pkgsort_pkgnum_cancel @$packages) { } if ($svcpart->{count} < $svcpart->{quantity}) { print qq!
!.svc_provision_link($pkg,$svcpart).qq!
!.svc_provision_link($pkg, $svcpart, $conf).qq!