summaryrefslogtreecommitdiff
path: root/httemplate/view
diff options
context:
space:
mode:
authorlevinse <levinse>2010-12-06 06:36:02 +0000
committerlevinse <levinse>2010-12-06 06:36:02 +0000
commit663b89d06a2c97fb0e7915ba409310fbefefea98 (patch)
treeaad540155dcd88062267857ff195858ad7f506f1 /httemplate/view
parentd4f1051cbd26721f4106df86cd423240315748e5 (diff)
-tr-select-cust_location.html and elements/location.html: optionally support alternate address format and
optional address -nearly finished qualifications, RT7111
Diffstat (limited to 'httemplate/view')
-rwxr-xr-xhttemplate/view/cust_main/packages.html5
-rw-r--r--httemplate/view/cust_main/qual_link.html16
-rw-r--r--httemplate/view/qual.cgi65
3 files changed, 86 insertions, 0 deletions
diff --git a/httemplate/view/cust_main/packages.html b/httemplate/view/cust_main/packages.html
index 660d0ef86..04c47aa3e 100755
--- a/httemplate/view/cust_main/packages.html
+++ b/httemplate/view/cust_main/packages.html
@@ -1,4 +1,9 @@
% my $s = 0;
+
+% # XXX: add qual access right
+ <% $s++ ? ' | ' : '' %>
+ <% include('qual_link.html', $cust_main) %>
+
% if ( $curuser->access_right('Order customer package') ) {
<% $s++ ? ' | ' : '' %>
<% include('order_pkg_link.html', $cust_main) %>
diff --git a/httemplate/view/cust_main/qual_link.html b/httemplate/view/cust_main/qual_link.html
new file mode 100644
index 000000000..077142c0a
--- /dev/null
+++ b/httemplate/view/cust_main/qual_link.html
@@ -0,0 +1,16 @@
+<% include( '/elements/popup_link-cust_main.html',
+ 'action' => $p. 'misc/qual.html',
+ 'label' => 'Service&nbsp;Qualification',
+ 'actionlabel' => 'Service Qualification',
+ 'color' => '#333399',
+ 'cust_main' => $cust_main,
+ 'closetext' => 'Close',
+ 'width' => 763,
+ 'height' => 436,
+ )
+%>
+<%init>
+
+my($cust_main) = @_;
+
+</%init>
diff --git a/httemplate/view/qual.cgi b/httemplate/view/qual.cgi
new file mode 100644
index 000000000..f96726995
--- /dev/null
+++ b/httemplate/view/qual.cgi
@@ -0,0 +1,65 @@
+<% include("/elements/header.html","View Qualification") %>
+
+% if ( $cust_or_prospect->custnum ) {
+
+ <% include( '/elements/small_custview.html', $cust_or_prospect->custnum, '', 1,
+ "${p}view/cust_main.cgi") %>
+ <BR>
+
+% }
+
+<B>Qualification #<% $qual->qualnum %></B>
+<% ntable("#cccccc", 2) %>
+<% include('elements/tr.html', label => 'Status', value => $qual->status_long ) %>
+<% include('elements/tr.html', label => 'Service Telephone Number', value => $qual->phonenum ) %>
+<% include('elements/tr.html', label => 'Address', value => $location_line ) %>
+% if ( $location_kind ) {
+<% include('elements/tr.html', label => 'Location Kind', value => $location_kind ) %>
+% } if ( $export ) {
+<% include('elements/tr.html', label => 'Qualified using', value => $export->exportname ) %>
+<% include('elements/tr.html', label => 'Vendor Qualification #', value => $qual->vendor_qual_id ) %>
+% }
+</TABLE>
+<BR><BR>
+
+% if ( $export ) {
+<% $export->qual_html($qual) %>
+% }
+
+<%init>
+
+# XXX: add access right for quals?
+
+my $qualnum;
+if ( $cgi->param('qualnum') ) {
+ $cgi->param('qualnum') =~ /^(\d+)$/ or die "unparsable qualnum";
+ $qualnum = $1;
+} else {
+ my($query) = $cgi->keywords;
+ $query =~ /^(\d+)$/ or die "no qualnum";
+ $qualnum = $1;
+}
+
+my $qual = qsearchs('qual', { qualnum => $qualnum }) or die "invalid qualnum";
+my $location_line = '';
+my %location_hash = $qual->location;
+my $cust_location;
+if ( %location_hash ) {
+ $cust_location = new FS::cust_location(\%location_hash);
+ $location_line = $cust_location->location_label;
+}
+# XXX: geocode_Mixin location_label doesn't currently have the new cust_location fields - add them
+
+my $location_kind;
+$location_kind = "Residential" if $cust_location->location_kind eq 'R';
+$location_kind = "Business" if $cust_location->location_kind eq 'B';
+
+my $cust_or_prospect = $qual->cust_or_prospect;
+
+my $export;
+if ( $qual->exportnum ) {
+ $export = qsearchs('part_export', { exportnum => $qual->exportnum } )
+ or die 'invalid exportnum';
+}
+
+</%init>