projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Rate CDRs immediately, RT#15839
[freeside.git]
/
httemplate
/
config
/
config.cgi
diff --git
a/httemplate/config/config.cgi
b/httemplate/config/config.cgi
index
45d77ff
..
6a1eaec
100644
(file)
--- a/
httemplate/config/config.cgi
+++ b/
httemplate/config/config.cgi
@@
-24,6
+24,7
@@
function SafeOnsubmit() {
<FORM NAME="OneTrueForm" ACTION="config-process.cgi" METHOD="POST" enctype="multipart/form-data" onSubmit="SafeOnsubmit()">
<INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $agentnum %>">
<FORM NAME="OneTrueForm" ACTION="config-process.cgi" METHOD="POST" enctype="multipart/form-data" onSubmit="SafeOnsubmit()">
<INPUT TYPE="hidden" NAME="agentnum" VALUE="<% $agentnum %>">
+<INPUT TYPE="hidden" NAME="locale" VALUE="<% $locale %>">
<INPUT TYPE="hidden" NAME="key" VALUE="<% $key %>">
Setting <b><% $key %></b>
<INPUT TYPE="hidden" NAME="key" VALUE="<% $key %>">
Setting <b><% $key %></b>
@@
-49,7
+50,8
@@
Setting <b><% $key %></b>
<% $conf->exists($key, $agentnum)
? 'Current image<br>'.
'<img src="config-image.cgi?key='. $key.
<% $conf->exists($key, $agentnum)
? 'Current image<br>'.
'<img src="config-image.cgi?key='. $key.
- ';agentnum='. $agentnum. '"><br>'
+ ';agentnum='. $agentnum.
+ ';locale='. $locale .'"><br>'
: ''
%>
: ''
%>
@@
-131,7
+133,11
@@
Setting <b><% $key %></b>
% } elsif ( $type eq 'select-sub' ) {
% } elsif ( $type eq 'select-sub' ) {
- <select name="<% "$key$n" %>"><option value="">
+ <select name="<% "$key$n" %>" <% $config_item->multiple ? 'MULTIPLE' : '' %>>
+
+% unless ( $config_item->multiple ) {
+ <option value="">
+% }
% my %options = &{$config_item->options_sub};
% my @options = sort { $a <=> $b } keys %options;
% my %options = &{$config_item->options_sub};
% my @options = sort { $a <=> $b } keys %options;
@@
-139,7
+145,17
@@
Setting <b><% $key %></b>
% foreach my $value ( @options ) {
% local($^W)=0; next if $saw{$value}++;
% foreach my $value ( @options ) {
% local($^W)=0; next if $saw{$value}++;
- <option value="<% $value %>" <% $value eq $conf->config($key, $agentnum) ? 'SELECTED' : '' %>><% $value %>: <% $options{$value} %>
+ <option value="<% $value %>"
+
+% if ( $value eq $conf->config($key, $agentnum)
+% || ( $config_item->multiple
+% && grep { $_ eq $value } $conf->config($key, $agentnum) ) ){
+
+ SELECTED
+
+% }
+
+ ><% $value %>: <% $options{$value} %>
% }
% my $curvalue = $conf->config($key, $agentnum);
% }
% my $curvalue = $conf->config($key, $agentnum);
@@
-271,6
+287,7
@@
Setting <b><% $key %></b>
%
% my %opt = ( 'element_name' => "$key$n",
% 'empty_label' => ' ',
%
% my %opt = ( 'element_name' => "$key$n",
% 'empty_label' => ' ',
+% 'showdisabled' => 1,
% );
% if ( $config_item->multiple ) {
% $opt{'multiple'} = 1 if $config_item->multiple;
% );
% if ( $config_item->multiple ) {
% $opt{'multiple'} = 1 if $config_item->multiple;
@@
-303,12
+320,8
@@
Setting <b><% $key %></b>
</HTML>
<%once>
</HTML>
<%once>
-my $conf = new FS::Conf;
-my @config_items = $conf->config_items;
-my %confitems = map { $_->key => $_ } @config_items;
-
my %element_types = map { $_ => 1 } qw(
my %element_types = map { $_ => 1 } qw(
- select-part_svc select-part_pkg
+ select-part_svc select-part_pkg
select-pkg_class select-agent
);
</%once>
);
</%once>
@@
-324,6
+337,15
@@
if ($cgi->param('agentnum') =~ /(\d+)$/) {
$agentnum=$1;
}
$agentnum=$1;
}
+my $locale = '';
+if ( $cgi->param('locale') =~ /^(\w+_\w+)$/) {
+ $locale = $1;
+}
+
+my $conf = new FS::Conf { 'locale' => $locale, 'localeonly' => 1 };
+my @config_items = $conf->config_items;
+my %confitems = map { $_->key => $_ } @config_items;
+
my $agent = '';
my $title;
if ($agentnum) {
my $agent = '';
my $title;
if ($agentnum) {