X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fcust_pkg.cgi;h=aa3b3b15aadfe6fba90c7ba45596c2c7f643a27d;hb=0354f39ed0e74fd2eae1d9da13906625b4f56591;hp=5ddb17aee869211cf555692a60f184da8114881c;hpb=91387f8f489e561deaf1de052d80ef800a4970a3;p=freeside.git diff --git a/httemplate/view/cust_pkg.cgi b/httemplate/view/cust_pkg.cgi index 5ddb17aee..aa3b3b15a 100755 --- a/httemplate/view/cust_pkg.cgi +++ b/httemplate/view/cust_pkg.cgi @@ -1,59 +1,44 @@ + <% -# - -use strict; -use vars qw ( $cgi %uiview %uiadd $part_svc $query $pkgnum $cust_pkg $part_pkg - $custnum $susp $cancel $expire $pkg $comment $setup $bill - $otaker ); -use Date::Format; -use CGI; -use CGI::Carp qw(fatalsToBrowser); -use FS::UID qw(cgisuidsetup); -use FS::CGI qw(popurl header menubar ntable table); -use FS::Record qw(qsearch qsearchs); -use FS::part_svc; -use FS::cust_pkg; -use FS::part_pkg; -use FS::pkg_svc; -use FS::cust_svc; - -$cgi = new CGI; -cgisuidsetup($cgi); - -foreach $part_svc ( qsearch('part_svc',{}) ) { + +my $conf = new FS::Conf; + +my %uiview = (); +my %uiadd = (); +foreach my $part_svc ( qsearch('part_svc',{}) ) { $uiview{$part_svc->svcpart} = popurl(2). "view/". $part_svc->svcdb . ".cgi"; $uiadd{$part_svc->svcpart}= popurl(2). "edit/". $part_svc->svcdb . ".cgi"; } -($query) = $cgi->keywords; +my ($query) = $cgi->keywords; $query =~ /^(\d+)$/; -$pkgnum = $1; +my $pkgnum = $1; #get package record -$cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); +my $cust_pkg = qsearchs('cust_pkg',{'pkgnum'=>$pkgnum}); die "No package!" unless $cust_pkg; -$part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); +my $part_pkg = qsearchs('part_pkg',{'pkgpart'=>$cust_pkg->getfield('pkgpart')}); -$custnum = $cust_pkg->getfield('custnum'); -print $cgi->header( @FS::CGI::header ), header('Package View', menubar( +my $custnum = $cust_pkg->getfield('custnum'); +print header('Package View', menubar( "View this customer (#$custnum)" => popurl(2). "view/cust_main.cgi?$custnum", 'Main Menu' => popurl(2) )); #print info -($susp,$cancel,$expire)=( +my ($susp,$cancel,$expire)=( $cust_pkg->getfield('susp'), $cust_pkg->getfield('cancel'), $cust_pkg->getfield('expire'), ); -($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); -($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); -$otaker = $cust_pkg->getfield('otaker'); +my($pkg,$comment)=($part_pkg->getfield('pkg'),$part_pkg->getfield('comment')); +my($setup,$bill)=($cust_pkg->getfield('setup'),$cust_pkg->getfield('bill')); +my $otaker = $cust_pkg->getfield('otaker'); print < function areyousure(href) { - if (confirm("Permanantly delete included services and cancel this package?") == true) + if (confirm("Permanently delete included services and cancel this package?") == true) window.location.href = href; } @@ -98,12 +83,14 @@ print 'Order taker', '' ; -# print < -# -#Expire (date): -# -#END +unless ($expire) { + print < + +Expire (date): + +END +} unless ($cancel) { @@ -135,18 +122,18 @@ unless ($cancel) { my($svcnum)=$cust_svc->svcnum; my($label, $value, $svcdb) = $cust_svc->label; print <(View) $svc: $value +(View/Edit) $svc: $value END } else { - print < - - (Add) $svc - or - (Link to existing) $svc - - -END + print qq!!. + qq!!. + qq!(Provision) $svc!; + + print qq! or !. + qq!(Link to legacy) $svc! + if $conf->exists('legacy_link'); + + print ''; } } @@ -154,11 +141,13 @@ END } print "", - "Choose (View) to view or edit an existing service
", - "Choose (Add) to setup a new service
", - "Choose (Link to existing) to link to a legacy (pre-Freeside) service", - "
" - ; + "Choose (View/Edit) to view or edit an existing service
", + "Choose (Provision) to setup a new service
"; + + print "Choose (Link to legacy) to link to a legacy (pre-Freeside) service" + if $conf->exists('legacy_link'); + + print ""; } #formatting