Index: /branches/comu-ver2/data/include/module.inc =================================================================== --- /branches/comu-ver2/data/include/module.inc (revision 17152) +++ /branches/comu-ver2/data/include/module.inc (revision 17193) @@ -53,4 +53,5 @@ 'mdl_opebuilder', 'mdl_souraku', + 'mdl_ts', ); Index: /branches/comu-ver2/data/class/pages/upgrade/LC_Page_Upgrade_Download.php =================================================================== --- /branches/comu-ver2/data/class/pages/upgrade/LC_Page_Upgrade_Download.php (revision 16932) +++ /branches/comu-ver2/data/class/pages/upgrade/LC_Page_Upgrade_Download.php (revision 17193) @@ -213,9 +213,11 @@ $this->registerUpdateLog($arrCopyLog, $objRet->data); - if ($mode != 'patch_download') { - // dtb_moduleの更新 - $objLog->log("* insert/update dtb_module start"); - $this->updateMdlTable($objRet->data); - } + // dtb_moduleの更新 + $objLog->log("* insert/update dtb_module start"); + $this->updateMdlTable($objRet->data); + + // DB更新ファイルの読み込み、実行 + $objLog->log("* file execute start"); + $this->fileExecute($objRet->data->product_code); // 配信サーバへ通知 @@ -370,4 +372,22 @@ $objQuery->insert('dtb_module_update_logs', $arrInsert); } + + /** + * DB更新ファイルの読み込み、実行 + * + * パッチ側でupdate.phpを用意する. + * 他の変数・関数とかぶらないよう、 + * LC_Update_Updater::execute()で処理を実行する. + */ + function fileExecute($productCode) { + $file = DATA_PATH . 'downloads/update/' . $productCode . '_update.php'; + if (file_exists($file)) { + @include_once $file; + if (class_exists('LC_Update_Updater')) { + $update = new LC_Update_Updater; + $update->execute(); + } + } + } } ?> Index: /branches/comu-ver2/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php =================================================================== --- /branches/comu-ver2/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php (revision 16947) +++ /branches/comu-ver2/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php (revision 17193) @@ -86,5 +86,5 @@ */ function decode($str) { - if (version_compare(phpversion(), '5.2.0', '>=')) { + if (function_exists('json_decode')) { LC_Upgrade_Helper_Log::log(' *use json_decode()'); return json_decode($str); Index: /branches/comu-ver2/data/class/pages/shopping/LC_Page_Shopping_Complete.php =================================================================== --- /branches/comu-ver2/data/class/pages/shopping/LC_Page_Shopping_Complete.php (revision 16985) +++ /branches/comu-ver2/data/class/pages/shopping/LC_Page_Shopping_Complete.php (revision 17193) @@ -124,4 +124,9 @@ $this->tpl_aff_option.= "|total=$total"; } + + // TradeSafe連携用 + if (function_exists('sfTSRequest')) { + sfTSRequest($order_id); + } } @@ -192,5 +197,4 @@ //その他情報の取得 - $other_data = $objQuery->get("dtb_order", "memo02", "order_id = ? ", array($order_id)); if($other_data != "") { @@ -216,4 +220,9 @@ if($total != "") { $this->tpl_aff_option.= "|total=$total"; + } + + // TS連携モジュールの実行 + if (function_exists('sfTSRequest')) { + sfTSRequest($order_id); } } Index: /branches/comu-ver2/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php =================================================================== --- /branches/comu-ver2/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php (revision 17136) +++ /branches/comu-ver2/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php (revision 17193) @@ -115,4 +115,7 @@ $objView->_smarty->clear_compiled_tpl(); + // common.cssの内容を更新 + $this->lfChangeCommonCss($template_code); + // ブロック位置を更新 $this->lfChangeBloc($template_code); @@ -254,4 +257,24 @@ } + /** + * common.cssの更新 + */ + function lfChangeCommonCss($template_code) { + $css_path = USER_PATH . "css/common.css"; + + // ファイル内容取得 + $css_data = file_get_contents($css_path); + + // ファイル内容更新 + $pt = '/(@import url\("\.\.\/packages\/.+\/css\/import\.css"\);)/'; + $rp = '@import url("../packages/'. $template_code. '/css/import.css");'; + $css = preg_replace($pt, $rp, $css_data); + + // ファイル更新 + $fp = fopen($css_path,"w"); + fwrite($fp, $css); + fclose($fp); + } + /** * ブロック位置の更新 Index: /branches/comu-ver2/data/class/pages/admin/products/LC_Page_Admin_Products.php =================================================================== --- /branches/comu-ver2/data/class/pages/admin/products/LC_Page_Admin_Products.php (revision 17191) +++ /branches/comu-ver2/data/class/pages/admin/products/LC_Page_Admin_Products.php (revision 17193) @@ -183,6 +183,6 @@ break; case 'search_name': // 商品名 - $where .= " AND name ILIKE ?"; - $view_where .= " AND name ILIKE ?"; + $where .= " AND name LIKE ?"; + $view_where .= " AND name LIKE ?"; $arrval[] = "%$val%"; break; Index: /branches/comu-ver2/data/class/pages/products/LC_Page_Products_List.php =================================================================== --- /branches/comu-ver2/data/class/pages/products/LC_Page_Products_List.php (revision 17094) +++ /branches/comu-ver2/data/class/pages/products/LC_Page_Products_List.php (revision 17193) @@ -375,5 +375,5 @@ $objQuery = new SC_Query(); $objDb = new SC_Helper_DB_Ex(); - $this->tpl_pageno = isset($_POST['pageno']) ? $_POST['pageno'] : ""; + $this->tpl_pageno = defined("MOBILE_SITE") ? @$_GET['pageno'] : @$_POST['pageno']; //表示順序 Index: /branches/comu-ver2/data/class/util/GC_Utils.php =================================================================== --- /branches/comu-ver2/data/class/util/GC_Utils.php (revision 16670) +++ /branches/comu-ver2/data/class/util/GC_Utils.php (revision 17193) @@ -207,4 +207,5 @@ unlink($path); touch($path); + chmod($path, 0666); } } Index: /branches/comu-ver2/data/class/batch/SC_Batch_Update.php =================================================================== --- /branches/comu-ver2/data/class/batch/SC_Batch_Update.php (revision 17141) +++ /branches/comu-ver2/data/class/batch/SC_Batch_Update.php (revision 17193) @@ -124,7 +124,8 @@ } - if ($sha1 == sha1_file($out)) { + if (file_exists($out) && $sha1 == sha1_file($out)) { $msg = "同じ内容のファイルをスキップしました: " . $out; $this->printLog($msg); + continue; } Index: /branches/comu-ver2/data/class/module/SC_Module.php =================================================================== --- /branches/comu-ver2/data/class/module/SC_Module.php (revision 17193) +++ /branches/comu-ver2/data/class/module/SC_Module.php (revision 17193) @@ -0,0 +1,266 @@ +getSubData(); + * $module->registerSubData($arrData); + * $arrPaymethod = $module->getMasterData('paymethod); // data/cache/mtb_mdl_gmopg_paymethod.php + * $module->log('order error!', $debugValue); // data/logs/mdl_gmopg.log + * + * @package module + * @author LOCKON CO.,LTD. + * @version $Id$ + * + * TODO モジュールコード周りの改修 命名がばらばらなのを吸収できるように + * TODO テーブル拡張, マスターデータ登録, 初期ファイルコピー処理の追加 + */ +class SC_Module { + + /** モジュール名 */ + var $moduleName; + + /** モジュールコード */ + var $moduleCode; + + /** サブデータを保持する */ + var $subData; + + /** パス定義 */ + var $classPath = 'class/'; + var $templatePath = 'template/'; + var $installPath = 'install/'; + + /** + * コンストラクタ + * + * @param string $code + * @param string $name + * @return SC_Module + */ + function SC_Module($code, $name='') { + $this->setCode($code); + $this->setName($name); + } + + function setName($name) { + $this->moduleName = strtolower($name); + } + + function setCode($code) { + $this->moduleCode = $code; + } + + /** + * モジュール名を返す. + * + * @return string + */ + function getName() { + if (empty($this->moduleName)) { + $moduleName = $this->_getName(); + $this->setName($moduleName); + return $moduleName; + } + return $this->moduleName; + } + + /** + * DBからモジュール名を取得する + * + * @return string + */ + function _getName() { + $objQuery = new SC_Query; + return $objQuery->get('dtb_module', 'module_name', 'module_code = ?', $this->getCode()); + } + + /** + * モジュールコードを返す. + * + * @param boolean $toUpper 大文字に変換するかどうか.デフォルトはfalse + * @return string + */ + function getCode($toUpper = false) { + $moduleCode = $this->moduleCode; + return $toUpper ? strtoupper($moduleCode) : $moduleCode; + } + + /** + * モジュールのベースパスを返す + * + * @return string + */ + function getBasePath() { + return MODULE_PATH . $this->getCode() . '/'; + } + + /** + * テンプレートパスを返す + * + * @return string + */ + function getTemplatePath() { + return $this->getBasePath() . $this->templatePath; + } + + /** + * クラスパスを返す. + * + * @return string + */ + function getClassPath() { + return $this->getBasePath() . $this->classPath; + } + + /** + * dtb_moduleのsub_dataを取得する. + * + * @access private + * @param booean $force + * @return mixed|null + */ + function _getSubData($force = false) { + if (isset($this->subData)) return $this->subData; + + $moduleCode = $this->getCode(); + $objQuery = new SC_Query; + $ret = $objQuery->get( + 'dtb_module', 'sub_data', 'module_code = ?', array($moduleCode) + ); + + if (isset($ret)) { + $this->subData = unserialize($ret); + return $this->subData; + } + return null; + } + + /** + * dtb_moduleのsub_dataを取得する. + * + * @param string $key + * @param boolean $force + * @return mixed|null + */ + function getSubData($key = null, $force = false) { + $subData = $this->_getSubData($force); + $returnData = null; + + if (is_null($key)) { + $returnData = $subData; + } else { + $returnData = isset($subData[$key]) + ? $subData[$key] + : null; + } + + return $returnData; + } + + /** + * サブデータを登録する. + * + * @param mixed $data + * @param string + */ + function registerSubData($data, $key = null) { + $subData = $this->getSubData(); + + if (is_null($key)) { + $subData = $data; + } else { + if (is_array($subData)) { + $subData[$key] = $data; + } else { + $subData = array($key => $data); + } + } + + $arrUpdate = array('sub_data' => serialize($subData)); + + $objQuery = new SC_Query; + $objQuery->update('dtb_module', $arrUpdate, 'module_code = ?', array($this->getCode())); + + $this->subData = $subData; + } + + /** + * マスターデータを登録. + * 作りかけ... + * + * @param unknown_type $key + * @param unknown_type $value + */ + function registerMasterData($key, $value) { + $masterData = new SC_DB_MasterData; + } + + /** + * マスターデータを取得する. + * + * キャッシュはmtb_mdl_[name]_[***].phpで保存されるが、 + * 取得する場合はは$keyに***を指定する. + * 例えば、mtb_mdl_gmopg_paymethod.phpにアクセスしたい場合は、 + * $arrPaymethod = $masterData->getMasterData('paymethod'); + * で取得できる. + * + * @param string $key + * @return array + */ + function getMasterData($key) { + $key = 'mtb_' . $this->getCode() . "_$key"; + $masterData = new SC_DB_MasterData_Ex; + return $masterData->getMasterData($key); + } + + /** + * ログを出力. + * + * @param string $msg + * @param mixed $data Dumpしたいデータ.デバッグ用. + * @param string $suffix + */ + function log($msg, $data = null, $suffix = '') { + $path = DATA_PATH . 'logs/' . $this->getCode() . "$suffix.log"; + GC_Utils::gfPrintLog($msg, $path); + + if (!is_null($data)) { + GC_Utils::gfPrintLog(print_r($data, true), $path); + } + } +} +/* + * Local variables: + * coding: utf-8 + * End: + */ +?> Index: /branches/comu-ver2/data/class/module/SC_Module_Payment.php =================================================================== --- /branches/comu-ver2/data/class/module/SC_Module_Payment.php (revision 17193) +++ /branches/comu-ver2/data/class/module/SC_Module_Payment.php (revision 17193) @@ -0,0 +1,44 @@ + Index: /branches/comu-ver2/data/Smarty/templates/default/shopping/confirm.tpl =================================================================== --- /branches/comu-ver2/data/Smarty/templates/default/shopping/confirm.tpl (revision 16999) +++ /branches/comu-ver2/data/Smarty/templates/default/shopping/confirm.tpl (revision 17193) @@ -225,4 +225,8 @@ + + + +