X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fsvc_www.cgi;h=b0f1d5c80d33ae1b04a47a5da154b2b85628d14c;hb=c8cccb4a92adceb943c635fe62dad0d034462ce0;hp=ae51c61fce4548796ab9fc21b78bb003086a6515;hpb=08662d58e7b9a13cf841e9c89daa39b28655724e;p=freeside.git diff --git a/httemplate/search/svc_www.cgi b/httemplate/search/svc_www.cgi index ae51c61fc..b0f1d5c80 100755 --- a/httemplate/search/svc_www.cgi +++ b/httemplate/search/svc_www.cgi @@ -1,53 +1,57 @@ -<% - -#my $conf = new FS::Conf; - -my($query)=$cgi->keywords; -$query ||= ''; #to avoid use of unitialized value errors -my $orderby; -if ( $query eq 'svcnum' ) { - $orderby = 'ORDER BY svcnum'; -} else { - eidiot('unimplemented'); -} - -my $count_query = 'SELECT COUNT(*) FROM svc_www'; -my $sql_query = { - 'table' => 'svc_www', - 'hashref' => {}, - 'select' => join(', ', - 'svc_www.*', - 'cust_main.custnum', - FS::UI::Web::cust_sql_fields(), - ), - 'extra_sql' => $orderby, - 'addl_from' => 'LEFT JOIN cust_svc USING ( svcnum )'. - 'LEFT JOIN cust_pkg USING ( pkgnum )'. - 'LEFT JOIN cust_main USING ( custnum )', -}; - -my $link = [ "${p}view/svc_www.cgi?", 'svcnum', ]; -#my $dlink = [ "${p}view/svc_www.cgi?", 'svcnum', ]; -my $ulink = [ "${p}view/svc_acct.cgi?", 'usersvc', ]; - -#smaller false laziness w/svc_*.cgi here -my $link_cust = sub { - my $svc_x = shift; - $svc_x->custnum ? [ "${p}view/cust_main.cgi?", 'custnum' ] : ''; -}; - -%><%= include( 'elements/search.html', +% +% +%#my $conf = new FS::Conf; +% +%my($query)=$cgi->keywords; +%$query ||= ''; #to avoid use of unitialized value errors +%my $orderby; +%if ( $query eq 'svcnum' ) { +% $orderby = 'ORDER BY svcnum'; +%} else { +% eidiot('unimplemented'); +%} +% +%my $count_query = 'SELECT COUNT(*) FROM svc_www'; +%my $sql_query = { +% 'table' => 'svc_www', +% 'hashref' => {}, +% 'select' => join(', ', +% 'svc_www.*', +% 'part_svc.svc', +% 'cust_main.custnum', +% FS::UI::Web::cust_sql_fields(), +% ), +% 'extra_sql' => $orderby, +% 'addl_from' => 'LEFT JOIN cust_svc USING ( svcnum )'. +% 'LEFT JOIN cust_pkg USING ( pkgnum )'. +% 'LEFT JOIN cust_main USING ( custnum )', +%}; +% +%my $link = [ "${p}view/svc_www.cgi?", 'svcnum', ]; +%#my $dlink = [ "${p}view/svc_www.cgi?", 'svcnum', ]; +%my $ulink = [ "${p}view/svc_acct.cgi?", 'usersvc', ]; +% +%#smaller false laziness w/svc_*.cgi here +%my $link_cust = sub { +% my $svc_x = shift; +% $svc_x->custnum ? [ "${p}view/cust_main.cgi?", 'custnum' ] : ''; +%}; +% +% +<% include( 'elements/search.html', 'title' => 'Virtual Host Search Results', 'name' => 'virtual hosts', 'query' => $sql_query, 'count_query' => $count_query, 'redirect' => $link, 'header' => [ '#', + 'Service', 'Zone', 'User', FS::UI::Web::cust_header(), ], 'fields' => [ 'svcnum', + 'svc', sub { $_[0]->domain_record->zone }, sub { my $svc_www = shift; @@ -59,6 +63,7 @@ my $link_cust = sub { \&FS::UI::Web::cust_fields, ], 'links' => [ $link, + $link, '', $ulink, ( map { $link_cust }