# HG changeset patch # User yoneda # Date 1248598811 -32400 # Node ID a34f2ff49097f86f308ecedc97109a91f6b4a874 # Parent 82c1375ddb4adc0290fde60322154b543c033541 add: editable title & description diff -r 82c1375ddb4a -r a34f2ff49097 changeReservation.php --- a/changeReservation.php Sat Jul 25 23:07:02 2009 +0900 +++ b/changeReservation.php Sun Jul 26 18:00:11 2009 +0900 @@ -1,21 +1,47 @@ title = trim( $_POST['title'] ); + if( ($dbh !== false) && ($rec->complete == 1) ) { + $title = trim( mysql_real_escape_string($_POST['title'])); + $title .= "(".date("Y/m/d", toTimestamp($rec->starttime)).")"; + $sqlstr = "update mt_cds_object set dc_title='".$title."' where metadata regexp 'epgrec:id=".$reserve_id."$'"; + mysql_query( $sqlstr ); + } } if( isset( $_POST['description'] ) ) { $rec->description = trim( $_POST['description'] ); + if( ($dbh !== false) && ($rec->complete == 1) ) { + $desc = "dc:description=".trim( mysql_real_escape_string($_POST['description'])); + $desc .= "&epgrec:id=".$reserve_id; + $sqlstr = "update mt_cds_object set metadata='".$desc."' where metadata regexp 'epgrec:id=".$reserve_id."$'"; + @mysql_query( $sqlstr ); + } } } catch( Exception $e ) { @@ -24,4 +50,4 @@ exit("complete"); -?> +?> \ No newline at end of file diff -r 82c1375ddb4a -r a34f2ff49097 recomplete.php --- a/recomplete.php Sat Jul 25 23:07:02 2009 +0900 +++ b/recomplete.php Sun Jul 26 18:00:11 2009 +0900 @@ -23,7 +23,7 @@ // 別にやらなくてもいいが $sqlstr = "set NAME utf8"; mysql_query( $sqlstr ); - $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."' where dc_title='".$rrec->path."'"; + $sqlstr = "update mt_cds_object set metadata='dc:description=".mysql_real_escape_string($rrec->description)."&epgrec:id=".$reserve_id."' where dc_title='".$rrec->path."'"; mysql_query( $sqlstr ); $sqlstr = "update mt_cds_object set dc_title='".mysql_real_escape_string($rrec->title)."(".date("Y/m/d").")' where dc_title='".$rrec->path."'"; mysql_query( $sqlstr ); diff -r 82c1375ddb4a -r a34f2ff49097 templates/recordedTable.html --- a/templates/recordedTable.html Sat Jul 25 23:07:02 2009 +0900 +++ b/templates/recordedTable.html Sun Jul 26 18:00:11 2009 +0900 @@ -40,8 +40,45 @@ $('#resid_' + id ).hide(); } }); + }, + editdialog:function(id) { + $('#floatBox4Dialog').dialog({title:'変更',width:500}); + var str; + str = '
録画ID:' + id + '
'; + str += ''; + str += '
タイトル
'; + str += '
概要
'; + str += '
変更する
'; + + $('#floatBox4Dialog').html(str); + $('#floatBox4Dialog').dialog('open','center'); + }, + edit:function() { + var id_reserve_id = $('#id_reserve_id').val(); + var id_title = $('#id_title').val(); + var id_description = $('#id_description').val(); + + $.post('changeReservation.php', { reserve_id: id_reserve_id, + title: id_title, + description: id_description }, function( data ) { + if(data.match(/^error/i)){ + alert(data); + $('#floatBox4Dialog').dialog('close'); + + } + else { + $('#tid_' + id_reserve_id ).html( id_title ); + $('#did_' + id_reserve_id ).html( id_description ); + $('#floatBox4Dialog').dialog('close'); + } + }); } } + $(document).ready(function () { + var DG = $('#floatBox4Dialog'); + DG.dialog({title:'あれ?',width:500}); + DG.dialog('close'); + }); -->