versioned backups + change folder for pending

git-svn-id: file:///root/webif/svn/humax/pkg/src/webif/trunk@2044 2a923420-c742-0410-a762-8d5b09965624
This commit is contained in:
hummypkg 2014-10-07 21:23:15 +00:00
parent e6d7af1fc4
commit c886f6afd2
4 changed files with 23 additions and 6 deletions

View File

@ -4,7 +4,7 @@ Section: web
Version: 1.0.17
Architecture: mipsel
Maintainer: af123@hummypkg.org.uk
Depends: webif-channelicons(>=1.1.12-2),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.21),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),mongoose
Depends: webif-channelicons(>=1.1.13),lighttpd(>=1.4.35-2),jim(>=0.75-1),jim-oo,jim-sqlite3(>=0.75),jim-cgi(>=0.7),jim-binary(>=0.75),service-control(>=1.2),busybox(>=1.20.2-1),lsof(>=4.87),epg(>=1.0.13),hmt(>=1.1.21),ssmtp,anacron,trm(>=1.1),openssl-command,nicesplice,id3v2,file,rsvsync(>=1.0.2),webif-charts(>=1.2-1),stripts(>=1.2.5-3),smartmontools,tmenu(>=1.08),ffmpeg,id3v2,multienv(>=1.6),mongoose
Suggests:
Description: An evolving web interface for the Humax.
Tags: http://hummy.tv/forum/threads/5031/

View File

@ -58,6 +58,7 @@ puts {
<div id=fchange title="Change folder" style="display: none">
<form id=fchangeform>
<input type=hidden name=sid id=fchangeslot value=0>
<input type=hidden name=table id=fchangetable value=TBL_RESERVATION>
<table border=0>
<tr>
<th>

View File

@ -152,7 +152,8 @@ function preparemenu(el, menu)
else
$('#optmenu').disableContextMenuItems('#mkfolder');
if ($(el).attr('table') != 'pending' && $(el).attr('reckind') == 4)
// if ($(el).attr('table') != 'pending' && $(el).attr('reckind') == 4)
if ($(el).attr('reckind') == 4)
$('#optmenu').enableContextMenuItems('#folder');
else
$('#optmenu').disableContextMenuItems('#folder');
@ -194,6 +195,7 @@ function menuclick(action, el, pos)
case 'folder':
$('#fchangeslot').val(sid);
$('#fchangename').val($(el).find('a.schedule').text());
$('#fchangetable').val($(el).attr('table'));
$('#fchange').dialog('open');
break;

View File

@ -279,11 +279,15 @@ rsv method insert {{table pending} {force 0}} {
set vals {}
foreach field $fields {
# Escape any quotes and percents embedded in the data.
regsub -all {['%]} [$self get $field] {&&} f
if {$field in $::binaryfields} {
set f [$self get $field]
if {$field in $::binaryfields && [string bytelength $f] > 1} {
if {![regexp -nocase {^[0-9a-f]+$} $f} {
binary scan $f H* f
}
lappend vals "X'$f'"
} else {
# Escape any quotes and percents embedded in the data.
regsub -all {['%]} $f {&&} f
lappend vals "'$f'"
}
}
@ -530,7 +534,8 @@ proc {rsv backup} {file} {
set fields [lsort [[rsv] vars]]
#puts $fd "# [join $fields "\t"]"
puts $fd "# version 2"
puts $fd "# [join $fields "\t"]"
foreach event $events {
puts " Backing up scheduled event '[$event name]'"
@ -590,12 +595,21 @@ proc {rsv restore} {file} {
set data [split [read $fd] "\n"]
set ver 1
foreach line $data {
if {[string match "# version *" $line]} {
set ver [lindex [split $line " "] 2]
puts "Backup version $ver"
}
set vals [split $line "\t"]
if {[lindex $vals 0] ne "event"} { continue }
set vars {}
set i 0
foreach f $fields {
if {$ver < 2 && $f eq "aulEventToRecordInfo"} {
continue
}
incr i
lappend vars $f [lindex $vals $i]
}