fix sorting by a column advancing a page, RT#25740
[freeside.git] / httemplate / edit / part_svc.cgi
index e899ad0..fe2dfde 100755 (executable)
@@ -9,8 +9,26 @@
       Service Part #<% $part_svc->svcpart ? $part_svc->svcpart : "(NEW)" %>
 <BR><BR>
 Service  <INPUT TYPE="text" NAME="svc" VALUE="<% $hashref->{svc} %>"><BR>
+
+Self-service access:
+<SELECT NAME="selfservice_access">
+% tie my %selfservice_access, 'Tie::IxHash', #false laziness w/browse/part_svc
+%   ''         => 'Yes',
+%   'hidden'   => 'Hidden',
+%   'readonly' => 'Read-only',
+% ;
+% for (keys %selfservice_access) {
+  <OPTION VALUE="<% $_ %>"
+          <% $_ eq $hashref->{'selfservice_access'} ? 'SELECTED' : '' %>
+  ><% $selfservice_access{$_} %>
+% }
+</SELECT><BR>
+
 <INPUT TYPE="checkbox" NAME="disabled" VALUE="Y"<% $hashref->{disabled} eq 'Y' ? ' CHECKED' : '' %>>&nbsp;Disable new orders<BR>
+
 <INPUT TYPE="checkbox" NAME="preserve" VALUE="Y"<% $hashref->{'preserve'} eq 'Y' ? ' CHECKED' : '' %>>&nbsp;Preserve this service on package cancellation<BR>
+
+
 <INPUT TYPE="hidden" NAME="svcpart" VALUE="<% $hashref->{svcpart} %>">
 
 <BR>
@@ -80,6 +98,7 @@ Service  <INPUT TYPE="text" NAME="svc" VALUE="<% $hashref->{svc} %>"><BR>
 %    #'form_action'    => 'process/part_svc.cgi',
 %    'form_action'    => 'part_svc.cgi', #self
 %    'form_text'      => [ qw( svc svcpart ) ],
+%    'form_select'    => [ 'selfservice_access' ],
 %    'form_checkbox'  => [ 'disabled', 'preserve' ],
 %    'layer_callback' => sub {
 %      my $layer = shift;
@@ -318,9 +337,9 @@ Service  <INPUT TYPE="text" NAME="svc" VALUE="<% $hashref->{svc} %>"><BR>
 %            qq!<TEXTAREA NAME="${layer}__${field}">!. encode_entities($value).
 %            '</TEXTAREA>';
 %
-%        } elsif ( $def->{type} =~ /select-(.*?).html/ ) {
+%        } elsif ( $def->{type} =~ /select-(.*?)(.html)?$/ && $1 ne 'hardware' ) {
 %
-%          $html .= include("/elements/".$def->{type},
+%          $html .= include("/elements/select-$1.html",
 %                             'curr_value'   => $value,
 %                             'element_name' => "${layer}__${field}",
 %                             'element_etc'  => $disabled,
@@ -371,12 +390,27 @@ Service  <INPUT TYPE="text" NAME="svc" VALUE="<% $hashref->{svc} %>"><BR>
 %
 %      } #foreach my $field (@fields) {
 %
+%      if ( $layer eq 'svc_acct' ) {
+%        # eww, more ugly special-caseyness
+%        $html .= 
+%          '<TR><TD COLSPAN=3 ALIGN="right">'.
+%          emt('Require "Provision" access right to edit password').
+%          '</TD><TD>'.
+%          '<INPUT TYPE="checkbox" NAME="restrict_edit_password" VALUE="Y"'.
+%          ($part_svc->restrict_edit_password ? ' CHECKED' : '').
+%          '></TD></TR>';
+%      } else {
+%        $html .= 
+%          '<INPUT TYPE="hidden" NAME="restrict_edit_password" VALUE="">';
+%      }
+%
 %      $part_svc->svcpart('') if $clone; #undone
 %      $html .= "</TABLE>";
 %
 %      $html .= include('/elements/progress-init.html',
 %                         $layer, #form name
-%                         [ qw(svc svcpart disabled preserve exportnum),
+%                         [ qw(svc svcpart selfservice_access disabled preserve
+%                              exportnum restrict_edit_password),
 %                           @fields ],
 %                         'process/part_svc.cgi',
 %                         $p.'browse/part_svc.cgi',