show labels for select(select_hash) config options, RT#3997
[freeside.git] / httemplate / config / config-process.cgi
index e220fd8..894dc41 100644 (file)
@@ -25,7 +25,7 @@ foreach my $type ( ref($i->type) ? @{$i->type} : $i->type ) {
     } else {
       $conf->delete($i->key, $agentnum);
     }
-  } elsif ( $type eq 'binary' ) {
+  } elsif ( $type eq 'binary' || $type eq 'image' ) {
     if ( defined($cgi->param($i->key.$n)) && $cgi->param($i->key.$n) ) {
       my $fh = $cgi->upload($i->key.$n);
       if (defined($fh)) {
@@ -87,6 +87,15 @@ $conf->delete($_, $agentnum) foreach @delete;
           configCell.style.backgroundColor = '#ff0000';
           configCell.innerHTML = 'NO';
 %       }
+%     } elsif ( $type eq 'select' && $i->select_hash ) {
+%       my %hash;
+%       if ( ref($i->select_hash) eq 'ARRAY' ) {
+%         tie %hash, 'Tie::IxHash', '' => '', @{ $i->select_hash };
+%       } else {
+%         tie %hash, 'Tie::IxHash', '' => '', %{ $i->select_hash };
+%       }
+        configCell.innerHTML = <% $conf->exists($i->key, $agentnum) ? $hash{ $conf->config($i->key, $agentnum) } : '' |js_string %>;
+
 %     } elsif ( $type eq 'text' || $type eq 'select' ) {
         configCell.innerHTML = <% $conf->exists($i->key, $agentnum) ? $conf->config($i->key, $agentnum) : '' |js_string %>;
 %     } elsif ( $type eq 'select-sub' ) {
@@ -94,7 +103,7 @@ $conf->delete($_, $agentnum) foreach @delete;
           <% $conf->config($i->key, $agentnum) |js_string %> + ': ' +
           <% &{ $i->option_sub }( $conf->config($i->key, $agentnum) ) |js_string %>;
 %     } else {
-        alert('unknown type <% $type %>');
+        //alert('unknown type <% $type %>');
         window.top.location.reload();
 %     }