X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fphone_avail.html;h=faf354420aa46ba3fad8913a04a97be720ccfe19;hb=6b5dda03831aef0cb5689cf2acf3fac47e4b12cb;hp=8dec7b247531f3e5bc81ebab2afb1acf51662a89;hpb=0fb307c305e4bc2c9c27dc25a3308beae3a4d33c;p=freeside.git diff --git a/httemplate/search/phone_avail.html b/httemplate/search/phone_avail.html index 8dec7b247..faf354420 100644 --- a/httemplate/search/phone_avail.html +++ b/httemplate/search/phone_avail.html @@ -1,9 +1,9 @@ -<% include( 'elements/search.html', +<& elements/search.html, 'title' => 'Phone Number (DID) Search Results', 'name_singular' => 'phone number', 'query' => { 'table' => 'phone_avail', - 'hashref' => {}, + 'hashref' => $hashref, 'select' => join(', ', 'phone_avail.*', 'cust_main.custnum', @@ -81,8 +81,8 @@ FS::UI::Web::cust_styles(), '', ], - ) -%> + +&> <%init> die "access denied" @@ -125,9 +125,14 @@ my $search = scalar(@search) my $addl_from = ' LEFT JOIN cust_svc USING ( svcnum ) '. #' LEFT JOIN part_svc USING ( svcpart ) '. ' LEFT JOIN cust_pkg USING ( pkgnum ) '. - ' LEFT JOIN cust_main USING ( custnum ) '; + FS::UI::Web::join_cust_main('cust_pkg', 'cust_pkg'); my $count_query = "SELECT COUNT(*) FROM phone_avail $search"; #$addl_from? +# All of these relationships are left joined in the many-to-one direction, +# so including $addl_from won't affect the count. Logic! + +my $hashref = {}; +$hashref->{'ordernum'} = $1 if $cgi->param('ordernum') =~ /^(\d+)$/; my $link_cust = sub { my $phone_avail = shift;