OSDN Git Service

update epgrec template,cmcheck class
authorHiroshi Yamashita <piro@users.sourceforge.jp>
Sun, 4 Nov 2012 12:13:21 +0000 (21:13 +0900)
committerHiroshi Yamashita <piro@users.sourceforge.jp>
Sun, 4 Nov 2012 12:13:21 +0000 (21:13 +0900)
epgrec/Cmcheck.class.php
epgrec/cmcheckExec.php
epgrec/templates/cmcheckTable.html

index 91387ed..39ee44c 100644 (file)
@@ -62,8 +62,13 @@ function __construct( $reserve_id = null ) {
                                $ary['startsv']=$itm[1];
                                 $ary['end']=$itm[2];
                                 $ary['diff']=$itm[4];
-                                $ary['cm']=trim($itm[5]);
-                               $ary['thumb']=$settings->install_url.$settings->spool. "/".$this->rrec->path."-".$itmcnt.".png";
+                                if (trim($itm[5])=='CM') {
+                                    $ary['cm']=trim($itm[5]);
+                                }
+                                else {
+                                    $ary['fixparam']=trim($itm[5]);
+                                }
+                               $ary['thumb']=$installurla['path'].$settings->spool. "/".$this->rrec->path."-".$itmcnt.".png";
                                 array_push($this->cmdata,$ary);
                                $itmcnt++;
                        }
@@ -92,9 +97,10 @@ function getfilename() {
 function getfileurl() {
        return $this->fileurl;
 }
-function putdata($newcm)
+function putdata($newcm,$fixstr)
 {
        $newary = explode(",",$newcm);
+       $fixary = explode("|",$fixstr);
 
        if (count($this->cmdata)!=count($newary)) return(0);
 
@@ -108,8 +114,9 @@ function putdata($newcm)
        foreach($this->cmdata as $data) {
                if ($newary[$cnt]=="1")
                        $cmval = "CM";
-               else
-                       $cmval = "";
+               else {
+                       $cmval = $fixary[$cnt];
+               }
                fprintf($fp,"# %s %s diff %s %s\n",
                        $data['startsv'],$data['end'],$data['diff'],$cmval);
                $cnt++;
index 15d209f..cd72dee 100755 (executable)
@@ -13,6 +13,7 @@ $reserve_id = $_POST['reserve_id'];
 $cmcheckcomplete = $_POST['cmcheckcomplete'];
 $replace = $_POST['replace'];
 $newcmcheckval = $_POST['checkval'];
+$newcmfixval = $_POST['fixval'];
 $cmdvol = $_POST['optvol'];
 $cmddif = $_POST['optdif'];
 
@@ -36,7 +37,7 @@ try{
                        if (!$cm->getbasefile()) {
                                exit( "Error:"."ファイルがありません");
                        }
-                       if ($cm->putdata($newcmcheckval)==1) {
+                       if ($cm->putdata($newcmcheckval,$newcmfixval)==1) {
                                $cmdbuf=sprintf("/usr/local/bin/cmcheckwave -t -x %s\n",escapeshellarg($cm->getfilename()));
                                system($cmdbuf);
                        }
index 20ffb8a..3c2bad6 100755 (executable)
@@ -10,6 +10,7 @@
 {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>
+<script type="text/javascript" src="js/jquery.validate.min.js"></script>
 <link rel="stylesheet" href="start/jquery-ui-1.7.2.custom.css" type="text/css">
 
 <script type="text/javascript">
                recut:function(mode){
                        var id_reserve_id = $('#id_reserve_id').val();
                        var tblstr="";
+                       var fixstr="";
                        if (mode == 1) {
-                               var elem = document.cmtbl.elements.length;
+                               var elem = document.cmtbl.iscm.length;
                                for(i=0;i<elem;i++) {
                                        if (tblstr!="")
                                                tblstr=tblstr + ",";
-                                       if (document.cmtbl.elements[i].checked)
+                                       if (document.cmtbl.iscm[i].checked)
                                                tblstr=tblstr + "1";
                                        else
                                                tblstr=tblstr + "0";
                                }
+                               elem = document.cmtbl.cmfix.length;
+                               for(i=0;i<elem;i++) {
+                                       if (i>0)
+                                               fixstr=fixstr + "|";
+                                   fixstr=fixstr + document.cmtbl.cmfix[i].value;
+                               }
                        }
                        var id_optvol = $('#id_optvol').val();
                        var id_optdif = $('#id_optdif').val();
@@ -82,7 +90,7 @@
                        $('#floatBox4Dialog').dialog('close');
                        $('#floatBox4Dialog').html(str);
                        $('#floatBox4Dialog').dialog('open', 'center');
-                       $.post('cmcheckExec.php', { reserve_id: id_reserve_id, checkval: tblstr ,optvol: id_optvol,optdif: id_optdif } , function( data ) {
+                       $.post('cmcheckExec.php', { reserve_id: id_reserve_id, checkval: tblstr ,optvol: id_optvol,optdif: id_optdif, fixval: fixstr } , function( data ) {
                                if(data.match(/^error/i)){
                                        $('#floatBox4Dialog').dialog('close');
                                        alert(data);
@@ -206,26 +214,28 @@ table#reservation_table tr.prg_rec  {background-color: #F55;color:#FEE}
 </div>
 <BR>
 <div>
-       チェックボックスのチェック内容で再度分割します。<input type="submit" value="再分割実施" onClick="javascript:PRG.dialog('{$reserveid}','{$sitetitle}',1)"/>
+    チェックボックスのチェック内容で再度分割します。<input type="button" value="再分割実施" onClick="javascript:PRG.dialog('{$reserveid}','{$sitetitle}',1)"/>
 </div>
 <BR>
+<form name="cmtbl" id="cmtbl">
 <table id="cmcheck_table">
  <tr>
   <th>id</th>
   <th>開始位置</th>
   <th>間隔</th>
   <th>CM</th>
+  <th>fix</th>
   <th>サムネイル</th>
  </tr>
 
-{foreach from=$cmary item=keyword}
-<form name="cmtbl">
<tr id="keyid_{$keyword.id}">
-  <td>{$keyword.id}</td>
-  <td>{$keyword.start}</td>
-  <td>{$keyword.diff}</td>
-  <td><input type="checkbox" id="iscm" name="iscm" value="1" {if $keyword.cm == CM } checked {/if}/>{$keyword.cm}</td>
-  <td><img width="128" height="72" src="{$keyword.thumb}"  onClick="javascript:PRG.imgdialog('{$keyword.id}','{$keyword.thumb}')""/></td>
+{foreach from=$cmary item=cm}
+ <tr id="keyid_{$cm.id}">
 <td>{$cm.id}</td>
+  <td>{$cm.start}</td>
+  <td>{$cm.diff}</td>
+  <td><input type="checkbox" id="iscm" name="iscm" value="1" {if $cm.cm == CM } checked {/if}/>{$cm.cm}</td>
+  <td><input type="text" size="5" id="cmfix" name="cmfix" value="{$cm.fixparam}" {if $cm.cm == CM } style="display:none" {/if}/></td>
+  <td><img width="128" height="72" src="{$cm.thumb}"  onClick="javascript:PRG.imgdialog('{$cm.id}','{$cm.thumb}')""/></td>
  </tr>
 {/foreach}
 </table>