use findhsvc class

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@352 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2011-09-03 23:26:54 +00:00
parent b378ec1b9c
commit f6bf03691d
4 changed files with 24 additions and 43 deletions

View File

@ -1,7 +1,7 @@
Package: webif
Priority: optional
Section: web
Version: 0.6.7
Version: 0.6.8
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: mongoose(>=3.0-2),jim(>=0.71-1),jim-sqlite3(>=0.71-1),jim-cgi(>=0.4),jim-oo,jim-pack,service-control,busybox(>=1.18.3-1),lsof,epg(>=1.0.3),hmt(>=1.0.6),ssmtp

View File

@ -3,7 +3,7 @@
package require cgi
source /mod/var/mongoose/lib/setup
require rsv.class
require rsv.class findhsvc
set dir /mod/var/backup
@ -33,24 +33,6 @@ if {[catch { set fd [open $ffile r] } msg]} {
exit
}
proc findhsvc {channel} {
global rsvdb
set hsvc [$rsvdb query "
select hSvc
from channel.TBL_SVC
where szSvcName = '$channel'
or szSvcname = '\025$channel'
limit 1
"]
if {[llength $hsvc] == 1} {
return [lindex [lindex $hsvc 0] 1]
} else {
return 0
}
}
puts "Restoring scheduled events..."
$rsvdb query {begin transaction;}
@ -111,7 +93,7 @@ foreach line $data {
set group [lindex $vals 1]
set type [lindex $vals 2]
set chan [lindex $vals 3]
set hsvc [findhsvc $chan]
set hsvc [get_channel_attr $chan]
if {$grp != $group} {
set grp $group

View File

@ -1,41 +1,38 @@
if {![exists -proc findhsvc]} {
if {![exists -proc get_channel_attr]} {
require rsv.class
proc findhsvc {channel} {
proc get_channel_attr {channel {field hSvc}} {
global rsvdb
set hsvc [$rsvdb query "
select hSvc
set ff [$rsvdb query "
select $field
from channel.TBL_SVC
where szSvcName = '$channel'
or szSvcname = '\025$channel'
limit 1
"]
if {[llength $hsvc] == 1} {
return [lindex [lindex $hsvc 0] 1]
} else {
return 0
if {[llength $ff] == 1} {
return [lindex [lindex $ff 0] 1]
}
return ""
}
proc findhsvcbylcn {lcn} {
proc get_channel_attr_bylcn {lcn {field hSvc}} {
global rsvdb
set hsvc [$rsvdb query "
select hSvc
set ff [$rsvdb query "
select $field
from channel.TBL_SVC
where usLcn = $lcn
limit 1
"]
if {[llength $hsvc] == 1} {
return [lindex [lindex $hsvc 0] 1]
} else {
return 0
if {[llength $ff] == 1} {
return [lindex [lindex $ff 0] 1]
}
return 0
}
}

View File

@ -82,7 +82,7 @@ rsv method channel_name {} {
rsv method icon {} {
set rsvicon ""
switch [$self get ersvtype] {
switch $ersvtype {
1 { set rsvicon "175_1_00_Reservation_Watch.png" }
2 { set rsvicon "175_1_00_Reservation_Watch.png" }
3 { set rsvicon "175_1_11_Reservation_Record.png" }
@ -94,16 +94,18 @@ rsv method icon {} {
}
rsv method RKIcon {} {
if {[$self get ucRecKind] == 4} {
set RKIcon "175_1_11_Series_Record.png"
} else {
switch [$self get erepeat] {
switch $ucRecKind {
2 { set RKIcon "178_1_26_Icon_Split.png" }
4 { set RKIcon "175_1_11_Series_Record.png" }
default {
switch $erepeat {
1 {set RKIcon "521_1_00_RP_Daily_C.png"}
2 {set RKIcon "521_1_00_RP_Weekly_C.png"}
3 {set RKIcon "521_1_00_RP_Weekdays_C.png"}
4 {set RKIcon "521_1_00_RP_Weekend_C.png"}
default {set RKIcon ""}
}
}
}
return $RKIcon
}
@ -113,7 +115,7 @@ rsv method set_delete {} {
}
rsv method remove_pending {} {
$::rsvdb query "delete from pending where ulslot = [$self get ulslot]"
$::rsvdb query "delete from pending where ulslot = $ulslot"
}
rsv method fix_hsvc {} {