RT#71447: OQM Service label override is not showing when provisioning or viewing...
[freeside.git] / httemplate / view / svc_acct / basics.html
index 752b483..5532c22 100644 (file)
 <% &ntable("#cccccc") %><TR><TD><% &ntable("#cccccc",2) %>
 
-<TR>
-  <TD ALIGN="right">Service</TD>
-  <TD BGCOLOR="#ffffff"><% $part_svc->svc %></TD>
-</TR>
-
-<TR>
-  <TD ALIGN="right">Username</TD>
-  <TD BGCOLOR="#ffffff"><% $svc_acct->username %></TD>
-</TR>
+<& /view/elements/tr.html, label=> $part_svc->part_svc_column('svc')->columnlabel || mt('Service'),  value=>$part_svc->svc &>
+% if ( $opt{cust_svc}->agent_svcid ) {
+  <& /view/elements/tr.html, label=>mt('Legacy ID'),  value=>$opt{cust_svc}->agent_svcid &>
+% }
+<& /view/elements/tr.html, label=> $part_svc->part_svc_column('username')->columnlabel || mt('Username'), value=>$svc_acct->username &>
+<& /view/elements/tr.html, label=> $part_svc->part_svc_column('domsvc')->columnlabel || mt('Domain'),   value=>$domain &>
 
-<TR>
-  <TD ALIGN="right">Domain</TD>
-  <TD BGCOLOR="#ffffff"><% $domain %></TD>
-</TR>
+% if ( $opt{'communigate'} ) {
+  <& /view/elements/tr.html, label=>mt('Aliases'), value=>$svc_acct->cgp_aliases &>
+%}
 
 % if ( $svc_acct->pbxsvc ) {
-    <TR>
-      <TD ALIGN="right">PBX</TD>
-      <TD BGCOLOR="#ffffff"><% $svc_acct->pbx_title %></TD>
-    </TR>
+  <& /view/elements/tr.html, label=> $part_svc->part_svc_column('pbxsvc')->columnlabel || mt('PBX'), value=>$svc_acct->pbx_title &>
 %}
 
-<TR>
-  <TD ALIGN="right">Password</TD>
-  <TD BGCOLOR="#ffffff">
+% my $show_pw = '';
 % my $password = $svc_acct->get_cleartext_password; 
 % if ( $password =~ /^\*\w+\* (.*)$/ ) {
-%         $password = $1;
-      <I>(login disabled)</I>
-% } 
-% if ( !$password and 
-%        $svc_acct->_password_encryption ne 'plain' and
-%        $svc_acct->_password ) {
-      <I>(<% uc($svc_acct->_password_encryption) %> encrypted)</I>
+%   $password = $1;
+%   $show_pw .= '<I>('. mt('login disabled') .')</I> ';
+% }
+% if ( ! $password
+%      && $svc_acct->_password_encryption ne 'plain'
+%      && $svc_acct->_password
+%    )
+% {
+%   $show_pw .= '<I>('. uc($svc_acct->_password_encryption). ' '.mt('encrypted').')</I>';
 % } elsif ( $conf->exists('showpasswords') ) { 
-      <PRE><% encode_entities($password) %></PRE>
+%   $show_pw .= '<SPAN >'. encode_entities($password). '</PRE>';
 % } else { 
-      <I>(hidden)</I>
-% } 
+%   $password = '';
+%   $show_pw .= '<I>('. mt('hidden') .')</I>';
+% }
+% my $psc = $part_svc->part_svc_column('_password');
+% if ( $psc->columnflag eq 'F' and $psc->columnvalue eq '' ) {
+%   # show nothing
+% } else {
+<TR>
+  <TD ALIGN="right"><% $psc->columnlabel || mt('Password') %></TD>
+  <TD STYLE="background-color: #ffffff; white-space: nowrap">
+  <% $show_pw %>
+%   my $curuser = $FS::CurrentUser::CurrentUser;
+%   if ( $curuser->access_right('Provision customer service') or
+%       ($curuser->access_right('Edit password') and
+%       ! $part_svc->restrict_edit_password)
+%        and $psc->columnflag ne 'F'
+%      )
+%   {
+  <& /elements/change_password.html,
+      'svc_acct'    => $svc_acct,
+      'curr_value'  => $password,
+  &>
+%   }
   </TD>
 </TR>
-% $password = ''; 
+% }
 
 % if ( $conf->exists('security_phrase') ) {
-%     my $sec_phrase = $svc_acct->sec_phrase;
-%
-  <TR>
-    <TD ALIGN="right">Security phrase</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->sec_phrase %></TD>
-  </TR>
+  <& /view/elements/tr.html, label=> $part_svc->part_svc_column('sec_phrase')->columnlabel || mt('Security phrase'), value=>$svc_acct->sec_phrase &>
 % } 
 
 % if ( $svc_acct->popnum ) {
-%    my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
-  <TR>
-    <TD ALIGN="right">Access number</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct_pop->text %></TD>
-  </TR>
+%   my $svc_acct_pop = qsearchs('svc_acct_pop',{'popnum'=>$svc_acct->popnum});
+    <& /view/elements/tr.html, label=> $part_svc->part_svc_column('popnum')->columnlabel || mt('Access number'), value=>$svc_acct_pop->text &>
 % } 
 
