Changeset 16282


Ignore:
Timestamp:
2007/10/05 22:47:45 (16 years ago)
Author:
naka
Message:

パラメータ設定まわりの改修

Location:
branches/feature-module-update/data/class
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/feature-module-update/data/class/GC_SendMail.php

    r16276 r16282  
    2222            $name = ereg_replace(">",">", $name); 
    2323             
    24             if(WINDOWS != true) { 
     24            if(OS_TYPE != 'WIN') { 
    2525                // windowsでは文字化けするので使用しない。 
    2626                $name = mb_convert_encoding($name,"JIS",CHAR_CODE);  
     
    7171        $from_name = ereg_replace(">",">", $from_name); 
    7272         
    73         if(WINDOWS != true) { 
     73        if(OS_TYPE != 'WIN') { 
    7474            // windowsでは文字化けするので使用しない。 
    7575            $from_name = mb_convert_encoding($from_name,"JIS",CHAR_CODE);        
  • branches/feature-module-update/data/class/SC_CheckError.php

    r16153 r16282  
    907907     */ 
    908908    function evalCheck($value) { 
     909        // falseは、正当な式と評価する。 
     910        if($value === "false") { 
     911            return true; 
     912        }        
    909913        return @eval("return " . $value . ";"); 
    910914    } 
  • branches/feature-module-update/data/class/SC_Query.php

    r15532 r16282  
    196196            if(eregi("^Now\(\)$", $val)) { 
    197197                $strval .= 'Now(),'; 
     198            // 先頭に~があるとプレースホルダーしない。 
     199            } else if(ereg("^~", $val)) { 
     200                $strval .= ereg_replace("^~", "", $val); 
    198201            } else { 
    199202                $strval .= '?,'; 
     
    266269            if(eregi("^Now\(\)$", $val)) { 
    267270                $strcol .= $key . '= Now(),'; 
     271            // 先頭に~があるとプレースホルダーしない。 
     272            } else if(ereg("^~", $val)) { 
     273                $strcol .= $key . "=" . ereg_replace("^~", "", $val) . ","; 
    268274            } else { 
    269275                $strcol .= $key . '= ?,'; 
  • branches/feature-module-update/data/class/db/SC_DB_MasterData.php

    r16248 r16282  
    3434 
    3535    /** デフォルトのテーブルカラム名 */ 
    36     var $columns = array("id", "name", "rank"); 
     36    var $columns = array("id", "name", "rank", "remarks"); 
    3737 
    3838    // }}} 
     
    146146        } 
    147147        return $i; 
     148    } 
     149     
     150    /** 
     151     * マスタデータを追加する. 
     152     * 
     153     * 引数 $masterData の値でマスタデータを更新する. 
     154     * $masterData は key => value 形式の配列である必要がある. 
     155     * 
     156     * @param string $name マスタデータ名 
     157     * @param string $key キー名 
     158     * @param string $comment コメント 
     159     * @param bool $autoCommit トランザクションを自動的に commit する場合 true 
     160     * @return integer マスタデータの更新数 
     161     */ 
     162    function insertMasterData($name, $key, $value, $comment, $autoCommit = true) { 
     163 
     164        $columns = $this->getDefaultColumnName(); 
     165 
     166        $this->objQuery = new SC_Query(); 
     167        if ($autoCommit) { 
     168            $this->objQuery->begin(); 
     169        } 
     170         
     171        // 指定のデータを追加 
     172        $sqlVal[$columns[0]] = $key;             
     173        $sqlVal[$columns[1]] = $value; 
     174        $sqlVal[$columns[2]] = $this->objQuery->max($name, $columns[2]) + 1;         
     175        $sqlVal[$columns[3]] = $comment; 
     176        $this->objQuery->insert($name, $sqlVal); 
     177         
     178        if ($autoCommit) { 
     179            $this->objQuery->commit(); 
     180        } 
     181        return 1; 
    148182    } 
    149183 
Note: See TracChangeset for help on using the changeset viewer.