From 98779ec47370ad67c716154f67f6a726b83e09ed Mon Sep 17 00:00:00 2001 From: levinse Date: Thu, 20 Jan 2011 20:46:30 +0000 Subject: Ikano / svc_dsl / qualification improvements, RT7111 --- httemplate/edit/process/quick-cust_pkg.cgi | 22 +++++++++++++-- httemplate/edit/svc_dsl.cgi | 17 ++++++++++- httemplate/elements/popup_link-cust_main.html | 4 +++ httemplate/elements/tr-select-cust_location.html | 5 ++++ httemplate/misc/order_pkg.html | 5 ++++ httemplate/view/cust_main/order_pkg_link.html | 10 +++++-- httemplate/view/qual.cgi | 36 +++++++++++++++++++++++- 7 files changed, 93 insertions(+), 6 deletions(-) (limited to 'httemplate') diff --git a/httemplate/edit/process/quick-cust_pkg.cgi b/httemplate/edit/process/quick-cust_pkg.cgi index 599f7607c..704d256e6 100644 --- a/httemplate/edit/process/quick-cust_pkg.cgi +++ b/httemplate/edit/process/quick-cust_pkg.cgi @@ -6,12 +6,23 @@ % my $show = $curuser->default_customer_view =~ /^(jumbo|packages)$/ % ? '' % : ';show=packages'; +% my $redir_url = popurl(3) +% ."view/cust_main.cgi?custnum=$custnum$show;fragment=$frag#$frag"; +% +% # for going right to a provision service after ordering a package +% if ( $svcpart ) { +% my $part_svc = qsearchs('part_svc', { 'svcpart' => $svcpart } ); +% if ( $part_svc ) { +% $redir_url = popurl(3)."edit/".$part_svc->svcdb.".cgi?" +% ."pkgnum=".$cust_pkg->pkgnum.";svcpart=$svcpart"; +% } +% } <% header('Package ordered') %> @@ -49,6 +60,13 @@ $cgi->param('discountnum') =~ /^(\-?\d*)$/ or die 'illegal discountnum '. $cgi->param('discountnum'); my $discountnum = $1; +# for going right to a provision service after ordering a package +my $svcpart; +if ( $cgi->param('svcpart') ) { + $cgi->param('svcpart') =~ /^(\-?\d*)$/ + or die 'illegal svcpart '. $cgi->param('svcpart'); + $svcpart = $1; +} my $cust_pkg = new FS::cust_pkg { 'custnum' => $custnum, @@ -83,6 +101,6 @@ if ( $locationnum == -1 ) { $opt{'cust_location'} = $cust_location; } -my $error = $cust_main->order_pkg( %opt ); +my $error = $cust_main->order_pkg( \%opt ); diff --git a/httemplate/edit/svc_dsl.cgi b/httemplate/edit/svc_dsl.cgi index 9b4d1c77d..48464fbad 100644 --- a/httemplate/edit/svc_dsl.cgi +++ b/httemplate/edit/svc_dsl.cgi @@ -95,6 +95,16 @@ my $new_cb = sub { my $ddd = $cust_pkg->start_date; $ddd = time unless $ddd; + my @quals = $export->quals_by_cust_and_pkg($cust_pkg->cust_main->custnum,$cust_pkg->pkgpart); + my @prequalids; + my %prequal_labels; + foreach my $qual ( @quals ) { + my $prequalid = $qual->vendor_qual_id; + push @prequalids, $prequalid; + $prequal_labels{$prequalid} = "$prequalid - qualification #" + .$qual->qualnum; + } + my @addl_fields = ( { field => 'loop_type', type => 'select', @@ -105,7 +115,12 @@ my $new_cb = sub { 'password', { field => 'isp_chg', type => 'checkbox', }, 'isp_prev', - 'vendor_qual_id', + { field => 'vendor_qual_id', + type => 'select', + options => \@prequalids, + labels => \%prequal_labels, + onchange => 'ikano_vendor_qual_id_changed', + }, { field => 'vendor_order_type', type => 'hidden', value => 'NEW' }, diff --git a/httemplate/elements/popup_link-cust_main.html b/httemplate/elements/popup_link-cust_main.html index 454fcc4c8..78e50e782 100644 --- a/httemplate/elements/popup_link-cust_main.html +++ b/httemplate/elements/popup_link-cust_main.html @@ -39,4 +39,8 @@ $params->{'action'} .= ( $params->{'action'} =~ /\?/ ? ';' : '?' ). 'custnum='. $params->{'cust_main'}->custnum; +$params->{'action'} .= ';pkgpart='.$params->{'pkgpart'} if $params->{'pkgpart'}; +$params->{'action'} .= ';locationnum='.$params->{'locationnum'} if $params->{'locationnum'}; +$params->{'action'} .= ';svcpart='.$params->{'svcpart'} if $params->{'svcpart'}; + diff --git a/httemplate/elements/tr-select-cust_location.html b/httemplate/elements/tr-select-cust_location.html index fa19405b2..5802f4ec2 100644 --- a/httemplate/elements/tr-select-cust_location.html +++ b/httemplate/elements/tr-select-cust_location.html @@ -154,11 +154,16 @@ Example: <<%$th%> ALIGN="right"><% $opt{'label'} || 'Service location' %>> +% if ( $svcpart ) { + +% } <% ntable("#cccccc", 2) %> <% include('/elements/tr-select-cust-part_pkg.html', @@ -139,4 +142,6 @@ if( ! $conf->exists('order_pkg-no_start_date') ) { $start_date = $start_date ? time2str($format, $start_date) : ''; } +my $svcpart = $cgi->param('svcpart'); + diff --git a/httemplate/view/cust_main/order_pkg_link.html b/httemplate/view/cust_main/order_pkg_link.html index 30c86a757..2e8b1dac1 100644 --- a/httemplate/view/cust_main/order_pkg_link.html +++ b/httemplate/view/cust_main/order_pkg_link.html @@ -1,16 +1,22 @@ <% include( '/elements/popup_link-cust_main.html', 'action' => $p. 'misc/order_pkg.html', - 'label' => 'Order new package', + 'label' => $opt{'label'} || 'Order new package', 'actionlabel' => 'Order new package', 'color' => '#333399', 'cust_main' => $cust_main, 'closetext' => 'Close', 'width' => 763, 'height' => 538, + %optional, ) %> <%init> -my($cust_main) = @_; +my($cust_main, %opt) = @_; + +my %optional = (); +$optional{'pkgpart'} = $opt{'pkgpart'} if $opt{'pkgpart'}; +$optional{'locationnum'} = $opt{'locationnum'} if $opt{'locationnum'}; +$optional{'svcpart'} = $opt{'svcpart'} if $opt{'svcpart'}; diff --git a/httemplate/view/qual.cgi b/httemplate/view/qual.cgi index 8ab0032ad..45f3d2a62 100644 --- a/httemplate/view/qual.cgi +++ b/httemplate/view/qual.cgi @@ -28,7 +28,41 @@

% if ( $export ) { -<% $export->qual_html($qual) %> +% my $qual_result = $export->qual_result($qual); +% if ($qual_result->{'header'}) { + <% $qual_result->{'header'} %> +% } +% if ($qual_result->{'pkglist'}) { # one of the possible formats +% my $svcpart = ''; +% my $pkglist = $qual_result->{'pkglist'}; +% my $cust_or_prospect = $qual->cust_or_prospect; +% my $locationnum = ''; +% my %location = $qual->location; +% if (%location && $location{'locationnum'}) { +% $locationnum = $location{'locationnum'}; +% } + +% } % } <%init> -- cgit v1.2.1