X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=httemplate%2Fview%2Fsvc_acct.cgi;h=e6d2b690fc46b81a6e818640d517977edf88f10e;hb=f9938915b0df2609f41c24d761d607595d5d0a34;hp=c378094d93c8421a29815a99aaee77bcf7b761a4;hpb=9509e5bfb7f9331303153cac24d7bfecbe2ea9f1;p=freeside.git diff --git a/httemplate/view/svc_acct.cgi b/httemplate/view/svc_acct.cgi index c378094d9..e6d2b690f 100755 --- a/httemplate/view/svc_acct.cgi +++ b/httemplate/view/svc_acct.cgi @@ -79,6 +79,7 @@ Upload: <% sprintf("%.3f", $input) %> megabytes
Download: <% sprintf("%.3f", $output) %> megabytes
+ Last Login: <% $svc_acct->last_login_text %>
% my $href = qq! -function enable_change () { - if ( document.OneTrueForm.svcpart.selectedIndex > 1 ) { - document.OneTrueForm.submit.disabled = false; - } else { - document.OneTrueForm.submit.disabled = true; - } -} - -
- - -% #print qq!
Send account information!; + + + + + + +% #print qq!
Send account information!; % -% my @part_svc = (); -% if ( $pkgnum ) { -% @part_svc = grep { $_->svcdb eq 'svc_acct' -% && $_->svcpart != $part_svc->svcpart } -% $cust_pkg->available_part_svc; -% } else { -% @part_svc = qsearch('part_svc', { -% svcdb => 'svc_acct', -% disabled => '', -% svcpart => { op=>'!=', value=>$part_svc->svcpart }, -% } ); -% } +% if ( $pkgnum ) { +% @part_svc = grep { $_->svcdb eq 'svc_acct' +% && $_->svcpart != $part_svc->svcpart } +% $cust_pkg->available_part_svc; +% } else { +% @part_svc = qsearch('part_svc', { +% svcdb => 'svc_acct', +% disabled => '', +% svcpart => { op=>'!=', value=>$part_svc->svcpart }, +% } ); +% } % - +% } Service #<% $svcnum %> | Edit this service + % if ( @part_svc ) { | + % } @@ -253,8 +259,9 @@ Service #<% $svcnum %> % foreach my $uf ( keys %ulabel ) { % my $tf = $uf . "_threshold"; % if ( $svc_acct->$uf ne '' ) { -% my $v = $uf eq 'seconds' ? duration_exact($svc_acct->$uf) -% : FS::UI::bytecount::display_bytecount($svc_acct->$uf); +% my $v = $uf eq 'seconds' +% ? (($svc_acct->$uf < 0 ? '-' : ''). duration_exact($svc_acct->$uf) ) +% : FS::UI::bytecount::display_bytecount($svc_acct->$uf); <% $ulabel{$uf} %> remaining <% $v %> @@ -303,6 +310,22 @@ Service #<% $svcnum %>


+% if ( @svc_www ) { + Hosting + <% &ntable("#cccccc") %><% &ntable("#cccccc",2) %> +% foreach my $svc_www (@svc_www) { +% my($label, $value) = $svc_www->cust_svc->label; +% my $link = $p. 'view/svc_www.cgi?'. $svc_www->svcnum; + + + <% "$label: $value" %> + + +% } + +

+% } + <% join("
", $conf->config('svc_acct-notes') ) %>

@@ -312,21 +335,22 @@ Service #<% $svcnum %> <%init> die "access denied" - unless $FS::CurrentUser::CurrentUser->access_right('View customer services') - || $FS::CurrentUser::CurrentUser->access_right('View customer'); #XXX remove me + unless $FS::CurrentUser::CurrentUser->access_right('View customer services'); my $conf = new FS::Conf; +my $addl_from = ' LEFT JOIN cust_svc USING ( svcnum ) '. + ' LEFT JOIN cust_pkg USING ( pkgnum ) '. + ' LEFT JOIN cust_main USING ( custnum ) '; + my($query) = $cgi->keywords; $query =~ /^(\d+)$/; my $svcnum = $1; my $svc_acct = qsearchs({ 'select' => 'svc_acct.*', 'table' => 'svc_acct', - 'addl_from' => ' LEFT JOIN cust_svc USING ( svcnum ) '. - ' LEFT JOIN cust_pkg USING ( pkgnum ) '. - ' LEFT JOIN cust_main USING ( custnum ) ', - 'hashref' => {'svcnum'=>$svcnum}, + 'addl_from' => $addl_from, + 'hashref' => { 'svcnum' => $svcnum }, 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql, }); die "Unknown svcnum" unless $svc_acct; @@ -356,4 +380,17 @@ die 'Unknown domain (domsvc '. $svc_acct->domsvc. unless $svc_domain; my $domain = $svc_domain->domain; +my @svc_www = qsearch({ + 'select' => 'svc_www.*', + 'table' => 'svc_www', + 'addl_from' => $addl_from, + 'hashref' => { 'usersvc' => $svcnum }, + #XXX shit outta luck if you somehow got them linked across agents + # maybe we should show but not link to them? kinda makes sense... + # (maybe a specific ACL for this situation???) + 'extra_sql' => ' AND '. $FS::CurrentUser::CurrentUser->agentnums_sql( + 'null_right' => 'View/link unlinked services' + ), +}); +