fix setings and auto process

This commit is contained in:
Bob Buxton 2020-05-01 15:41:13 +01:00
parent 93ecb00259
commit ac9e2ce8e8
3 changed files with 9 additions and 7 deletions

View File

@ -12,7 +12,7 @@ proc ::schedchk::run {} {
#::auto::autoflagscan $::auto::root schedchk ::schedchk::directory
set sc_noauto [$::auto::settings _nval_setting "schedchk_noauto"]
if {!$sc_noauto} {
exec /mod/webif/plugin/schedchk/schedchk.jim -rsv >@$::auto::logfd
exec /mod/webif/plugin/schedchk/schedchk.jim -rsv >>$::auto::logfile
}
}

View File

@ -13,10 +13,11 @@ source "/mod/webif/plugin/schedchk/optlist.jim"
# Update settings if value changed
foreach optl $optarray {
lassign $optl desc key defval helptxt
set curval [$settings _nval_setting "schedchk_$key"]
set keyl [string tolower $key]
set curval [$settings _nval_setting "schedchk_$keyl"]
set newval [cgi_get schedchk_$key]
if {$newval != $curval} {
[settings new] _nval_setting "schedchk_$key" $newval
[settings new] _nval_setting "schedchk_$keyl" $newval
puts "<br>Updated -$key default"
}
}

View File

@ -17,12 +17,13 @@ source "/mod/webif/plugin/schedchk/optlist.jim"
# Override default from settings DB
foreach optl $optarray {
lassign $optl desc key defval helptxt
set keyl [string tolower $key]
set chkbox 0
if {[string is alpha $defval]} {set chkbox 1}
if {$defval eq "n"} {set defval 0}
if {$defval eq "y"} {set defval 1}
set ::opts($key) [$settings _nval_setting "schedchk_$key"]
if {$::opts($key)==0} {set ::opts($key) $defval}
set ::opts($keyl) [$settings _nval_setting "schedchk_$keyl"]
if {$::opts($keyl)==0} {set ::opts($keyl) $defval}
if {$chkbox} {
puts "
@ -31,7 +32,7 @@ foreach optl $optarray {
</th>
<td><input id=schedchk_$key name=schedchk_$key
type=checkbox value=1"
if {$::opts($key)} { puts -nonewline " checked" }
if {$::opts($keyl)} { puts -nonewline " checked" }
puts ">
</td>
<td>$helptxt</td>
@ -42,7 +43,7 @@ foreach optl $optarray {
<th class=key>$desc (-$key)
</th>
<td><input id=schedchk_$key name=schedchk_$key
type=number size=5 value=$::opts($key)>
type=number size=5 value=$::opts($keyl)>
</td>
<td>$helptxt</td>
</tr>"