Mercurial > epgrec.yaz
changeset 14:bbbc4f1ecf1d
added: remove video with real file.
author | Sushi-k <epgrec@park.mda.or.jp> |
---|---|
date | Tue, 14 Jul 2009 20:11:42 +0900 |
parents | b0fc647167f5 |
children | cbbddf99d1cd |
files | LICENSE.txt cancelReservation.php cron.d/getepg do-record.sh.sample imgs/prg_bg2.png imgs/trancBG50.png imgs/trancBG70.png recordedTable.php templates/recordedTable.html templates_c/index.html thumbs/index.html video/index.html |
diffstat | 3 files changed, 47 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- a/cancelReservation.php Tue Jul 14 00:19:55 2009 +0900 +++ b/cancelReservation.php Tue Jul 14 20:11:42 2009 +0900 @@ -15,12 +15,23 @@ try { $rec = new DBRecord( TBL_PREFIX.RESERVE_TBL, "id" , $reserve_id ); $program_id = $rec->program_id; + + if( isset( $_GET['delete_file'] ) ) { + if( $_GET['delete_file'] == 1 ) { + // ファイルを削除 + if( file_exists( INSTALL_PATH."/".SPOOL."/".$rec->path ) ) { + @unlink(INSTALL_PATH."/".SPOOL."/".$rec->path); + } + } + } } catch( Exception $e ) { // 無視 } } + + // 手動取り消しのときには、その番組を自動録画対象から外す if( $program_id ) { try {
--- a/recordedTable.php Tue Jul 14 00:19:55 2009 +0900 +++ b/recordedTable.php Tue Jul 14 20:11:42 2009 +0900 @@ -49,9 +49,10 @@ $arr['station_name'] = $ch->name; $arr['starttime'] = $r->starttime; $arr['endtime'] = $r->endtime; - $arr['title'] = "<a href=\"".INSTALL_URL."/viewer.php?reserve_id=".$r->id."\">".htmlspecialchars($r->title,ENT_QUOTES)."</a>"; - $arr['description'] = "<a href=\"".INSTALL_URL."/viewer.php?reserve_id=".$r->id."\">".htmlspecialchars($r->description,ENT_QUOTES)."</a>"; - $arr['thumb'] = "<a href=\"".INSTALL_URL."/viewer.php?reserve_id=".$r->id."\"><img src=\"".INSTALL_URL.THUMBS."/".$r->path.".jpg\" /></a>"; + $arr['asf'] = "".INSTALL_URL."/viewer.php?reserve_id=".$r->id; + $arr['title'] = htmlspecialchars($r->title,ENT_QUOTES); + $arr['description'] = htmlspecialchars($r->description,ENT_QUOTES); + $arr['thumb'] = "<img src=\"".INSTALL_URL.THUMBS."/".$r->path.".jpg\" />"; $arr['cat'] = $cat->name_en; $arr['mode'] = $RECORD_MODE[$r->mode]['name'];
--- a/templates/recordedTable.html Tue Jul 14 00:19:55 2009 +0900 +++ b/templates/recordedTable.html Tue Jul 14 20:11:42 2009 +0900 @@ -9,10 +9,29 @@ {literal} <script type="text/javascript" src="js/jquery-1.3.2.min.js"></script> +<script type="text/javascript" src="js/jquery-ui-1.7.2.custom.min.js"></script> +<link rel="stylesheet" href="start/jquery-ui-1.7.2.custom.css" type="text/css"> <script type="text/javascript"> +<!-- var PRG = { + + dialog:function(id, title){ + $('#floatBox4Dialog').dialog({title:'削除',width:500}); + var str = '<div class="prg_title">' + title + 'を削除します</div>'; + str += '<form><div style="text-align:center;">録画ファイルも削除する<input type="checkbox" id="delete_file" name="delete_file" value="1" /></div></form>'; + str +='<div style="margin:2em 0 1em 0;text-align:center;"><a href="javascript:PRG.rec(' + id + ')" class="ui-state-default ui-corner-all ui-dialog-buttonpane button">この録画を本当に削除する</a></div>'; + $('#floatBox4Dialog').html(str); + $('#floatBox4Dialog').dialog('open', 'center'); + }, rec:function(id){ - $.get(INISet.prgCancelURL, { reserve_id: id } ,function(data){ + var df = 0; + + if( $('#delete_file').attr('checked') ) { + df = 1; + } + $('#floatBox4Dialog').dialog('close'); + + $.get(INISet.prgCancelURL, { reserve_id: id, delete_file: df } ,function(data){ if(data.match(/^error/i)){ alert(data); @@ -23,6 +42,7 @@ }); } } +--> </script> <style type="text/css"> <!-- @@ -69,6 +89,12 @@ table#reservation_table tr.ctg_10, #category_select a.ctg_10 {background-color: #E4F4F4;} +#floatBox4Dialog .prg_title{font-size:120%;font-weight:bold;padding:0.4em 0;text-align:center;} +#floatBox4Dialog .prg_rec_cfg{background:#EEE;padding:1em 2em;margin:0.4em 0;} +#floatBox4Dialog .labelLeft {width:8em;float:left;text-align:right;} +#floatBox4Dialog .button {padding:0.4em 1em;} + + --> </style> {/literal} @@ -118,10 +144,10 @@ <td>{$rec.starttime}</td> <td>{$rec.station_name}</td> <td>{$rec.mode}</td> - {if $use_thumbs}<td>{$rec.thumb}</td>{/if} - <td>{$rec.title}</td> - <td>{$rec.description}</td> - <td><input type="button" value="削除" onClick="javascript:PRG.rec('{$rec.id}')" /></td> + {if $use_thumbs}<td><a href="{$rec.asf}">{$rec.thumb}</a></td>{/if} + <td><a href="{$rec.asf}">{$rec.title}</a></td> + <td><a href="{$rec.asf}">{$rec.description}</a></td> + <td><input type="button" value="削除" onClick="javascript:PRG.dialog('{$rec.id}','{$rec.title}')" /></td> </tr> {/foreach} </table> @@ -130,7 +156,7 @@ 現在、録画済データはありません {/if} - +<div id="floatBox4Dialog">jQuery UI Dialog</div> {literal} <script type="text/javascript">