projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fix disposition, add clid, RT#81941
[freeside.git]
/
httemplate
/
config
/
config.cgi
diff --git
a/httemplate/config/config.cgi
b/httemplate/config/config.cgi
index
6a1eaec
..
50b3eba
100644
(file)
--- a/
httemplate/config/config.cgi
+++ b/
httemplate/config/config.cgi
@@
-40,12
+40,14
@@
Setting <b><% $key %></b>
<table><tr><td>
% my $n = 0;
<table><tr><td>
% my $n = 0;
+% my $submit = 0;
% foreach my $type (@types) {
% if ( $type eq '' ) {
<font color="#ff0000">no type</font>
% } elsif ( $type eq 'image' ) {
% foreach my $type (@types) {
% if ( $type eq '' ) {
<font color="#ff0000">no type</font>
% } elsif ( $type eq 'image' ) {
+% $submit++;
<% $conf->exists($key, $agentnum)
? 'Current image<br>'.
<% $conf->exists($key, $agentnum)
? 'Current image<br>'.
@@
-59,24
+61,37
@@
Setting <b><% $key %></b>
New image filename <input type="file" name="<% "$key$n" %>">
% } elsif ( $type eq 'binary' ) {
New image filename <input type="file" name="<% "$key$n" %>">
% } elsif ( $type eq 'binary' ) {
+% $submit++;
Filename <input type="file" name="<% "$key$n" %>">
% } elsif ( $type eq 'textarea' ) {
Filename <input type="file" name="<% "$key$n" %>">
% } elsif ( $type eq 'textarea' ) {
+% $submit++;
<textarea name="<% "$key$n" %>" rows=12 cols=78 wrap="off"><% join("\n", $conf->config($key, $agentnum)) |h %></textarea>
% } elsif ( $type eq 'checkbox' ) {
<textarea name="<% "$key$n" %>" rows=12 cols=78 wrap="off"><% join("\n", $conf->config($key, $agentnum)) |h %></textarea>
% } elsif ( $type eq 'checkbox' ) {
+%
+% if ( $agentnum && $conf->exists($key) && ! $agent_bool ) {
- <input name="<% "$key$n" %>" type="checkbox" value="1"
-
<% $conf->exists($key, $agentnum) ? 'CHECKED' : '' %>
>
+ <input name="<% "$key$n" %>" type="checkbox" value="1" CHECKED DISABLED>
+
<FONT SIZE="-1"><I>(global setting cannot yet be overridden)</I></FONT
>
-% } elsif ( $type eq 'text' ) {
+% } else {
+% $submit++;
- <input name="<% "$key$n" %>" type="text" value="<% $conf->exists($key, $agentnum) ? $conf->config($key, $agentnum) : '' |h %>">
+ <input name="<% "$key$n" %>" type="checkbox" value="1"
+ <% $conf->config_bool($key, $agentnum) ? 'CHECKED' : '' %> >
+% }
-% } elsif ( $type eq 'select' || $type eq 'selectmultiple' ) {
+% } elsif ( $type eq 'text' ) {
+% $submit++;
+ <input name="<% "$key$n" %>" type="text" value="<% $conf->exists($key, $agentnum) ? $conf->config($key, $agentnum) : '' |h %>">
+
+% } elsif ( $type eq 'select' || $type eq 'selectmultiple' ) {
+% $submit++;
+
<select name="<% "$key$n" %>" <% $type eq 'selectmultiple' ? 'MULTIPLE' : '' %>>
%
<select name="<% "$key$n" %>" <% $type eq 'selectmultiple' ? 'MULTIPLE' : '' %>>
%
@@
-131,7
+146,8
@@
Setting <b><% $key %></b>
</select>
</select>
-% } elsif ( $type eq 'select-sub' ) {
+% } elsif ( $type eq 'select-sub' ) {
+% $submit++;
<select name="<% "$key$n" %>" <% $config_item->multiple ? 'MULTIPLE' : '' %>>
<select name="<% "$key$n" %>" <% $config_item->multiple ? 'MULTIPLE' : '' %>>
@@
-140,7
+156,9
@@
Setting <b><% $key %></b>
% }
% my %options = &{$config_item->options_sub};
% }
% my %options = &{$config_item->options_sub};
-% my @options = sort { $a <=> $b } keys %options;
+% my @options = keys %options;
+% my $sortsub = $config_item->sort_sub || sub { $a <=> $b };
+% @options = sort $sortsub @options;
% my %saw;
% foreach my $value ( @options ) {
% local($^W)=0; next if $saw{$value}++;
% my %saw;
% foreach my $value ( @options ) {
% local($^W)=0; next if $saw{$value}++;
@@
-167,8
+185,8
@@
Setting <b><% $key %></b>
</select>
</select>
-% } elsif ( $type eq 'editlist' ) {
-%
+% } elsif ( $type eq 'editlist' ) {
+%
$submit++;
<script>
function doremove<% "$key$n" %>() {
fromObject = document.OneTrueForm.<% "$key$n" %>;
<script>
function doremove<% "$key$n" %>() {
fromObject = document.OneTrueForm.<% "$key$n" %>;
@@
-284,10
+302,10
@@
Setting <b><% $key %></b>
</tr></table>
% } elsif ( $element_types{$type} ) {
</tr></table>
% } elsif ( $element_types{$type} ) {
+% $submit++;
%
% 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;
@@
-313,7
+331,10
@@
Setting <b><% $key %></b>
% }
</tr>
</table>
% }
</tr>
</table>
-<INPUT TYPE="submit" VALUE="<% $title %>">
+
+% if ( $submit ) {
+ <INPUT TYPE="submit" VALUE="<% $title %>">
+% }
</FORM>
</BODY>
</FORM>
</BODY>
@@
-365,5
+386,6
@@
my $config_item = $confitems{$key};
my $description = $config_item->description;
my $config_type = $config_item->type;
my @types = ref($config_type) ? @$config_type : ($config_type);
my $description = $config_item->description;
my $config_type = $config_item->type;
my @types = ref($config_type) ? @$config_type : ($config_type);
+my $agent_bool = $config_item->agent_bool;
</%init>
</%init>