X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fsearch%2Fcust_main.cgi;h=e87fe36d7985cc3e7a816176c73ec600685770f7;hb=5bfefc51b44ef58c853f2108c80a57a36296cb79;hp=c484496e0abd08fca9e961453c5ad70764fd7e51;hpb=3ce7691203a7737406bf2d4442f7fd84b81f847e;p=freeside.git diff --git a/httemplate/search/cust_main.cgi b/httemplate/search/cust_main.cgi index c484496e0..e87fe36d7 100755 --- a/httemplate/search/cust_main.cgi +++ b/httemplate/search/cust_main.cgi @@ -1,4 +1,5 @@ -% +%die "access denied" +% unless $FS::CurrentUser::CurrentUser->access_right('List customers'); % %my $conf = new FS::Conf; %my $maxrecords = $conf->config('maxsearchrecordsperpage'); @@ -84,6 +85,8 @@ % } % % if ( $cgi->param('otaker_on') ) { +% die "access denied" +% unless $FS::CurrentUser::CurrentUser->access_right('Configuration'); % $cgi->param('otaker') =~ /^(\w{1,32})$/ or eidiot "Illegal otaker\n"; % $search{otaker} = $1; % } elsif ( $cgi->param('agentnum_on') ) { @@ -194,7 +197,6 @@ % if ( $cgi->param('search_cust') ) { % $sortby = \*company_sort; % $orderby = "ORDER BY LOWER(company || ' ' || last || ' ' || first )"; -% warn "smart searching for: ". $cgi->param('search_cust'); % push @cust_main, smart_search( 'search' => $cgi->param('search_cust') ); % } % @@ -239,33 +241,13 @@ <% $total %> matching customers found -% -% #begin pager -% my $pager = ''; -% if ( $total != scalar(@cust_main) && $maxrecords ) { -% unless ( $offset == 0 ) { -% $cgi->param('offset', $offset - $maxrecords); -% $pager .= 'Previous '; -% } -% my $poff; -% my $page; -% for ( $poff = 0; $poff < $total; $poff += $maxrecords ) { -% $page++; -% if ( $offset == $poff ) { -% $pager .= qq!$page !; -% } else { -% $cgi->param('offset', $poff); -% $pager .= qq!$page !; -% } -% } -% unless ( $offset + $maxrecords > $total ) { -% $cgi->param('offset', $offset + $maxrecords); -% $pager .= 'Next '; -% } -% } -% #end pager + +% my $pager = include( '/elements/pager.html', +% 'offset' => $offset, +% 'num_rows' => scalar(@cust_main), +% 'total' => $total, +% 'maxrecords' => $maxrecords, +% ); % % unless ( $cgi->param('cancelled') ) { % if ( $cgi->param('showcancelledcustomers') eq '0' #see if it was set by me @@ -328,7 +310,8 @@ % % print "

". $pager. include('/elements/table-grid.html'). < -% +% # +% Status % (bill) name % company %END @@ -392,10 +375,12 @@ % ? qq!$company! % : ' '; % - +% my $status = $cust_main->status; +% my $statuscol = $FS::cust_main::statuscolor{$status}; - ><% $custnum %> + ><% $custnum %> + >><% ucfirst($status) %> ><% "$last, $first" %> ><% $pcompany %> % @@ -507,8 +492,9 @@ % my($label, $value, $svcdb) = $cust_svc->label; % my($svcnum) = $cust_svc->svcnum; % my($sview) = $p.'view'; -% print $n2,qq!$label!, -% qq!$value!; +% print $n2, +% qq!!. FS::UI::Web::svc_link($m, $cust_svc->part_svc, $cust_svc) . qq! !. +% qq!!. FS::UI::Web::svc_label_link($m, $cust_svc->part_svc, $cust_svc) . qq! !; % $n2=""; % } % @@ -740,6 +726,3 @@ % % \@cust_main; %} -% -% -