+% if ( $svc_acct->sectornum && $conf->exists('svc_acct-tower_sector') ) {
+%   my $tower_sector = $svc_acct->tower_sector;
+%   my $link = $tower_sector->ip_addr
+%                ? '<A HREF="http://'. $tower_sector->ip_addr. '">'
+%                : '';
+    <& /view/elements/tr.html,
+        label =>  $part_svc->part_svc_column('sectornum')->columnlabel || mt('Tower sector'),
+        value => $link. $tower_sector->description. ($link ? '</A>' : ''),
+    &>
+% }
+
+<& /view/elements/tr-svc_export_machine.html,
+     'svc'      => $svc_acct,
+     'part_svc' => $part_svc,
+&>
+
 % if ($svc_acct->uid ne '') { 
-  <TR>
-    <TD ALIGN="right">UID</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->uid %></TD>
-  </TR>
+  <& /view/elements/tr.html, label=> $part_svc->part_svc_column('uid')->columnlabel || mt('UID'), value=>$svc_acct->uid &>
 % } 
 
 % if ($svc_acct->gid ne '') { 
-  <TR>
-    <TD ALIGN="right">GID</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->gid %></TD>
-  </TR>
+  <& /view/elements/tr.html, label=> $part_svc->part_svc_column('gid')->columnlabel || mt('GID'), value=>$svc_acct->gid &>
 % } 
 
 % if ($svc_acct->finger ne '') { 
-  <TR>
-    <TD ALIGN="right">Real Name</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->finger %></TD>
-  </TR>
+  <& /view/elements/tr.html, label=> $part_svc->part_svc_column('finger')->columnlabel || mt('Real Name'), value=>$svc_acct->finger &>
 % } 
 
 % if ($svc_acct->dir ne '') { 
-  <TR>
-    <TD ALIGN="right">Home directory</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->dir %></TD>
-  </TR>
+  <& /view/elements/tr.html, label=> $part_svc->part_svc_column('dir')->columnlabel || mt('Home directory'), value=>$svc_acct->dir &>
 % } 
 
 % if ($svc_acct->shell ne '') { 
-  <TR>
-    <TD ALIGN="right">Shell</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->shell %></TD>
-  </TR>
+  <& /view/elements/tr.html, label=> $part_svc->part_svc_column('shell')->columnlabel || mt('Shell'), value=>$svc_acct->shell &>
 % } 
 
 % if ($svc_acct->quota ne '' && ! $opt{'communigate'} ) { 
-  <TR>
-    <TD ALIGN="right">Quota</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->quota %></TD>
-  </TR>
-% } elsif ( $opt{'communigate'} ) {
-
-  <TR>
-    <TD ALIGN="right">Mailbox type</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->cgp_type %></TD>
-  </TR>
-
-  <TR>
-    <TD ALIGN="right">Enabled services</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->cgp_accessmodes %></TD>
-  </TR>
-
-  <TR>
-    <TD ALIGN="right">Mail storage limit</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->quota %></TD>
-  </TR>
 
-  <TR>
-    <TD ALIGN="right">File storage limit</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->file_quota %></TD>
-  </TR>
+  <& /view/elements/tr.html, label=> $part_svc->part_svc_column('quota')->columnlabel || mt('Quota'), value=>$svc_acct->quota &>
 
-  <TR>
-    <TD ALIGN="right">Number of files limit</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->file_maxnum %></TD>
-  </TR>
+% } elsif ( $opt{'communigate'} ) {
 
-  <TR>
-    <TD ALIGN="right">File size limit</TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->file_maxsize %></TD>
-  </TR>
+  <& communigate.html, %opt &>
 
 % }
 
+<%perl>
+# minor false laziness w/ view/svc_broadband.cgi
+sub slipip {
+  my $svc_acct = shift;
+  my $out = $svc_acct->slipip or return '';
+  if ( $out eq '0.0.0.0' or $out eq '0e0' ) {
+    return '<I>('.mt('Dynamic').'</I>';
+  }
+  $out .= ' ('.
+          include('/elements/popup_link-ping.html', ip => $svc_acct->slipip).
+          ')';
+  if ( my $addr_block = $svc_acct->addr_block ) {
+    $out .= '<br>Netmask: ' . $addr_block->NetAddr->mask .
+            '<br>Gateway: ' . $addr_block->ip_gateway;
+  }
+  $out;
+}
+</%perl>
+
 % if ($svc_acct->slipip) { 
-  <TR>
-    <TD ALIGN="right">IP address</TD>
-    <TD BGCOLOR="#ffffff">
-      <% ( $svc_acct->slipip eq "0.0.0.0" || $svc_acct->slipip eq '0e0' )
-            ? "<I>(Dynamic)</I>"
-            : $svc_acct->slipip
-      %>
-    </TD>
-  </TR>
+  <& /view/elements/tr.html,
+       label=> $part_svc->part_svc_column('slipip')->columnlabel || mt('IP address'),
+       value=> slipip($svc_acct)
+  &>
 % } 
 
-<% include('usage.html',
-             'svc_acct' => $svc_acct,
-          )
-%>
+<& usage.html, 'svc_acct' => $svc_acct &>
 
 % foreach my $attribute ( grep /^radius_/, $svc_acct->fields ) {
-%  $attribute =~ /^radius_(.*)$/;
-%  my $pattribute = $FS::raddb::attrib{$1};
-  <TR>
-    <TD ALIGN="right">Radius (reply) <% $pattribute %></TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->getfield($attribute) %></TD>
-  </TR>
-
+%   $attribute =~ /^radius_(.*)$/;
+%   my $pattribute = $FS::raddb::attrib{$1};
+    <& /view/elements/tr.html, label=>mt("Radius (reply) [_1]",$pattribute),
+                          value=>$svc_acct->getfield($attribute)
+    &>
 % } 
+
 % foreach my $attribute ( grep /^rc_/, $svc_acct->fields ) {
-%  $attribute =~ /^rc_(.*)$/;
-%  my $pattribute = $FS::raddb::attrib{$1};
-  <TR>
-    <TD ALIGN="right">Radius (check) <% $pattribute %></TD>
-    <TD BGCOLOR="#ffffff"><% $svc_acct->getfield($attribute) %></TD>
-  </TR>
+%   $attribute =~ /^rc_(.*)$/;
+%   my $pattribute = $FS::raddb::attrib{$1};
+    <& /view/elements/tr.html, label=>mt("Radius (check) [_1]",$pattribute),
+                          value=>$svc_acct->getfield($attribute)
+    &>
 % } 
 
-<TR>
-  <TD ALIGN="right">RADIUS groups</TD>
-  <TD BGCOLOR="#ffffff"><% join('<BR>', $svc_acct->radius_groups) %></TD>
-</TR>
+<& /view/elements/tr.html, label=> $part_svc->part_svc_column('usergroup')->columnlabel || mt('RADIUS groups'),
+    value=>join('<BR>', $svc_acct->radius_groups('long_description')) &>
+
+<& router.html, 'svc_acct' => $svc_acct &>
 
 %# Can this be abstracted further?  Maybe a library function like
 %# widget('HTML', 'view', $svc_acct) ?  It would definitely make UI