diff --git a/composer.json b/composer.json index 2a9a479fdd3..f0c9e55db77 100644 --- a/composer.json +++ b/composer.json @@ -45,5 +45,13 @@ "satooshi/php-coveralls": "dev-master", "phpunit/phpunit": "3.7.*", "phing/phing": "2.*" +<<<<<<< HEAD + }, + "autoload": { + "psr-0": { + "Eccube": "data/" + } +======= +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 } } diff --git a/composer.lock b/composer.lock index 3c45ce48454..9bdd04cca94 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,11 @@ "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], +<<<<<<< HEAD + "hash": "8955ff1b2364c1658bb9961fff25b0c6", +======= "hash": "05f8c47a64c10e867f5ed142cf64462d", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "packages": [ { "name": "mobiledetect/mobiledetectlib", @@ -1388,17 +1392,30 @@ }, { "name": "symfony/config", +<<<<<<< HEAD + "version": "v2.6.3", +======= "version": "v2.6.1", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "target-dir": "Symfony/Component/Config", "source": { "type": "git", "url": "https://github.com/symfony/Config.git", +<<<<<<< HEAD + "reference": "d94f222eff99a22ce313555b78642b4873418d56" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Config/zipball/d94f222eff99a22ce313555b78642b4873418d56", + "reference": "d94f222eff99a22ce313555b78642b4873418d56", +======= "reference": "84c0c150c1520995f09ea9e47e817068b353cb0f" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/Config/zipball/84c0c150c1520995f09ea9e47e817068b353cb0f", "reference": "84c0c150c1520995f09ea9e47e817068b353cb0f", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "shasum": "" }, "require": { @@ -1432,21 +1449,38 @@ ], "description": "Symfony Config Component", "homepage": "http://symfony.com", +<<<<<<< HEAD + "time": "2015-01-03 08:01:59" + }, + { + "name": "symfony/console", + "version": "v2.6.3", +======= "time": "2014-12-02 20:19:20" }, { "name": "symfony/console", "version": "v2.6.1", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "target-dir": "Symfony/Component/Console", "source": { "type": "git", "url": "https://github.com/symfony/Console.git", +<<<<<<< HEAD + "reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Console/zipball/6ac6491ff60c0e5a941db3ccdc75a07adbb61476", + "reference": "6ac6491ff60c0e5a941db3ccdc75a07adbb61476", +======= "reference": "ef825fd9f809d275926547c9e57cbf14968793e8" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/Console/zipball/ef825fd9f809d275926547c9e57cbf14968793e8", "reference": "ef825fd9f809d275926547c9e57cbf14968793e8", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "shasum": "" }, "require": { @@ -1489,21 +1523,38 @@ ], "description": "Symfony Console Component", "homepage": "http://symfony.com", +<<<<<<< HEAD + "time": "2015-01-06 17:50:02" + }, + { + "name": "symfony/event-dispatcher", + "version": "v2.6.3", +======= "time": "2014-12-02 20:19:20" }, { "name": "symfony/event-dispatcher", "version": "v2.6.1", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "target-dir": "Symfony/Component/EventDispatcher", "source": { "type": "git", "url": "https://github.com/symfony/EventDispatcher.git", +<<<<<<< HEAD + "reference": "40ff70cadea3785d83cac1c8309514b36113064e" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/40ff70cadea3785d83cac1c8309514b36113064e", + "reference": "40ff70cadea3785d83cac1c8309514b36113064e", +======= "reference": "720fe9bca893df7ad1b4546649473b5afddf0216" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/EventDispatcher/zipball/720fe9bca893df7ad1b4546649473b5afddf0216", "reference": "720fe9bca893df7ad1b4546649473b5afddf0216", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "shasum": "" }, "require": { @@ -1511,10 +1562,17 @@ }, "require-dev": { "psr/log": "~1.0", +<<<<<<< HEAD + "symfony/config": "~2.0,>=2.0.5", + "symfony/dependency-injection": "~2.6", + "symfony/expression-language": "~2.6", + "symfony/stopwatch": "~2.3" +======= "symfony/config": "~2.0", "symfony/dependency-injection": "~2.6", "symfony/expression-language": "~2.6", "symfony/stopwatch": "~2.2" +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 }, "suggest": { "symfony/dependency-injection": "", @@ -1547,21 +1605,38 @@ ], "description": "Symfony EventDispatcher Component", "homepage": "http://symfony.com", +<<<<<<< HEAD + "time": "2015-01-05 14:28:40" + }, + { + "name": "symfony/filesystem", + "version": "v2.6.3", +======= "time": "2014-12-02 20:19:20" }, { "name": "symfony/filesystem", "version": "v2.6.1", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "target-dir": "Symfony/Component/Filesystem", "source": { "type": "git", "url": "https://github.com/symfony/Filesystem.git", +<<<<<<< HEAD + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Filesystem/zipball/a1f566d1f92e142fa1593f4555d6d89e3044a9b7", + "reference": "a1f566d1f92e142fa1593f4555d6d89e3044a9b7", +======= "reference": "ff6efc95256cb33031933729e68b01d720b5436b" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/Filesystem/zipball/ff6efc95256cb33031933729e68b01d720b5436b", "reference": "ff6efc95256cb33031933729e68b01d720b5436b", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "shasum": "" }, "require": { @@ -1594,21 +1669,38 @@ ], "description": "Symfony Filesystem Component", "homepage": "http://symfony.com", +<<<<<<< HEAD + "time": "2015-01-03 21:13:09" + }, + { + "name": "symfony/stopwatch", + "version": "v2.6.3", +======= "time": "2014-12-02 20:19:20" }, { "name": "symfony/stopwatch", "version": "v2.6.1", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "target-dir": "Symfony/Component/Stopwatch", "source": { "type": "git", "url": "https://github.com/symfony/Stopwatch.git", +<<<<<<< HEAD + "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", + "reference": "e8da5286132ba75ce4b4275fbf0f4cd369bfd71c", +======= "reference": "261abd360cfb6ac65ea93ffd82073e2011d034fc" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/Stopwatch/zipball/261abd360cfb6ac65ea93ffd82073e2011d034fc", "reference": "261abd360cfb6ac65ea93ffd82073e2011d034fc", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "shasum": "" }, "require": { @@ -1641,21 +1733,38 @@ ], "description": "Symfony Stopwatch Component", "homepage": "http://symfony.com", +<<<<<<< HEAD + "time": "2015-01-03 08:01:59" + }, + { + "name": "symfony/yaml", + "version": "v2.6.3", +======= "time": "2014-12-02 20:19:20" }, { "name": "symfony/yaml", "version": "v2.6.1", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "target-dir": "Symfony/Component/Yaml", "source": { "type": "git", "url": "https://github.com/symfony/Yaml.git", +<<<<<<< HEAD + "reference": "82462a90848a52c2533aa6b598b107d68076b018" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/Yaml/zipball/82462a90848a52c2533aa6b598b107d68076b018", + "reference": "82462a90848a52c2533aa6b598b107d68076b018", +======= "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20" }, "dist": { "type": "zip", "url": "https://api.github.com/repos/symfony/Yaml/zipball/3346fc090a3eb6b53d408db2903b241af51dcb20", "reference": "3346fc090a3eb6b53d408db2903b241af51dcb20", +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 "shasum": "" }, "require": { @@ -1688,7 +1797,11 @@ ], "description": "Symfony Yaml Component", "homepage": "http://symfony.com", +<<<<<<< HEAD + "time": "2015-01-03 15:33:07" +======= "time": "2014-12-02 20:19:20" +>>>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 } ], "aliases": [ diff --git a/data/Eccube/Api/AbstractApi.php b/data/Eccube/Api/AbstractApi.php new file mode 100644 index 00000000000..0e883066d61 --- /dev/null +++ b/data/Eccube/Api/AbstractApi.php @@ -0,0 +1,81 @@ +requestMethod = $this->getRequestMethod(); + $this->requestBody = $this->getRequestBody(); + $this->responseStatusCode = 200; + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + } + + public function sendResponseJson () { + $objDisplay = new Display(); + $objDisplay->addHeader('HTTP/1.1', $this->responseStatusCode); + $objDisplay->addHeader('Content-type', "application/json; charset=utf-8"); + $objDisplay->addHeader('Cache-Control', ''); + $objDisplay->addHeader('Pragma', ''); + + $objDisplay->response->body = json_encode($this->responseBody); + $objDisplay->response->write(); + Response::actionExit(); + } + + /** + * メソッド取得 + * @return string + */ + protected function getRequestMethod() { + return $_SERVER['REQUEST_METHOD']; + } + + /** + * リクエストボディ取得 + * @return string + */ + protected function getRequestBody() { + $f = fopen('php://input', 'r'); + $content = stream_get_contents($f); + fclose($f); + // 連想配列でreturn + return json_decode($content, true); + } + +} \ No newline at end of file diff --git a/data/Eccube/Api/Customer/Index.php b/data/Eccube/Api/Customer/Index.php new file mode 100644 index 00000000000..a5ee201a2c6 --- /dev/null +++ b/data/Eccube/Api/Customer/Index.php @@ -0,0 +1,139 @@ +action(); + $this->sendResponseJson(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + switch($this->requestMethod) { + case 'GET': + $this->getCustomer(); + break; + case 'POST': + $this->PostCustomer(); + break; + case 'PUT': + $this->PutCustomer(); + break; + case 'DELETE': + $this->DeleteCustomer(); + break; + } + } + + private function getCustomer() + { + $this->responseBody = json_encode(CustomerHelper::sfGetCustomerData($_REQUEST['customer_id'])); + $this->responseStatusCode = 200; + } + + private function PostCustomer() + { + if (isset($this->requestBody['customer_id'])) { + $customer = CustomerHelper::sfEditCustomerData($this->requestBody, $this->requestBody['customer_id']); + $this->responseStatusCode = 200; + } else { + $this->responseStatusCode = 400; + } + } + + private function PutCustomer() + { + if (isset($this->requestBody['customer_id'])) { + $this->responseStatusCode = 400; + } else { + if ($this->checkError($this->requestBody)) { + $this->requestBody['update_date'] = 'now()'; + $query = new Query(); + + $query->begin(); + $this->requestBody['customer_id'] = $query->nextVal('dtb_customer_customer_id'); + $query->insert('dtb_customer', $this->requestBody); + $query->commit(); + $this->responseStatusCode = 201; + } else { + $this->responseStatusCode = 400; + } + } + } + + private function DeleteCustomer() + { + if (isset($_REQUEST['customer_id'])) { + if (CustomerHelper::delete($_REQUEST['customer_id'])) { + $this->responseStatusCode = 200; + } else { + $this->responseStatusCode = 404; + } + } else { + $this->responseStatusCode = 400; + } + } + + private function checkError($request) + { + $notNullParam = array('name01', 'name02', 'email', 'secret_key'); + foreach ($notNullParam as $param) { + if (!isset($request[$param])) { + return false; + } + } + return true; + } +} \ No newline at end of file diff --git a/data/class/api/SC_Api_Utils.php b/data/Eccube/Common/Api/ApiUtils.php similarity index 82% rename from data/class/api/SC_Api_Utils.php rename to data/Eccube/Common/Api/ApiUtils.php index fb3da333e90..d3589d1fc72 100644 --- a/data/class/api/SC_Api_Utils.php +++ b/data/Eccube/Common/Api/ApiUtils.php @@ -1,38 +1,32 @@ plugin default > base - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'operation_name Like ? AND del_flg = 0 AND enable = 1'; $arrApiConfig = $objQuery->getRow('*', 'dtb_api_config', $where, array($operation_name)); - if (SC_Utils_Ex::isBlank($arrApiConfig)) { - $objApi = SC_Api_Utils_Ex::loadApiOperation($operation_name); + if (Utils::isBlank($arrApiConfig)) { + $objApi = static::loadApiOperation($operation_name); if (is_object($objApi)) { $arrApiConfig = $objApi->getDefaultConfig(); } - if (!SC_Utils_Ex::isBlank($arrApiConfig)) { + if (!Utils::isBlank($arrApiConfig)) { // デフォルト設定がロード出来た場合は自動で設定に反映 $arrData = $arrApiConfig; $arrData['update_date'] = 'CURRENT_TIMESTAMP'; @@ -99,7 +93,7 @@ public function getApiConfig($operation_name) } else { // ロード出来ない場合はAPI_Defaultを適用 $operation_name = 'Default'; - $objApi = SC_Api_Utils_Ex::loadApiOperation($operation_name); + $objApi = static::loadApiOperation($operation_name); $arrApiConfig = $objApi->getDefaultConfig(); } } @@ -116,13 +110,13 @@ public function getApiConfig($operation_name) */ public function printApiLog($msg, $start_time = '' , $operation_name = '') { - if (!SC_Utils_Ex::isBlank($operation_name)) { + if (!Utils::isBlank($operation_name)) { $msg = 'API_' . $operation_name . ':' . $msg; } - if (!SC_Utils_Ex::isBlank($start_time)) { + if (!Utils::isBlank($start_time)) { $msg = '(RequestId:' . $start_time . ')' . $msg; } - GC_Utils_Ex::gfPrintLog($msg, DATA_REALDIR . self::API_LOGFILE, self::API_DEBUG_MODE); + GcUtils::gfPrintLog($msg, DATA_REALDIR . self::API_LOGFILE, self::API_DEBUG_MODE); } /** @@ -199,11 +193,11 @@ public function sendResponseJson($response_outer_name, &$arrResponse) unset($arrResponse["callback"]); header('Content-Type: application/javascript; charset=UTF-8'); $arrResponse['response_name'] = $response_outer_name; - echo $callback . "(" . SC_Utils_Ex::jsonEncode($arrResponse) . ")"; + echo $callback . "(" . Utils::jsonEncode($arrResponse) . ")"; } else { header('Content-Type: application/json; charset=UTF-8'); $arrResponse['response_name'] = $response_outer_name; - echo SC_Utils_Ex::jsonEncode($arrResponse); + echo Utils::jsonEncode($arrResponse); } } diff --git a/data/class/api/SC_Api_Operation.php b/data/Eccube/Common/Api/Operation.php similarity index 76% rename from data/class/api/SC_Api_Operation.php rename to data/Eccube/Common/Api/Operation.php index 139cfa46bb6..8480fe15bad 100644 --- a/data/class/api/SC_Api_Operation.php +++ b/data/Eccube/Common/Api/Operation.php @@ -1,26 +1,25 @@ 1 AND work = 1'; $arrData = $objQuery->getRow($cols, $table, $where, array($member_id)); - if (SC_Utils_Ex::isBlank($arrData)) { + if (Utils::isBlank($arrData)) { return false; } // ユーザー入力パスワードの判定 - if (SC_Utils_Ex::sfIsMatchHashPassword($member_password, $arrData['password'], $arrData['salt'])) { + if (Utils::sfIsMatchHashPassword($member_password, $arrData['password'], $arrData['salt'])) { return true; } @@ -84,7 +82,7 @@ protected function checkMemberAccount($member_id, $member_password) */ protected function checkCustomerAccount($login_email, $login_password) { - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); if ($objCustomer->getCustomerDataFromEmailPass($login_password, $login_email)) { return true; } else { @@ -100,8 +98,8 @@ protected function checkCustomerAccount($login_email, $login_password) protected function checkReferer() { $ret = false; - if (!SC_Utils_Ex::isBlank($_SERVER['HTTP_REFERER'])) { - $domain = SC_Utils_Ex::sfIsHTTPS() ? HTTPS_URL : HTTP_URL; + if (!Utils::isBlank($_SERVER['HTTP_REFERER'])) { + $domain = Utils::sfIsHTTPS() ? HTTPS_URL : HTTP_URL; $pattern = sprintf('|^%s.*|', $domain); $referer = $_SERVER['HTTP_REFERER']; if (preg_match($pattern, $referer)) { @@ -122,22 +120,22 @@ protected function checkReferer() */ protected function checkApiSignature($operation_name, $arrParam, $arrApiConfig) { - if (SC_Utils_Ex::isBlank($arrParam['Signature'])) { + if (Utils::isBlank($arrParam['Signature'])) { return false; } - if (SC_Utils_Ex::isBlank($arrParam['Timestamp'])) { + if (Utils::isBlank($arrParam['Timestamp'])) { return false; } /* - $allow_account_id = SC_Api_Operation_Ex::getOperationSubConfig($operation_name, 'allow_account_id', $arrApiConfig); - if (!SC_Utils_Ex::isBlank($allow_account_id) and) { + $allow_account_id = static::getOperationSubConfig($operation_name, 'allow_account_id', $arrApiConfig); + if (!Utils::isBlank($allow_account_id) and) { $arrAllowAccountIds = explode('|', $allow_account_id); } */ $access_key = $arrParam['AccessKeyId']; - $secret_key = SC_Api_Operation_Ex::getApiSecretKey($access_key); - if (SC_Utils_Ex::isBlank($secret_key)) { + $secret_key = static::getApiSecretKey($access_key); + if (Utils::isBlank($secret_key)) { return false; } @@ -152,7 +150,7 @@ protected function checkApiSignature($operation_name, $arrParam, $arrApiConfig) case 'Signature': break; default: - $check_str .= '&' . SC_Utils_Ex::encodeRFC3986($key) . '=' . SC_Utils_Ex::encodeRFC3986($val); + $check_str .= '&' . Utils::encodeRFC3986($key) . '=' . Utils::encodeRFC3986($val); break; } } @@ -178,7 +176,7 @@ protected function checkApiSignature($operation_name, $arrParam, $arrApiConfig) protected function checkIp($operation_name) { $ret = false; - $allow_hosts = SC_Api_Utils_Ex::getOperationSubConfig($operation_name, 'allow_hosts'); + $allow_hosts = ApiUtils::getOperationSubConfig($operation_name, 'allow_hosts'); $arrAllowHost = explode("\n", $allow_hosts); if (is_array($arrAllowHost) && count($arrAllowHost) > 0) { if (array_search($_SERVER['REMOTE_ADDR'], $arrAllowHost) !== FALSE) { @@ -197,7 +195,7 @@ protected function checkIp($operation_name) */ protected function getApiSecretKey($access_key) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $secret_key = $objQuery->get('api_secret_key', 'dtb_api_account', 'api_access_key = ? and enable = 1 and del_flg = 0', array($access_key)); return $secret_key; @@ -212,7 +210,7 @@ protected function getApiSecretKey($access_key) */ protected function checkOperationAuth($operation_name, &$arrParam, &$arrApiConfig) { - if (SC_Utils_Ex::isBlank($operation_name)) { + if (Utils::isBlank($operation_name)) { return false; } $arrAuthTypes = explode('|', $arrApiConfig['auth_types']); @@ -221,35 +219,35 @@ protected function checkOperationAuth($operation_name, &$arrParam, &$arrApiConfi $ret = false; switch ($auth_type) { case self::API_AUTH_TYPE_REFERER: - $ret = SC_Api_Operation_Ex::checkReferer(); + $ret = static::checkReferer(); break; case self::API_AUTH_TYPE_SESSION_TOKEN: - $ret = SC_Helper_Session_Ex::isValidToken(false); + $ret = SessionHelper::isValidToken(false); break; case self::API_AUTH_TYPE_API_SIGNATURE: - $ret = SC_Api_Operation_Ex::checkApiSignature($operation_name, $arrParam, $arrApiConfig); + $ret = static::checkApiSignature($operation_name, $arrParam, $arrApiConfig); break; case self::API_AUTH_TYPE_CUSTOMER: - $ret = SC_Api_Operation_Ex::checkCustomerAccount($arrParam['login_email'], $arrParam['login_password']); + $ret = static::checkCustomerAccount($arrParam['login_email'], $arrParam['login_password']); break; case self::API_AUTH_TYPE_MEMBER: - $ret = SC_Api_Operation_Ex::checkMemberAccount($arrParam['member_id'], $arrParam['member_password']); + $ret = static::checkMemberAccount($arrParam['member_id'], $arrParam['member_password']); break; case self::API_AUTH_TYPE_CUSTOMER_LOGIN_SESSION: - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); $ret = $objCustomer->isLoginSuccess(); break; case self::API_AUTH_TYPE_MEMBER_LOGIN_SESSION: - $ret = SC_Utils_Ex::sfIsSuccess(new SC_Session_Ex(), false); + $ret = Utils::sfIsSuccess(new Session(), false); break; case self::API_AUTH_TYPE_IP: - $ret = SC_Api_Operation_Ex::checkIp($operation_name); + $ret = static::checkIp($operation_name); break; case self::API_AUTH_TYPE_HOST: - $ret = SC_Api_Operation_Ex::checkHost($operation_name); + $ret = static::checkHost($operation_name); break; case self::API_AUTH_TYPE_SSL: - $ret = SC_Utils_Ex::sfIsHTTPS(); + $ret = Utils::sfIsHTTPS(); break; case self::API_AUTH_TYPE_OPEN: $result = true; @@ -272,8 +270,8 @@ protected function checkOperationAuth($operation_name, &$arrParam, &$arrApiConfi /** * APIのリクエスト基本パラメーターの設定 * - * @param object SC_FormParam - * @param SC_FormParam_Ex $objFormParam + * @param object FormParam + * @param FormParam $objFormParam * @return void */ protected function setApiBaseParam(&$objFormParam) @@ -296,18 +294,18 @@ public function doApiAction($arrPost) // 実行時間計測用 $start_time = microtime(true); - $objFormParam = new SC_FormParam_Ex(); - SC_Api_Operation_Ex::setApiBaseParam($objFormParam); + $objFormParam = new FormParam(); + static::setApiBaseParam($objFormParam); $objFormParam->setParam($arrPost); $objFormParam->convParam(); - $arrErr = SC_Api_Operation_Ex::checkParam($objFormParam); + $arrErr = static::checkParam($objFormParam); // API機能が有効であるかをチェック. if (API_ENABLE_FLAG == false) { $arrErr['ECCUBE.Function.Disable'] = 'API機能が無効です。'; } - if (SC_Utils_Ex::isBlank($arrErr)) { + if (Utils::isBlank($arrErr)) { $arrParam = $objFormParam->getHashArray(); $operation_name = $arrParam['Operation']; $service_name = $arrParam['Service']; @@ -315,16 +313,16 @@ public function doApiAction($arrPost) $validate_flag = $arrParam['Validate']; $api_version = $arrParam['Version']; - SC_Api_Utils_Ex::printApiLog('access', $start_time, $operation_name); + ApiUtils::printApiLog('access', $start_time, $operation_name); // API設定のロード - $arrApiConfig = SC_Api_Utils_Ex::getApiConfig($operation_name); + $arrApiConfig = ApiUtils::getApiConfig($operation_name); - if (SC_Api_Operation_Ex::checkOperationAuth($operation_name, $arrPost, $arrApiConfig)) { - SC_Api_Utils_Ex::printApiLog('Authority PASS', $start_time, $operation_name); + if (static::checkOperationAuth($operation_name, $arrPost, $arrApiConfig)) { + ApiUtils::printApiLog('Authority PASS', $start_time, $operation_name); // オペレーション権限OK // API オブジェクトをロード - $objApiOperation = SC_Api_Utils_Ex::loadApiOperation($operation_name, $arrParam); + $objApiOperation = ApiUtils::loadApiOperation($operation_name, $arrParam); if (is_object($objApiOperation) && method_exists($objApiOperation, 'doAction')) { // API オペレーション実行 @@ -354,7 +352,7 @@ public function doApiAction($arrPost) ) ); $response_outer = $operation_name . 'Response'; - SC_Api_Utils_Ex::printApiLog('Operation SUCCESS', $start_time, $response_outer); + ApiUtils::printApiLog('Operation SUCCESS', $start_time, $response_outer); } else { // 実行失敗 $arrResponseErrorSection = array(); @@ -371,11 +369,11 @@ public function doApiAction($arrPost) } else { $response_outer = 'ECCUBEApiCommonResponse'; } - SC_Api_Utils_Ex::printApiLog('Operation FAILED', $start_time, $response_outer); + ApiUtils::printApiLog('Operation FAILED', $start_time, $response_outer); } $arrResponse = array(); - $arrResponse['OperationRequest'] = SC_Api_Operation_Ex::getOperationRequestEcho($arrPost, $start_time); + $arrResponse['OperationRequest'] = static::getOperationRequestEcho($arrPost, $start_time); $arrResponse[$response_group_name] = array(); // Items $arrResponse[$response_group_name] = $arrResponseValidSection; if (is_array($arrResponseBody)) { @@ -408,7 +406,7 @@ protected function getOperationRequestEcho($arrParam, $start_time) return $arrRet; } - // TODO: ここらへんは SC_Displayに持って行きたい所だが・・ + // TODO: ここらへんは Displayに持って行きたい所だが・・ /** * @param string $type @@ -418,14 +416,14 @@ public function sendApiResponse($type, $response_outer_name, &$arrResponse) { switch ($type) { case 'xml': - SC_Api_Utils_Ex::sendResponseXml($response_outer_name, $arrResponse); + ApiUtils::sendResponseXml($response_outer_name, $arrResponse); break; case 'php': - SC_Api_Utils_Ex::sendResponsePhp($response_outer_name, $arrResponse); + ApiUtils::sendResponsePhp($response_outer_name, $arrResponse); break; case 'json': default: - SC_Api_Utils_Ex::sendResponseJson($response_outer_name, $arrResponse); + ApiUtils::sendResponseJson($response_outer_name, $arrResponse); break; } } @@ -433,25 +431,25 @@ public function sendApiResponse($type, $response_outer_name, &$arrResponse) /** * APIのリクエスト基本パラメーターのチェック * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return array $arrErr */ protected function checkParam($objFormParam) { $arrErr = $objFormParam->checkError(); - if (!preg_match("/^[a-zA-Z0-9\-\_]+$/", $objFormParam->getValue('Operation')) && !SC_Utils::isBlank($objFormParam->getValue('Operation'))) { + if (!preg_match("/^[a-zA-Z0-9\-\_]+$/", $objFormParam->getValue('Operation')) && !Utils::isBlank($objFormParam->getValue('Operation'))) { $arrErr['ECCUBE.Operation.ParamError'] = 'Operationの値が不正です。'; } - if (!preg_match("/^[a-zA-Z0-9\-\_]+$/", $objFormParam->getValue('Service')) && !SC_Utils::isBlank($objFormParam->getValue('Service'))) { + if (!preg_match("/^[a-zA-Z0-9\-\_]+$/", $objFormParam->getValue('Service')) && !Utils::isBlank($objFormParam->getValue('Service'))) { $arrErr['ECCUBE.Service.ParamError'] = 'Serviceの値が不正です。'; } - if (!preg_match("/^[a-zA-Z0-9\-\_]+$/", $objFormParam->getValue('Style')) && !SC_Utils::isBlank($objFormParam->getValue('Style'))) { + if (!preg_match("/^[a-zA-Z0-9\-\_]+$/", $objFormParam->getValue('Style')) && !Utils::isBlank($objFormParam->getValue('Style'))) { $arrErr['ECCUBE.Style.ParamError'] = 'Styleの値が不正です。'; } - if (!preg_match("/^[a-zA-Z0-9\-\_]+$/", $objFormParam->getValue('Validate')) && !SC_Utils::isBlank($objFormParam->getValue('Validate'))) { + if (!preg_match("/^[a-zA-Z0-9\-\_]+$/", $objFormParam->getValue('Validate')) && !Utils::isBlank($objFormParam->getValue('Validate'))) { $arrErr['ECCUBE.Validate.ParamError'] = 'Validateの値が不正です。'; } - if (!preg_match("/^[a-zA-Z0-9\-\_\.]+$/", $objFormParam->getValue('Version')) && !SC_Utils::isBlank($objFormParam->getValue('Version'))) { + if (!preg_match("/^[a-zA-Z0-9\-\_\.]+$/", $objFormParam->getValue('Version')) && !Utils::isBlank($objFormParam->getValue('Version'))) { $arrErr['ECCUBE.Version.ParamError'] = 'Versionの値が不正です。'; } return $arrErr; diff --git a/data/class/api/operations/AddrFromZip.php b/data/Eccube/Common/Api/Operation/AddrFromZip.php similarity index 61% rename from data/class/api/operations/AddrFromZip.php rename to data/Eccube/Common/Api/Operation/AddrFromZip.php index a4402db7126..e4efdc281e4 100644 --- a/data/class/api/operations/AddrFromZip.php +++ b/data/Eccube/Common/Api/Operation/AddrFromZip.php @@ -1,36 +1,26 @@ doInitParam($arrParam); if (!$this->isParamError()) { $zipcode = $arrRequest['zip1'] . $arrRequest['zip2']; - $arrAddrList = SC_Utils_Ex::sfGetAddress($zipcode); - if (!SC_Utils_Ex::isBlank($arrAddrList)) { + $arrAddrList = Utils::sfGetAddress($zipcode); + if (!Utils::isBlank($arrAddrList)) { $this->setResponse('Address', array( 'State' => $arrAddrList[0]['state'], 'City' => $arrAddrList[0]['city'], diff --git a/data/class/api/SC_Api_Abstract.php b/data/Eccube/Common/Api/Operation/Base.php similarity index 78% rename from data/class/api/SC_Api_Abstract.php rename to data/Eccube/Common/Api/Operation/Base.php index ed64ca65377..feccaa7a3af 100644 --- a/data/class/api/SC_Api_Abstract.php +++ b/data/Eccube/Common/Api/Operation/Base.php @@ -1,35 +1,28 @@ arrErr); + return !Utils::isBlank($this->arrErr); } protected function checkErrorExtended($arrParam) @@ -120,7 +113,7 @@ protected function checkErrorExtended($arrParam) protected function doInitParam($arrParam = array()) { - $this->objFormParam = new SC_FormParam_Ex(); + $this->objFormParam = new FormParam(); $this->lfInitParam($this->objFormParam); $this->objFormParam->setParam($arrParam); $this->objFormParam->convParam(); @@ -133,7 +126,7 @@ protected function doInitParam($arrParam = array()) public function getRequestValidate() { $arrParam = $this->objFormParam->getHashArray(); - if (!SC_Utils_Ex::isBlank($arrParam)) { + if (!Utils::isBlank($arrParam)) { return $arrParam; } diff --git a/data/class/api/operations/BrowseNodeLookup.php b/data/Eccube/Common/Api/Operation/BrowseNodeLookup.php similarity index 70% rename from data/class/api/operations/BrowseNodeLookup.php rename to data/Eccube/Common/Api/Operation/BrowseNodeLookup.php index 741293b8565..2c0cc85ea64 100644 --- a/data/class/api/operations/BrowseNodeLookup.php +++ b/data/Eccube/Common/Api/Operation/BrowseNodeLookup.php @@ -1,36 +1,27 @@ isParamError()) { $category_id = $arrRequest['BrowseNodeId']; if ($category_id - && !SC_Helper_DB_Ex::sfIsRecord('dtb_category', 'category_id', (array) $category_id, 'del_flg = 0')) { + && !DbHelper::isRecord('dtb_category', 'category_id', (array) $category_id, 'del_flg = 0')) { $category_id = '0'; - } elseif (SC_Utils_Ex::isBlank($category_id)) { + } elseif (Utils::isBlank($category_id)) { $category_id = '0'; } // LC_Page_Products_CategoryList::lfGetCategories() と相当類似しているので共通化したい $arrCategory = null; // 選択されたカテゴリ $arrChildren = array(); // 子カテゴリ - $arrAll = SC_Helper_DB_Ex::sfGetCatTree($category_id, true); + $arrAll = DbHelper::getCatTree($category_id, true); foreach ($arrAll as $category) { if ($category_id != 0 && $category['category_id'] == $category_id) { $arrCategory = $category; @@ -64,12 +55,12 @@ public function doAction($arrParam) continue; } - $arrGrandchildrenID = SC_Utils_Ex::sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']); + $arrGrandchildrenID = Utils::sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']); $category['has_children'] = count($arrGrandchildrenID) > 0; $arrChildren[] = $category; } - if (!SC_Utils_Ex::isBlank($arrCategory)) { + if (!Utils::isBlank($arrCategory)) { $arrData = array( 'BrowseNodeId' => $category_id, 'Name' => $arrCategory['category_name'], @@ -85,7 +76,7 @@ public function doAction($arrParam) ); } - if (!SC_Utils_Ex::isBlank($arrChildren)) { + if (!Utils::isBlank($arrChildren)) { $arrData['Children'] = array(); foreach ($arrChildren as $category) { $arrData['Children']['BrowseNode'][] = array( diff --git a/data/class/api/operations/CartAdd.php b/data/Eccube/Common/Api/Operation/CartAdd.php similarity index 51% rename from data/class/api/operations/CartAdd.php rename to data/Eccube/Common/Api/Operation/CartAdd.php index 90cfef75343..75f66b67a6b 100644 --- a/data/class/api/operations/CartAdd.php +++ b/data/Eccube/Common/Api/Operation/CartAdd.php @@ -1,36 +1,24 @@ doInitParam($arrParam); if (!$this->isParamError()) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); switch ($arrRequest['IdType']) { case 'product_code': @@ -84,7 +75,7 @@ protected function checkErrorExtended($arrParam) case 'product_id': case 'product_class_id': default: - $objErr = new SC_CheckError_Ex($arrParam); + $objErr = new CheckError($arrParam); $objErr->doFunc(array('指定ID', 'ItemId', INT_LEN), array('MAX_LENGTH_CHECK', 'NUM_CHECK')); $this->addError($objErr->arrErr); break; diff --git a/data/class/api/operations/ItemSearch.php b/data/Eccube/Common/Api/Operation/ItemSearch.php similarity index 84% rename from data/class/api/operations/ItemSearch.php rename to data/Eccube/Common/Api/Operation/ItemSearch.php index e0647913f16..fd3ab3850a5 100644 --- a/data/class/api/operations/ItemSearch.php +++ b/data/Eccube/Common/Api/Operation/ItemSearch.php @@ -1,36 +1,31 @@ doInitParam($arrParam); if (!$this->isParamError()) { - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $arrSTATUS = $masterData->getMasterData('mtb_status'); $arrSTATUS_IMAGE = $masterData->getMasterData('mtb_status_image'); - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $arrSearchData = array( 'category_id' => $arrRequest['BrowseNode'], 'maker_name' => $arrRequest['Manufacturer'], @@ -58,18 +53,18 @@ public function doAction($arrParam) $arrSearchCondition = $this->getSearchCondition($arrSearchData); $disp_number = 10; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setWhere($arrSearchCondition['where_for_count']); - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $linemax = $objProduct->findProductCount($objQuery, $arrSearchCondition['arrval']); - $objNavi = new SC_PageNavi_Ex($arrRequest['ItemPage'], $linemax, $disp_number); + $objNavi = new PageNavi($arrRequest['ItemPage'], $linemax, $disp_number); $arrProducts = $this->getProductsList($arrSearchCondition, $disp_number, $objNavi->start_row, $linemax, $objProduct); - if (!SC_Utils_Ex::isBlank($arrProducts)) { + if (!Utils::isBlank($arrProducts)) { $arrProducts = $this->setStatusDataTo($arrProducts, $arrSTATUS, $arrSTATUS_IMAGE); - SC_Product_Ex::setPriceTaxTo($arrProducts); + Product::setPriceTaxTo($arrProducts); foreach ($arrProducts as $key=>$val) { - $arrProducts[$key]['main_list_image'] = SC_Utils_Ex::sfNoImageMainList($val['main_list_image']); + $arrProducts[$key]['main_list_image'] = Utils::sfNoImageMainList($val['main_list_image']); } $arrData = array(); @@ -110,13 +105,13 @@ public function getResponseGroupName() * * @param integer $disp_number * @param integer $linemax - * @param SC_Product_Ex $objProduct + * @param Product $objProduct * @return array * TODO: LC_Page_Products_List::lfGetProductsList() と共通化 */ protected function getProductsList($searchCondition, $disp_number, $startno, $linemax, &$objProduct) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrOrderVal = array(); @@ -167,7 +162,7 @@ protected function getProductsList($searchCondition, $disp_number, $startno, $li // 表示すべきIDとそのIDの並び順を一気に取得 $arrProductId = $objProduct->findProductIdsOrder($objQuery, array_merge($searchCondition['arrval'], $arrOrderVal)); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrProducts = $objProduct->getListByProductIds($objQuery, $arrProductId); // 規格を設定 $objProduct->setProductsClassByProductIds($arrProductId); @@ -193,8 +188,8 @@ protected function getSearchCondition($arrSearchData) ); // カテゴリからのWHERE文字列取得 - if (!SC_Utils_Ex::isBlank($arrSearchData['category_id'])) { - list($searchCondition['where_category'], $searchCondition['arrvalCategory']) = SC_Helper_DB_Ex::sfGetCatWhere($arrSearchData['category_id']); + if (!Utils::isBlank($arrSearchData['category_id'])) { + list($searchCondition['where_category'], $searchCondition['arrvalCategory']) = DbHelper::getCatWhere($arrSearchData['category_id']); } // ▼対象商品IDの抽出 // 商品検索条件の作成(未削除、表示) @@ -236,7 +231,7 @@ protected function getSearchCondition($arrSearchData) } // ソート順 - if (!SC_Utils_Ex::isBlank($arrSearchData['orderby'])) { + if (!Utils::isBlank($arrSearchData['orderby'])) { $searchCondition['orderby'] = $arrSearchData['orderby']; } diff --git a/data/Eccube/Common/Batch/AbstractBatch.php b/data/Eccube/Common/Batch/AbstractBatch.php new file mode 100644 index 00000000000..d60da913934 --- /dev/null +++ b/data/Eccube/Common/Batch/AbstractBatch.php @@ -0,0 +1,32 @@ + static::CACHEDIR, + 'lifeTime' => static::LIFETIME, + 'automaticSerialization' => TRUE + ); + static::$_instance = new Cache_Lite($options); + } + + /** + * Get Cache_Lite object. + * + * @return void + */ + public static function getInstance() + { + is_null(static::$_instance) and static::forge(); + + return static::$_instance; + } + + /** + * Get data from cache. + * + * @param string $id cache id + * @param string $group name of the cache group + * @param int $lifeTime custom lifetime + * @return mixed data of cache (else : false) + */ + public static function get($id, $group = 'default', $lifeTime = NULL) + { + $processor = static::getInstance(); + + // set custom lifetime. + !is_null($lifeTime) and $processor->setOption('lifeTime', $lifeTime); + + $cache = $processor->get($id, $group); + + // set back to default lifetime. + !is_null($lifeTime) and $processor->setOption('lifeTime', static::$_lifetime); + + return $cache; + } + + /** + * Save data into cache. + * + * @param mixed $data data of cache + * @param string $id cache id + * @param string $group name of the cache group + * @return void + */ + public static function save($data, $id, $group = 'default') + { + $processor = static::getInstance(); + + $processor->save($data, $id, $group); + } + + /** + * Clean cache. + * + * @param string $group name of the cache group + * @return void + */ + public static function clean($group = FALSE) + { + $processor = static::getInstance(); + + $processor->clean($group); + } +} diff --git a/data/class/SC_CartSession.php b/data/Eccube/Common/CartSession.php similarity index 91% rename from data/class/SC_CartSession.php rename to data/Eccube/Common/CartSession.php index 7e89c3e9625..75489fcf161 100644 --- a/data/class/SC_CartSession.php +++ b/data/Eccube/Common/CartSession.php @@ -1,33 +1,30 @@ cartSession[$productTypeId][$i]['quantity'] = ''; } $quantity = $this->cartSession[$productTypeId][$i]['quantity']; - $incTax = SC_Helper_TaxRule_Ex::sfCalcIncTax($price, + $incTax = TaxRuleHelper::sfCalcIncTax($price, $this->cartSession[$productTypeId][$i]['productsClass']['product_id'], $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], $pref_id, $country_id); @@ -202,7 +199,7 @@ public function getAllProductsTax($productTypeId, $pref_id = 0, $country_id = 0) for ($i = 0; $i <= $max; $i++) { $price = $this->cartSession[$productTypeId][$i]['price']; $quantity = $this->cartSession[$productTypeId][$i]['quantity']; - $tax = SC_Helper_TaxRule_Ex::sfTax($price, + $tax = TaxRuleHelper::sfTax($price, $this->cartSession[$productTypeId][$i]['productsClass']['product_id'], $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], $pref_id, $country_id); @@ -236,7 +233,7 @@ public function getAllProductsPoint($productTypeId) if (!isset($this->cartSession[$productTypeId][$i]['id'][0])) { $this->cartSession[$productTypeId][$i]['id'][0] = ''; } - $point = SC_Utils_Ex::sfPrePoint($price, $point_rate); + $point = Utils::sfPrePoint($price, $point_rate); $total+= ($point * $quantity); } } @@ -247,7 +244,7 @@ public function getAllProductsPoint($productTypeId) // カートへの商品追加 public function addProduct($product_class_id, $quantity) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $arrProduct = $objProduct->getProductsClass($product_class_id); $productTypeId = $arrProduct['product_type_id']; $find = false; @@ -262,9 +259,11 @@ public function addProduct($product_class_id, $quantity) } } if (!$find) { - $this->cartSession[$productTypeId][$max+1]['id'] = $product_class_id; - $this->cartSession[$productTypeId][$max+1]['quantity'] = $quantity; - $this->cartSession[$productTypeId][$max+1]['cart_no'] = $this->getNextCartID($productTypeId); + $this->cartSession[$productTypeId][] = array( + 'id' => $product_class_id, + 'quantity' => $quantity, + 'cart_no' => $this->getNextCartID($productTypeId), + ); } } @@ -360,7 +359,7 @@ public function adjustSessionProductsClass(&$arrProductsClass) */ public function setCartSession4getCartList($productTypeId, $key) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $this->cartSession[$productTypeId][$key]['productsClass'] =& $objProduct->getDetailAndProductsClass($this->cartSession[$productTypeId][$key]['id']); @@ -372,7 +371,7 @@ public function setCartSession4getCartList($productTypeId, $key) = $this->cartSession[$productTypeId][$key]['productsClass']['point_rate']; $quantity = $this->cartSession[$productTypeId][$key]['quantity']; - $incTax = SC_Helper_TaxRule_Ex::sfCalcIncTax($price, + $incTax = TaxRuleHelper::sfCalcIncTax($price, $this->cartSession[$productTypeId][$key]['productsClass']['product_id'], $this->cartSession[$productTypeId][$key]['id'][0]); @@ -392,12 +391,12 @@ public function setCartSession4getCartList($productTypeId, $key) */ public function getCartList($productTypeId, $pref_id = 0, $country_id = 0) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $max = $this->getMax($productTypeId); $arrRet = array(); /* - $const_name = '_CALLED_SC_CARTSESSION_GETCARTLIST_' . $productTypeId; + $const_name = '_CALLED_CARTSESSION_GETCARTLIST_' . $productTypeId; if (defined($const_name)) { $is_first = true; } else { @@ -431,12 +430,12 @@ public function getCartList($productTypeId, $pref_id = 0, $country_id = 0) $quantity = $this->cartSession[$productTypeId][$i]['quantity']; - $arrTaxRule = SC_Helper_TaxRule_Ex::getTaxRule( + $arrTaxRule = TaxRuleHelper::getTaxRule( $this->cartSession[$productTypeId][$i]['productsClass']['product_id'], $this->cartSession[$productTypeId][$i]['productsClass']['product_class_id'], $pref_id, $country_id); - $incTax = $price + SC_Helper_TaxRule_Ex::calcTax($price, $arrTaxRule['tax_rate'], $arrTaxRule['tax_rule'], $arrTaxRule['tax_adjust']); + $incTax = $price + TaxRuleHelper::calcTax($price, $arrTaxRule['tax_rate'], $arrTaxRule['tax_rule'], $arrTaxRule['tax_adjust']); $total = $incTax * $quantity; $this->cartSession[$productTypeId][$i]['price_inctax'] = $incTax; @@ -607,8 +606,8 @@ public function getProductClassId($cart_no, $productTypeId) */ public function checkProducts($productTypeId) { - $objProduct = new SC_Product_Ex(); - $objDelivery = new SC_Helper_Delivery_Ex(); + $objProduct = new Product(); + $objDelivery = new DeliveryHelper(); $arrDeliv = $objDelivery->getList($productTypeId); $tpl_message = ''; @@ -619,14 +618,14 @@ public function checkProducts($productTypeId) /* * 表示/非表示商品のチェック */ - if (SC_Utils_Ex::isBlank($product) || $product['status'] != 1) { + if (Utils::isBlank($product) || $product['status'] != 1) { $this->delProduct($arrItem['cart_no'], $productTypeId); $tpl_message .= "※ 現時点で販売していない商品が含まれておりました。該当商品をカートから削除しました。\n"; } else { /* * 配送業者のチェック */ - if (SC_Utils_Ex::isBlank($arrDeliv)) { + if (Utils::isBlank($arrDeliv)) { $tpl_message .= '※「' . $product['name'] . '」はまだ配送の準備ができておりません。'; $tpl_message .= '恐れ入りますがお問い合わせページよりお問い合わせください。' . "\n"; $this->delProduct($arrItem['cart_no'], $productTypeId); @@ -639,7 +638,7 @@ public function checkProducts($productTypeId) if (!is_null($limit) && $arrItem['quantity'] > $limit) { if ($limit > 0) { $this->setProductValue($arrItem['id'], 'quantity', $limit, $productTypeId); - $total_inctax = $limit * SC_Helper_TaxRule_Ex::sfCalcIncTax($arrItem['price'], + $total_inctax = $limit * TaxRuleHelper::sfCalcIncTax($arrItem['price'], $product['product_id'], $arrItem['id'][0]); $this->setProductValue($arrItem['id'], 'total_inctax', $total_inctax, $productTypeId); @@ -665,8 +664,6 @@ public function checkProducts($productTypeId) */ public function isDelivFree($productTypeId) { - $objDb = new SC_Helper_DB_Ex(); - $subtotal = $this->getAllProductsTotal($productTypeId); // 送料無料の購入数が設定されている場合 @@ -680,7 +677,7 @@ public function isDelivFree($productTypeId) } // 送料無料条件が設定されている場合 - $arrInfo = $objDb->sfGetBasisData(); + $arrInfo = DbHelper::getBasisData(); if ($arrInfo['free_rule'] > 0) { // 小計が送料無料条件以上の場合 if ($subtotal >= $arrInfo['free_rule']) { @@ -704,7 +701,7 @@ public function isDelivFree($productTypeId) * - add_point: 加算ポイント * * @param integer $productTypeId 商品種別ID - * @param SC_Customer $objCustomer ログイン中の SC_Customer インスタンス + * @param Customer $objCustomer ログイン中の Customer インスタンス * @param integer $use_point 今回使用ポイント * @param integer|array $deliv_pref 配送先都道府県ID. 複数に配送する場合は都道府県IDの配列 @@ -715,7 +712,7 @@ public function isDelivFree($productTypeId) * @param integer $order_country_id 注文者の国 * @return array カートの計算結果の配列 */ - public function calculate($productTypeId, &$objCustomer, $use_point = 0, + public function calculate($productTypeId, Customer &$objCustomer, $use_point = 0, $deliv_pref = '', $charge = 0, $discount = 0, $deliv_id = 0, $order_pref = 0, $order_country_id = 0 ) { @@ -737,9 +734,9 @@ public function calculate($productTypeId, &$objCustomer, $use_point = 0, // 配送業者の送料を加算 if (OPTION_DELIV_FEE == 1 - && !SC_Utils_Ex::isBlank($deliv_pref) - && !SC_Utils_Ex::isBlank($deliv_id)) { - $results['deliv_fee'] += SC_Helper_Delivery_Ex::getDelivFee($deliv_pref, $deliv_id); + && !Utils::isBlank($deliv_pref) + && !Utils::isBlank($deliv_id)) { + $results['deliv_fee'] += DeliveryHelper::getDelivFee($deliv_pref, $deliv_id); } // 送料無料チェック @@ -758,7 +755,7 @@ public function calculate($productTypeId, &$objCustomer, $use_point = 0, // 加算ポイントの計算 if (USE_POINT !== false) { - $results['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($total_point, $use_point); + $results['add_point'] = DbHelper::getAddPoint($total_point, $use_point); if ($objCustomer != '') { // 誕生日月であった場合 if ($objCustomer->isBirthMonth()) { diff --git a/data/class/SC_CheckError.php b/data/Eccube/Common/CheckError.php similarity index 97% rename from data/class/SC_CheckError.php rename to data/Eccube/Common/CheckError.php index f67bde18233..5605bff90c7 100644 --- a/data/class/SC_CheckError.php +++ b/data/Eccube/Common/CheckError.php @@ -1,32 +1,24 @@ arrParam = $_POST; } - } /** @@ -1607,7 +1598,7 @@ public function MOBILE_EMAIL_CHECK($value) $this->createParam($value); - $objMobile = new SC_Helper_Mobile_Ex(); + $objMobile = new MobileHelper(); $input_var = $this->arrParam[$keyname]; if (strlen($input_var) > 0 &&!$objMobile->gfIsMobileMailAddress($input_var) @@ -1636,14 +1627,14 @@ public function CHECK_REGIST_CUSTOMER_EMAIL($value) $this->createParam($value); - $register_user_flg = SC_Helper_Customer_Ex::sfCheckRegisterUserFromEmail($this->arrParam[$keyname]); + $register_user_flg = CustomerHelper::sfCheckRegisterUserFromEmail($this->arrParam[$keyname]); switch ($register_user_flg) { case 1: - $this->arrErr[$keyname] .= + $this->arrErr[$keyname] = "※ すでに会員登録で使用されている{$disp_name}です。
"; break; case 2: - $this->arrErr[$keyname] .= + $this->arrErr[$keyname] = "※ 退会から一定期間の間は、同じ{$disp_name}を使用することはできません。
"; break; default: diff --git a/data/class/SC_ClassAutoloader.php b/data/Eccube/Common/ClassAutoloader.php similarity index 81% rename from data/class/SC_ClassAutoloader.php rename to data/Eccube/Common/ClassAutoloader.php index c15c356df58..3b3cdac3e53 100644 --- a/data/class/SC_ClassAutoloader.php +++ b/data/Eccube/Common/ClassAutoloader.php @@ -1,34 +1,26 @@ doAction('loadClassFileChange', array(&$plugin_class, &$plugin_classpath)); // FIXME: トリッキーな処理で _Ex ファイルを無視しないようにする(無視するとユーザーカスタマイズで分かりにくい) - // SC_XXXX_Ex がロードされる場合にextendsのchainを - // SC_XXXX_Ex -> SC_XXXX から、 SC_XXXX_Ex -> $class (-> SC_XXXX) と変える。 + // XXXX_Ex がロードされる場合にextendsのchainを + // XXXX_Ex -> XXXX から、 XXXX_Ex -> $class (-> XXXX) と変える。 // そうでない場合は、直接置き換えと想定して帰ってきたクラスをロードする if (is_array($plugin_class) && count($plugin_class) > 0) { $arrPluginClassName = $plugin_class; diff --git a/data/class/SC_Cookie.php b/data/Eccube/Common/Cookie.php similarity index 56% rename from data/class/SC_Cookie.php rename to data/Eccube/Common/Cookie.php index 3593cc196bd..effeeb029f8 100644 --- a/data/class/SC_Cookie.php +++ b/data/Eccube/Common/Cookie.php @@ -1,31 +1,22 @@ getAll($sql, $arrValues); if (empty($result)) { return false; @@ -53,7 +53,7 @@ public function getCustomerDataFromEmailPass($pass, $email, $mobile = false) } // パスワードが合っていれば会員情報をcustomer_dataにセットしてtrueを返す - if (SC_Utils_Ex::sfIsMatchHashPassword($pass, $data['password'], $data['salt'])) { + if (Utils::sfIsMatchHashPassword($pass, $data['password'], $data['salt'])) { $this->customer_data = $data; $this->startSession(); @@ -72,9 +72,9 @@ public function getCustomerDataFromEmailPass($pass, $email, $mobile = false) public function checkMobilePhoneId() { //docomo用にデータを取り出す。 - if (SC_MobileUserAgent_Ex::getCarrier() == 'docomo') { + if (MobileUserAgent::getCarrier() == 'docomo') { if ($_SESSION['mobile']['phone_id'] == '' && strlen($_SESSION['mobile']['phone_id']) == 0) { - $_SESSION['mobile']['phone_id'] = SC_MobileUserAgent_Ex::getId(); + $_SESSION['mobile']['phone_id'] = MobileUserAgent::getId(); } } if (!isset($_SESSION['mobile']['phone_id']) || $_SESSION['mobile']['phone_id'] === false) { @@ -82,7 +82,7 @@ public function checkMobilePhoneId() } // 携帯端末IDが一致し、本登録された会員を検索する。 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists('dtb_customer', 'mobile_phone_id = ? AND del_flg = 0 AND status = 2', array($_SESSION['mobile']['phone_id'])); return $exists; @@ -99,9 +99,9 @@ public function checkMobilePhoneId() public function getCustomerDataFromMobilePhoneIdPass($pass) { //docomo用にデータを取り出す。 - if (SC_MobileUserAgent_Ex::getCarrier() == 'docomo') { + if (MobileUserAgent::getCarrier() == 'docomo') { if ($_SESSION['mobile']['phone_id'] == '' && strlen($_SESSION['mobile']['phone_id']) == 0) { - $_SESSION['mobile']['phone_id'] = SC_MobileUserAgent_Ex::getId(); + $_SESSION['mobile']['phone_id'] = MobileUserAgent::getId(); } } if (!isset($_SESSION['mobile']['phone_id']) || $_SESSION['mobile']['phone_id'] === false) { @@ -110,11 +110,11 @@ public function getCustomerDataFromMobilePhoneIdPass($pass) // 携帯端末IDが一致し、本登録された会員を検索する。 $sql = 'SELECT * FROM dtb_customer WHERE mobile_phone_id = ? AND del_flg = 0 AND status = 2'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); @list($data) = $objQuery->getAll($sql, array($_SESSION['mobile']['phone_id'])); // パスワードが合っている場合は、会員情報をcustomer_dataに格納してtrueを返す。 - if (SC_Utils_Ex::sfIsMatchHashPassword($pass, $data['password'], $data['salt'])) { + if (Utils::sfIsMatchHashPassword($pass, $data['password'], $data['salt'])) { $this->customer_data = $data; $this->startSession(); @@ -139,7 +139,7 @@ public function updateMobilePhoneId() return; } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqlval = array('mobile_phone_id' => $_SESSION['mobile']['phone_id']); $where = 'customer_id = ? AND del_flg = 0 AND status = 2'; $objQuery->update('dtb_customer', $sqlval, $where, array($this->customer_data['customer_id'])); @@ -152,7 +152,7 @@ public function setLogin($email) { // 本登録された会員のみ $sql = 'SELECT * FROM dtb_customer WHERE (email = ? OR email_mobile = ?) AND del_flg = 0 AND status = 2'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $result = $objQuery->getAll($sql, array($email, $email)); $data = isset($result[0]) ? $result[0] : ''; $this->customer_data = $data; @@ -164,7 +164,7 @@ public function updateSession() { $sql = 'SELECT * FROM dtb_customer WHERE customer_id = ? AND del_flg = 0'; $customer_id = $this->getValue('customer_id'); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->getAll($sql, array($customer_id)); $this->customer_data = isset($arrRet[0]) ? $arrRet[0] : ''; $_SESSION['customer'] = $this->customer_data; @@ -175,7 +175,7 @@ public function startSession() { $_SESSION['customer'] = $this->customer_data; // セッション情報の保存 - GC_Utils_Ex::gfPrintLog('access : user='.$this->customer_data['customer_id'] ."\t".'ip='. $this->getRemoteHost(), CUSTOMER_LOG_REALFILE, false); + GcUtils::gfPrintLog('access : user='.$this->customer_data['customer_id'] ."\t".'ip='. $this->getRemoteHost(), CUSTOMER_LOG_REALFILE, false); } // ログアウト $_SESSION['customer']を解放し、ログに書き込む @@ -187,16 +187,16 @@ public function EndSession() // $_SESSION['customer']の解放 unset($_SESSION['customer']); // セッションの配送情報を全て破棄する - SC_Helper_Purchase_Ex::unsetAllShippingTemp(true); + PurchaseHelper::unsetAllShippingTemp(true); // トランザクショントークンの破棄 - SC_Helper_Session_Ex::destroyToken(); - $objSiteSess = new SC_SiteSession_Ex(); + SessionHelper::destroyToken(); + $objSiteSess = new SiteSession(); $objSiteSess->unsetUniqId(); // ログに記録する $log = sprintf("logout : user=%d\tip=%s", $customer_id, $this->getRemoteHost()); - GC_Utils_Ex::gfPrintLog($log, CUSTOMER_LOG_REALFILE, false); + GcUtils::gfPrintLog($log, CUSTOMER_LOG_REALFILE, false); } // ログインに成功しているか判定する。 @@ -204,14 +204,14 @@ public function isLoginSuccess($dont_check_email_mobile = false) { // ログイン時のメールアドレスとDBのメールアドレスが一致している場合 if (isset($_SESSION['customer']['customer_id']) - && SC_Utils_Ex::sfIsInt($_SESSION['customer']['customer_id']) + && Utils::sfIsInt($_SESSION['customer']['customer_id']) ) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $email = $objQuery->get('email', 'dtb_customer', 'customer_id = ?', array($_SESSION['customer']['customer_id'])); if ($email == $_SESSION['customer']['email']) { // モバイルサイトの場合は携帯のメールアドレスが登録されていることもチェックする。 // ただし $dont_check_email_mobile が true の場合はチェックしない。 - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE && !$dont_check_email_mobile) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE && !$dont_check_email_mobile) { $email_mobile = $objQuery->get('email_mobile', 'dtb_customer', 'customer_id = ?', array($_SESSION['customer']['customer_id'])); return isset($email_mobile); @@ -229,7 +229,7 @@ public function getValue($keyname) { // ポイントはリアルタイム表示 if ($keyname == 'point') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $point = $objQuery->get('point', 'dtb_customer', 'customer_id = ?', array($_SESSION['customer']['customer_id'])); $_SESSION['customer']['point'] = $point; @@ -258,7 +258,7 @@ public function setValue($keyname, $val) public function hasValue($keyname) { if (isset($_SESSION['customer'][$keyname])) { - return !SC_Utils_Ex::isBlank($_SESSION['customer'][$keyname]); + return !Utils::isBlank($_SESSION['customer'][$keyname]); } return false; @@ -302,7 +302,7 @@ public function getRemoteHost() //受注関連の会員情報を更新 public function updateOrderSummary($customer_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = <<< __EOS__ SUM( payment_total) AS buy_total, @@ -332,7 +332,7 @@ public function updateOrderSummary($customer_id) */ public function doLogin($login_email, $login_pass) { - switch (SC_Display_Ex::detectDevice()) { + switch (Display::detectDevice()) { case DEVICE_TYPE_MOBILE: if (!$this->getCustomerDataFromMobilePhoneIdPass($login_pass) && !$this->getCustomerDataFromEmailPass($login_pass, $login_email, true) @@ -340,7 +340,7 @@ public function doLogin($login_email, $login_pass) return false; } else { // Session Fixation対策 - SC_Helper_Session_Ex::regenerateSID(); + SessionHelper::regenerateSID(); $this->updateMobilePhoneId(); @@ -355,7 +355,7 @@ public function doLogin($login_email, $login_pass) return false; } else { // Session Fixation対策 - SC_Helper_Session_Ex::regenerateSID(); + SessionHelper::regenerateSID(); return true; } diff --git a/data/class/SC_CustomerList.php b/data/Eccube/Common/CustomerList.php similarity index 94% rename from data/class/SC_CustomerList.php rename to data/Eccube/Common/CustomerList.php index 6caa5405507..e528cd61c93 100644 --- a/data/class/SC_CustomerList.php +++ b/data/Eccube/Common/CustomerList.php @@ -1,30 +1,26 @@ arrSql['search_htmlmail'])) { $this->setWhere('status = 2'); - if (SC_Utils_Ex::sfIsInt($this->arrSql['search_htmlmail'])) { + if (Utils::sfIsInt($this->arrSql['search_htmlmail'])) { // メルマガ拒否している会員も含む場合は、条件を付加しない if ($this->arrSql['search_htmlmail'] != 99) { $this->setWhere('mailmaga_flg = ?'); @@ -306,7 +302,7 @@ public function __construct($array, $mode = '') if (!isset($this->arrSql['search_category_id'])) $this->arrSql['search_category_id'] = ''; if (strlen($this->arrSql['search_category_id']) > 0) { // カテゴリで絞込検索を行うSQL文生成 - list($tmp_where, $tmp_arrval) = $objDb->sfGetCatWhere($this->arrSql['search_category_id']); + list($tmp_where, $tmp_arrval) = $objDb->getCatWhere($this->arrSql['search_category_id']); // カテゴリで絞込みが可能の場合 if ($tmp_where != '') { diff --git a/data/class/db/SC_DB_DBFactory.php b/data/Eccube/Common/DB/DBFactory.php similarity index 84% rename from data/class/db/SC_DB_DBFactory.php rename to data/Eccube/Common/DB/DBFactory.php index a144512f6d1..cc38fb1a2b3 100644 --- a/data/class/db/SC_DB_DBFactory.php +++ b/data/Eccube/Common/DB/DBFactory.php @@ -1,52 +1,47 @@ conn->loadModule('Manager'); @@ -244,7 +239,7 @@ function addLimitOffset($sql, $limit = 0, $offset = 0) */ public function alldtlSQL($where_products_class = '') { - if (!SC_Utils_Ex::isBlank($where_products_class)) { + if (!Utils::isBlank($where_products_class)) { $where_products_class = 'AND (' . $where_products_class . ')'; } /* diff --git a/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php b/data/Eccube/Common/DB/DBFactory/MysqlDBFactory.php similarity index 86% rename from data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php rename to data/Eccube/Common/DB/DBFactory/MysqlDBFactory.php index 5e0ca372bc6..bbe31ea3570 100644 --- a/data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php +++ b/data/Eccube/Common/DB/DBFactory/MysqlDBFactory.php @@ -1,40 +1,34 @@ getOne('select version()'); return 'MySQL ' . $val; @@ -81,7 +75,7 @@ public function sfChangeMySQL($sql) */ public function getCharSet() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->getAll("SHOW VARIABLES LIKE 'char%'"); return $arrRet; @@ -245,10 +239,10 @@ public function concatColumn($columns) */ public function findTableNames($expression = '') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sql = 'SHOW TABLES LIKE '. $objQuery->quote('%' . $expression . '%'); $arrColList = $objQuery->getAll($sql); - $arrColList = SC_Utils_Ex::sfSwapArray($arrColList, false); + $arrColList = Utils::sfSwapArray($arrColList, false); return $arrColList[0]; } @@ -327,7 +321,7 @@ public function sfChangeArrayToString($sql) */ public function sfGetCreateIndexDefinition($table, $name, $definition) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrTblInfo = $objQuery->getTableInfo($table); foreach ($arrTblInfo as $fieldInfo) { if (array_key_exists($fieldInfo['name'], $definition['fields'])) { @@ -353,12 +347,12 @@ public function getDummyFromClauseSql() } /** - * 各 DB に応じた SC_Query での初期化を行う + * 各 DB に応じた Query での初期化を行う * - * @param SC_Query $objQuery SC_Query インスタンス + * @param Query $objQuery Query インスタンス * @return void */ - public function initObjQuery(SC_Query &$objQuery) + public function initObjQuery(Query &$objQuery) { $objQuery->exec('SET SESSION storage_engine = InnoDB'); $objQuery->exec("SET SESSION sql_mode = 'ANSI'"); diff --git a/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php b/data/Eccube/Common/DB/DBFactory/PgsqlDBFactory.php similarity index 87% rename from data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php rename to data/Eccube/Common/DB/DBFactory/PgsqlDBFactory.php index 0f43631a200..5269345092e 100644 --- a/data/class/db/dbfactory/SC_DB_DBFactory_PGSQL.php +++ b/data/Eccube/Common/DB/DBFactory/PgsqlDBFactory.php @@ -1,38 +1,33 @@ getOne('select version()'); $arrLine = explode(' ', $val); @@ -126,7 +121,7 @@ public function getSendHistoryWhereStartdateSql() */ public function getDownloadableDaysWhereSql($dtb_order_alias = 'dtb_order') { - $baseinfo = SC_Helper_DB_Ex::sfGetBasisData(); + $baseinfo = DbHelper::getBasisData(); //downloadable_daysにNULLが入っている場合(無期限ダウンロード可能時)もあるので、NULLの場合は0日に補正 $downloadable_days = $baseinfo['downloadable_days']; // FIXME 怪しい比較「== null」 @@ -222,13 +217,13 @@ public function concatColumn($columns) * * 引数に部分一致するテーブル名を配列で返す. * - * @deprecated SC_Query::listTables() を使用してください + * @deprecated Query::listTables() を使用してください * @param string $expression 検索文字列 * @return array テーブル名の配列 */ public function findTableNames($expression = '') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sql = ' SELECT c.relname AS name, ' . ' CASE c.relkind ' . " WHEN 'r' THEN 'table' " @@ -242,7 +237,7 @@ public function findTableNames($expression = '') . ' AND c.relname LIKE ?' . ' ORDER BY 1,2;'; $arrColList = $objQuery->getAll($sql, array('%' . $expression . '%')); - $arrColList = SC_Utils_Ex::sfSwapArray($arrColList, false); + $arrColList = Utils::sfSwapArray($arrColList, false); return $arrColList[0]; } @@ -274,7 +269,7 @@ public function getDummyFromClauseSql() * MDB2_Driver_Manager_pgsql#listTables の不具合回避を目的として独自実装している。 * @return array テーブル名の配列 */ - public function listTables(SC_Query &$objQuery) + public function listTables(Query &$objQuery) { $col = 'tablename'; $from = 'pg_tables'; @@ -292,7 +287,7 @@ public function listTables(SC_Query &$objQuery) */ public function alldtlSQL($where_products_class = '') { - if (!SC_Utils_Ex::isBlank($where_products_class)) { + if (!Utils::isBlank($where_products_class)) { $where_products_class = 'AND (' . $where_products_class . ')'; } /* diff --git a/data/class/db/SC_DB_MasterData.php b/data/Eccube/Common/DB/MasterData.php similarity index 90% rename from data/class/db/SC_DB_MasterData.php rename to data/Eccube/Common/DB/MasterData.php index 0492d8999f9..68f72d8bf50 100644 --- a/data/class/db/SC_DB_MasterData.php +++ b/data/Eccube/Common/DB/MasterData.php @@ -1,26 +1,20 @@ getDefaultColumnName($columns); - $this->objQuery =& SC_Query_Ex::getSingletonInstance(); + $this->objQuery = Query::getSingletonInstance(); if ($autoCommit) { $this->objQuery->begin(); } @@ -136,7 +129,7 @@ public function updateMasterData($name, $columns, $masterData, $autoCommit = tru { $columns = $this->getDefaultColumnName($columns); - $this->objQuery =& SC_Query_Ex::getSingletonInstance(); + $this->objQuery = Query::getSingletonInstance(); if ($autoCommit) { $this->objQuery->begin(); } @@ -145,7 +138,7 @@ public function updateMasterData($name, $columns, $masterData, $autoCommit = tru $i = 0; foreach ($masterData as $key => $val) { $sqlVal = array($columns[1] => $val); - $this->objQuery->update($name, $sqlVal, $columns[0] . ' = ' . SC_Utils_Ex::sfQuoteSmart($key)); + $this->objQuery->update($name, $sqlVal, $columns[0] . ' = ' . Utils::sfQuoteSmart($key)); $i++; } if ($autoCommit) { @@ -171,7 +164,7 @@ public function insertMasterData($name, $key, $value, $comment, $autoCommit = tr { $columns = $this->getDefaultColumnName(); - $this->objQuery =& SC_Query_Ex::getSingletonInstance(); + $this->objQuery = Query::getSingletonInstance(); if ($autoCommit) { $this->objQuery->begin(); } @@ -202,7 +195,7 @@ public function insertMasterData($name, $key, $value, $comment, $autoCommit = tr */ public function deleteMasterData($name, $autoCommit = true) { - $this->objQuery =& SC_Query_Ex::getSingletonInstance(); + $this->objQuery = Query::getSingletonInstance(); if ($autoCommit) { $this->objQuery->begin(); } @@ -308,7 +301,7 @@ public function getDbMasterData($name, $columns = array()) { $columns = $this->getDefaultColumnName($columns); - $this->objQuery =& SC_Query_Ex::getSingletonInstance(); + $this->objQuery = Query::getSingletonInstance(); if (isset($columns[2]) && strlen($columns[2]) >= 1) { $this->objQuery->setOrder($columns[2]); } diff --git a/data/class/SC_Date.php b/data/Eccube/Common/Date.php similarity index 78% rename from data/class/SC_Date.php rename to data/Eccube/Common/Date.php index a4bd298c388..40498a0f6a8 100644 --- a/data/class/SC_Date.php +++ b/data/Eccube/Common/Date.php @@ -1,28 +1,22 @@ setArrHoliday(); - if (is_null(SC_Date_Ex::$arrRegularHoliday)) $this->setRegularHoliday(); + if (is_null(static::$arrHoliday)) $this->setArrHoliday(); + if (is_null(static::$arrRegularHoliday)) $this->setRegularHoliday(); - if (!empty(SC_Date_Ex::$arrHoliday[$month])) { - if (in_array($day, SC_Date_Ex::$arrHoliday[$month])) { + if (!empty(static::$arrHoliday[$month])) { + if (in_array($day, static::$arrHoliday[$month])) { return true; } } - if (!empty(SC_Date_Ex::$arrRegularHoliday)) { + if (!empty(static::$arrRegularHoliday)) { $day = date('w', mktime(0, 0, 0, $month, $day, $year)); - if (in_array($day, SC_Date_Ex::$arrRegularHoliday)) { + if (in_array($day, static::$arrRegularHoliday)) { return true; } } @@ -227,13 +221,13 @@ public function isHoliday($year, $month, $day) */ private function setArrHoliday() { - $objHoliday = new SC_Helper_Holiday_Ex(); + $objHoliday = new HolidayHelper(); $holiday = $objHoliday->getList(); $arrHoliday = array(); foreach ($holiday AS $val) { $arrHoliday[$val['month']][] = $val['day']; } - SC_Date_Ex::$arrHoliday = $arrHoliday; + static::$arrHoliday = $arrHoliday; } /** @@ -243,7 +237,7 @@ private function setArrHoliday() */ private function setRegularHoliday() { - $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); - SC_Date_Ex::$arrRegularHoliday = explode('|', $arrInfo['regular_holiday_ids']); + $arrInfo = DbHelper::getBasisData(); + static::$arrRegularHoliday = explode('|', $arrInfo['regular_holiday_ids']); } } diff --git a/data/class/SC_Display.php b/data/Eccube/Common/Display.php similarity index 65% rename from data/class/SC_Display.php rename to data/Eccube/Common/Display.php index 63035813f16..89773dbee2b 100644 --- a/data/class/SC_Display.php +++ b/data/Eccube/Common/Display.php @@ -1,33 +1,29 @@ response = new SC_Response_Ex(); + $this->response = new Response(); if ($hasPrevURL) { $this->setPrevURL(); } @@ -58,8 +54,8 @@ public function __construct($hasPrevURL = true) public function setPrevURL() { - // TODO SC_SiteSession で実装した方が良さげ - $objCartSess = new SC_CartSession_Ex(); + // TODO SiteSession で実装した方が良さげ + $objCartSess = new CartSession(); $objCartSess->setPrevURL($_SERVER['REQUEST_URI']); } @@ -83,7 +79,7 @@ public function prepare($page, $is_admin = false) /** * リロードを行う. * - * SC_Response::reload() のラッパーです. + * Response::reload() のラッパーです. */ public function reload($queryString = array(), $removeQueryString = false) { @@ -115,22 +111,22 @@ public function setDevice($device = DEVICE_TYPE_PC) exit; } $this->response->setContentType('text/html'); - $this->setView(new SC_SiteView_Ex(true, DEVICE_TYPE_MOBILE)); + $this->setView(new MobileView(true, DEVICE_TYPE_MOBILE)); break; case DEVICE_TYPE_SMARTPHONE: - $this->setView(new SC_SiteView_Ex(true, DEVICE_TYPE_SMARTPHONE)); + $this->setView(new SmartphoneView(true, DEVICE_TYPE_SMARTPHONE)); break; case DEVICE_TYPE_PC: - $this->setView(new SC_SiteView_Ex(true, DEVICE_TYPE_PC)); + $this->setView(new SiteView(true, DEVICE_TYPE_PC)); break; case DEVICE_TYPE_ADMIN: - $this->setView(new SC_AdminView_Ex()); + $this->setView(new AdminView()); } $this->deviceSeted = true; } /** - * SC_View インスタンスを設定する. + * View インスタンスを設定する. */ public function setView($view) { @@ -140,9 +136,9 @@ public function setView($view) /** * 端末種別を判別する。 * - * SC_Display::MOBILE = ガラケー = 1 - * SC_Display::SMARTPHONE = スマホ = 2 - * SC_Display::PC = PC = 10 + * Display::MOBILE = ガラケー = 1 + * Display::SMARTPHONE = スマホ = 2 + * Display::PC = PC = 10 * * @static * @param $reset boolean @@ -150,19 +146,19 @@ public function setView($view) */ public static function detectDevice($reset = FALSE) { - if (is_null(SC_Display_Ex::$device) || $reset) { - $nu = new Net_UserAgent_Mobile(); - $su = new SC_SmartphoneUserAgent_Ex(); + if (is_null(static::$device) || $reset) { + $nu = new \Net_UserAgent_Mobile(); + $su = new SmartphoneUserAgent(); if ($nu->isMobile()) { - SC_Display_Ex::$device = DEVICE_TYPE_MOBILE; + static::$device = DEVICE_TYPE_MOBILE; } elseif ($su->isSmartphone()) { - SC_Display_Ex::$device = DEVICE_TYPE_SMARTPHONE; + static::$device = DEVICE_TYPE_SMARTPHONE; } else { - SC_Display_Ex::$device = DEVICE_TYPE_PC; + static::$device = DEVICE_TYPE_PC; } } - return SC_Display_Ex::$device; + return static::$device; } public function assign($val1,$val2) diff --git a/data/Eccube/Common/Filter/Lf2crlfFilter.php b/data/Eccube/Common/Filter/Lf2crlfFilter.php new file mode 100644 index 00000000000..5bb8479758c --- /dev/null +++ b/data/Eccube/Common/Filter/Lf2crlfFilter.php @@ -0,0 +1,32 @@ +data = preg_replace("/[\r\n]+$/", "\r\n", $bucket->data); + $consumed += $bucket->datalen; + stream_bucket_append($out, $bucket); + } + return PSFS_PASS_ON; + } +} diff --git a/data/class/SC_FormParam.php b/data/Eccube/Common/FormParam.php similarity index 92% rename from data/class/SC_FormParam.php rename to data/Eccube/Common/FormParam.php index 4593481a88d..e12f6cd463e 100644 --- a/data/class/SC_FormParam.php +++ b/data/Eccube/Common/FormParam.php @@ -1,26 +1,21 @@ check_dir = IMAGE_SAVE_REALDIR; - // SC_FormParamのフックポイント + // FormParamのフックポイント // TODO: debug_backtrace以外にいい方法があれば良いが、一旦これで $backtraces = debug_backtrace(); // 呼び出し元のクラスを取得 $class = $backtraces[1]['class']; $objPage = $backtraces[1]['object']; - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($objPage->plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance($objPage->plugin_activate_flg); if (is_object($objPlugin)) { - $objPlugin->doAction('SC_FormParam_construct', array($class, $this)); + $objPlugin->doAction('FormParam_construct', array($class, $this)); } } @@ -231,7 +226,7 @@ public function checkError($br = true) case 'NUM_POINT_CHECK': $this->recursionCheck($this->disp_name[$index], $func, $value, $arrErr[$key], $this->length[$index]); - if (SC_Utils_Ex::isBlank($arrErr[$key])) { + if (Utils::isBlank($arrErr[$key])) { unset($arrErr[$key]); } break; @@ -266,7 +261,7 @@ public function checkError($br = true) } /** - * SC_CheckError::doFunc() を再帰的に実行する. + * CheckError::doFunc() を再帰的に実行する. * * 再帰実行した場合は, エラーメッセージを多次元配列で格納する * @@ -286,7 +281,7 @@ public function recursionCheck($disp_name, $func, $value, &$arrErr, foreach ($value as $key => $in) { $this->recursionCheck($disp_name, $func, $in, $arrErr[$key], $length); - if (SC_Utils_Ex::isBlank($arrErr[$key])) { + if (Utils::isBlank($arrErr[$key])) { unset($arrErr[$key]); } } @@ -294,9 +289,9 @@ public function recursionCheck($disp_name, $func, $value, &$arrErr, } $dummy_key = 'dummy'; // 仮のキーを指定。どんな値でも良い。 - $objErr = new SC_CheckError_Ex(array($dummy_key => $value)); + $objErr = new CheckError(array($dummy_key => $value)); $objErr->doFunc(array($disp_name, $dummy_key, $length), array($func)); - if (!SC_Utils_Ex::isBlank($objErr->arrErr[$dummy_key])) { + if (isset($objErr->arrErr[$dummy_key]) && !Utils::isBlank($objErr->arrErr[$dummy_key])) { $arrErr = $objErr->arrErr[$dummy_key]; } } @@ -329,7 +324,7 @@ public function recursionConvParam(&$value, $convert) $this->recursionConvParam($value[$key], $convert); } } else { - if (!SC_Utils_Ex::isBlank($value)) { + if (!Utils::isBlank($value)) { $value = mb_convert_kana($value, $convert); } } @@ -376,7 +371,7 @@ public function getSwapArray($arrKey = array()) { $arrTmp = $this->getHashArray($arrKey); - return SC_Utils_Ex::sfSwapArray($arrTmp); + return Utils::sfSwapArray($arrTmp); } // 項目名一覧の取得 @@ -431,12 +426,12 @@ public function getValue($keyname, $default = '') if (is_array($ret)) { foreach ($ret as &$value) { - if (SC_Utils_Ex::isBlank($value)) { + if (Utils::isBlank($value)) { $value = $default; } } } else { - if (SC_Utils_Ex::isBlank($ret)) { + if (Utils::isBlank($ret)) { $ret = $default; } } @@ -486,7 +481,7 @@ public function recursionTrim(&$value, $has_wide_space = true) $this->recursionTrim($value[$key], $has_wide_space); } } else { - if (!SC_Utils_Ex::isBlank($value)) { + if (!Utils::isBlank($value)) { if ($has_wide_space) { $value = preg_replace($pattern, '$1', $value); } diff --git a/data/class/SC_Fpdf.php b/data/Eccube/Common/Fpdf.php similarity index 87% rename from data/class/SC_Fpdf.php rename to data/Eccube/Common/Fpdf.php index 2bdf08e0a54..bf446f6dc9b 100644 --- a/data/class/SC_Fpdf.php +++ b/data/Eccube/Common/Fpdf.php @@ -1,26 +1,23 @@ pdf_download = $download; // PDFのダウンロード形式(0:表示、1:ダウンロード) $this->tpl_title = $title; $this->tpl_dispmode = 'real'; // 表示モード - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->width_cell = array(110.3,12,21.7,24.5); @@ -81,7 +78,7 @@ public function setData($arrData) //表示倍率(100%) $this->SetDisplayMode($this->tpl_dispmode); - if (SC_Utils_Ex::sfIsInt($arrData['order_id'])) { + if (Utils::sfIsInt($arrData['order_id'])) { $this->disp_mode = true; } @@ -98,8 +95,8 @@ private function setShopData() { // ショップ情報 - $objDb = new SC_Helper_DB_Ex(); - $arrInfo = $objDb->sfGetBasisData(); + $objDb = new DbHelper(); + $arrInfo = $objDb->getBasisData(); // ショップ名 $this->lfText(125, 60, $arrInfo['shop_name'], 8, 'B'); @@ -159,7 +156,7 @@ private function setOrderData() // お届け先情報 $this->SetFont('SJIS', '', 10); - $this->lfText(25, 125, SC_Utils_Ex::sfDispDBDate($this->arrDisp['create_date']), 10); //ご注文日 + $this->lfText(25, 125, Utils::sfDispDBDate($this->arrDisp['create_date']), 10); //ご注文日 $this->lfText(25, 135, $this->arrDisp['order_id'], 10); //注文番号 $this->SetFont('Gothic', 'B', 15); @@ -181,7 +178,7 @@ private function setOrderData() $data[0] = $this->arrDisp['quantity'][$i]; // 税込金額(単価) - $data[1] = SC_Helper_DB_Ex::sfCalcIncTax($this->arrDisp['price'][$i], $this->arrDisp['tax_rate'][$i], $this->arrDisp['tax_rule'][$i]); + $data[1] = DbHelper::calcIncTax($this->arrDisp['price'][$i], $this->arrDisp['tax_rate'][$i], $this->arrDisp['tax_rule'][$i]); // 小計(商品毎) $data[2] = $data[0] * $data[1]; @@ -271,7 +268,7 @@ private function setEtcData() $this->SetFont('Gothic', 'B', 9); $this->MultiCell(0, 6, '< 備考 >', 'T', 2, 'L', 0, ''); $this->SetFont('SJIS', '', 8); - $text = SC_Utils_Ex::rtrim($this->arrData['etc1'] . "\n" . $this->arrData['etc2'] . "\n" . $this->arrData['etc3']); + $text = Utils::rtrim($this->arrData['etc1'] . "\n" . $this->arrData['etc2'] . "\n" . $this->arrData['etc3']); $this->MultiCell(0, 4, $text, '', 2, 'L', 0, ''); } @@ -316,16 +313,16 @@ private function lfText($x, $y, $text, $size = 0, $style = '') // 受注データの取得 private function lfGetOrderData($order_id) { - if (SC_Utils_Ex::sfIsInt($order_id)) { + if (Utils::sfIsInt($order_id)) { // DBから受注情報を読み込む - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $this->arrDisp = $objPurchase->getOrder($order_id); - list($point) = SC_Helper_Customer_Ex::sfGetCustomerPoint($order_id, $this->arrDisp['use_point'], $this->arrDisp['add_point']); + list($point) = CustomerHelper::sfGetCustomerPoint($order_id, $this->arrDisp['use_point'], $this->arrDisp['add_point']); $this->arrDisp['point'] = $point; // 受注詳細データの取得 $arrRet = $objPurchase->getOrderDetail($order_id); - $arrRet = SC_Utils_Ex::sfSwapArray($arrRet); + $arrRet = Utils::sfSwapArray($arrRet); $this->arrDisp = array_merge($this->arrDisp, $arrRet); // その他支払い情報を表示 diff --git a/data/class/graph/SC_Graph_Base.php b/data/Eccube/Common/Graph/AbstractGraph.php similarity index 95% rename from data/class/graph/SC_Graph_Base.php rename to data/Eccube/Common/Graph/AbstractGraph.php index e270cc26b21..1b64c47fa3c 100644 --- a/data/class/graph/SC_Graph_Base.php +++ b/data/Eccube/Common/Graph/AbstractGraph.php @@ -1,26 +1,17 @@ setOrder('other_deliv_id DESC'); //スマートフォン用の処理 if ($startno != '') { @@ -139,7 +132,7 @@ public function deleteAddress($other_deliv_id, $customer_id = '') return false; } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $from = 'dtb_other_deliv'; $where = 'customer_id = ? AND other_deliv_id = ?'; @@ -150,24 +143,24 @@ public function deleteAddress($other_deliv_id, $customer_id = '') /** * お届け先フォーム初期化 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function setFormParam(&$objFormParam) { - SC_Helper_Customer_Ex::sfCustomerCommonParam($objFormParam); + CustomerHelper::sfCustomerCommonParam($objFormParam); $objFormParam->addParam('', 'other_deliv_id'); } /** * お届け先フォームエラーチェック * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function errorCheck(&$objFormParam) { - $objErr = SC_Helper_Customer_Ex::sfCustomerCommonErrorCheck($objFormParam); + $objErr = CustomerHelper::sfCustomerCommonErrorCheck($objFormParam); return $objErr->arrErr; } diff --git a/data/class/helper/SC_Helper_BestProducts.php b/data/Eccube/Common/Helper/BestProductsHelper.php similarity index 84% rename from data/class/helper/SC_Helper_BestProducts.php rename to data/Eccube/Common/Helper/BestProductsHelper.php index f9e07bf7720..e297a1a39fb 100644 --- a/data/class/helper/SC_Helper_BestProducts.php +++ b/data/Eccube/Common/Helper/BestProductsHelper.php @@ -1,34 +1,27 @@ 1); @@ -157,7 +150,7 @@ public function deleteBestProducts($best_id) */ public function deleteByProductIDs($productIDs) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); $arrList = $this->getList(); foreach ($arrList as $recommend) { if (in_array($recommend['product_id'], $productIDs)) { @@ -231,7 +224,7 @@ public function rankDown($best_id) */ public function changeRank($best_id, $rank) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_best_products'; $sqlval = array('rank' => $rank); diff --git a/data/class/helper/SC_Helper_Bloc.php b/data/Eccube/Common/Helper/BlocHelper.php similarity index 72% rename from data/class/helper/SC_Helper_Bloc.php rename to data/Eccube/Common/Helper/BlocHelper.php index 70abc034625..81cd4eeb0ce 100644 --- a/data/class/helper/SC_Helper_Bloc.php +++ b/data/Eccube/Common/Helper/BlocHelper.php @@ -1,34 +1,29 @@ getRow($col, 'dtb_bloc', $where, array($bloc_id, $this->device_type_id)); - if (SC_Utils_Ex::isAbsoluteRealPath($arrRet['tpl_path'])) { + if (Utils::isAbsoluteRealPath($arrRet['tpl_path'])) { $tpl_path = $arrRet['tpl_path']; } else { - $tpl_path = SC_Helper_PageLayout_Ex::getTemplatePath($this->device_type_id) . BLOC_DIR . $arrRet['tpl_path']; + $tpl_path = PageLayoutHelper::getTemplatePath($this->device_type_id) . BLOC_DIR . $arrRet['tpl_path']; } if (file_exists($tpl_path)) { $arrRet['bloc_html'] = file_get_contents($tpl_path); @@ -68,7 +63,7 @@ public function getBloc($bloc_id) */ public function getList() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = '*'; $where = 'device_type_id = ?'; $table = 'dtb_bloc'; @@ -85,9 +80,9 @@ public function getList() */ public function getWhere($where = '', $sqlval = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = '*'; - $where = 'device_type_id = ? ' . (SC_Utils_Ex::isBlank($where) ? $where : 'AND ' . $where); + $where = 'device_type_id = ? ' . (Utils::isBlank($where) ? $where : 'AND ' . $where); array_unshift($sqlval, $this->device_type_id); $table = 'dtb_bloc'; $arrRet = $objQuery->select($col, $table, $where, $sqlval); @@ -103,12 +98,12 @@ public function getWhere($where = '', $sqlval = array()) */ public function save($sqlval) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); // blod_id が空の場合は新規登録 - $is_new = SC_Utils_Ex::isBlank($sqlval['bloc_id']); - $bloc_dir = SC_Helper_PageLayout_Ex::getTemplatePath($sqlval['device_type_id']) . BLOC_DIR; + $is_new = Utils::isBlank($sqlval['bloc_id']); + $bloc_dir = PageLayoutHelper::getTemplatePath($sqlval['device_type_id']) . BLOC_DIR; // 既存データの重複チェック if (!$is_new) { $arrExists = $this->getBloc($sqlval['bloc_id']); @@ -126,7 +121,7 @@ public function save($sqlval) $arrValues['update_date'] = 'CURRENT_TIMESTAMP'; // 新規登録 - if ($is_new || SC_Utils_Ex::isBlank($arrExists)) { + if ($is_new || Utils::isBlank($arrExists)) { $objQuery->setOrder(''); $arrValues['bloc_id'] = 1 + $objQuery->max('bloc_id', $table, 'device_type_id = ?', array($arrValues['device_type_id'])); @@ -139,7 +134,7 @@ public function save($sqlval) } $bloc_path = $bloc_dir . $arrValues['tpl_path']; - if (!SC_Helper_FileManager_Ex::sfWriteFile($bloc_path, $sqlval['bloc_html'])) { + if (!FileManagerHelper::sfWriteFile($bloc_path, $sqlval['bloc_html'])) { $objQuery->rollback(); return false; @@ -158,18 +153,18 @@ public function save($sqlval) */ public function delete($bloc_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $arrExists = $this->getWhere('bloc_id = ? AND deletable_flg = 1', array($bloc_id)); $is_error = false; - if (!SC_Utils_Ex::isBlank($arrExists)) { + if (!Utils::isBlank($arrExists)) { $objQuery->delete('dtb_bloc', 'bloc_id = ? AND device_type_id = ?', array($arrExists[0]['bloc_id'], $arrExists[0]['device_type_id'])); $objQuery->delete('dtb_blocposition', 'bloc_id = ? AND device_type_id = ?', array($arrExists[0]['bloc_id'], $arrExists[0]['device_type_id'])); - $bloc_dir = SC_Helper_PageLayout_Ex::getTemplatePath($this->device_type_id) . BLOC_DIR; + $bloc_dir = PageLayoutHelper::getTemplatePath($this->device_type_id) . BLOC_DIR; $exists_file = $bloc_dir . $arrExists[0]['filename'] . '.tpl'; // ファイルの削除 diff --git a/data/class/helper/SC_Helper_Category.php b/data/Eccube/Common/Helper/CategoryHelper.php similarity index 81% rename from data/class/helper/SC_Helper_Category.php rename to data/Eccube/Common/Helper/CategoryHelper.php index 76669833579..dc5347b8879 100644 --- a/data/class/helper/SC_Helper_Category.php +++ b/data/Eccube/Common/Helper/CategoryHelper.php @@ -1,34 +1,28 @@ count_check])) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'dtb_category.*, dtb_category_total_count.product_count'; $from = 'dtb_category left join dtb_category_total_count ON dtb_category.category_id = dtb_category_total_count.category_id'; // 登録商品数のチェック @@ -98,7 +92,7 @@ public function getList($cid_to_key = FALSE, $reset = FALSE) if ($cid_to_key) { if (!isset($cidIsKey[$this->count_check])) { // 配列のキーをカテゴリーIDに - $cidIsKey[$this->count_check] = SC_Utils_Ex::makeArrayIDToKey('category_id', $arrCategory[$this->count_check]); + $cidIsKey[$this->count_check] = Utils::makeArrayIDToKey('category_id', $arrCategory[$this->count_check]); } return $cidIsKey[$this->count_check]; @@ -123,7 +117,7 @@ public function getTree($reset = false) if (!isset($arrTree[$this->count_check])) { $arrList = $this->getList(false, $reset); - $arrTree[$this->count_check] = SC_Utils_Ex::buildTree('category_id', 'parent_category_id', LEVEL_MAX, $arrList); + $arrTree[$this->count_check] = Utils::buildTree('category_id', 'parent_category_id', LEVEL_MAX, $arrList); } return $arrTree[$this->count_check]; @@ -139,7 +133,7 @@ public function getTree($reset = false) public function getTreeTrail($category_id, $id_only = TRUE) { $arrCategory = $this->getList(TRUE); - $arrTrailID = SC_Utils_Ex::getTreeTrail($category_id, 'category_id', 'parent_category_id', $arrCategory, TRUE, 0, $id_only); + $arrTrailID = Utils::getTreeTrail($category_id, 'category_id', 'parent_category_id', $arrCategory, TRUE, 0, $id_only); return $arrTrailID; } @@ -181,12 +175,12 @@ public function getTreeBranch($category_id) */ public function save($data) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $category_id = $data['category_id']; // ミリ秒付きの時間文字列を取得. CSVへの対応. // トランザクション内のCURRENT_TIMESTAMPは全てcommit()時の時間に統一されてしまう為. - $query = array('update_date' => SC_Utils_Ex::getFormattedDateWithMicroSecond()); + $query = array('update_date' => Utils::getFormattedDateWithMicroSecond()); $objQuery->begin(); if ($category_id == '') { @@ -243,9 +237,9 @@ public function save($data) */ public function delete($category_id) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // ランク付きレコードの削除(※処理負荷を考慮してレコードごと削除する。) - $objDb->sfDeleteRankRecord('dtb_category', 'category_id', $category_id, '', true); + $objDb->deleteRankRecord('dtb_category', 'category_id', $category_id, '', true); } /** @@ -256,7 +250,7 @@ public function delete($category_id) */ public function rankUp($category_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $up_id = $this->getNeighborRankId('upper', $category_id); if ($up_id != '') { @@ -282,7 +276,7 @@ public function rankUp($category_id) */ public function rankDown($category_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $down_id = $this->getNeighborRankId('lower', $category_id); if ($down_id != '') { @@ -344,9 +338,9 @@ private function getNeighborRankId($side, $category_id) */ private function countAllBranches($category_id) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // 子ID一覧を取得 - $arrRet = $objDb->sfGetChildrenArray('dtb_category', 'parent_category_id', 'category_id', $category_id); + $arrRet = $objDb->getChildrenArray('dtb_category', 'parent_category_id', 'category_id', $category_id); return count($arrRet); } @@ -354,18 +348,18 @@ private function countAllBranches($category_id) /** * 子孫カテゴリーの表示順を一括して上げる. * - * @param SC_Query $objQuery + * @param Query $objQuery * @param int $category_id * @param int $count * @return array|bool */ - private function raiseBranchRank(SC_Query $objQuery, $category_id, $count) + private function raiseBranchRank(Query $objQuery, $category_id, $count) { $table = 'dtb_category'; - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // 子ID一覧を取得 - $arrRet = $objDb->sfGetChildrenArray($table, 'parent_category_id', 'category_id', $category_id); - $line = SC_Utils_Ex::sfGetCommaList($arrRet); + $arrRet = $objDb->getChildrenArray($table, 'parent_category_id', 'category_id', $category_id); + $line = Utils::sfGetCommaList($arrRet); $where = "category_id IN ($line) AND del_flg = 0"; $arrRawVal = array( 'rank' => "(rank + $count)", @@ -377,18 +371,18 @@ private function raiseBranchRank(SC_Query $objQuery, $category_id, $count) /** * 子孫カテゴリーの表示順を一括して下げる. * - * @param SC_Query $objQuery + * @param Query $objQuery * @param int $category_id * @param int $count * @return array|bool */ - private function reduceBranchRank(SC_Query $objQuery, $category_id, $count) + private function reduceBranchRank(Query $objQuery, $category_id, $count) { $table = 'dtb_category'; - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // 子ID一覧を取得 - $arrRet = $objDb->sfGetChildrenArray($table, 'parent_category_id', 'category_id', $category_id); - $line = SC_Utils_Ex::sfGetCommaList($arrRet); + $arrRet = $objDb->getChildrenArray($table, 'parent_category_id', 'category_id', $category_id); + $line = Utils::sfGetCommaList($arrRet); $where = "category_id IN ($line) AND del_flg = 0"; $arrRawVal = array( 'rank' => "(rank - $count)", @@ -411,9 +405,9 @@ public function isValidCategoryId($category_id, $include_deleted = false) { $where = 'del_flg = 0'; } if ( - SC_Utils_Ex::sfIsInt($category_id) - && !SC_Utils_Ex::sfIsZeroFilling($category_id) - && SC_Helper_DB_Ex::sfIsRecord('dtb_category', 'category_id', array($category_id), $where) + Utils::sfIsInt($category_id) + && !Utils::sfIsZeroFilling($category_id) + && DbHelper::isRecord('dtb_category', 'category_id', array($category_id), $where) ) { return true; } diff --git a/data/class/helper/SC_Helper_CSV.php b/data/Eccube/Common/Helper/CsvHelper.php similarity index 87% rename from data/class/helper/SC_Helper_CSV.php rename to data/Eccube/Common/Helper/CsvHelper.php index 5bde5377dd1..d31ea408e7d 100644 --- a/data/class/helper/SC_Helper_CSV.php +++ b/data/Eccube/Common/Helper/CsvHelper.php @@ -1,18 +1,30 @@ sfGetCsvOutput($csv_id, 'status = ' . CSV_COLUMN_STATUS_FLG_ENABLE)); + $arrOutput = Utils::sfSwapArray($this->sfGetCsvOutput($csv_id, 'status = ' . CSV_COLUMN_STATUS_FLG_ENABLE)); if (count($arrOutput) <= 0) return false; // 失敗終了 $arrOutputCols = $arrOutput['col']; - $cols = SC_Utils_Ex::sfGetCommaList($arrOutputCols, true); + $cols = Utils::sfGetCommaList($arrOutputCols, true); // 商品の場合 if ($csv_id == 1) { // この WHERE 句を足さないと無効な規格も出力される。現行仕様と合わせる為追加。 $inner_where = 'dtb_products_class.del_flg = 0'; - $from = SC_Product_Ex::prdclsSQL($inner_where); + $from = Product::prdclsSQL($inner_where); // 会員の場合 } elseif ($csv_id == 2) { $from = 'dtb_customer'; @@ -113,12 +125,12 @@ public function sfDownloadCsv($csv_id, $where = '', $arrVal = array(), $order = */ public function sfGetCsvOutput($csv_id = '', $where = '', $arrVal = array(), $order = 'rank, no') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $cols = 'no, csv_id, col, disp_name, rank, status, rw_flg, mb_convert_kana_option, size_const_type, error_check_types'; $table = 'dtb_csv'; - if (SC_Utils_Ex::sfIsInt($csv_id)) { + if (Utils::sfIsInt($csv_id)) { if ($where == '') { $where = 'csv_id = ?'; } else { @@ -212,7 +224,7 @@ public function cbOutputCSV($data) $this->output_header = false; } fputcsv($this->fpOutput, $data); - SC_Utils_Ex::extendTimeOut(); + Utils::extendTimeOut(); return true; } @@ -229,13 +241,13 @@ public function cbOutputCSV($data) */ public function sfDownloadCsvFromSql($sql, $arrVal = array(), $file_head = 'csv', $arrHeader = null, $is_download = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); if (!$is_download) { ob_start(); } - $this->fpOutput =& SC_Helper_CSV_Ex::fopen_for_output_csv(); + $this->fpOutput = static::fopen_for_output_csv(); // ヘッダー構築 $this->output_header = false; @@ -260,7 +272,7 @@ public function sfDownloadCsvFromSql($sql, $arrVal = array(), $file_head = 'csv' // CSV 用の HTTP ヘッダーを送出する。 if ($is_download) { $file_name = $file_head . '_' . date('ymd_His') .'.csv'; - SC_Response_Ex::headerForDownload($file_name); + Response::headerForDownload($file_name); $return = true; } // 戻り値にCSVデータをセットする @@ -319,15 +331,15 @@ public function lfDownloadCsv($arrData, $prefix = '') { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); if ($prefix == '') { - $dir_name = SC_Utils_Ex::sfUpDirName(); + $dir_name = Utils::sfUpDirName(); $file_name = $dir_name . date('ymdHis') .'.csv'; } else { $file_name = $prefix . date('ymdHis') .'.csv'; } - SC_Response_Ex::headerForDownload($file_name); + Response::headerForDownload($file_name); /* データを出力 */ - $fp =& SC_Helper_CSV_Ex::fopen_for_output_csv(); + $fp = static::fopen_for_output_csv(); foreach ($arrData as $lineArray) { fputcsv($fp, $lineArray); } @@ -343,7 +355,7 @@ public function lfDownloadCSVFile($filepath, $prefix = '') { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); $file_name = $prefix . date('YmdHis') . '.csv'; - SC_Response_Ex::headerForDownload($file_name); + Response::headerForDownload($file_name); /* データを出力 */ // file_get_contentsはメモリマッピングも自動的に使ってくれるので高速&省メモリ @@ -359,30 +371,10 @@ public static function &fopen_for_output_csv($filename = 'php://output') { $fp = fopen($filename, 'w'); + stream_filter_register('convert.eccube_lf2crlf', '\\Eccube\\Common\\Filter\\Lf2crlfFilter'); stream_filter_append($fp, 'convert.iconv.utf-8/cp932'); stream_filter_append($fp, 'convert.eccube_lf2crlf'); return $fp; } } - -/** - * 改行コードを CRLF に変換するフィルター - * - * @package php_user_filter - * @author Seasoft 塚田将久 (新規作成) - * @version $Id$ - */ -class php_user_filter_lf2crlf extends php_user_filter -{ - function filter($in, $out, &$consumed, $closing) - { - while ($bucket = stream_bucket_make_writeable($in)) { - $bucket->data = preg_replace("/[\r\n]+$/", "\r\n", $bucket->data); - $consumed += $bucket->datalen; - stream_bucket_append($out, $bucket); - } - return PSFS_PASS_ON; - } -} -stream_filter_register('convert.eccube_lf2crlf', 'php_user_filter_lf2crlf'); diff --git a/data/class/helper/SC_Helper_Customer.php b/data/Eccube/Common/Helper/CustomerHelper.php similarity index 85% rename from data/class/helper/SC_Helper_Customer.php rename to data/Eccube/Common/Helper/CustomerHelper.php index 8eee97d78b5..476b75cf172 100644 --- a/data/class/helper/SC_Helper_Customer.php +++ b/data/Eccube/Common/Helper/CustomerHelper.php @@ -1,47 +1,46 @@ begin(); $old_version_flag = false; @@ -57,7 +56,7 @@ public function sfEditCustomerData($arrData, $customer_id = null) $old_version_flag = true; } } else { - $salt = SC_Utils_Ex::sfGetRandomString(10); + $salt = Utils::sfGetRandomString(10); $arrData['salt'] = $salt; } //-- パスワードの更新がある場合は暗号化 @@ -68,11 +67,11 @@ public function sfEditCustomerData($arrData, $customer_id = null) // 旧バージョン(2.11未満)からの移行を考慮 if ($old_version_flag) { $is_password_updated = true; - $salt = SC_Utils_Ex::sfGetRandomString(10); + $salt = Utils::sfGetRandomString(10); $arrData['salt'] = $salt; } - $arrData['password'] = SC_Utils_Ex::sfGetHashString($arrData['password'], $salt); + $arrData['password'] = Utils::sfGetHashString($arrData['password'], $salt); } //-- 秘密の質問の更新がある場合は暗号化 if ($arrData['reminder_answer'] == DEFAULT_PASSWORD or $arrData['reminder_answer'] == '') { @@ -83,7 +82,7 @@ public function sfEditCustomerData($arrData, $customer_id = null) if ($old_version_flag && $is_password_updated) { // パスワードが更新される場合は、平文になっている秘密の質問を暗号化する $reminder_answer = $objQuery->get('reminder_answer', 'dtb_customer', 'customer_id = ? ', array($customer_id)); - $arrData['reminder_answer'] = SC_Utils_Ex::sfGetHashString($reminder_answer, $salt); + $arrData['reminder_answer'] = Utils::sfGetHashString($reminder_answer, $salt); } } else { // 旧バージョン(2.11未満)からの移行を考慮 @@ -91,7 +90,7 @@ public function sfEditCustomerData($arrData, $customer_id = null) // パスワードが更新されない場合は、平文のままにする unset($arrData['salt']); } else { - $arrData['reminder_answer'] = SC_Utils_Ex::sfGetHashString($arrData['reminder_answer'], $salt); + $arrData['reminder_answer'] = Utils::sfGetHashString($arrData['reminder_answer'], $salt); } } @@ -132,7 +131,7 @@ public function sfEditCustomerData($arrData, $customer_id = null) */ public function sfGetCustomerPoint($order_id, $use_point, $add_point) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->select('customer_id', 'dtb_order', 'order_id = ?', array($order_id)); $customer_id = $arrRet[0]['customer_id']; @@ -156,19 +155,19 @@ public function sfGetCustomerPoint($order_id, $use_point, $add_point) /** * emailアドレスから、登録済み会員や退会済み会員をチェックする * - * XXX SC_CheckError からしか呼び出されず, 本クラスの中で SC_CheckError を呼び出している + * XXX CheckError からしか呼び出されず, 本クラスの中で CheckError を呼び出している * * @param string $email メールアドレス * @return integer 0:登録可能 1:登録済み 2:再登録制限期間内削除ユーザー 3:自分のアドレス */ public function sfCheckRegisterUserFromEmail($email) { - $objCustomer = new SC_Customer_Ex(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objCustomer = new Customer(); + $objQuery = Query::getSingletonInstance(); // ログインしている場合、すでに登録している自分のemailの場合 if ($objCustomer->isLoginSuccess(true) - && SC_Helper_Customer_Ex::sfCustomerEmailDuplicationCheck($objCustomer->getValue('customer_id'), $email)) { + && CustomerHelper::sfCustomerEmailDuplicationCheck($objCustomer->getValue('customer_id'), $email)) { // 自分のアドレス return 3; } @@ -185,7 +184,7 @@ public function sfCheckRegisterUserFromEmail($email) return 1; } else { // 退会した会員である場合 - $leave_time = SC_Utils_Ex::sfDBDatetoTime($arrRet[0]['update_date']); + $leave_time = Utils::sfDBDatetoTime($arrRet[0]['update_date']); $now_time = time(); $pass_time = $now_time - $leave_time; // 退会から何時間-経過しているか判定する。 @@ -212,7 +211,7 @@ public function sfCheckRegisterUserFromEmail($email) */ public function sfCustomerEmailDuplicationCheck($customer_id, $email) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrResults = $objQuery->getRow('email, email_mobile', 'dtb_customer', 'customer_id = ?', @@ -235,7 +234,7 @@ public function sfCustomerEmailDuplicationCheck($customer_id, $email) */ public function sfGetCustomerData($customer_id, $mask_flg = true) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 会員情報DB取得 $ret = $objQuery->select('*', 'dtb_customer', 'customer_id=?', array($customer_id)); @@ -273,14 +272,14 @@ public function sfGetCustomerData($customer_id, $mask_flg = true) */ public function sfGetCustomerDataFromId($customer_id, $add_where = '', $arrAddVal = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); if ($add_where == '') { $where = 'customer_id = ?'; $arrData = $objQuery->getRow('*', 'dtb_customer', $where, array($customer_id)); } else { $where = $add_where; - if (SC_Utils_Ex::sfIsInt($customer_id)) { + if (Utils::sfIsInt($customer_id)) { $where .= ' AND customer_id = ?'; $arrAddVal[] = $customer_id; } @@ -298,10 +297,10 @@ public function sfGetCustomerDataFromId($customer_id, $add_where = '', $arrAddVa */ public function sfGetUniqSecretKey() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); do { - $uniqid = SC_Utils_Ex::sfGetUniqRandomId('r'); + $uniqid = Utils::sfGetUniqRandomId('r'); $exists = $objQuery->exists('dtb_customer', 'secret_key = ?', array($uniqid)); } while ($exists); @@ -318,7 +317,7 @@ public function sfGetUniqSecretKey() */ public function sfGetCustomerId($uniqid, $check_status = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'secret_key = ?'; @@ -332,15 +331,15 @@ public function sfGetCustomerId($uniqid, $check_status = false) /** * 会員登録時フォーム初期化 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param boolean $isAdmin true:管理者画面 false:会員向け * @access public * @return void */ public function sfCustomerEntryParam(&$objFormParam, $isAdmin = false) { - SC_Helper_Customer_Ex::sfCustomerCommonParam($objFormParam); - SC_Helper_Customer_Ex::sfCustomerRegisterParam($objFormParam, $isAdmin); + CustomerHelper::sfCustomerCommonParam($objFormParam); + CustomerHelper::sfCustomerRegisterParam($objFormParam, $isAdmin); if ($isAdmin) { $objFormParam->addParam('会員ID', 'customer_id', INT_LEN, 'n', array('NUM_CHECK')); $objFormParam->addParam('携帯メールアドレス', 'email_mobile', null, 'a', array('NO_SPTAB', 'EMAIL_CHECK', 'SPTAB_CHECK', 'EMAIL_CHAR_CHECK', 'MOBILE_EMAIL_CHECK')); @@ -349,7 +348,7 @@ public function sfCustomerEntryParam(&$objFormParam, $isAdmin = false) $objFormParam->addParam('所持ポイント', 'point', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK'), 0); } - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { // 登録確認画面の「戻る」ボタンのためのパラメーター $objFormParam->addParam('戻る', 'return', '', '', array(), '', false); } @@ -358,15 +357,15 @@ public function sfCustomerEntryParam(&$objFormParam, $isAdmin = false) /** * 会員情報変更フォーム初期化 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @access public * @return void */ public function sfCustomerMypageParam(&$objFormParam) { - SC_Helper_Customer_Ex::sfCustomerCommonParam($objFormParam); - SC_Helper_Customer_Ex::sfCustomerRegisterParam($objFormParam, false, true); - if (SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE) { + CustomerHelper::sfCustomerCommonParam($objFormParam); + CustomerHelper::sfCustomerRegisterParam($objFormParam, false, true); + if (Display::detectDevice() !== DEVICE_TYPE_MOBILE) { $objFormParam->addParam('携帯メールアドレス', 'email_mobile', null, 'a', array('NO_SPTAB', 'EMAIL_CHECK', 'SPTAB_CHECK', 'EMAIL_CHAR_CHECK', 'MOBILE_EMAIL_CHECK')); $objFormParam->addParam('携帯メールアドレス(確認)', 'email_mobile02', null, 'a', array('NO_SPTAB', 'EMAIL_CHECK', 'SPTAB_CHECK', 'EMAIL_CHAR_CHECK', 'MOBILE_EMAIL_CHECK'), '', false); } else { @@ -378,7 +377,7 @@ public function sfCustomerMypageParam(&$objFormParam) /** * 会員・顧客・お届け先共通 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param string $prefix キー名にprefixを付ける場合に指定 * @access public * @return void @@ -417,7 +416,7 @@ public function sfCustomerCommonParam(&$objFormParam, $prefix = '') /** * 会員登録共通 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param boolean $isAdmin true:管理者画面 false:会員向け * @param boolean $is_mypage マイページの場合 true * @param string $prefix キー名にprefixを付ける場合に指定 @@ -436,7 +435,7 @@ public function sfCustomerRegisterParam(&$objFormParam, $isAdmin = false, $is_my $objFormParam->addParam('メールマガジン', $prefix . 'mailmaga_flg', INT_LEN, 'n', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); - if (SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() !== DEVICE_TYPE_MOBILE) { $objFormParam->addParam('メールアドレス', $prefix . 'email', null, 'a', array('NO_SPTAB', 'EXIST_CHECK', 'EMAIL_CHECK', 'SPTAB_CHECK', 'EMAIL_CHAR_CHECK')); $objFormParam->addParam('パスワード(確認)', $prefix . 'password02', PASSWORD_MAX_LEN, '', array('EXIST_CHECK', 'SPTAB_CHECK', 'GRAPH_CHECK'), '', false); if (!$isAdmin) { @@ -451,26 +450,26 @@ public function sfCustomerRegisterParam(&$objFormParam, $isAdmin = false, $is_my /** * 会員登録エラーチェック - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @access public * @return array エラーの配列 */ public function sfCustomerEntryErrorCheck(&$objFormParam) { - $objErr = SC_Helper_Customer_Ex::sfCustomerCommonErrorCheck($objFormParam); - $objErr = SC_Helper_Customer_Ex::sfCustomerRegisterErrorCheck($objErr); + $objErr = CustomerHelper::sfCustomerCommonErrorCheck($objFormParam); + $objErr = CustomerHelper::sfCustomerRegisterErrorCheck($objErr); /* * sfCustomerRegisterErrorCheck() では, ログイン中の場合は重複チェック * されないので, 再度チェックを行う */ - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); if ($objCustomer->isLoginSuccess(true) - && SC_Helper_Customer_Ex::sfCustomerEmailDuplicationCheck($objCustomer->getValue('customer_id'), $objFormParam->getValue('email'))) { + && CustomerHelper::sfCustomerEmailDuplicationCheck($objCustomer->getValue('customer_id'), $objFormParam->getValue('email'))) { $objErr->arrErr['email'] .= '※ すでに会員登録で使用されているメールアドレスです。
'; } if ($objCustomer->isLoginSuccess(true) - && SC_Helper_Customer_Ex::sfCustomerEmailDuplicationCheck($objCustomer->getValue('customer_id'), $objFormParam->getValue('email_mobile'))) { + && CustomerHelper::sfCustomerEmailDuplicationCheck($objCustomer->getValue('customer_id'), $objFormParam->getValue('email_mobile'))) { $objErr->arrErr['email_mobile'] .= '※ すでに会員登録で使用されているメールアドレスです。
'; } @@ -480,7 +479,7 @@ public function sfCustomerEntryErrorCheck(&$objFormParam) /** * 会員情報変更エラーチェック * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param boolean $isAdmin 管理画面チェック時:true * @access public * @return array エラーの配列 @@ -490,8 +489,8 @@ public function sfCustomerMypageErrorCheck(&$objFormParam, $isAdmin = false) $objFormParam->toLower('email_mobile'); $objFormParam->toLower('email_mobile02'); - $objErr = SC_Helper_Customer_Ex::sfCustomerCommonErrorCheck($objFormParam); - $objErr = SC_Helper_Customer_Ex::sfCustomerRegisterErrorCheck($objErr, $isAdmin); + $objErr = CustomerHelper::sfCustomerCommonErrorCheck($objFormParam); + $objErr = CustomerHelper::sfCustomerRegisterErrorCheck($objErr, $isAdmin); if (isset($objErr->arrErr['password']) && $objFormParam->getValue('password') == DEFAULT_PASSWORD) { @@ -509,10 +508,10 @@ public function sfCustomerMypageErrorCheck(&$objFormParam, $isAdmin = false) /** * 会員エラーチェック共通 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param string $prefix キー名にprefixを付ける場合に指定 * @access public - * @return SC_CheckError_Ex エラー情報の配列 + * @return CheckError エラー情報の配列 */ public function sfCustomerCommonErrorCheck(&$objFormParam, $prefix = '') { @@ -522,7 +521,7 @@ public function sfCustomerCommonErrorCheck(&$objFormParam, $prefix = '') $arrParams = $objFormParam->getHashArray(); // 入力データを渡す。 - $objErr = new SC_CheckError_Ex($arrParams); + $objErr = new CheckError($arrParams); $objErr->arrErr = $objFormParam->checkError(); $objErr->doFunc(array('電話番号', $prefix . 'tel01', $prefix . 'tel02', $prefix . 'tel03'), array('TEL_CHECK')); @@ -535,16 +534,16 @@ public function sfCustomerCommonErrorCheck(&$objFormParam, $prefix = '') /** * 会員登録編集共通の相関チェック * - * @param SC_CheckError $objErr SC_CheckError インスタンス + * @param CheckError $objErr CheckError インスタンス * @param boolean $isAdmin 管理画面チェック時:true - * @return SC_CheckError $objErr エラー情報 + * @return CheckError $objErr エラー情報 */ public function sfCustomerRegisterErrorCheck(&$objErr, $isAdmin = false) { $objErr->doFunc(array('生年月日', 'year', 'month', 'day'), array('CHECK_BIRTHDAY')); $objErr->doFunc(array('パスワード', 'password', PASSWORD_MIN_LEN, PASSWORD_MAX_LEN), array('NUM_RANGE_CHECK')); - if (SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() !== DEVICE_TYPE_MOBILE) { if (!$isAdmin) { $objErr->doFunc(array('メールアドレス', 'メールアドレス(確認)', 'email', 'email02'), array('EQUAL_CHECK')); } @@ -563,7 +562,7 @@ public function sfCustomerRegisterErrorCheck(&$objErr, $isAdmin = false) /** * 会員検索パラメーター(管理画面用) * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @access public * @return void */ @@ -613,7 +612,7 @@ public function sfSetSearchParam(&$objFormParam) /** * 会員検索パラメーター エラーチェック(管理画面用) * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @access public * @return array エラー配列 */ @@ -624,7 +623,7 @@ public function sfCheckErrorSearchParam(&$objFormParam) // エラーチェック対象のパラメータ取得 $array = $objFormParam->getHashArray(); // 拡張エラーチェック初期化 - $objErr = new SC_CheckError_Ex($array); + $objErr = new CheckError($array); // 拡張エラーチェック $objErr->doFunc(array('誕生日(開始日)', 'search_b_start_year', 'search_b_start_month', 'search_b_start_day'), array('CHECK_DATE')); $objErr->doFunc(array('誕生日(終了日)', 'search_b_end_year', 'search_b_end_month', 'search_b_end_day'), array('CHECK_DATE')); @@ -638,20 +637,20 @@ public function sfCheckErrorSearchParam(&$objFormParam) // 開始 > 終了 の場合はエラーとする $objErr->doFunc(array('最終購入日(開始)', '最終購入日(終了)', 'search_buy_start_year', 'search_buy_start_month', 'search_buy_start_day', 'search_buy_end_year', 'search_buy_end_month', 'search_buy_end_day'), array('CHECK_SET_TERM')); - if (SC_Utils_Ex::sfIsInt($array['search_buy_total_from']) - && SC_Utils_Ex::sfIsInt($array['search_buy_total_to']) + if (Utils::sfIsInt($array['search_buy_total_from']) + && Utils::sfIsInt($array['search_buy_total_to']) && $array['search_buy_total_from'] > $array['search_buy_total_to'] ) { $objErr->arrErr['search_buy_total_from'] .= '※ 購入金額の指定範囲が不正です。'; } - if (SC_Utils_Ex::sfIsInt($array['search_buy_times_from']) - && SC_Utils_Ex::sfIsInt($array['search_buy_times_to']) + if (Utils::sfIsInt($array['search_buy_times_from']) + && Utils::sfIsInt($array['search_buy_times_to']) && $array['search_buy_times_from'] > $array['search_buy_times_to'] ) { $objErr->arrErr['search_buy_times_from'] .= '※ 購入回数の指定範囲が不正です。'; } - if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { + if (!Utils::isBlank($objErr->arrErr)) { $arrErr = array_merge($arrErr, $objErr->arrErr); } @@ -663,14 +662,14 @@ public function sfCheckErrorSearchParam(&$objFormParam) * * @param array $arrParam 検索パラメーター連想配列 * @param string $limitMode ページングを利用するか判定用フラグ - * @return array( integer 全体件数, mixed 会員データ一覧配列, mixed SC_PageNaviオブジェクト) + * @return array( integer 全体件数, mixed 会員データ一覧配列, mixed PageNaviオブジェクト) */ public function sfGetSearchData($arrParam, $limitMode = '') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $objSelect = new SC_CustomerList_Ex($arrParam, 'customer'); + $objQuery = Query::getSingletonInstance(); + $objSelect = new CustomerList($arrParam, 'customer'); - $page_max = SC_Utils_Ex::sfGetSearchPageMax($arrParam['search_page_max']); + $page_max = Utils::sfGetSearchPageMax($arrParam['search_page_max']); $disp_pageno = $arrParam['search_pageno']; if ($disp_pageno == 0) { $disp_pageno = 1; @@ -682,11 +681,11 @@ public function sfGetSearchData($arrParam, $limitMode = '') $arrData = $objQuery->getAll($objSelect->getList(), $objSelect->arrVal); // 該当全体件数の取得 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $linemax = $objQuery->getOne($objSelect->getListCount(), $objSelect->arrVal); // ページ送りの取得 - $objNavi = new SC_PageNavi_Ex($arrParam['search_pageno'], + $objNavi = new PageNavi($arrParam['search_pageno'], $linemax, $page_max, 'eccube.moveSearchPage', @@ -703,7 +702,7 @@ public function sfGetSearchData($arrParam, $limitMode = '') */ public function checkTempCustomer($login_email) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'email = ? AND status = 1 AND del_flg = 0'; $exists = $objQuery->exists('dtb_customer', $where, array($login_email)); @@ -719,8 +718,8 @@ public function checkTempCustomer($login_email) */ public static function delete($customer_id) { - $arrData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id, 'del_flg = 0'); - if (SC_Utils_Ex::isBlank($arrData)) { + $arrData = CustomerHelper::sfGetCustomerDataFromId($customer_id, 'del_flg = 0'); + if (Utils::isBlank($arrData)) { //対象となるデータが見つからない。 return false; } @@ -728,7 +727,7 @@ public static function delete($customer_id) $arrVal = array( 'del_flg' => '1', ); - SC_Helper_Customer_Ex::sfEditCustomerData($arrVal, $customer_id); + CustomerHelper::sfEditCustomerData($arrVal, $customer_id); return true; } diff --git a/data/class/helper/SC_Helper_DB.php b/data/Eccube/Common/Helper/DbHelper.php similarity index 84% rename from data/class/helper/SC_Helper_DB.php rename to data/Eccube/Common/Helper/DbHelper.php index fd6b4bb1385..a6ad828e9d0 100644 --- a/data/class/helper/SC_Helper_DB.php +++ b/data/Eccube/Common/Helper/DbHelper.php @@ -1,34 +1,32 @@ getDSN($dsn); - $objQuery =& SC_Query_Ex::getSingletonInstance($dsn); + $objQuery = Query::getSingletonInstance($dsn); // テーブルが無ければエラー if (!in_array($tableName, $objQuery->listTables())) return false; @@ -79,7 +77,7 @@ public function sfColumnExists($tableName, $colName, $colType = '', $dsn = '', $ // カラムを追加する if ($add) { - return $this->sfColumnAdd($tableName, $colName, $colType); + return $this->columnAdd($tableName, $colName, $colType); } return false; @@ -89,9 +87,9 @@ public function sfColumnExists($tableName, $colName, $colType = '', $dsn = '', $ * @param string $colType * @param string $tableName */ - public function sfColumnAdd($tableName, $colName, $colType) + public function columnAdd($tableName, $colName, $colType) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->query("ALTER TABLE $tableName ADD $colName $colType "); } @@ -105,9 +103,9 @@ public function sfColumnAdd($tableName, $colName, $colType) * @return bool データが存在する場合 true, データの追加に成功した場合 true, * $add == false で, データが存在しない場合 false */ - public static function sfDataExists($tableName, $where, $arrWhereVal) + public static function dataExists($tableName, $where, $arrWhereVal) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists($tableName, $where, $arrWhereVal); return $exists; @@ -122,12 +120,12 @@ public static function sfDataExists($tableName, $where, $arrWhereVal) * @param boolean $force 強制的にDB取得するか * @return array 店舗基本情報の配列 */ - public function sfGetBasisData($force = false) + public static function getBasisData($force = false) { static $arrData = null; if ($force || is_null($arrData)) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrData = $objQuery->getRow('*', 'dtb_baseinfo'); } @@ -141,7 +139,7 @@ public function sfGetBasisData($force = false) * @param boolean $generate キャッシュファイルが無い時、DBのデータを基にキャッシュを生成するか * @return array 店舗基本情報の配列 */ - public function sfGetBasisDataCache($generate = false) + public function getBasisDataCache($generate = false) { // テーブル名 $name = 'dtb_baseinfo'; @@ -150,7 +148,7 @@ public function sfGetBasisDataCache($generate = false) // ファイル存在確認 if (!file_exists($filepath) && $generate) { // 存在していなければキャッシュ生成 - $this->sfCreateBasisDataCache(); + $this->createBasisDataCache(); } // 戻り値初期化 $cacheData = array(); @@ -165,23 +163,23 @@ public function sfGetBasisDataCache($generate = false) /** * 基本情報のキャッシュデータファイルを生成する - * データはsfGetBasisDataより取得。 + * データはgetBasisDataより取得。 * * このメソッドが直接呼ばれるのは、 *「基本情報管理>SHOPマスター」の更新完了後。 - * sfGetBasisDataCacheでは、 + * getBasisDataCacheでは、 * キャッシュデータファイルが無い場合に呼ばれます。 * * @return bool キャッシュデータファイル生成結果 */ - public function sfCreateBasisDataCache() + public function createBasisDataCache() { // テーブル名 $name = 'dtb_baseinfo'; // キャッシュファイルパス $filepath = MASTER_DATA_REALDIR . $name . '.serial'; // データ取得 - $arrData = $this->sfGetBasisData(true); + $arrData = $this->getBasisData(true); // シリアライズ $data = serialize($arrData); // ファイルを書き出しモードで開く @@ -208,9 +206,9 @@ public function sfCreateBasisDataCache() * @return int * @deprecated */ - public function sfGetBasisCount() + public function getBasisCount() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->count('dtb_baseinfo'); } @@ -220,15 +218,15 @@ public function sfGetBasisCount() * * @return boolean 有無 */ - public function sfGetBasisExists() + public function getBasisExists() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->exists('dtb_baseinfo'); } /* 選択中のアイテムのルートカテゴリIDを取得する */ - public function sfGetRootId() + public function getRootId() { if (!$this->g_root_on) { $this->g_root_on = true; @@ -238,10 +236,10 @@ public function sfGetRootId() if (!empty($_GET['product_id']) || !empty($_GET['category_id'])) { // 選択中のカテゴリIDを判定する - $category_id = $this->sfGetCategoryId($_GET['product_id'], $_GET['category_id']); + $category_id = $this->getCategoryId($_GET['product_id'], $_GET['category_id']); // ROOTカテゴリIDの取得 if (count($category_id) > 0) { - $arrRet = $this->sfGetParents('dtb_category', 'parent_category_id', 'category_id', $category_id); + $arrRet = $this->getParents('dtb_category', 'parent_category_id', 'category_id', $category_id); $root_id = isset($arrRet[0]) ? $arrRet[0] : ''; } else { $root_id = ''; @@ -265,9 +263,9 @@ public function sfGetRootId() * @param integer $order_status 対応状況 * @return array オーダー前ポイントの配列 */ - public function sfGetRollbackPoint($order_id, $use_point, $add_point, $order_status) + public function getRollbackPoint($order_id, $use_point, $add_point, $order_status) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->select('customer_id', 'dtb_order', 'order_id = ?', array($order_id)); $customer_id = $arrRet[0]['customer_id']; if ($customer_id != '' && $customer_id >= 1) { @@ -276,12 +274,12 @@ public function sfGetRollbackPoint($order_id, $use_point, $add_point, $order_sta $rollback_point = $arrRet[0]['point']; // 対応状況がポイント利用対象の場合、使用ポイント分を戻す - if (SC_Helper_Purchase_Ex::isUsePoint($order_status)) { + if (PurchaseHelper::isUsePoint($order_status)) { $rollback_point += $use_point; } // 対応状況がポイント加算対象の場合、加算ポイント分を戻す - if (SC_Helper_Purchase_Ex::isAddPoint($order_status)) { + if (PurchaseHelper::isAddPoint($order_status)) { $rollback_point -= $add_point; } } else { @@ -299,9 +297,9 @@ public function sfGetRollbackPoint($order_id, $use_point, $add_point, $order_sta * @param bool $count_check 登録商品数のチェックを行う場合 true * @return array カテゴリツリーの配列 */ - public function sfGetCatTree($parent_category_id, $count_check = false) + public function getCatTree($parent_category_id, $count_check = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = ''; $col .= ' cat.category_id,'; $col .= ' cat.category_name,'; @@ -323,7 +321,7 @@ public function sfGetCatTree($parent_category_id, $count_check = false) $objQuery->setOption('ORDER BY rank DESC'); $arrRet = $objQuery->select($col, $from, $where); - $arrParentID = SC_Utils_Ex::getTreeTrail($parent_category_id, 'category_id', 'parent_category_id', $arrRet); + $arrParentID = Utils::getTreeTrail($parent_category_id, 'category_id', 'parent_category_id', $arrRet); foreach ($arrRet as $key => $array) { foreach ($arrParentID as $val) { @@ -370,11 +368,11 @@ public function findTree(&$arrTree, $parent, &$result) * @param integer $category_id カテゴリID * @return string 親カテゴリを連結した文字列 */ - public function sfGetCatCombName($category_id) + public function getCatCombName($category_id) { // 商品が属するカテゴリIDを縦に取得 - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $arrCatID = $this->sfGetParents('dtb_category', 'parent_category_id', 'category_id', $category_id); + $objQuery = Query::getSingletonInstance(); + $arrCatID = $this->getParents('dtb_category', 'parent_category_id', 'category_id', $category_id); $ConbName = ''; // カテゴリ名称を取得する @@ -396,12 +394,12 @@ public function sfGetCatCombName($category_id) * @param integer $category_id カテゴリID * @return array 指定したカテゴリIDの大カテゴリ */ - public function sfGetFirstCat($category_id) + public function getFirstCat($category_id) { // 商品が属するカテゴリIDを縦に取得 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = array(); - $arrCatID = $this->sfGetParents('dtb_category', 'parent_category_id', 'category_id', $category_id); + $arrCatID = $this->getParents('dtb_category', 'parent_category_id', 'category_id', $category_id); $arrRet['id'] = $arrCatID[0]; // カテゴリ名称を取得する @@ -422,9 +420,9 @@ public function sfGetFirstCat($category_id) * @param string $head カテゴリ名のプレフィックス文字列 * @return array カテゴリツリーの配列 */ - public function sfGetCategoryList($addwhere = '', $products_check = false, $head = CATEGORY_HEAD) + public function getCategoryList($addwhere = '', $products_check = false, $head = CATEGORY_HEAD) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'del_flg = 0'; if ($addwhere != '') { @@ -463,9 +461,9 @@ public function sfGetCategoryList($addwhere = '', $products_check = false, $head * @param bool $parent_zero 親カテゴリの Value=0 の場合 true * @return array カテゴリツリーの配列 */ - public function sfGetLevelCatList($parent_zero = true) + public function getLevelCatList($parent_zero = true) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // カテゴリ名リストを取得 $col = 'category_id, parent_category_id, category_name'; @@ -514,15 +512,15 @@ public function sfGetLevelCatList($parent_zero = true) * @return array 選択中の商品のカテゴリIDの配列 * */ - public function sfGetCategoryId($product_id, $category_id = 0, $closed = false) + public function getCategoryId($product_id, $category_id = 0, $closed = false) { $category_id = (int) $category_id; $product_id = (int) $product_id; - $objCategory = new SC_Helper_Category_Ex(); + $objCategory = new CategoryHelper(); if ($objCategory->isValidCategoryId($category_id, $closed)) { $category_id = array($category_id); } else { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $category_id = $objProduct->getCategoryIds($product_id, $closed); } @@ -538,7 +536,7 @@ public function sfGetCategoryId($product_id, $category_id = 0, $closed = false) */ public function addProductBeforCategories($category_id, $product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqlval = array('category_id' => $category_id, 'product_id' => $product_id); @@ -563,7 +561,7 @@ public function addProductAfterCategories($category_id, $product_id) $sqlval = array('category_id' => $category_id, 'product_id' => $product_id); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 現在の商品カテゴリを取得 $arrCat = $objQuery->select('product_id, category_id, rank', @@ -593,7 +591,7 @@ public function addProductAfterCategories($category_id, $product_id) */ public function removeProductByCategories($category_id, $product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->delete('dtb_product_categories', 'category_id = ? AND product_id = ?', array($category_id, $product_id)); } @@ -607,7 +605,7 @@ public function removeProductByCategories($category_id, $product_id) */ public function updateProductCategories($arrCategory_id, $product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 現在のカテゴリ情報を取得 $arrCurrentCat = $objQuery->getCol('category_id', @@ -626,7 +624,7 @@ public function updateProductCategories($arrCategory_id, $product_id) // カテゴリを登録 foreach ($arrCategory_id as $category_id) { $this->addProductBeforCategories($category_id, $product_id); - SC_Utils_Ex::extendTimeOut(); + Utils::extendTimeOut(); } } @@ -634,16 +632,16 @@ public function updateProductCategories($arrCategory_id, $product_id) * カテゴリ数の登録を行う. * * - * @param SC_Query $objQuery SC_Query インスタンス + * @param Query $objQuery Query インスタンス * @param boolean $is_force_all_count 全カテゴリの集計を強制する場合 true * @return void */ - public function sfCountCategory($objQuery = NULL, $is_force_all_count = false) + public function countCategory($objQuery = NULL, $is_force_all_count = false) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); if ($objQuery == NULL) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); } $is_out_trans = false; @@ -653,7 +651,7 @@ public function sfCountCategory($objQuery = NULL, $is_force_all_count = false) } //共通のfrom/where文の構築 - $sql_where = SC_Product_Ex::getProductDispConditions('alldtl'); + $sql_where = Product::getProductDispConditions('alldtl'); // 在庫無し商品の非表示 if (NOSTOCK_HIDDEN) { $where_products_class = '(stock >= 1 OR stock_unlimited = 1)'; @@ -758,7 +756,7 @@ public function sfCountCategory($objQuery = NULL, $is_force_all_count = false) $arrTgtCategory_id = array(); foreach ($arrDiffCategory_id as $parent_category_id) { $arrTgtCategory_id[] = $parent_category_id; - $arrParentID = $this->sfGetParents('dtb_category', 'parent_category_id', 'category_id', $parent_category_id); + $arrParentID = $this->getParents('dtb_category', 'parent_category_id', 'category_id', $parent_category_id); $arrTgtCategory_id = array_unique(array_merge($arrTgtCategory_id, $arrParentID)); } @@ -774,7 +772,7 @@ public function sfCountCategory($objQuery = NULL, $is_force_all_count = false) $from = $objProduct->alldtlSQL($where_products_class); foreach ($arrTgtCategory_id as $category_id) { $arrWhereVal = array(); - list($tmp_where, $arrTmpVal) = $this->sfGetCatWhere($category_id); + list($tmp_where, $arrTmpVal) = $this->getCatWhere($category_id); if ($tmp_where != '') { $sql_where_product_ids = 'product_id IN (SELECT product_id FROM dtb_product_categories WHERE ' . $tmp_where . ')'; $arrWhereVal = $arrTmpVal; @@ -817,9 +815,9 @@ public function sfCountCategory($objQuery = NULL, $is_force_all_count = false) * @param integer $id ID * @param array 子ID の配列 */ - public function sfGetChildsID($table, $pid_name, $id_name, $id) + public function getChildsID($table, $pid_name, $id_name, $id) { - $arrRet = $this->sfGetChildrenArray($table, $pid_name, $id_name, $id); + $arrRet = $this->getChildrenArray($table, $pid_name, $id_name, $id); return $arrRet; } @@ -833,14 +831,14 @@ public function sfGetChildsID($table, $pid_name, $id_name, $id) * @param integer $id ID番号 * @return array 子IDの配列 */ - public function sfGetChildrenArray($table, $pid_name, $id_name, $id) + public function getChildrenArray($table, $pid_name, $id_name, $id) { $arrChildren = array(); $arrRet = array($id); while (count($arrRet) > 0) { $arrChildren = array_merge($arrChildren, $arrRet); - $arrRet = SC_Helper_DB_Ex::sfGetChildrenArraySub($table, $pid_name, $id_name, $arrRet); + $arrRet = static::getChildrenArraySub($table, $pid_name, $id_name, $arrRet); } return $arrChildren; @@ -855,11 +853,11 @@ public function sfGetChildrenArray($table, $pid_name, $id_name, $id) * @param string $table * @return array 子IDの配列 */ - public function sfGetChildrenArraySub($table, $pid_name, $id_name, $arrPID) + public function getChildrenArraySub($table, $pid_name, $id_name, $arrPID) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); - $where = "$pid_name IN (" . SC_Utils_Ex::repeatStrWithSeparator('?', count($arrPID)) . ')'; + $where = "$pid_name IN (" . Utils::repeatStrWithSeparator('?', count($arrPID)) . ')'; $return = $objQuery->getCol($id_name, $table, $where, $arrPID); @@ -875,9 +873,9 @@ public function sfGetChildrenArraySub($table, $pid_name, $id_name, $arrPID) * @param integer $id ID * @return array 親IDの配列 */ - public function sfGetParents($table, $pid_name, $id_name, $id) + public function getParents($table, $pid_name, $id_name, $id) { - $arrRet = SC_Helper_DB_Ex::sfGetParentsArray($table, $pid_name, $id_name, $id); + $arrRet = static::getParentsArray($table, $pid_name, $id_name, $id); return $arrRet; } @@ -891,20 +889,20 @@ public function sfGetParents($table, $pid_name, $id_name, $id) * @param integer $id ID * @return array 親IDの配列 */ - public function sfGetParentsArray($table, $pid_name, $id_name, $id) + public function getParentsArray($table, $pid_name, $id_name, $id) { $arrParents = array(); $ret = $id; $loop_cnt = 1; - while ($ret != '0' && !SC_Utils_Ex::isBlank($ret)) { + while ($ret != '0' && !Utils::isBlank($ret)) { // 無限ループの予防 if ($loop_cnt > LEVEL_MAX) { trigger_error('最大階層制限到達', E_USER_ERROR); } $arrParents[] = $ret; - $ret = SC_Helper_DB_Ex::sfGetParentsArraySub($table, $pid_name, $id_name, $ret); + $ret = static::getParentsArraySub($table, $pid_name, $id_name, $ret); ++$loop_cnt; } @@ -921,12 +919,12 @@ public function sfGetParentsArray($table, $pid_name, $id_name, $id) * @param string $pid_name * @param string $id_name */ - public function sfGetParentsArraySub($table, $pid_name, $id_name, $child) + public function getParentsArraySub($table, $pid_name, $id_name, $child) { - if (SC_Utils_Ex::isBlank($child)) { + if (Utils::isBlank($child)) { return false; } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); if (!is_array($child)) { $child = array($child); } @@ -941,12 +939,12 @@ public function sfGetParentsArraySub($table, $pid_name, $id_name, $child) * @param integer $category_id カテゴリID * @return array 商品を検索する場合の配列 */ - public function sfGetCatWhere($category_id) - { - // 子カテゴリIDの取得 - $arrRet = SC_Helper_DB_Ex::sfGetChildrenArray('dtb_category', 'parent_category_id', 'category_id', $category_id); + public function getCatWhere($category_id) + { + // 子カテゴリIDの取得 + $arrRet = static::getChildrenArray('dtb_category', 'parent_category_id', 'category_id', $category_id); - $where = 'category_id IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', count($arrRet)) . ')'; + $where = 'category_id IN (' . Utils::repeatStrWithSeparator('?', count($arrRet)) . ')'; return array($where, $arrRet); } @@ -961,9 +959,9 @@ public function sfGetCatWhere($category_id) * @param array $arrVal プレースホルダ * @return array SELECT ボックス用リストの配列 */ - public static function sfGetIDValueList($table, $keyname, $valname, $where = '', $arrVal = array()) + public static function getIDValueList($table, $keyname, $valname, $where = '', $arrVal = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = "$keyname, $valname"; $objQuery->setWhere('del_flg = 0'); $objQuery->setOrder('rank DESC'); @@ -988,9 +986,9 @@ public static function sfGetIDValueList($table, $keyname, $valname, $where = '', * @param string $andwhere SQL の AND 条件である WHERE 句 * @return void */ - public function sfRankUp($table, $colname, $id, $andwhere = '') + public function rankUp($table, $colname, $id, $andwhere = '') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $where = "$colname = ?"; if ($andwhere != '') { @@ -1040,9 +1038,9 @@ public function sfRankUp($table, $colname, $id, $andwhere = '') * @param string $andwhere SQL の AND 条件である WHERE 句 * @return void */ - public function sfRankDown($table, $colname, $id, $andwhere = '') + public function rankDown($table, $colname, $id, $andwhere = '') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $where = "$colname = ?"; if ($andwhere != '') { @@ -1092,9 +1090,9 @@ public function sfRankDown($table, $colname, $id, $andwhere = '') * @param string $where SQL の AND 条件である WHERE 句 * @return void */ - public function sfMoveRank($tableName, $keyIdColumn, $keyId, $pos, $where = '') + public function moveRank($tableName, $keyIdColumn, $keyId, $pos, $where = '') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); // 自身のランクを取得する @@ -1157,7 +1155,7 @@ public function getNewRank($position, $maxRank) * * @param int $newRank * @param int $oldRank - * @param SC_Query $objQuery + * @param Query $objQuery * @param string $tableName * @param string $addWhere * @return boolean @@ -1199,9 +1197,9 @@ public function moveOtherItemRank($newRank, $oldRank, &$objQuery, $tableName, $a * レコードごと削除しない場合 false * @return void */ - public function sfDeleteRankRecord($table, $colname, $id, $andwhere = '', + public function deleteRankRecord($table, $colname, $id, $andwhere = '', $delete = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); // 削除レコードのランクを取得する。 $where = "$colname = ?"; @@ -1241,14 +1239,14 @@ public function sfDeleteRankRecord($table, $colname, $id, $andwhere = '', /** * 親IDの配列を元に特定のカラムを取得する. * - * @param SC_Query $objQuery SC_Query インスタンス + * @param Query $objQuery Query インスタンス * @param string $table テーブル名 * @param string $id_name ID名 * @param string $col_name カラム名 * @param array $arrId IDの配列 * @return array 特定のカラムの配列 */ - public function sfGetParentsCol($objQuery, $table, $id_name, $col_name, $arrId) + public function getParentsCol($objQuery, $table, $id_name, $col_name, $arrId) { $col = $col_name; $len = count($arrId); @@ -1273,7 +1271,7 @@ public function sfGetParentsCol($objQuery, $table, $id_name, $col_name, $arrId) * * ※この関数って、どこからも呼ばれていないのでは?? * - * @param SC_Query $objQuery SC_Query インスタンス + * @param Query $objQuery Query インスタンス * @param string $table テーブル名 * @param string $id_name ID名 * @param string $cat_name カテゴリ名 @@ -1282,7 +1280,7 @@ public function sfGetParentsCol($objQuery, $table, $id_name, $col_name, $arrId) * @param integer $id ID * @return void */ - public function sfMoveCatRank($objQuery, $table, $id_name, $cat_name, $old_catid, $new_catid, $id) + public function moveCatRank($objQuery, $table, $id_name, $cat_name, $old_catid, $new_catid, $id) { if ($old_catid == $new_catid) { return; @@ -1314,7 +1312,7 @@ public function sfMoveCatRank($objQuery, $table, $id_name, $cat_name, $old_catid /** * レコードの存在チェックを行う. * - * TODO SC_Query に移行するべきか? + * TODO Query に移行するべきか? * * @param string $table テーブル名 * @param string $col カラム名 @@ -1322,9 +1320,9 @@ public function sfMoveCatRank($objQuery, $table, $id_name, $cat_name, $old_catid * @param string $addwhere SQL の AND 条件である WHERE 句 * @return bool レコードが存在する場合 true */ - public static function sfIsRecord($table, $col, $arrVal, $addwhere = '') + public static function isRecord($table, $col, $arrVal, $addwhere = '') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrCol = preg_split('/[, ]/', $col); $where = 'del_flg = 0'; @@ -1354,10 +1352,10 @@ public static function sfIsRecord($table, $col, $arrVal, $addwhere = '') /** * メーカー商品数数の登録を行う. * - * @param SC_Query $objQuery SC_Query インスタンス + * @param Query $objQuery Query インスタンス * @return void */ - public function sfCountMaker($objQuery) + public function countMaker($objQuery) { //テーブル内容の削除 $objQuery->query('DELETE FROM dtb_maker_count'); @@ -1380,7 +1378,7 @@ public function sfCountMaker($objQuery) * @return array 選択中の商品のメーカーIDの配列 * */ - public function sfGetMakerId($product_id, $maker_id = 0, $closed = false) + public function getMakerId($product_id, $maker_id = 0, $closed = false) { if ($closed) { $status = ''; @@ -1392,10 +1390,10 @@ public function sfGetMakerId($product_id, $maker_id = 0, $closed = false) $this->g_maker_on = true; $maker_id = (int) $maker_id; $product_id = (int) $product_id; - if (SC_Utils_Ex::sfIsInt($maker_id) && $maker_id != 0 && $this->sfIsRecord('dtb_maker', 'maker_id', $maker_id)) { + if (Utils::sfIsInt($maker_id) && $maker_id != 0 && $this->isRecord('dtb_maker', 'maker_id', $maker_id)) { $this->g_maker_id = array($maker_id); - } elseif (SC_Utils_Ex::sfIsInt($product_id) && $product_id != 0 && $this->sfIsRecord('dtb_products', 'product_id', $product_id, $status)) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + } elseif (Utils::sfIsInt($product_id) && $product_id != 0 && $this->isRecord('dtb_products', 'product_id', $product_id, $status)) { + $objQuery = Query::getSingletonInstance(); $maker_id = $objQuery->getCol('maker_id', 'dtb_products', 'product_id = ?', array($product_id)); $this->g_maker_id = $maker_id; } else { @@ -1416,9 +1414,9 @@ public function sfGetMakerId($product_id, $maker_id = 0, $closed = false) * @param bool $products_check 商品の存在するカテゴリのみ取得する場合 true * @return array カテゴリツリーの配列 */ - public function sfGetMakerList($addwhere = '', $products_check = false) + public function getMakerList($addwhere = '', $products_check = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'del_flg = 0'; if ($addwhere != '') { @@ -1455,31 +1453,31 @@ public function sfGetMakerList($addwhere = '', $products_check = false) * @param integer $price 計算対象の金額 * @return double 税金額 */ - public function sfTax($price) + public function tax($price) { // 店舗基本情報を取得 - $CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $CONF = static::getBasisData(); - return SC_Utils_Ex::sfTax($price, $CONF['tax'], $CONF['tax_rule']); + return Utils::sfTax($price, $CONF['tax'], $CONF['tax_rule']); } /** * 店舗基本情報に基づいて税金付与した金額を返す - * SC_Utils_Ex::sfCalcIncTax とどちらか統一したほうが良い + * Utils::sfCalcIncTax とどちらか統一したほうが良い * * @param int $price 計算対象の金額 * @param int $tax * @param int $tax_rule * @return double 税金付与した金額 */ - public static function sfCalcIncTax($price, $tax = null, $tax_rule = null) + public static function calcIncTax($price, $tax = null, $tax_rule = null) { // 店舗基本情報を取得 - $CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $CONF = static::getBasisData(); $tax = $tax === null ? $CONF['tax'] : $tax; $tax_rule = $tax_rule === null ? $CONF['tax_rule'] : $tax_rule; - return SC_Utils_Ex::sfCalcIncTax($price, $tax, $tax_rule); + return Utils::sfCalcIncTax($price, $tax, $tax_rule); } /** @@ -1489,12 +1487,12 @@ public static function sfCalcIncTax($price, $tax = null, $tax_rule = null) * @param integer $use_point * @return integer 加算ポイント */ - public function sfGetAddPoint($totalpoint, $use_point) + public static function getAddPoint($totalpoint, $use_point) { // 店舗基本情報を取得 - $CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $CONF = static::getBasisData(); - return SC_Utils_Ex::sfGetAddPoint($totalpoint, $use_point, $CONF['point_rate']); + return Utils::getAddPoint($totalpoint, $use_point, $CONF['point_rate']); } /** @@ -1505,10 +1503,10 @@ public function sfGetAddPoint($totalpoint, $use_point) * @param string $sqlFilePath SQL ファイルのパス * @return void */ - public function sfExecSqlByFile($sqlFilePath) + public function execSqlByFile($sqlFilePath) { if (file_exists($sqlFilePath)) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqls = file_get_contents($sqlFilePath); if ($sqls === false) trigger_error('ファイルは存在するが読み込めない', E_USER_ERROR); @@ -1527,11 +1525,11 @@ public function sfExecSqlByFile($sqlFilePath) * @param integer $product_id 商品ID * @return bool 商品規格が存在する場合:true, それ以外:false */ - public function sfHasProductClass($product_id) + public function hasProductClass($product_id) { - if (!SC_Utils_Ex::sfIsInt($product_id)) return false; + if (!Utils::sfIsInt($product_id)) return false; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'product_id = ? AND del_flg = 0 AND (classcategory_id1 != 0 OR classcategory_id2 != 0)'; $exists = $objQuery->exists('dtb_products_class', $where, array($product_id)); @@ -1546,7 +1544,7 @@ public function sfHasProductClass($product_id) */ public static function registerBasisData($arrData) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrData = $objQuery->extractOnlyColsOf('dtb_baseinfo', $arrData); @@ -1559,13 +1557,13 @@ public static function registerBasisData($arrData) // UPDATEの実行 $ret = $objQuery->update('dtb_baseinfo', $arrData); - GC_Utils_Ex::gfPrintLog('dtb_baseinfo に UPDATE を実行しました。'); + GcUtils::gfPrintLog('dtb_baseinfo に UPDATE を実行しました。'); // UPDATE できなかった場合、INSERT if ($ret == 0) { $arrData['id'] = 1; $objQuery->insert('dtb_baseinfo', $arrData); - GC_Utils_Ex::gfPrintLog('dtb_baseinfo に INSERT を実行しました。'); + GcUtils::gfPrintLog('dtb_baseinfo に INSERT を実行しました。'); } } @@ -1579,7 +1577,7 @@ public static function registerBasisData($arrData) */ public function countRecords($table, $where = '', $arrval = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'COUNT(*)'; return $objQuery->get($col, $table, $where, $arrval); diff --git a/data/class/helper/SC_Helper_Delivery.php b/data/Eccube/Common/Helper/DeliveryHelper.php similarity index 84% rename from data/class/helper/SC_Helper_Delivery.php rename to data/Eccube/Common/Helper/DeliveryHelper.php index 084aa231306..5bbb94446b6 100644 --- a/data/class/helper/SC_Helper_Delivery.php +++ b/data/Eccube/Common/Helper/DeliveryHelper.php @@ -1,34 +1,27 @@ setOrder('rank DESC'); $arrRet = $objQuery->select($col, $table, $where, $arrVal); + if ($is_list) { + $arrTmp = $arrRet; + $arrRet = array(); + foreach ($arrTmp as $deliv) { + $arrRet[$deliv['deliv_id']] = $deliv['service_name']; + } + } return $arrRet; } @@ -105,7 +105,7 @@ public function getList($product_type_id = null, $has_deleted = false) */ public function save($sqlval) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); // お届け時間 @@ -217,9 +217,9 @@ public function save($sqlval) */ public function delete($deliv_id) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // ランク付きレコードの削除 - $objDb->sfDeleteRankRecord('dtb_deliv', 'deliv_id', $deliv_id); + $objDb->deleteRankRecord('dtb_deliv', 'deliv_id', $deliv_id); } /** @@ -230,8 +230,8 @@ public function delete($deliv_id) */ public function rankUp($deliv_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankUp('dtb_deliv', 'deliv_id', $deliv_id); + $objDb = new DbHelper(); + $objDb->rankUp('dtb_deliv', 'deliv_id', $deliv_id); } /** @@ -242,8 +242,8 @@ public function rankUp($deliv_id) */ public function rankDown($deliv_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankDown('dtb_deliv', 'deliv_id', $deliv_id); + $objDb = new DbHelper(); + $objDb->rankDown('dtb_deliv', 'deliv_id', $deliv_id); } /** @@ -254,11 +254,11 @@ public function rankDown($deliv_id) */ public function checkExist($arrDeliv) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); if ($arrDeliv['deliv_id'] == '') { - $ret = $objDb->sfIsRecord('dtb_deliv', 'service_name', array($arrDeliv['service_name'])); + $ret = $objDb->isRecord('dtb_deliv', 'service_name', array($arrDeliv['service_name'])); } else { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $ret = (($objQuery->count('dtb_deliv', 'deliv_id != ? AND service_name = ? AND del_flg = 0', array($arrDeliv['deliv_id'], $arrDeliv['service_name'])) > 0) ? true : false); } @@ -273,7 +273,7 @@ public function checkExist($arrDeliv) */ public static function getIDValueList($type = 'name') { - return SC_Helper_DB_Ex::sfGetIDValueList('dtb_deliv', 'deliv_id', $type); + return DbHelper::getIDValueList('dtb_deliv', 'deliv_id', $type); } /** @@ -284,7 +284,7 @@ public static function getIDValueList($type = 'name') */ public static function getDelivTime($deliv_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('time_id'); $results = $objQuery->select('time_id, deliv_time', 'dtb_delivtime', 'deliv_id = ?', array($deliv_id)); $arrDelivTime = array(); @@ -303,7 +303,7 @@ public static function getDelivTime($deliv_id) */ public static function getPayments($deliv_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('rank'); return $objQuery->getCol('payment_id', 'dtb_payment_options', 'deliv_id = ?', array($deliv_id), MDB2_FETCHMODE_ORDERED); @@ -318,7 +318,7 @@ public static function getPayments($deliv_id) */ public static function getDelivFee($pref_id, $deliv_id = 0) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); if (!is_array($pref_id)) { $pref_id = array($pref_id); } @@ -347,7 +347,7 @@ public static function getDelivFee($pref_id, $deliv_id = 0) */ public static function getDelivFeeList($deliv_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('pref'); $col = 'fee_id, fee, pref'; $where = 'deliv_id = ?'; @@ -355,4 +355,13 @@ public static function getDelivFeeList($deliv_id) return $objQuery->select($col, $table, $where, array($deliv_id)); } + + public function isSingleDeliv($product_type_id) + { + $arrList = $this->getList($product_type_id); + if (count($arrList) <= 1) { + return true; + } + return false; + } } diff --git a/data/class/helper/SC_Helper_FileManager.php b/data/Eccube/Common/Helper/FileManagerHelper.php similarity index 89% rename from data/class/helper/SC_Helper_FileManager.php rename to data/Eccube/Common/Helper/FileManagerHelper.php index 326f37c321d..3238a0e679e 100644 --- a/data/class/helper/SC_Helper_FileManager.php +++ b/data/Eccube/Common/Helper/FileManagerHelper.php @@ -1,34 +1,27 @@ extractModify($dir. '/', $unpacking_name); - GC_Utils_Ex::gfPrintLog('解凍:' . $dir.'/'.$file_name.'->'.$dir.'/'.$unpacking_name); + GcUtils::gfPrintLog('解凍:' . $dir.'/'.$file_name.'->'.$dir.'/'.$unpacking_name); // フォルダ削除 - SC_Helper_FileManager_Ex::deleteFile($dir . '/' . $unpacking_name); + static::deleteFile($dir . '/' . $unpacking_name); // 圧縮ファイル削除 unlink($path); @@ -417,19 +410,19 @@ public static function deleteFile($path, $del_myself = true) $flg = false; // 対象が存在するかを検証. if (file_exists($path) === false) { - GC_Utils_Ex::gfPrintLog($path . ' が存在しません.'); + GcUtils::gfPrintLog($path . ' が存在しません.'); } elseif (is_dir($path)) { // ディレクトリが指定された場合 $handle = opendir($path); if (!$handle) { - GC_Utils_Ex::gfPrintLog($path . ' が開けませんでした.'); + GcUtils::gfPrintLog($path . ' が開けませんでした.'); } while (($item = readdir($handle)) !== false) { if ($item === '.' || $item === '..') continue; $cur_path = $path . '/' . $item; if (is_dir($cur_path)) { // ディレクトリの場合、再帰処理 - $flg = SC_Helper_FileManager_Ex::deleteFile($cur_path); + $flg = static::deleteFile($cur_path); } else { // ファイルの場合、unlink $flg = @unlink($cur_path); @@ -437,13 +430,13 @@ public static function deleteFile($path, $del_myself = true) } closedir($handle); // ディレクトリを削除 - GC_Utils_Ex::gfPrintLog($path . ' を削除します.'); + GcUtils::gfPrintLog($path . ' を削除します.'); if ($del_myself) { $flg = @rmdir($path); } } else { // ファイルが指定された場合. - GC_Utils_Ex::gfPrintLog($path . ' を削除します.'); + GcUtils::gfPrintLog($path . ' を削除します.'); $flg = @unlink($path); } diff --git a/data/class/helper/SC_Helper_FPDI.php b/data/Eccube/Common/Helper/FpdiHelper.php similarity index 90% rename from data/class/helper/SC_Helper_FPDI.php rename to data/Eccube/Common/Helper/FpdiHelper.php index 0b7e935ff60..db684f9ebf4 100644 --- a/data/class/helper/SC_Helper_FPDI.php +++ b/data/Eccube/Common/Helper/FpdiHelper.php @@ -1,11 +1,24 @@ (Fatal error)<\/b>: +(.+) in (.+)<\/b> on line (\d+)<\/b>
/i', $buffer, $matches)) { $message = "$matches[1]: $matches[2] on [$matches[3]($matches[4])]"; - GC_Utils_Ex::gfPrintLog($message, ERROR_LOG_REALFILE, true); + GcUtils::gfPrintLog($message, ERROR_LOG_REALFILE, true); if (DEBUG_MODE !== true) { $url = HTTP_URL . 'error.php'; if (defined('ADMIN_FUNCTION') && ADMIN_FUNCTION === true) { @@ -179,13 +171,13 @@ public static function handle_error() return; } - $error_type_name = GC_Utils_Ex::getErrorTypeName($arrError['type']); + $error_type_name = GcUtils::getErrorTypeName($arrError['type']); $errstr = "Fatal error($error_type_name): {$arrError[message]} on [{$arrError[file]}({$arrError[line]})]"; - GC_Utils_Ex::gfPrintLog($errstr, ERROR_LOG_REALFILE, true); + GcUtils::gfPrintLog($errstr, ERROR_LOG_REALFILE, true); // エラー画面を表示する - SC_Helper_HandleError_Ex::displaySystemError($errstr); + static::displaySystemError($errstr); } /** @@ -196,7 +188,7 @@ public static function handle_error() */ public static function displaySystemError($errstr = null) { - SC_Helper_HandleError_Ex::$under_error_handling = true; + static::$under_error_handling = true; ob_clean(); @@ -204,19 +196,18 @@ public static function displaySystemError($errstr = null) $loaded_ob_emoji = false; $arrObs = ob_get_status(true); foreach ($arrObs as $arrOb) { - if ($arrOb['name'] === 'SC_MobileEmoji::handler') { + if ($arrOb['name'] === 'Eccube\\Common\\MobileEmoji::handler') { $loaded_ob_emoji = true; break; } } // 絵文字変換・除去フィルターが無効で、利用できる場合、有効にする。 - if (!$loaded_ob_emoji && class_exists('SC_MobileEmoji')) { - ob_start(array('SC_MobileEmoji', 'handler')); + if (!$loaded_ob_emoji && class_exists('Eccube\\Common\\MobileEmoji')) { + ob_start(array('Eccube\\Common\\MobileEmoji', 'handler')); } - require_once CLASS_EX_REALDIR . 'page_extends/error/LC_Page_Error_SystemError_Ex.php'; - $objPage = new LC_Page_Error_SystemError_Ex(); + $objPage = new \Eccube\Page\Error\SystemError(); $objPage->init(); if (isset($errstr)) { $objPage->addDebugMsg($errstr); diff --git a/data/class/helper/SC_Helper_Holiday.php b/data/Eccube/Common/Helper/HolidayHelper.php similarity index 70% rename from data/class/helper/SC_Helper_Holiday.php rename to data/Eccube/Common/Helper/HolidayHelper.php index a97e12173f6..276680d096f 100644 --- a/data/class/helper/SC_Helper_Holiday.php +++ b/data/Eccube/Common/Helper/HolidayHelper.php @@ -1,34 +1,28 @@ sfDeleteRankRecord('dtb_holiday', 'holiday_id', $holiday_id, '', true); + $objDb->deleteRankRecord('dtb_holiday', 'holiday_id', $holiday_id, '', true); } /** @@ -121,8 +115,8 @@ public function delete($holiday_id) */ public function rankUp($holiday_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankUp('dtb_holiday', 'holiday_id', $holiday_id); + $objDb = new DbHelper(); + $objDb->rankUp('dtb_holiday', 'holiday_id', $holiday_id); } /** @@ -133,8 +127,8 @@ public function rankUp($holiday_id) */ public function rankDown($holiday_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankDown('dtb_holiday', 'holiday_id', $holiday_id); + $objDb = new DbHelper(); + $objDb->rankDown('dtb_holiday', 'holiday_id', $holiday_id); } /** @@ -147,15 +141,15 @@ public function rankDown($holiday_id) */ public function isDateExist($month, $day, $holiday_id = NULL) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'del_flg = 0 AND month = ? AND day = ?'; $arrVal = array($month, $day); - if (!SC_Utils_Ex::isBlank($holiday_id)) { + if (!Utils::isBlank($holiday_id)) { $where .= ' AND holiday_id <> ?'; $arrVal[] = $holiday_id; } $arrRet = $objQuery->select('holiday_id, title', 'dtb_holiday', $where, $arrVal); - return !SC_Utils_Ex::isBlank($arrRet); + return !Utils::isBlank($arrRet); } } diff --git a/data/class/helper/SC_Helper_Kiyaku.php b/data/Eccube/Common/Helper/KiyakuHelper.php similarity index 71% rename from data/class/helper/SC_Helper_Kiyaku.php rename to data/Eccube/Common/Helper/KiyakuHelper.php index 269e4bcdc3d..0c872b3e355 100644 --- a/data/class/helper/SC_Helper_Kiyaku.php +++ b/data/Eccube/Common/Helper/KiyakuHelper.php @@ -1,34 +1,28 @@ sfDeleteRankRecord('dtb_kiyaku', 'kiyaku_id', $kiyaku_id); + $objDb->deleteRankRecord('dtb_kiyaku', 'kiyaku_id', $kiyaku_id); } /** @@ -121,8 +115,8 @@ public function deleteKiyaku($kiyaku_id) */ public function rankUp($kiyaku_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankUp('dtb_kiyaku', 'kiyaku_id', $kiyaku_id); + $objDb = new DbHelper(); + $objDb->rankUp('dtb_kiyaku', 'kiyaku_id', $kiyaku_id); } /** @@ -133,8 +127,8 @@ public function rankUp($kiyaku_id) */ public function rankDown($kiyaku_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankDown('dtb_kiyaku', 'kiyaku_id', $kiyaku_id); + $objDb = new DbHelper(); + $objDb->rankDown('dtb_kiyaku', 'kiyaku_id', $kiyaku_id); } /** @@ -146,18 +140,18 @@ public function rankDown($kiyaku_id) */ public function isTitleExist($title, $kiyaku_id = NULL) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'del_flg = 0 AND kiyaku_title = ?'; $arrVal = array($title); - if (!SC_Utils_Ex::isBlank($kiyaku_id)) { + if (!Utils::isBlank($kiyaku_id)) { $where .= ' AND kiyaku_id <> ?'; $arrVal[] = $kiyaku_id; } $arrRet = $objQuery->select('kiyaku_id, kiyaku_title', 'dtb_kiyaku', $where, $arrVal); - return !SC_Utils_Ex::isBlank($arrRet); + return !Utils::isBlank($arrRet); } } diff --git a/data/class/helper/SC_Helper_Mail.php b/data/Eccube/Common/Helper/MailHelper.php similarity index 84% rename from data/class/helper/SC_Helper_Mail.php rename to data/Eccube/Common/Helper/MailHelper.php index b8dca3450ae..5abf1bf903b 100644 --- a/data/class/helper/SC_Helper_Mail.php +++ b/data/Eccube/Common/Helper/MailHelper.php @@ -1,34 +1,34 @@ arrMAILTPLPATH = $masterData->getMasterData('mtb_mail_tpl_path'); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); @@ -56,7 +56,7 @@ public function __construct() * * @param LC_Page $objPage */ - public function setPage(LC_Page $objPage) + public function setPage($objPage) { $this->objPage = $objPage; } @@ -81,22 +81,22 @@ public function getPage() public function sfSendTemplateMail($to, $to_name, $template_id, &$objPage, $from_address = '', $from_name = '', $reply_to = '', $bcc = '') { // メールテンプレート情報の取得 - $objMailtemplate = new SC_Helper_Mailtemplate_Ex(); + $objMailtemplate = new MailtemplateHelper(); $mailtemplate = $objMailtemplate->get($template_id); $objPage->tpl_header = $mailtemplate['header']; $objPage->tpl_footer = $mailtemplate['footer']; $tmp_subject = $mailtemplate['subject']; - $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $arrInfo = DbHelper::getBasisData(); - $objMailView = new SC_SiteView_Ex(); + $objMailView = new SiteView(); $objMailView->setPage($this->getPage()); // メール本文の取得 $objMailView->assignobj($objPage); $body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]); // メール送信処理 - $objSendMail = new SC_SendMail_Ex(); + $objSendMail = new SendMail(); if ($from_address == '') $from_address = $arrInfo['email03']; if ($from_name == '') $from_name = $arrInfo['shop_name']; if ($reply_to == '') $reply_to = $arrInfo['email03']; @@ -111,15 +111,15 @@ public function sfSendTemplateMail($to, $to_name, $template_id, &$objPage, $from /* 注文受付メール送信 */ public function sfSendOrderMail($order_id, $template_id, $subject = '', $header = '', $footer = '', $send = true) { - $arrTplVar = new stdClass(); - $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $arrTplVar = new \stdClass(); + $arrInfo = DbHelper::getBasisData(); $arrTplVar->arrInfo = $arrInfo; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); if ($subject == '' && $header == '' && $footer == '') { // メールテンプレート情報の取得 - $objMailtemplate = new SC_Helper_Mailtemplate_Ex(); + $objMailtemplate = new MailtemplateHelper(); $mailtemplate = $objMailtemplate->get($template_id); $arrTplVar->tpl_header = $mailtemplate['header']; $arrTplVar->tpl_footer = $mailtemplate['footer']; @@ -161,7 +161,7 @@ public function sfSendOrderMail($order_id, $template_id, $subject = '', $header $arrOther = unserialize($arrOrder['memo02']); foreach ($arrOther as $other_key => $other_val) { - if (SC_Utils_Ex::sfTrim($other_val['value']) == '') { + if (Utils::sfTrim($other_val['value']) == '') { $arrOther[$other_key]['value'] = ''; } } @@ -174,15 +174,15 @@ public function sfSendOrderMail($order_id, $template_id, $subject = '', $header // 国変換 $arrTplVar->arrCountry = $this->arrCountry; - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); $arrTplVar->tpl_user_point = $objCustomer->getValue('point'); $objMailView = null; // 注文受付メール(携帯) if ($template_id == 2) { - $objMailView = new SC_SiteView_Ex(true, DEVICE_TYPE_MOBILE); + $objMailView = new SiteView(true, DEVICE_TYPE_MOBILE); } else { - $objMailView = new SC_SiteView_Ex(); + $objMailView = new SiteView(); } // メール本文の取得 $objMailView->setPage($this->getPage()); @@ -190,7 +190,7 @@ public function sfSendOrderMail($order_id, $template_id, $subject = '', $header $body = $objMailView->fetch($this->arrMAILTPLPATH[$template_id]); // メール送信処理 - $objSendMail = new SC_SendMail_Ex(); + $objSendMail = new SendMail(); $bcc = $arrInfo['email01']; $from = $arrInfo['email03']; $error = $arrInfo['email04']; @@ -217,7 +217,7 @@ public function sfSendOrderMail($order_id, $template_id, $subject = '', $header */ function sfGetShippingData($order_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('shipping_id'); $arrRet = $objQuery->select('*', 'dtb_shipping', 'order_id = ?', array($order_id)); @@ -238,16 +238,16 @@ function sfGetShippingData($order_id) // テンプレートを使用したメールの送信 public function sfSendTplMail($to, $tmp_subject, $tplpath, &$objPage) { - $objMailView = new SC_SiteView_Ex(); + $objMailView = new SiteView(); $objMailView->setPage($this->getPage()); - $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $arrInfo = DbHelper::getBasisData(); // メール本文の取得 $objPage->tpl_shopname=$arrInfo['shop_name']; $objPage->tpl_infoemail = $arrInfo['email02']; $objMailView->assignobj($objPage); $body = $objMailView->fetch($tplpath); // メール送信処理 - $objSendMail = new SC_SendMail_Ex(); + $objSendMail = new SendMail(); $bcc = $arrInfo['email01']; $from = $arrInfo['email03']; $error = $arrInfo['email04']; @@ -260,9 +260,9 @@ public function sfSendTplMail($to, $tmp_subject, $tplpath, &$objPage) // 通常のメール送信 public function sfSendMail($to, $tmp_subject, $body) { - $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $arrInfo = DbHelper::getBasisData(); // メール送信処理 - $objSendMail = new SC_SendMail_Ex(); + $objSendMail = new SendMail(); $bcc = $arrInfo['email01']; $from = $arrInfo['email03']; $error = $arrInfo['email04']; @@ -275,23 +275,23 @@ public function sfSendMail($to, $tmp_subject, $body) //件名にテンプレートを用いる /** - * @param SC_SiteView_Ex $objMailView + * @param SiteView $objMailView */ public function sfMakeSubject($subject, &$objMailView = NULL) { if (empty($objMailView)) { - $objMailView = new SC_SiteView_Ex(); + $objMailView = new SiteView(); $objMailView->setPage($this->getPage()); } - $objTplAssign = new stdClass; + $objTplAssign = new \stdClass; - $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $arrInfo = DbHelper::getBasisData(); $objTplAssign->tpl_shopname=$arrInfo['shop_name']; $objTplAssign->tpl_infoemail=$subject; // 従来互換 $objTplAssign->tpl_mailtitle=$subject; $objMailView->assignobj($objTplAssign); $subject = $objMailView->fetch('mail_templates/mail_title.tpl'); - // #1940 (SC_Helper_Mail#sfMakeSubject 先頭に改行を含む値を返す) 対応 + // #1940 (MailHelper#sfMakeSubject 先頭に改行を含む値を返す) 対応 $subject = trim($subject); return $subject; @@ -317,7 +317,7 @@ public function sfSaveMailHistory($order_id, $template_id, $subject, $body) } $sqlval['mail_body'] = $body; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqlval['send_id'] = $objQuery->nextVal('dtb_mail_history_send_id'); $objQuery->insert('dtb_mail_history', $sqlval); } @@ -328,7 +328,7 @@ public function sfCheckCustomerMailMaga($email) $col = 'email, mailmaga_flg, customer_id'; $from = 'dtb_customer'; $where = '(email = ? OR email_mobile = ?) AND status = 2 AND del_flg = 0'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->select($col, $from, $where, array($email)); // 会員のメールアドレスが登録されている if (!empty($arrRet[0]['customer_id'])) { @@ -351,18 +351,18 @@ public function sfCheckCustomerMailMaga($email) public function sfSendRegistMail($secret_key, $customer_id = '', $is_mobile = false, $resend_flg = false) { // 会員データの取得 - if (SC_Utils_Ex::sfIsInt($customer_id)) { - $arrCustomerData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id); + if (Utils::sfIsInt($customer_id)) { + $arrCustomerData = CustomerHelper::sfGetCustomerDataFromId($customer_id); } else { - $arrCustomerData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId('', 'secret_key = ?', array($secret_key)); + $arrCustomerData = CustomerHelper::sfGetCustomerDataFromId('', 'secret_key = ?', array($secret_key)); } - if (SC_Utils_Ex::isBlank($arrCustomerData)) { + if (Utils::isBlank($arrCustomerData)) { return false; } - $CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $CONF = DbHelper::getBasisData(); - $objMailText = new SC_SiteView_Ex(); + $objMailText = new SiteView(); $objMailText->setPage($this->getPage()); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $arrCustomerData['name01']); @@ -371,7 +371,7 @@ public function sfSendRegistMail($secret_key, $customer_id = '', $is_mobile = fa $objMailText->assignobj($arrCustomerData); $objMailText->assignobj($this); - $objHelperMail = new SC_Helper_Mail_Ex(); + $objHelperMail = new static(); // 仮会員が有効の場合 if (CUSTOMER_CONFIRM_MAIL == true and $arrCustomerData['status'] == 1 or $arrCustomerData['status'] == 1 and $resend_flg == true) { $subject = $objHelperMail->sfMakeSubject('会員登録のご確認', $objMailText); @@ -382,7 +382,7 @@ public function sfSendRegistMail($secret_key, $customer_id = '', $is_mobile = fa } - $objMail = new SC_SendMail_Ex(); + $objMail = new SendMail(); $objMail->setItem( '', // 宛先 $subject, // サブジェクト @@ -417,13 +417,13 @@ public function sfGetMailmagaTemplate($template_id = null) { // 初期化 $where = ''; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 条件文 $where = 'del_flg = ?'; $arrValues[] = 0; //template_id指定時 - if (SC_Utils_Ex::sfIsInt($template_id) === true) { + if (Utils::sfIsInt($template_id) === true) { $where .= ' AND template_id = ?'; $arrValues[] = $template_id; } @@ -445,14 +445,14 @@ public function sfGetSendHistory($send_id = null) { // 初期化 $where = ''; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 条件文 $where = 'del_flg = ?'; $arrValues[] = 0; //send_id指定時 - if (SC_Utils_Ex::sfIsInt($send_id) === true) { + if (Utils::sfIsInt($send_id) === true) { $where .= ' AND send_id = ?'; $arrValues[] = $send_id; } @@ -473,16 +473,16 @@ public function sfGetSendHistory($send_id = null) */ public function sfSendMailmagazine($send_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $objDb = new SC_Helper_DB_Ex(); - $objSite = $objDb->sfGetBasisData(); - $objMail = new SC_SendMail_Ex(); + $objQuery = Query::getSingletonInstance(); + $objDb = new DbHelper(); + $objSite = $objDb->getBasisData(); + $objMail = new SendMail(); $where = 'del_flg = 0 AND send_id = ?'; $arrMail = $objQuery->getRow('*', 'dtb_send_history', $where, array($send_id)); // 対象となる$send_idが見つからない - if (SC_Utils_Ex::isBlank($arrMail)) return; + if (Utils::isBlank($arrMail)) return; // 送信先リストの取得 $arrDestinationList = $objQuery->select( @@ -494,7 +494,7 @@ public function sfSendMailmagazine($send_id) // 現在の配信数 $complete_count = $arrMail['complete_count']; - if (SC_Utils_Ex::isBlank($arrMail)) { + if (Utils::isBlank($arrMail)) { $complete_count = 0; } diff --git a/data/class/helper/SC_Helper_Mailtemplate.php b/data/Eccube/Common/Helper/MailtemplateHelper.php similarity index 72% rename from data/class/helper/SC_Helper_Mailtemplate.php rename to data/Eccube/Common/Helper/MailtemplateHelper.php index 6b8d1bca86a..b36eb525955 100644 --- a/data/class/helper/SC_Helper_Mailtemplate.php +++ b/data/Eccube/Common/Helper/MailtemplateHelper.php @@ -1,34 +1,26 @@ select('*', 'dtb_maker', $where, array($maker_id)); + $arrRet = $objQuery->getRow('*', 'dtb_maker', $where, array($maker_id)); - return $arrRet[0]; + return $arrRet; } /** @@ -58,14 +51,14 @@ public function getMaker($maker_id, $has_deleted = false) */ public function getByName($name, $has_deleted = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'name = ?'; if (!$has_deleted) { $where .= ' AND del_flg = 0'; } - $arrRet = $objQuery->select('*', 'dtb_maker', $where, array($name)); + $arrRet = $objQuery->getRow('*', 'dtb_maker', $where, array($name)); - return $arrRet[0]; + return $arrRet; } /** @@ -76,7 +69,7 @@ public function getByName($name, $has_deleted = false) */ public function getList($has_deleted = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'maker_id, name'; $where = ''; if (!$has_deleted) { @@ -97,7 +90,7 @@ public function getList($has_deleted = false) */ public function saveMaker($sqlval) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $maker_id = $sqlval['maker_id']; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; @@ -127,9 +120,9 @@ public function saveMaker($sqlval) */ public function delete($maker_id) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // ランク付きレコードの削除 - $objDb->sfDeleteRankRecord('dtb_maker', 'maker_id', $maker_id, '', true); + $objDb->deleteRankRecord('dtb_maker', 'maker_id', $maker_id, '', true); } /** @@ -140,8 +133,8 @@ public function delete($maker_id) */ public function rankUp($maker_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankUp('dtb_maker', 'maker_id', $maker_id); + $objDb = new DbHelper(); + $objDb->rankUp('dtb_maker', 'maker_id', $maker_id); } /** @@ -152,8 +145,8 @@ public function rankUp($maker_id) */ public function rankDown($maker_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankDown('dtb_maker', 'maker_id', $maker_id); + $objDb = new DbHelper(); + $objDb->rankDown('dtb_maker', 'maker_id', $maker_id); } /** @@ -163,6 +156,6 @@ public function rankDown($maker_id) */ public static function getIDValueList() { - return SC_Helper_DB_Ex::sfGetIDValueList('dtb_maker', 'maker_id', 'name'); + return DbHelper::getIDValueList('dtb_maker', 'maker_id', 'name'); } } diff --git a/data/class/helper/SC_Helper_Mobile.php b/data/Eccube/Common/Helper/MobileHelper.php similarity index 90% rename from data/class/helper/SC_Helper_Mobile.php rename to data/Eccube/Common/Helper/MobileHelper.php index b2b1b8350a7..00fd1c3d92d 100644 --- a/data/class/helper/SC_Helper_Mobile.php +++ b/data/Eccube/Common/Helper/MobileHelper.php @@ -1,34 +1,30 @@ $value) { $session_id = $objQuery->get('session_id', 'dtb_mobile_ext_session_id', @@ -170,9 +166,9 @@ public function lfMobileGetSessionId() } // セッションIDの存在をチェックする。 - $sessionFactory = SC_SessionFactory_Ex::getInstance(); + $sessionFactory = SessionFactory::getInstance(); if ($sessionFactory->sfSessRead($sessionId) === null) { - GC_Utils_Ex::gfPrintLog("Non-existent session id : sid=$sessionId"); + GcUtils::gfPrintLog("Non-existent session id : sid=$sessionId"); return false; } @@ -198,18 +194,18 @@ public function lfMobileValidateSession() if (intval(@$_SESSION['mobile']['expires']) < time()) { $msg = 'Session expired at ' . date('Y/m/d H:i:s', @$_SESSION['mobile']['expires']) . ' : sid=' . session_id(); - GC_Utils_Ex::gfPrintLog($msg); + GcUtils::gfPrintLog($msg); return false; } // 携帯端末の機種が一致するかどうかをチェックする。 - $model = SC_MobileUserAgent_Ex::getModel(); + $model = MobileUserAgent::getModel(); if (@$_SESSION['mobile']['model'] != $model) { $msg = 'User agent model mismatch : ' . '"$model" != "' . @$_SESSION['mobile']['model'] . '" (expected), sid=' . session_id(); - GC_Utils_Ex::gfPrintLog($msg); + GcUtils::gfPrintLog($msg); return false; } @@ -235,7 +231,7 @@ public function lfMobileInitOutput() mb_http_output('SJIS-win'); // 端末に合わせて画像サイズを変換する。 - ob_start(array('SC_MobileImage_Ex', 'handler')); + ob_start(array('\\Eccube\\Common\\MobileImage', 'handler')); // 内部エンコーディングから Shift JIS に変換する。 ob_start('mb_output_handler'); @@ -270,7 +266,7 @@ public function sfMobileInit() */ public function gfAddSessionId($url = null) { - $objURL = new Net_URL($url); + $objURL = new \Net_URL($url); $objURL->addQueryString(session_name(), session_id()); return $objURL->getURL(); @@ -320,7 +316,7 @@ public function gfPrepareKaraMail($next_url, $session_id = null) $session_id = session_id(); } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // GC $time = date('Y-m-d H:i:s', time() - MOBILE_SESSION_LIFETIME); @@ -363,7 +359,7 @@ public function gfPrepareKaraMail($next_url, $session_id = null) */ public function gfRegisterKaraMail($token, $email) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // GC $time = date('Y-m-d H:i:s', time() - MOBILE_SESSION_LIFETIME); @@ -394,7 +390,7 @@ public function gfRegisterKaraMail($token, $email) */ public function gfFinishKaraMail($token) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRow = $objQuery->getRow( 'session_id, next_url, email', @@ -411,7 +407,7 @@ public function gfFinishKaraMail($token) $objQuery->delete('dtb_mobile_kara_mail', 'token = ?', array($token)); list($session_id, $next_url, $email) = $arrRow; - $objURL = new Net_URL(HTTP_URL . $next_url); + $objURL = new \Net_URL(HTTP_URL . $next_url); $objURL->addQueryString(session_name(), $session_id); $url = $objURL->getURL(); @@ -433,7 +429,7 @@ public function gfFinishKaraMail($token) */ public function sfMobileSetExtSessionId($param_key, $param_value, $url) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // GC $time = date('Y-m-d H:i:s', time() - MOBILE_SESSION_LIFETIME); @@ -457,7 +453,7 @@ public function sfMobileSetExtSessionId($param_key, $param_value, $url) */ public function gfIsMobileMailAddress($address) { - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $arrMobileMailDomains = $masterData->getMasterData('mtb_mobile_domain'); foreach ($arrMobileMailDomains as $domain) { diff --git a/data/class/helper/SC_Helper_News.php b/data/Eccube/Common/Helper/NewsHelper.php similarity index 74% rename from data/class/helper/SC_Helper_News.php rename to data/Eccube/Common/Helper/NewsHelper.php index 76701c041b1..e812daa693e 100644 --- a/data/class/helper/SC_Helper_News.php +++ b/data/Eccube/Common/Helper/NewsHelper.php @@ -1,34 +1,27 @@ sfDeleteRankRecord('dtb_news', 'news_id', $news_id); + $objDb->deleteRankRecord('dtb_news', 'news_id', $news_id); } /** @@ -131,8 +124,8 @@ public function deleteNews($news_id) */ public function rankUp($news_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankUp('dtb_news', 'news_id', $news_id); + $objDb = new DbHelper(); + $objDb->rankUp('dtb_news', 'news_id', $news_id); } /** @@ -143,8 +136,8 @@ public function rankUp($news_id) */ public function rankDown($news_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankDown('dtb_news', 'news_id', $news_id); + $objDb = new DbHelper(); + $objDb->rankDown('dtb_news', 'news_id', $news_id); } /** @@ -156,8 +149,8 @@ public function rankDown($news_id) */ public function moveRank($news_id, $rank) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfMoveRank('dtb_news', 'news_id', $news_id, $rank); + $objDb = new DbHelper(); + $objDb->moveRank('dtb_news', 'news_id', $news_id, $rank); } /** @@ -168,7 +161,7 @@ public function moveRank($news_id, $rank) */ public function getCount($has_deleted = false) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); if (!$has_deleted) { $where = 'del_flg = 0'; } else { diff --git a/data/class/helper/SC_Helper_PageLayout.php b/data/Eccube/Common/Helper/PageLayoutHelper.php similarity index 70% rename from data/class/helper/SC_Helper_PageLayout.php rename to data/Eccube/Common/Helper/PageLayoutHelper.php index 883f5018719..8799557eee9 100644 --- a/data/class/helper/SC_Helper_PageLayout.php +++ b/data/Eccube/Common/Helper/PageLayoutHelper.php @@ -1,35 +1,47 @@ '\\Eccube\\Page\\Bloc\\Calendar', + 'cart' => '\\Eccube\\Page\\Bloc\\Cart', + 'category' => '\\Eccube\\Page\\Bloc\\Category', + 'login' => '\\Eccube\\Page\\Bloc\\Login', + 'login_footer' => '\\Eccube\\Page\\Bloc\\LoginFooter', + 'login_header' => '\\Eccube\\Page\\Bloc\\LoginHeader', + 'navi_footer' => '\\Eccube\\Page\\Bloc\\NaviFooter', + 'navi_header' => '\\Eccube\\Page\\Bloc\\NaviHeader', + 'news' => '\\Eccube\\Page\\Bloc\\News', + 'recommend' => '\\Eccube\\Page\\Bloc\\Recommend', + 'search_products' => '\\Eccube\\Page\\Bloc\\SearchProducts', + ); + /** * ページのレイアウト情報を取得し, 設定する. * @@ -45,6 +57,7 @@ class SC_Helper_PageLayout */ public function sfGetPageLayout(&$objPage, $preview = false, $url = '', $device_type_id = DEVICE_TYPE_PC) { + /** TODO::モックなおす **/ // URLを元にページ情報を取得 if ($preview === false) { $url = preg_replace('|^' . preg_quote(ROOT_URLPATH) . '|', '', $url); @@ -53,55 +66,56 @@ public function sfGetPageLayout(&$objPage, $preview = false, $url = '', $device_ } else { $arrPageData = $this->getPageProperties($device_type_id, 0); } - - if (empty($arrPageData)) { + if (empty($arrPageData[0])) { trigger_error('ページ情報を取得できませんでした。', E_USER_WARNING); - } - - $objPage->tpl_mainpage = $this->getTemplatePath($device_type_id) . $arrPageData[0]['filename'] . '.tpl'; + $objPage->arrPageLayout = array(); + $objPage->tpl_column_num = 1; + } else { + $objPage->tpl_mainpage = $this->getTemplatePath($device_type_id) . $arrPageData[0]['filename'] . '.tpl'; - if (!file_exists($objPage->tpl_mainpage)) { - $msg = 'メイン部のテンプレートが存在しません。[' . $objPage->tpl_mainpage . ']'; - trigger_error($msg, E_USER_WARNING); - } + if (!file_exists($objPage->tpl_mainpage)) { + $msg = 'メイン部のテンプレートが存在しません。[' . $objPage->tpl_mainpage . ']'; + trigger_error($msg, E_USER_WARNING); + } - $objPage->arrPageLayout =& $arrPageData[0]; - if (strlen($objPage->arrPageLayout['author']) === 0) { - $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); - $objPage->arrPageLayout['author'] = $arrInfo['company_name']; - } + $objPage->arrPageLayout =& $arrPageData[0]; + if (strlen($objPage->arrPageLayout['author']) === 0) { + $arrInfo = DbHelper::getBasisData(); + $objPage->arrPageLayout['author'] = $arrInfo['company_name']; + } - // ページタイトルを設定 - if (SC_Utils_Ex::isBlank($objPage->tpl_title)) { - $objPage->tpl_title = $objPage->arrPageLayout['page_name']; - } + // ページタイトルを設定 + if (Utils::isBlank($objPage->tpl_title)) { + $objPage->tpl_title = $objPage->arrPageLayout['page_name']; + } - // 該当ページのブロックを取得し, 配置する - $masterData = new SC_DB_MasterData_Ex(); - $arrTarget = $masterData->getMasterData('mtb_target'); - $arrBlocs = $this->getBlocPositions($device_type_id, $objPage->arrPageLayout['page_id']); - // 無効なプラグインのブロックを取り除く. - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance(); - $arrBlocs = $objPlugin->getEnableBlocs($arrBlocs); - // php_path, tpl_path が存在するものを, 各ターゲットに配置 - foreach ($arrTarget as $target_id => $value) { - foreach ($arrBlocs as $arrBloc) { - if ($arrBloc['target_id'] != $target_id) { - continue; - } - if (is_file($arrBloc['php_path']) - || is_file($arrBloc['tpl_path'])) { - $objPage->arrPageLayout[$arrTarget[$target_id]][] = $arrBloc; - } else { - $error = "ブロックが見つかりません\n" - . 'tpl_path: ' . $arrBloc['tpl_path'] . "\n" - . 'php_path: ' . $arrBloc['php_path']; - trigger_error($error, E_USER_WARNING); + // 該当ページのブロックを取得し, 配置する + $masterData = new MasterData(); + $arrTarget = $masterData->getMasterData('mtb_target'); + $arrBlocs = $this->getBlocPositions($device_type_id, $objPage->arrPageLayout['page_id']); + // 無効なプラグインのブロックを取り除く. + $objPlugin = PluginHelper::getSingletonInstance(); + $arrBlocs = $objPlugin->getEnableBlocs($arrBlocs); + // php_path, tpl_path が存在するものを, 各ターゲットに配置 + foreach ($arrTarget as $target_id => $value) { + foreach ($arrBlocs as $arrBloc) { + if ($arrBloc['target_id'] != $target_id) { + continue; + } + if (array_key_exists($arrBloc['filename'], $this->classes) + || is_file($arrBloc['tpl_path'])) { + $objPage->arrPageLayout[$arrTarget[$target_id]][] = $arrBloc; + } else { + $error = "ブロックが見つかりません\n" + . 'tpl_path: ' . $arrBloc['tpl_path'] . "\n" + . 'php_path: ' . $arrBloc['php_path']; + trigger_error($error, E_USER_WARNING); + } } } + // カラム数を取得する + $objPage->tpl_column_num = $this->getColumnNum($objPage->arrPageLayout); } - // カラム数を取得する - $objPage->tpl_column_num = $this->getColumnNum($objPage->arrPageLayout); } /** @@ -120,8 +134,8 @@ public function sfGetPageLayout(&$objPage, $preview = false, $url = '', $device_ */ public function getPageProperties($device_type_id = DEVICE_TYPE_PC, $page_id = null, $where = '', $arrParams = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $where = 'device_type_id = ? ' . (SC_Utils_Ex::isBlank($where) ? $where : 'AND ' . $where); + $objQuery = Query::getSingletonInstance(); + $where = 'device_type_id = ? ' . (Utils::isBlank($where) ? $where : 'AND ' . $where); if ($page_id === null) { $where = 'page_id <> ? AND ' . $where; $page_id = 0; @@ -146,7 +160,7 @@ public function getPageProperties($device_type_id = DEVICE_TYPE_PC, $page_id = n */ public function getBlocs($device_type_id = DEVICE_TYPE_PC, $where = '', $arrParams = array(), $has_realpath = true) { - $objBloc = new SC_Helper_Bloc_Ex($device_type_id); + $objBloc = new BlocHelper($device_type_id); $arrBlocs = $objBloc->getWhere($where, $arrParams); if ($has_realpath) { $this->setBlocPathTo($device_type_id, $arrBlocs); @@ -166,7 +180,7 @@ public function getBlocs($device_type_id = DEVICE_TYPE_PC, $where = '', $arrPara */ public function getBlocPositions($device_type_id, $page_id, $has_realpath = true) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = <<< __EOF__ dtb_blocposition AS pos @@ -209,13 +223,13 @@ public function getBlocPositions($device_type_id, $page_id, $has_realpath = true */ public function lfDelPageData($page_id, $device_type_id = DEVICE_TYPE_PC) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // page_id が空でない場合にはdeleteを実行 if ($page_id != '') { $arrPageData = $this->getPageProperties($device_type_id, $page_id); $ret = $objQuery->delete('dtb_pagelayout', 'page_id = ? AND device_type_id = ?', array($page_id, $device_type_id)); // ファイルの削除 - $this->lfDelFile($arrPageData[0]['filename'], $device_type_id); + $this->lfDelFile($arrPageData['filename'], $device_type_id); } return $ret; @@ -233,7 +247,7 @@ public function lfDelPageData($page_id, $device_type_id = DEVICE_TYPE_PC) */ public function lfDelFile($filename, $device_type_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); /* * 同名ファイルの使用件数 @@ -359,12 +373,12 @@ public function setBlocPathTo($device_type_id = DEVICE_TYPE_PC, &$arrBlocs = arr { foreach ($arrBlocs as $key => $value) { $arrBloc =& $arrBlocs[$key]; - $arrBloc['php_path'] = SC_Utils_Ex::isBlank($arrBloc['php_path']) ? '' : HTML_REALDIR . $arrBloc['php_path']; + $arrBloc['php_path'] = Utils::isBlank($arrBloc['php_path']) ? '' : HTML_REALDIR . $arrBloc['php_path']; // php_pathがある場合は、pathを追加せずにLC_Page_FrontParts_Blocで処理する - if (! SC_Utils_Ex::isBlank($arrBloc['php_path']) ) continue; + if (! Utils::isBlank($arrBloc['php_path']) ) continue; $bloc_dir = $this->getTemplatePath($device_type_id) . BLOC_DIR; - $arrBloc['tpl_path'] = SC_Utils_Ex::isBlank($arrBloc['tpl_path']) ? '' : $bloc_dir . $arrBloc['tpl_path']; + $arrBloc['tpl_path'] = Utils::isBlank($arrBloc['tpl_path']) ? '' : $bloc_dir . $arrBloc['tpl_path']; } } @@ -380,9 +394,9 @@ public function getColumnNum($arrPageLayout) // メインは確定 $col_num = 1; // LEFT NAVI - if (count($arrPageLayout['LeftNavi']) > 0) $col_num++; + if (isset($arrPageLayout['LeftNavi']) && count($arrPageLayout['LeftNavi']) > 0) $col_num++; // RIGHT NAVI - if (count($arrPageLayout['RightNavi']) > 0) $col_num++; + if (isset($arrPageLayout['RightNavi']) && count($arrPageLayout['RightNavi']) > 0) $col_num++; return $col_num; } } diff --git a/data/class/helper/SC_Helper_Payment.php b/data/Eccube/Common/Helper/PaymentHelper.php similarity index 77% rename from data/class/helper/SC_Helper_Payment.php rename to data/Eccube/Common/Helper/PaymentHelper.php index d138704bfc4..a46d1c0c0fe 100644 --- a/data/class/helper/SC_Helper_Payment.php +++ b/data/Eccube/Common/Helper/PaymentHelper.php @@ -1,34 +1,28 @@ sfDeleteRankRecord('dtb_payment', 'payment_id', $payment_id); + $objDb->deleteRankRecord('dtb_payment', 'payment_id', $payment_id); } /** @@ -155,8 +149,8 @@ public function delete($payment_id) */ public function rankUp($payment_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankUp('dtb_payment', 'payment_id', $payment_id); + $objDb = new DbHelper(); + $objDb->rankUp('dtb_payment', 'payment_id', $payment_id); } /** @@ -167,8 +161,8 @@ public function rankUp($payment_id) */ public function rankDown($payment_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankDown('dtb_payment', 'payment_id', $payment_id); + $objDb = new DbHelper(); + $objDb->rankDown('dtb_payment', 'payment_id', $payment_id); } /** @@ -181,10 +175,10 @@ public function rankDown($payment_id) */ public static function useModule($payment_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $memo03 = $objQuery->get('memo03', 'dtb_payment', 'payment_id = ?', array($payment_id)); - return !SC_Utils_Ex::isBlank($memo03); + return !Utils::isBlank($memo03); } /** @@ -195,6 +189,6 @@ public static function useModule($payment_id) */ public static function getIDValueList($type = 'payment_method') { - return SC_Helper_DB_Ex::sfGetIDValueList('dtb_payment', 'payment_id', $type); + return DbHelper::getIDValueList('dtb_payment', 'payment_id', $type); } } diff --git a/data/class/helper/SC_Helper_Plugin.php b/data/Eccube/Common/Helper/PluginHelper.php similarity index 85% rename from data/class/helper/SC_Helper_Plugin.php rename to data/Eccube/Common/Helper/PluginHelper.php index bbab8893d8e..073317a4fdd 100644 --- a/data/class/helper/SC_Helper_Plugin.php +++ b/data/Eccube/Common/Helper/PluginHelper.php @@ -1,33 +1,28 @@ load($plugin_activate_flg); + $GLOBALS['_PluginHelper_instance'] = new static(); + $GLOBALS['_PluginHelper_instance']->load($plugin_activate_flg); } - return $GLOBALS['_SC_Helper_Plugin_instance']; + return $GLOBALS['_PluginHelper_instance']; } /** @@ -185,7 +179,7 @@ public function registerLocalHookPoint($objPlugin, $priority) // ローカルプラグイン関数を定義しているかを検証. if (method_exists($objPlugin, 'register') === true) { // アクションの登録(プラグイン側に記述) - $objPluginHelper =& SC_Helper_Plugin::getSingletonInstance(); + $objPluginHelper = static::getSingletonInstance(); $objPlugin->register($objPluginHelper, $priority); } } @@ -304,18 +298,18 @@ public function setHeadNaviBlocs(&$arrBlocs) * Utility function to set a hook point. * * @param string $hook_point hook point - * @param SC_SiteView[] $arrArgs argument passing to callback function + * @param SiteView[] $arrArgs argument passing to callback function * @param boolean $plugin_activate_flg * @return void */ public static function hook($hook_point, $arrArgs = array(), $plugin_activate_flg = PLUGIN_ACTIVATE_FLAG) { // エラー処理中は実行しない - if (SC_Helper_HandleError_Ex::$under_error_handling) { + if (HandleErrorHelper::$under_error_handling) { return; } - $objPlugin = SC_Helper_Plugin::getSingletonInstance($plugin_activate_flg); + $objPlugin = static::getSingletonInstance($plugin_activate_flg); // 以前、エラー処理中に (オブジェクトではない) false に対し、doAction をコールする不具合があった。(#1971, #2551) // 現在、そういった状況は回避している認識だが、念のため同様の状況が発生した場合、ログを残し、実行しない。 diff --git a/data/class/helper/SC_Helper_Purchase.php b/data/Eccube/Common/Helper/PurchaseHelper.php similarity index 83% rename from data/class/helper/SC_Helper_Purchase.php rename to data/Eccube/Common/Helper/PurchaseHelper.php index a8b26486365..e3936be1f1c 100644 --- a/data/class/helper/SC_Helper_Purchase.php +++ b/data/Eccube/Common/Helper/PurchaseHelper.php @@ -1,26 +1,32 @@ getValue('customer_id'); $objQuery->begin(); if (!$objSiteSession->isPrePage()) { - // エラー時は、正当なページ遷移とは認めない - $objSiteSess->setNowPage(''); - - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSession); + Utils::sfDispSiteError(PAGE_ERROR, $objSiteSession); } $uniqId = $objSiteSession->getUniqId(); @@ -84,7 +86,7 @@ public function completeOrder($orderStatus = ORDER_NEW) $orderTemp['status'] = $orderStatus; $cartkey = $objCartSession->getKey(); $order_id = $this->registerOrderComplete($orderTemp, $objCartSession, $cartkey); - $isMultiple = SC_Helper_Purchase::isMultiple(); + $isMultiple = static::isMultiple(); $shippingTemp =& $this->getShippingTemp($isMultiple); foreach ($shippingTemp as $shippingId => $val) { $this->registerShipmentItem($order_id, $shippingId, $val['shipment_item']); @@ -95,12 +97,12 @@ public function completeOrder($orderStatus = ORDER_NEW) //会員情報の最終購入日、購入合計を更新 if ($customerId > 0) { - SC_Customer_Ex::updateOrderSummary($customerId); + Customer::updateOrderSummary($customerId); } $this->cleanupSession($order_id, $objCartSession, $objCustomer, $cartkey); - GC_Utils_Ex::gfPrintLog('order complete. order_id=' . $order_id); + GcUtils::gfPrintLog('order complete. order_id=' . $order_id); } /** @@ -121,7 +123,7 @@ public function completeOrder($orderStatus = ORDER_NEW) */ public function cancelOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $in_transaction = $objQuery->inTransaction(); if (!$in_transaction) { $objQuery->begin(); @@ -164,7 +166,7 @@ public function cancelOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete = */ public function rollbackOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $in_transaction = $objQuery->inTransaction(); if (!$in_transaction) { $objQuery->begin(); @@ -174,9 +176,9 @@ public function rollbackOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete $arrOrderTemp = $this->getOrderTempByOrderId($order_id); $_SESSION = array_merge($_SESSION, unserialize($arrOrderTemp['session'])); - $objSiteSession = new SC_SiteSession_Ex(); - $objCartSession = new SC_CartSession_Ex(); - $objCustomer = new SC_Customer_Ex(); + $objSiteSession = new SiteSession(); + $objCartSession = new CartSession(); + $objCustomer = new Customer(); // 新たに受注一時情報を保存する $objSiteSession->unsetUniqId(); @@ -203,7 +205,7 @@ public function rollbackOrder($order_id, $orderStatus = ORDER_CANCEL, $is_delete * カート画面へ遷移する. * * @param string $uniqId ユニークID - * @param SC_CartSession $objCartSession + * @param CartSession $objCartSession * @return void */ public function verifyChangeCart($uniqId, &$objCartSession) @@ -211,8 +213,8 @@ public function verifyChangeCart($uniqId, &$objCartSession) $cartKey = $objCartSession->getKey(); // カート内が空でないか - if (SC_Utils_Ex::isBlank($cartKey)) { - SC_Response_Ex::sendRedirect(CART_URL); + if (Utils::isBlank($cartKey)) { + Response::sendRedirect(CART_URL); exit; } @@ -223,15 +225,15 @@ public function verifyChangeCart($uniqId, &$objCartSession) * POSTのユニークIDとセッションのユニークIDを比較 *(ユニークIDがPOSTされていない場合はスルー) */ - if (!SC_SiteSession_Ex::checkUniqId()) { - SC_Utils_Ex::sfDispSiteError(CANCEL_PURCHASE); + if (!SiteSession::checkUniqId()) { + Utils::sfDispSiteError(CANCEL_PURCHASE); exit; } // 購入ボタンを押してから変化がないか $quantity = $objCartSession->getTotalQuantity($cartKey); if ($objCartSession->checkChangeCart($cartKey) || !($quantity > 0)) { - SC_Response_Ex::sendRedirect(CART_URL); + Response::sendRedirect(CART_URL); exit; } } @@ -244,7 +246,7 @@ public function verifyChangeCart($uniqId, &$objCartSession) */ public function getOrderTemp($uniqId) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->getRow('*', 'dtb_order_temp', 'order_temp_id = ?', array($uniqId)); } @@ -257,7 +259,7 @@ public function getOrderTemp($uniqId) */ public function getOrderTempByOrderId($order_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->getRow('*', 'dtb_order_temp', 'order_id = ?', array($order_id)); } @@ -269,16 +271,16 @@ public function getOrderTempByOrderId($order_id) * * @param integer $uniqId 受注一時情報ID * @param array $params 登録する受注情報の配列 - * @param SC_Customer $objCustomer SC_Customer インスタンス + * @param Customer $objCustomer Customer インスタンス * @return void */ public function saveOrderTemp($uniqId, $params, &$objCustomer = NULL) { - if (SC_Utils_Ex::isBlank($uniqId)) { + if (Utils::isBlank($uniqId)) { return; } - $params['device_type_id'] = SC_Display_Ex::detectDevice(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $params['device_type_id'] = Display::detectDevice(); + $objQuery = Query::getSingletonInstance(); // 存在するカラムのみを対象とする $cols = $objQuery->listTableFields('dtb_order_temp'); $sqlval = array(); @@ -298,7 +300,7 @@ public function saveOrderTemp($uniqId, $params, &$objCustomer = NULL) //国ID追加 $sqlval['order_country_id'] = ($sqlval['order_country_id']) ? $sqlval['order_country_id'] : DEFAULT_COUNTRY_ID; - if (SC_Utils_Ex::isBlank($exists)) { + if (Utils::isBlank($exists)) { $sqlval['order_temp_id'] = $uniqId; $sqlval['create_date'] = 'CURRENT_TIMESTAMP'; $objQuery->insert('dtb_order_temp', $sqlval); @@ -365,11 +367,11 @@ public function setShipmentItemTemp($shipping_id, $product_class_id, $quantity) $arrItems['product_class_id'] = $product_class_id; $arrItems['quantity'] = $quantity; - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); // カート情報から読みこめば済むと思うが、一旦保留。むしろ、カート情報も含め、セッション情報を縮小すべきかもしれない。 /* - $objCartSession = new SC_CartSession_Ex(); + $objCartSession = new CartSession(); $cartKey = $objCartSession->getKey(); // 詳細情報を取得 $cartItems = $objCartSession->getCartList($cartKey); @@ -380,7 +382,7 @@ public function setShipmentItemTemp($shipping_id, $product_class_id, $quantity) $arrItems['productsClass'] = $product; } $arrItems['price'] = $arrItems['productsClass']['price02']; - $inctax = SC_Helper_TaxRule_Ex::sfCalcIncTax($arrItems['price'], $arrItems['productsClass']['product_id'], + $inctax = TaxRuleHelper::sfCalcIncTax($arrItems['price'], $arrItems['productsClass']['product_id'], $arrItems['productsClass']['product_class_id']); $arrItems['total_inctax'] = $inctax * $arrItems['quantity']; } @@ -392,7 +394,7 @@ public function setShipmentItemTemp($shipping_id, $product_class_id, $quantity) public function getShippingPref($is_multiple) { $results = array(); - foreach (SC_Helper_Purchase_Ex::getShippingTemp($is_multiple) as $val) { + foreach (static::getShippingTemp($is_multiple) as $val) { $results[] = $val['shipping_pref']; } @@ -406,7 +408,7 @@ public function getShippingPref($is_multiple) */ public function isMultiple() { - return count(SC_Helper_Purchase_Ex::getShippingTemp(true)) >= 2; + return count(static::getShippingTemp(true)) >= 2; } /** @@ -437,7 +439,7 @@ public function saveShippingTemp($arrSrc, $shipping_id = 0) */ public function unsetShippingTemp() { - SC_Helper_Purchase_Ex::unsetAllShippingTemp(true); + PurchaseHelper::unsetAllShippingTemp(true); } /** @@ -473,7 +475,7 @@ public static function unsetOneShippingTemp($shipping_id) * customer_id は強制的にコピーされる. * * @param array $dest コピー先の配列 - * @param SC_Customer $objCustomer SC_Customer インスタンス + * @param Customer $objCustomer Customer インスタンス * @param string $prefix コピー先の接頭辞. デフォルト order * @param array $keys コピー対象のキー * @return void @@ -492,7 +494,7 @@ public function copyFromCustomer(&$dest, &$objCustomer, $prefix = 'order', } } - if ((SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) + if ((Display::detectDevice() == DEVICE_TYPE_MOBILE) && in_array('email', $keys) ) { $email_mobile = $objCustomer->getValue('email_mobile'); @@ -513,7 +515,7 @@ public function copyFromCustomer(&$dest, &$objCustomer, $prefix = 'order', * * 受注情報($src)を $dest の order_* へコピーする. * - * TODO 汎用的にして SC_Utils へ移動 + * TODO 汎用的にして \Eccube\Common\Util\Utils へ移動 * * @param array $dest コピー先の配列 * @param array $src コピー元の配列 @@ -527,10 +529,10 @@ public function copyFromOrder(&$dest, $src, $prefix = 'shipping', $src_prefix = if (is_null($arrKey)) { $arrKey = $this->arrShippingKey; } - if (!SC_Utils_Ex::isBlank($prefix)) { + if (!Utils::isBlank($prefix)) { $prefix = $prefix . '_'; } - if (!SC_Utils_Ex::isBlank($src_prefix)) { + if (!Utils::isBlank($src_prefix)) { $src_prefix = $src_prefix . '_'; } foreach ($arrKey as $key) { @@ -553,12 +555,71 @@ public function extractShipping($arrSrc) $arrKey[] = 'shipping_' . $key; } - return SC_Utils_Ex::sfArrayIntersectKeys($arrSrc, $arrKey); + return Utils::sfArrayIntersectKeys($arrSrc, $arrKey); + } + + public function setDefaultPurchase($uniqId, $cartKey, &$objCustomer, &$objCartSess) + { + // 基本配送情報登録 + $sqlval = array(); + $this->copyFromCustomer($sqlval, $objCustomer, 'shipping'); + $this->saveShippingTemp($sqlval); + // 基本配送業者・支払方法登録 + $objDelivery = new DeliveryHelper(); + $arrDeliv = $objDelivery->getList($cartKey); + $deliv_id = $arrDeliv[0]['deliv_id']; + $sqlval['deliv_id'] = $deliv_id; + $arrPaymentDeliv = $objDelivery->getPayments($deliv_id); + $total = $objCartSess->getAllProductsTotal($cartKey); + $objPayment = new PaymentHelper(); + $arrPaymentTotal = $objPayment->getByPrice($total); + foreach ($arrPaymentTotal as $payment) { + if (in_array($payment['payment_id'], $arrPaymentDeliv)) { + $sqlval['payment_id'] = $payment['payment_id']; + $sqlval['charge'] = $payment['charge']; + $sqlval['payment_method'] = $payment['payment_method']; + break; + } + } + $this->saveOrderTemp($uniqId, $sqlval); + } + + /** + * 配送業者IDから, 支払い方法, お届け時間の配列を取得する. + * + * 結果の連想配列の添字の値は以下の通り + * - 'arrDelivTime' - お届け時間の配列 + * - 'arrPayment' - 支払い方法の配列 + * - 'img_show' - 支払い方法の画像の有無 + * + * @param SC_CartSession $objCartSess SC_CartSession インスタンス + * @param integer $deliv_id 配送業者ID + * @return array 支払い方法, お届け時間を格納した配列 + */ + public function getSelectablePayment(&$objCartSess, $deliv_id, $is_list = false) + { + $arrPayment = array(); + if (strval($deliv_id) === strval(intval($deliv_id))) { + $total = $objCartSess->getAllProductsTotal($objCartSess->getKey()); + $payments_deliv = DeliveryHelper::getPayments($deliv_id); + $objPayment = new PaymentHelper(); + $payments_total = $objPayment->getByPrice($total); + foreach ($payments_total as $payment) { + if (in_array($payment['payment_id'], $payments_deliv)) { + if ($is_list) { + $arrPayment[$payment['payment_id']] = $payment['payment_method']; + } else { + $arrPayment[] = $payment; + } + } + } + } + return $arrPayment; } /** * お届け日一覧を取得する. - * @param SC_CartSession $objCartSess + * @param CartSession $objCartSess * @param integer $productTypeId */ public function getDelivDate(&$objCartSess, $productTypeId) @@ -623,7 +684,7 @@ public function getDelivDate(&$objCartSess, $productTypeId) */ public function getDateArray($start_day, $end_day) { - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $arrWDAY = $masterData->getMasterData('mtb_wday'); //お届け可能日のスタート値がセットされていれば if ($start_day >= 1) { @@ -658,7 +719,7 @@ public function getDateArray($start_day, $end_day) */ public function registerShipping($order_id, $arrParams, $convert_shipping_date = true) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_shipping'; $where = 'order_id = ?'; $objQuery->delete($table, $where, array($order_id)); @@ -667,7 +728,7 @@ public function registerShipping($order_id, $arrParams, $convert_shipping_date = $arrValues = $objQuery->extractOnlyColsOf($table, $arrShipping); // 配送日付を timestamp に変換 - if (!SC_Utils_Ex::isBlank($arrValues['shipping_date']) + if (!Utils::isBlank($arrValues['shipping_date']) && $convert_shipping_date) { $d = mb_strcut($arrValues['shipping_date'], 0, 10); $arrDate = explode('/', $d); @@ -701,34 +762,34 @@ public function registerShipping($order_id, $arrParams, $convert_shipping_date = */ public function registerShipmentItem($order_id, $shipping_id, $arrParams) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_shipment_item'; $where = 'order_id = ? AND shipping_id = ?'; $objQuery->delete($table, $where, array($order_id, $shipping_id)); - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); foreach ($arrParams as $arrValues) { - if (SC_Utils_Ex::isBlank($arrValues['product_class_id'])) { + if (Utils::isBlank($arrValues['product_class_id'])) { continue; } $d = $objProduct->getDetailAndProductsClass($arrValues['product_class_id']); - $name = SC_Utils_Ex::isBlank($arrValues['product_name']) + $name = Utils::isBlank($arrValues['product_name']) ? $d['name'] : $arrValues['product_name']; - $code = SC_Utils_Ex::isBlank($arrValues['product_code']) + $code = Utils::isBlank($arrValues['product_code']) ? $d['product_code'] : $arrValues['product_code']; - $cname1 = SC_Utils_Ex::isBlank($arrValues['classcategory_name1']) + $cname1 = Utils::isBlank($arrValues['classcategory_name1']) ? $d['classcategory_name1'] : $arrValues['classcategory_name1']; - $cname2 = SC_Utils_Ex::isBlank($arrValues['classcategory_name2']) + $cname2 = Utils::isBlank($arrValues['classcategory_name2']) ? $d['classcategory_name2'] : $arrValues['classcategory_name2']; - $price = SC_Utils_Ex::isBlank($arrValues['price']) + $price = Utils::isBlank($arrValues['price']) ? $d['price'] : $arrValues['price']; @@ -752,13 +813,13 @@ public function registerShipmentItem($order_id, $shipping_id, $arrParams) * 登録後, 受注一時テーブルに削除フラグを立てる. * * @param array $orderParams 登録する受注情報の配列 - * @param SC_CartSession $objCartSession カート情報のインスタンス + * @param CartSession $objCartSession カート情報のインスタンス * @param integer $cartKey 登録を行うカート情報のキー * @param integer 受注ID */ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 不要な変数を unset $unsets = array('mailmaga_flg', 'deliv_check', 'point_check', 'password', @@ -768,7 +829,7 @@ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey) } // 対応状況の指定が無い場合は新規受付 - if (SC_Utils_Ex::isBlank($orderParams['status'])) { + if (Utils::isBlank($orderParams['status'])) { $orderParams['status'] = ORDER_NEW; } @@ -782,7 +843,7 @@ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey) $cartItems = $objCartSession->getCartList($cartKey, $orderParams['order_pref'], $orderParams['order_country_id']); // 詳細情報を生成 - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $i = 0; $arrDetail = array(); foreach ($cartItems as $item) { @@ -804,7 +865,7 @@ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey) // 在庫の減少処理 if (!$objProduct->reduceStock($p['product_class_id'], $item['quantity'])) { $objQuery->rollback(); - SC_Utils_Ex::sfDispSiteError(SOLD_OUT, '', true); + Utils::sfDispSiteError(SOLD_OUT, '', true); } $i++; } @@ -812,7 +873,7 @@ public function registerOrderComplete($orderParams, &$objCartSession, $cartKey) $objQuery->update('dtb_order_temp', array('del_flg' => 1), 'order_temp_id = ?', - array(SC_SiteSession_Ex::getUniqId())); + array(SiteSession::getUniqId())); return $orderParams['order_id']; } @@ -831,7 +892,7 @@ public function registerOrder($order_id, $arrParams) { $table = 'dtb_order'; $where = 'order_id = ?'; - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrValues = $objQuery->extractOnlyColsOf($table, $arrParams); $exists = $objQuery->exists($table, $where, array($order_id)); @@ -845,7 +906,7 @@ public function registerOrder($order_id, $arrParams) $arrValues['update_date'] = 'CURRENT_TIMESTAMP'; $objQuery->update($table, $arrValues, $where, array($order_id)); } else { - if (SC_Utils_Ex::isBlank($order_id)) { + if (Utils::isBlank($order_id)) { $order_id = $this->getNextOrderID(); } /* @@ -856,7 +917,7 @@ public function registerOrder($order_id, $arrParams) $arrValues['status'] = null; $arrValues['order_id'] = $order_id; $arrValues['customer_id'] = - SC_Utils_Ex::isBlank($arrValues['customer_id']) + Utils::isBlank($arrValues['customer_id']) ? 0 : $arrValues['customer_id']; $arrValues['create_date'] = 'CURRENT_TIMESTAMP'; $arrValues['update_date'] = 'CURRENT_TIMESTAMP'; @@ -885,7 +946,7 @@ public function registerOrderDetail($order_id, $arrParams) { $table = 'dtb_order_detail'; $where = 'order_id = ?'; - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->delete($table, $where, array($order_id)); foreach ($arrParams as $arrDetail) { @@ -905,10 +966,10 @@ public function registerOrderDetail($order_id, $arrParams) */ public function getOrder($order_id, $customer_id = null) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'order_id = ?'; $arrValues = array($order_id); - if (!SC_Utils_Ex::isBlank($customer_id)) { + if (!Utils::isBlank($customer_id)) { $where .= ' AND customer_id = ?'; $arrValues[] = $customer_id; } @@ -925,8 +986,8 @@ public function getOrder($order_id, $customer_id = null) */ public function getOrderDetail($order_id, $has_order_status = true) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $objQuery = Query::getSingletonInstance(); + $dbFactory = DBFactory::getInstance(); $col = <<< __EOS__ T3.product_id, T3.product_class_id as product_class_id, @@ -989,7 +1050,7 @@ public function setDownloadableFlgTo(&$arrOrderDetail) $arrOrderDetail[$key]['is_downloadable'] = true; // ダウンロード期限内かつ, 入金日あり } elseif ($arrOrderDetail[$key]['effective'] == '1' - && !SC_Utils_Ex::isBlank($arrOrderDetail[$key]['payment_date'])) { + && !Utils::isBlank($arrOrderDetail[$key]['payment_date'])) { $arrOrderDetail[$key]['is_downloadable'] = true; } else { $arrOrderDetail[$key]['is_downloadable'] = false; @@ -1006,7 +1067,7 @@ public function setDownloadableFlgTo(&$arrOrderDetail) */ public function getShippings($order_id, $has_items = true) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrResults = array(); $objQuery->setOrder('shipping_id'); $arrShippings = $objQuery->select('*', 'dtb_shipping', 'order_id = ?', @@ -1038,8 +1099,8 @@ public function getShippings($order_id, $has_items = true) */ public function getShipmentItems($order_id, $shipping_id, $has_detail = true) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $objProduct = new SC_Product_Ex(); + $objQuery = Query::getSingletonInstance(); + $objProduct = new Product(); $arrResults = array(); $objQuery->setOrder('order_detail_id'); $arrItems = $objQuery->select('dtb_shipment_item.*', @@ -1077,14 +1138,14 @@ public function getShipmentItems($order_id, $shipping_id, $has_detail = true) */ public static function sendOrderMail($order_id, &$objPage = NULL) { - $objMail = new SC_Helper_Mail_Ex(); + $objMail = new MailHelper(); // setPageは、プラグインの処理に必要(see #1798) if (is_object($objPage)) { $objMail->setPage($objPage); } - $arrOrder = SC_Helper_Purchase::getOrder($order_id); + $arrOrder = static::getOrder($order_id); if (empty($arrOrder)) { return false; // 失敗 } @@ -1108,7 +1169,7 @@ public static function sendOrderMail($order_id, &$objPage = NULL) */ public function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddPoint = null, $newUsePoint = null, &$sqlval = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrOrderOld = $objQuery->getRow('status, add_point, use_point, customer_id', 'dtb_order', 'order_id = ?', array($orderId)); // 対応状況が変更無しの場合、DB値を引き継ぐ @@ -1171,7 +1232,7 @@ public function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddPoint = // ロールバック $objQuery->rollback(); // エラー - SC_Utils_Ex::sfDispSiteError(LACK_POINT); + Utils::sfDispSiteError(LACK_POINT); } } } @@ -1203,7 +1264,7 @@ public function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddPoint = //会員情報の最終購入日、購入合計を更新 if ($arrOrderOld['customer_id'] > 0 and $arrOrderOld['status'] != $newStatus) { - SC_Customer_Ex::updateOrderSummary($arrOrderOld['customer_id']); + Customer::updateOrderSummary($arrOrderOld['customer_id']); } } @@ -1216,7 +1277,7 @@ public function sfUpdateOrderStatus($orderId, $newStatus = null, $newAddPoint = */ public function sfUpdateOrderNameCol($order_id, $temp_table = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); if ($temp_table) { $tgt_table = 'dtb_order_temp'; @@ -1309,15 +1370,15 @@ public function isAddPoint($status) * $orderId が使われていない。 * * @param integer $orderId 注文番号 - * @param SC_CartSession $objCartSession カート情報のインスタンス - * @param SC_Customer $objCustomer SC_Customer インスタンス + * @param CartSession $objCartSession カート情報のインスタンス + * @param Customer $objCustomer Customer インスタンス * @param integer $cartKey 登録を行うカート情報のキー */ public function cleanupSession($orderId, &$objCartSession, &$objCustomer, $cartKey) { // カートの内容を削除する. $objCartSession->delAllProducts($cartKey); - SC_SiteSession_Ex::unsetUniqId(); + SiteSession::unsetUniqId(); // セッションの配送情報を破棄する. $this->unsetAllShippingTemp(true); @@ -1327,13 +1388,13 @@ public function cleanupSession($orderId, &$objCartSession, &$objCustomer, $cartK /** * 単一配送指定用に配送商品を設定する * - * @param SC_CartSession $objCartSession カート情報のインスタンス + * @param CartSession $objCartSession カート情報のインスタンス * @param integer $shipping_id 配送先ID * @return void */ public function setShipmentItemTempForSole(&$objCartSession, $shipping_id = 0) { - $objCartSess = new SC_CartSession_Ex(); + $objCartSess = new CartSession(); $this->clearShipmentItemTemp(); @@ -1351,7 +1412,7 @@ public function setShipmentItemTempForSole(&$objCartSession, $shipping_id = 0) */ public function getNextOrderID() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->nextVal('dtb_order_order_id'); } @@ -1376,17 +1437,17 @@ public function cancelPendingOrder($cancel_flg) public function checkDbAllPendingOrder() { $term = PENDING_ORDER_CANCEL_TIME; - if (!SC_Utils_Ex::isBlank($term) && preg_match("/^[0-9]+$/", $term)) { + if (!Utils::isBlank($term) && preg_match("/^[0-9]+$/", $term)) { $target_time = strtotime('-' . $term . ' sec'); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrVal = array(date('Y/m/d H:i:s', $target_time), ORDER_PENDING); $objQuery->begin(); $arrOrders = $objQuery->select('order_id', 'dtb_order', 'create_date <= ? and status = ? and del_flg = 0', $arrVal); - if (!SC_Utils_Ex::isBlank($arrOrders)) { + if (!Utils::isBlank($arrOrders)) { foreach ($arrOrders as $arrOrder) { $order_id = $arrOrder['order_id']; - SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true); - GC_Utils_Ex::gfPrintLog('order cancel.(time expire) order_id=' . $order_id); + static::cancelOrder($order_id, ORDER_CANCEL, true); + GcUtils::gfPrintLog('order cancel.(time expire) order_id=' . $order_id); } } $objQuery->commit(); @@ -1395,39 +1456,39 @@ public function checkDbAllPendingOrder() public function checkDbMyPendignOrder() { - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); if ($objCustomer->isLoginSuccess(true)) { $customer_id = $objCustomer->getValue('customer_id'); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrVal = array($customer_id, ORDER_PENDING); $objQuery->setOrder('create_date desc'); $objQuery->begin(); $arrOrders = $objQuery->select('order_id,create_date', 'dtb_order', 'customer_id = ? and status = ? and del_flg = 0', $arrVal); - if (!SC_Utils_Ex::isBlank($arrOrders)) { + if (!Utils::isBlank($arrOrders)) { foreach ($arrOrders as $key => $arrOrder) { $order_id = $arrOrder['order_id']; if ($key == 0) { - $objCartSess = new SC_CartSession_Ex(); + $objCartSess = new CartSession(); $cartKeys = $objCartSess->getKeys(); $term = PENDING_ORDER_CANCEL_TIME; if (preg_match("/^[0-9]+$/", $term)) { $target_time = strtotime('-' . $term . ' sec'); $create_time = strtotime($arrOrder['create_date']); - if (SC_Utils_Ex::isBlank($cartKeys) && $target_time < $create_time) { - SC_Helper_Purchase_Ex::rollbackOrder($order_id, ORDER_CANCEL, true); - GC_Utils_Ex::gfPrintLog('order rollback.(my pending) order_id=' . $order_id); + if (Utils::isBlank($cartKeys) && $target_time < $create_time) { + static::rollbackOrder($order_id, ORDER_CANCEL, true); + GcUtils::gfPrintLog('order rollback.(my pending) order_id=' . $order_id); } else { - SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true); + static::cancelOrder($order_id, ORDER_CANCEL, true); if ($target_time > $create_time) { - GC_Utils_Ex::gfPrintLog('order cancel.(my pending and time expire) order_id=' . $order_id); + GcUtils::gfPrintLog('order cancel.(my pending and time expire) order_id=' . $order_id); } else { - GC_Utils_Ex::gfPrintLog('order cancel.(my pending and set cart) order_id=' . $order_id); + GcUtils::gfPrintLog('order cancel.(my pending and set cart) order_id=' . $order_id); } } } } else { - SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true); - GC_Utils_Ex::gfPrintLog('order cancel.(my old pending) order_id=' . $order_id); + static::cancelOrder($order_id, ORDER_CANCEL, true); + GcUtils::gfPrintLog('order cancel.(my old pending) order_id=' . $order_id); } } } @@ -1437,21 +1498,21 @@ public function checkDbMyPendignOrder() public function checkSessionPendingOrder() { - if (!SC_Utils_Ex::isBlank($_SESSION['order_id'])) { + if (isset($_SESSION['order_id']) && !Utils::isBlank($_SESSION['order_id'])) { $order_id = $_SESSION['order_id']; unset($_SESSION['order_id']); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); - $arrOrder = SC_Helper_Purchase_Ex::getOrder($order_id); + $arrOrder = static::getOrder($order_id); if ($arrOrder['status'] == ORDER_PENDING) { - $objCartSess = new SC_CartSession_Ex(); + $objCartSess = new CartSession(); $cartKeys = $objCartSess->getKeys(); - if (SC_Utils_Ex::isBlank($cartKeys)) { - SC_Helper_Purchase_Ex::rollbackOrder($order_id, ORDER_CANCEL, true); - GC_Utils_Ex::gfPrintLog('order rollback.(session pending) order_id=' . $order_id); + if (Utils::isBlank($cartKeys)) { + static::rollbackOrder($order_id, ORDER_CANCEL, true); + GcUtils::gfPrintLog('order rollback.(session pending) order_id=' . $order_id); } else { - SC_Helper_Purchase_Ex::cancelOrder($order_id, ORDER_CANCEL, true); - GC_Utils_Ex::gfPrintLog('order rollback.(session pending and set card) order_id=' . $order_id); + static::cancelOrder($order_id, ORDER_CANCEL, true); + GcUtils::gfPrintLog('order rollback.(session pending and set card) order_id=' . $order_id); } } $objQuery->commit(); diff --git a/data/class/helper/SC_Helper_Review.php b/data/Eccube/Common/Helper/ReviewHelper.php similarity index 86% rename from data/class/helper/SC_Helper_Review.php rename to data/Eccube/Common/Helper/ReviewHelper.php index 623429d7af6..d2068578846 100644 --- a/data/class/helper/SC_Helper_Review.php +++ b/data/Eccube/Common/Helper/ReviewHelper.php @@ -1,34 +1,27 @@ update('dtb_review', $data, 'review_id = ?', array($review_id)); } @@ -112,7 +105,7 @@ public function delete($review_id) */ public function find($params = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 検索条件を作成 $query = (isset($params['query'])) ? $params['query'] : array(); @@ -151,7 +144,7 @@ public function find($params = array()) */ public function count($query = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 検索条件を作成 list($where, $values) = $this->makeWhere($query); $from = 'dtb_review AS A LEFT JOIN dtb_products AS B ON A.product_id = B.product_id '; @@ -176,7 +169,7 @@ private function makeWhere($query = array()) switch ($key) { case 'product_id': if (is_array($val)) { - $where.= ' AND A.product_id IN (' . SC_Utils_Ex::sfGetCommaList($val) . ')'; + $where.= ' AND A.product_id IN (' . Utils::sfGetCommaList($val) . ')'; } else { $where.= ' AND A.product_id = ?'; $values[] = $val; @@ -185,7 +178,7 @@ private function makeWhere($query = array()) case 'review_id': if (is_array($val)) { - $where.= ' AND review_id IN (' . SC_Utils_Ex::sfGetCommaList($val) . ')'; + $where.= ' AND review_id IN (' . Utils::sfGetCommaList($val) . ')'; } else { $where.= ' AND review_id = ?'; $values[] = $val; diff --git a/data/class/helper/SC_Helper_Session.php b/data/Eccube/Common/Helper/SessionHelper.php similarity index 71% rename from data/class/helper/SC_Helper_Session.php rename to data/Eccube/Common/Helper/SessionHelper.php index a08b6f5cbc2..79506e78ed0 100644 --- a/data/class/helper/SC_Helper_Session.php +++ b/data/Eccube/Common/Helper/SessionHelper.php @@ -1,18 +1,29 @@ getMasterData('mtb_auth_excludes'); - foreach ($arrExcludes as $exclude) { - $arrExcludesPath = explode('/', str_replace('\\', '/', HTML_REALDIR . ADMIN_DIR . $exclude)); - $arrDiff = array_diff_assoc($arrExcludesPath, $arrScriptPath); - if (count($arrDiff) === 0) { - return; - } + $arrScriptPath = explode('/', str_replace('\\', '/', $_SERVER['SCRIPT_FILENAME'])); + if (!GcUtils::isAdminFunction()) { + return; + } else { + $masterData = new MasterData(); + $arrExcludes = $masterData->getMasterData('mtb_auth_excludes'); + foreach ($arrExcludes as $exclude) { + $arrExcludesPath = explode('/', str_replace('\\', '/', HTML_REALDIR . ADMIN_DIR . $exclude)); + $arrDiff = array_diff_assoc($arrExcludesPath, $arrScriptPath); + if (count($arrDiff) === 0) { + return; } } } - SC_Utils_Ex::sfIsSuccess(new SC_Session_Ex()); + Utils::sfIsSuccess(new Session()); } /** diff --git a/data/class/helper/SC_Helper_TaxRule.php b/data/Eccube/Common/Helper/TaxRuleHelper.php similarity index 86% rename from data/class/helper/SC_Helper_TaxRule.php rename to data/Eccube/Common/Helper/TaxRuleHelper.php index a562762364b..685add69358 100644 --- a/data/class/helper/SC_Helper_TaxRule.php +++ b/data/Eccube/Common/Helper/TaxRuleHelper.php @@ -1,34 +1,27 @@ isLoginSuccess(true)) { if ($country_id == 0) { $country_id = $objCustomer->getValue('country_id'); @@ -162,7 +155,7 @@ public static function getTaxRule($product_id = 0, $product_class_id = 0, $pref_ $arrPriorityKeys = explode(',', TAX_RULE_PRIORITY); // 条件に基づいて税の設定情報を取得 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_tax_rule'; $cols = '*'; @@ -236,7 +229,7 @@ public static function getTaxRule($product_id = 0, $product_class_id = 0, $pref_ public static function setTaxRuleForProduct($tax_rate, $product_id = 0, $product_class_id = 0, $tax_adjust=0, $pref_id = 0, $country_id = 0) { // 基本設定を取得 - $arrRet = SC_Helper_TaxRule_Ex::getTaxRule($product_id, $product_class_id); + $arrRet = static::getTaxRule($product_id, $product_class_id); // 基本設定の消費税率と一緒であれば設定しない if ($arrRet['tax_rate'] != $tax_rate) { @@ -245,7 +238,7 @@ public static function setTaxRuleForProduct($tax_rate, $product_id = 0, $product // 日付は登録時点を設定 $apply_date = date('Y/m/d H:i:s'); // 税情報を設定 - SC_Helper_TaxRule_Ex::setTaxRule($calc_rule, $tax_rate, $apply_date, NULL, $tax_adjust, $product_id, $product_class_id, $pref_id, $country_id); + static::setTaxRule($calc_rule, $tax_rate, $apply_date, NULL, $tax_adjust, $product_id, $product_class_id, $pref_id, $country_id); } } @@ -275,7 +268,7 @@ public function setTaxRule($calc_rule, $tax_rate, $apply_date, $tax_rule_id=NULL $arrValues['update_date'] = 'CURRENT_TIMESTAMP'; // 新規か更新か? - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); if ($tax_rule_id == NULL && $product_id != 0 && $product_class_id != 0) { $where = 'product_id = ? AND product_class_id= ? AND pref_id = ? AND country_id = ?'; $arrVal = array($product_id, $product_class_id, $pref_id, $country_id); @@ -307,7 +300,7 @@ public function setTaxRule($calc_rule, $tax_rate, $apply_date, $tax_rule_id=NULL */ public function getTaxRuleList($has_deleted = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'tax_rule_id, tax_rate, calc_rule, apply_date'; $where = ''; if (!$has_deleted) { @@ -328,7 +321,7 @@ public function getTaxRuleList($has_deleted = false) */ public function getTaxRuleData($tax_rule_id, $has_deleted = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'tax_rule_id = ?'; if (!$has_deleted) { $where .= ' AND del_flg = 0'; @@ -344,7 +337,7 @@ public function getTaxRuleData($tax_rule_id, $has_deleted = false) */ public function getTaxRuleByTime($apply_date, $has_deleted = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'apply_date = ?'; if (!$has_deleted) { $where .= ' AND del_flg = 0'; @@ -362,7 +355,7 @@ public function getTaxRuleByTime($apply_date, $has_deleted = false) */ public function deleteTaxRuleData($tax_rule_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqlval = array(); $sqlval['del_flg'] = 1; diff --git a/data/class/helper/SC_Helper_Transform.php b/data/Eccube/Common/Helper/TransformHelper.php similarity index 94% rename from data/class/helper/SC_Helper_Transform.php rename to data/Eccube/Common/Helper/TransformHelper.php index 6c8c5bbda9f..5be3ec260ae 100644 --- a/data/class/helper/SC_Helper_Transform.php +++ b/data/Eccube/Common/Helper/TransformHelper.php @@ -1,33 +1,24 @@ snip_count) { $html = $this->objDOM->saveHTML(); $html = preg_replace('/^.*(]*>)/s', '$1', $html); @@ -640,7 +631,7 @@ protected function lfSetTransform($mode, $target_key, $html_snip) } $this->snip_count++; } catch (Exception $e) { - SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, 'テンプレートの操作に失敗しました。'); + Utils::sfDispSiteError(FREE_ERROR_MSG, '', true, 'テンプレートの操作に失敗しました。'); } return true; diff --git a/data/class/SC_Image.php b/data/Eccube/Common/Image.php similarity index 89% rename from data/class/SC_Image.php rename to data/Eccube/Common/Image.php index 9e3e7e8bc3e..bbc9b22da65 100644 --- a/data/class/SC_Image.php +++ b/data/Eccube/Common/Image.php @@ -1,28 +1,21 @@ MakeThumb($_FILES[$keyname]['tmp_name'], $this->tmp_dir, $max_width, $max_height, $newFileName); - GC_Utils_Ex::gfDebugLog($result); + GcUtils::gfDebugLog($result); return $newFileName; } @@ -56,7 +49,7 @@ public function moveTempImage($filename, $save_dir) unlink($from_path); } } else { - GC_Utils_Ex::gfDebugLog($from_path.'->'.$to_path.'のcopyに失敗しました。'); + GcUtils::gfDebugLog($from_path.'->'.$to_path.'のcopyに失敗しました。'); } } @@ -193,8 +186,8 @@ public function MakeThumb($FromImgPath, $ToImgPath, $tmpMW, $tmpMH, $newFileName ImageCopyResampled($ImgNew, $ImgDefault, 0, 0, 0, 0, $re_size[0], $re_size[1], $size[0], $size[1]); } - GC_Utils_Ex::gfDebugLog($size); - GC_Utils_Ex::gfDebugLog($re_size); + GcUtils::gfDebugLog($size); + GcUtils::gfDebugLog($re_size); if ($newFileName) { $ToFile = $newFileName; diff --git a/data/Eccube/Common/ImageConverter.php b/data/Eccube/Common/ImageConverter.php new file mode 100644 index 00000000000..f3ebc782cc0 --- /dev/null +++ b/data/Eccube/Common/ImageConverter.php @@ -0,0 +1,248 @@ +outputImageDir = realpath(realpath(dirname(__FILE__))); + $this->outputImageType = 'jpg'; + $this->outputImageWidth = 320; + $this->outputImageHeight = NULL; + $this->outputFileSize = 20000; + } + + // 変換実行 + public function execute($inputImagePath) + { + // 前処理 + $filestat = @stat($inputImagePath); + $imagesize = getimagesize($inputImagePath); + $inputImageWidth = $imagesize[0]; + $inputImageHeight = $imagesize[1]; + $inputImageType = $imagesize[2]; + + // 今回実行用の一時変数をセット + $output_image_width = $this->outputImageWidth; + $output_image_height = is_null($this->outputImageHeight) + ? $inputImageHeight * ($output_image_width / $inputImageWidth) + : $this->outputImageHeight; + // GIF 画像は縮小後も GIF 画像で出力する。旧機種対応などで、機種用の画像形式に変換したい場合、expr3 に固定する。 + $output_image_type = $inputImageType == IMAGETYPE_GIF ? 'gif' : $this->outputImageType; + + $outputImageName = sha1($inputImagePath . '_' . $this->outputImageWidth . '_' . $this->outputFileSize . '_' . $filestat['mtime']) . '.' . $output_image_type; + $outputImagePath = $this->outputImageDir . '/' . $outputImageName; + + if ($inputImageWidth <= $output_image_width) { + if ($inputImageHeight <= $output_image_height) { + $output_image_width = $inputImageWidth; + $output_image_height = $inputImageHeight; + } else { + $output_image_width = $inputImageWidth * ($output_image_height / $inputImageHeight); + } + } else { + if ($inputImageHeight <= $output_image_height) { + $output_image_height = $inputImageHeight * ($output_image_width / $inputImageWidth); + } else { + if ($output_image_width / $inputImageWidth < $output_image_height / $inputImageHeight) { + $output_image_height = $inputImageHeight * ($output_image_width / $inputImageWidth); + } else { + $output_image_width = $inputImageWidth * ($output_image_height / $inputImageHeight); + } + } + } + + // ファイルが存在するか確認し、存在しない場合のみ作成する + if (file_exists($outputImagePath)) { + $info['convert'] = FALSE; + } else { + // 元ファイル作成 + switch ($inputImageType) { + case IMAGETYPE_GIF: + $tempImage = imagecreatefromgif($inputImagePath); + $arrTransparentColor = $this->getTransparentColor($tempImage); + if (!empty($arrTransparentColor)) { + imagecolortransparent($tempImage, $arrTransparentColor); + } + break; + + case IMAGETYPE_JPEG: + $tempImage = imagecreatefromjpeg($inputImagePath); + break; + + case IMAGETYPE_PNG: + $tempImage = imagecreatefrompng($inputImagePath); + break; + + case IMAGETYPE_WBMP: + $tempImage = imagecreatefromwbmp($inputImagePath); + break; + } + + if (!$tempImage) { + return false; + } + + $scale = 1.0; + $outputImagePathTemp = $outputImagePath . '.tmp-' . rand(); + do { + // 空ファイル作成 + if ($output_image_type == 'gif') { + // 縮小時のノイズ防止のためインデックスカラーで処理する。特に透過色を扱う上で重要。 + $outputImage = ImageCreate($output_image_width * $scale, $output_image_height * $scale); + } else { + $outputImage = ImageCreateTruecolor($output_image_width * $scale, $output_image_height * $scale); + } + + ImageCopyResampled($outputImage, $tempImage, 0, 0, 0, 0, $output_image_width * $scale, $output_image_height * $scale, $inputImageWidth, $inputImageHeight); + + // ファイル出力 + + @unlink($outputImagePathTemp); + + switch ($output_image_type) { + case 'gif': + if (!empty($arrTransparentColor)) { + $transparent_color_id = imagecolorexact($outputImage, $arrTransparentColor['red'], $arrTransparentColor['green'], $arrTransparentColor['blue']); + imagecolortransparent($outputImage, $transparent_color_id); + } + imagegif($outputImage, $outputImagePathTemp); + break; + + case 'jpg': + $quality = 75; + // 表示可能なファイルサイズ以下になるまで、10%ずつクオリティを調整する + do { + @unlink($outputImagePathTemp); + imagejpeg($outputImage, $outputImagePathTemp, $quality); + $quality -= 10; + clearstatcache(); + } while (filesize($outputImagePathTemp) > $this->outputFileSize && $quality > 0); + break; + + case 'png': + imagepng($outputImage, $outputImagePathTemp); + break; + + case 'bmp': + imagewbmp($outputImage, $outputImagePathTemp); + break; + + default: + GC_Utils_Ex::gfPrintLog('不正な画像タイプ: '); + break; + } + + // メモリ開放 + imagedestroy($outputImage); + + $scale -= 0.1; + clearstatcache(); + } while (filesize($outputImagePathTemp) > $this->outputFileSize && $scale >= 0.5); + + rename($outputImagePathTemp, $outputImagePath); + + // メモリ開放 + imagedestroy($tempImage); + + $info['convert'] = TRUE; + } + + $info['outputImagePath'] = $outputImagePath; + $info['outputImageName'] = $outputImageName; + return $info; + + } + + // Setter + public function setOutputDir($outputDir) + { + $this->outputImageDir = $outputDir; + } + public function setImageType($imageType) + { + $this->outputImageType = $imageType; + } + public function setImageWidth($imageWidth) + { + $this->outputImageWidth = $imageWidth; + } + public function setImageHeight($imageHeight) + { + $this->outputImageHeight = $imageHeight; + } + public function setFileSize($fileSize) + { + $this->outputFileSize = $fileSize; + } + + // Getter + public function getOutputDir() + { + return $this->outputDir; + } + public function getImageType() + { + return $this->outputImageType; + } + public function getImageWidth() + { + return $this->outputImageWidth; + } + public function getImageHeight() + { + return $this->outputImageHeight; + } + + /* + * PrivateMethod + */ + public function beforeExecute() + { + } + + /** + * 透過GIFの色情報を返す + * + * @access private + * @param resource $image imagecreatetruecolor() のような画像作成関数が返す画像リソース。 + * @return array 色情報 + */ + public function getTransparentColor($image) + { + $max_x = imagesx($image) - 1; + $max_y = imagesy($image) - 1; + for ($x = 0; $x <= $max_x; $x++) { + for ($y = 0; $y <= $max_y; $y++) { + $color_index = imagecolorat($image, $x, $y); + $arrColors = imagecolorsforindex($image, $color_index); + if ($arrColors['alpha'] !== 0) { + return $arrColors; + } + } + } + + return array(); + } +} diff --git a/data/class/SC_Initial.php b/data/Eccube/Common/Initial.php similarity index 91% rename from data/class/SC_Initial.php rename to data/Eccube/Common/Initial.php index ceccdefa678..6c765973196 100644 --- a/data/class/SC_Initial.php +++ b/data/Eccube/Common/Initial.php @@ -1,33 +1,23 @@ host; - $netUrlCorrect = new Net_URL(SC_Utils_Ex::sfIsHTTPS() ? HTTPS_URL : HTTP_URL); + $netUrlCorrect = new \Net_URL(\Eccube\Common\Util\Utils::sfIsHTTPS() ? HTTPS_URL : HTTP_URL); // 設定上のホスト名 $correct_hostname = $netUrlCorrect->host; @@ -541,8 +531,8 @@ public function normalizeHostname() $msg .= 'リダイレクト先=' . var_export($correct_url, true) . ' '; trigger_error($msg, E_USER_WARNING); // リダイレクト(恒久的) - SC_Response_Ex::sendHttpStatus(301); - SC_Response_Ex::sendRedirect($correct_url); + \Eccube\Common\Response::sendHttpStatus(301); + \Eccube\Common\Response::sendRedirect($correct_url); } } } diff --git a/data/Eccube/Common/MobileEmoji.php b/data/Eccube/Common/MobileEmoji.php new file mode 100644 index 00000000000..c28274b7513 --- /dev/null +++ b/data/Eccube/Common/MobileEmoji.php @@ -0,0 +1,53 @@ +setOutputDir(MOBILE_IMAGE_REALDIR); $imageConverter->setImageType($imageType); $imageConverter->setImageWidth($imageWidth); diff --git a/data/class/SC_MobileUserAgent.php b/data/Eccube/Common/MobileUserAgent.php similarity index 73% rename from data/class/SC_MobileUserAgent.php rename to data/Eccube/Common/MobileUserAgent.php index 219efffbb42..a24722e540a 100644 --- a/data/class/SC_MobileUserAgent.php +++ b/data/Eccube/Common/MobileUserAgent.php @@ -1,33 +1,26 @@ isDoCoMo() || $objAgent->isVodafone()) { $id = $objAgent->getSerialNumber(); @@ -88,10 +81,10 @@ public function getId() * * @return string 携帯端末のモデルを表す文字列を返す。 */ - public function getModel() + public static function getModel() { - $objAgent =& Net_UserAgent_Mobile::singleton(); - if (Net_UserAgent_Mobile::isError($objAgent)) { + $objAgent =& \Net_UserAgent_Mobile::singleton(); + if (\Net_UserAgent_Mobile::isError($objAgent)) { return 'Unknown'; } elseif ($objAgent->isNonMobile()) { return $objAgent->getName(); @@ -112,13 +105,13 @@ public function getModel() * * @return boolean サポートしている場合は true、それ以外の場合は false を返す。 */ - public function isSupported() + public static function isSupported() { - $objAgent =& Net_UserAgent_Mobile::singleton(); + $objAgent =& \Net_UserAgent_Mobile::singleton(); // 携帯端末だと認識されたが、User-Agent の形式が未知の場合 - if (Net_UserAgent_Mobile::isError($objAgent)) { - GC_Utils_Ex::gfPrintLog($objAgent->toString()); + if (\Net_UserAgent_Mobile::isError($objAgent)) { + GcUtils::gfPrintLog($objAgent->toString()); return false; } @@ -145,10 +138,10 @@ public function isSupported() * * @return boolean サポートしている場合は true、それ以外の場合は false を返す。 */ - public function isMobile() + public static function isMobile() { - $objAgent =& Net_UserAgent_Mobile::singleton(); - if (Net_UserAgent_Mobile::isError($objAgent)) { + $objAgent =& \Net_UserAgent_Mobile::singleton(); + if (\Net_UserAgent_Mobile::isError($objAgent)) { return false; } else { return $objAgent->isDoCoMo() || $objAgent->isEZweb() || $objAgent->isVodafone(); diff --git a/data/class/SC_PageNavi.php b/data/Eccube/Common/PageNavi.php similarity index 88% rename from data/class/SC_PageNavi.php rename to data/Eccube/Common/PageNavi.php index b7bc20f0ea4..28d2d31d2d6 100644 --- a/data/class/SC_PageNavi.php +++ b/data/Eccube/Common/PageNavi.php @@ -1,26 +1,17 @@ "> @@ -39,7 +30,7 @@ document.forms[form].submit(); }; */ -class SC_PageNavi +class PageNavi { public $now_page; // 現在のページ番号 public $max_page; // 最終のページ番号 diff --git a/data/class/plugin/SC_Plugin_Base.php b/data/Eccube/Common/Plugin/PluginBase.php similarity index 77% rename from data/class/plugin/SC_Plugin_Base.php rename to data/Eccube/Common/Plugin/PluginBase.php index cc13d70cedd..4826db7af44 100644 --- a/data/class/plugin/SC_Plugin_Base.php +++ b/data/Eccube/Common/Plugin/PluginBase.php @@ -1,36 +1,26 @@ arrSelfInfo['plugin_hook_point'])) { $arrHookPoints = $this->arrSelfInfo['plugin_hook_point']; diff --git a/data/class/plugin/SC_Plugin_Installer.php b/data/Eccube/Common/Plugin/PluginInstaller.php similarity index 84% rename from data/class/plugin/SC_Plugin_Installer.php rename to data/Eccube/Common/Plugin/PluginInstaller.php index 1628f6a0bf6..952b45623a8 100644 --- a/data/class/plugin/SC_Plugin_Installer.php +++ b/data/Eccube/Common/Plugin/PluginInstaller.php @@ -1,26 +1,22 @@ log("exec sql: " . $sql['sql']); $objQuery->query($sql['sql'], $sql['params']); @@ -85,7 +81,7 @@ public function execPlugin() } $arrInsertQuery = $this->arrInstallData['insert']; - if (!SC_Utils_Ex::isBlank($arrInsertQuery)) { + if (!Utils::isBlank($arrInsertQuery)) { foreach ($arrInsertQuery as $query) { $objQuery->insert( $query['table'], @@ -99,7 +95,7 @@ public function execPlugin() } $arrUpdateQuery = $this->arrInstallData['update']; - if (!SC_Utils_Ex::isBlank($arrUpdateQuery)) { + if (!Utils::isBlank($arrUpdateQuery)) { foreach ($arrUpdateQuery as $query) { $objQuery->update( $query['table'], @@ -115,11 +111,11 @@ public function execPlugin() // プラグインのディレクトリコピー $arrCopyDirectories = $this->arrInstallData['copy_directory']; - if (!SC_Utils_Ex::isBlank($arrCopyDirectories)) { + if (!Utils::isBlank($arrCopyDirectories)) { foreach ($arrCopyDirectories as $directory) { $this->log("exec dir copy: " . $directory['src'] . ' -> ' . $directory['dist']); // ディレクトリコピー -> HTML配下とDATA配下を別関数にする - SC_Utils::copyDirectory( + Utils::copyDirectory( PLUGIN_UPLOAD_REALDIR . $plugin_code . DIRECTORY_SEPARATOR . $directory['src'], PLUGIN_HTML_REALDIR . $plugin_code . DIRECTORY_SEPARATOR . $directory['dist']); } @@ -128,7 +124,7 @@ public function execPlugin() // プラグインのファイルコピー $arrCopyFiles = $this->arrInstallData['copy_file']; - if (!SC_Utils_Ex::isBlank($arrCopyFiles)) { + if (!Utils::isBlank($arrCopyFiles)) { foreach ($arrCopyFiles as $file) { $this->log("exec file copy: " . $file['src'] . ' -> ' . $file['dist']); // ファイルコピー @@ -181,7 +177,7 @@ public function sql($sql, array $params = array()) protected function log($msg) { $msg = sprintf("%s %s: %s", $this->plugin_code, $this->exec_func, $msg); - GC_Utils::gfPrintLog($msg, PLUGIN_LOG_REALFILE); + GcUtils::gfPrintLog($msg, PLUGIN_LOG_REALFILE); } /** @@ -236,7 +232,7 @@ public function update($table, $arrVal, $where = '', $arrWhereVal = array(), $ar protected function verifySql($sql, $params) { // FIXME $paramsのチェックも行いたい. - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // force runを有効にし, システムエラーを回避する $objQuery->force_run = true; @@ -244,7 +240,7 @@ protected function verifySql($sql, $params) // prepareでSQLを検証 $sth = $objQuery->prepare($sql); - if (PEAR::isError($sth)) { + if (\PEAR::isError($sth)) { $error_message = $sth->message . ":" . $sth->userinfo; $objQuery->force_run = false; diff --git a/data/class/plugin/SC_Plugin_Util.php b/data/Eccube/Common/Plugin/PluginUtil.php similarity index 86% rename from data/class/plugin/SC_Plugin_Util.php rename to data/Eccube/Common/Plugin/PluginUtil.php index dd21ef80783..32250835226 100644 --- a/data/class/plugin/SC_Plugin_Util.php +++ b/data/Eccube/Common/Plugin/PluginUtil.php @@ -1,35 +1,28 @@ delete('dtb_plugin', $where, array($plugin_id)); $objQuery->delete('dtb_plugin_hookpoint', $where, array($plugin_id)); @@ -148,7 +141,7 @@ public function getPluginDirectory() */ public function getPluginHookPoint($plugin_id, $use_type = 1) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $cols = '*'; $from = 'dtb_plugin_hookpoint'; $where = 'plugin_id = ?'; @@ -177,7 +170,7 @@ public function getPluginHookPoint($plugin_id, $use_type = 1) */ public function getPluginHookPointList($use_type = 3) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('hook_point ASC, priority DESC'); $cols = 'dtb_plugin_hookpoint.*, dtb_plugin.priority, dtb_plugin.plugin_name'; $from = 'dtb_plugin_hookpoint LEFT JOIN dtb_plugin USING(plugin_id)'; @@ -240,7 +233,7 @@ public function checkExtension($key) */ public function setPluginHookPointChangeUse($plugin_hookpoint_id, $use_flg = 0) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqlval['use_flg'] = $use_flg; $objQuery->update('dtb_plugin_hookpoint', $sqlval, 'plugin_hookpoint_id = ?', array($plugin_hookpoint_id)); } @@ -256,16 +249,16 @@ public function checkConflictPlugin($plugin_id = '') // フックポイントを取得します. $where = 'T1.hook_point = ? AND NOT T1.plugin_id = ? AND T2.enable = ?'; if ($plugin_id > 0) { - $hookPoints = SC_Plugin_Util::getPluginHookPoint($plugin_id, ''); + $hookPoints = static::getPluginHookPoint($plugin_id, ''); } else { - $hookPoints = SC_Plugin_Util::getPluginHookPointList(1); + $hookPoints = static::getPluginHookPointList(1); $where .= ' AND T1.use_flg = 1'; } $conflict_alert_message = ''; $arrConflictPluginName = array(); $arrConflictHookPoint = array(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setGroupBy('T1.hook_point, T1.plugin_id, T2.plugin_name'); $table = 'dtb_plugin_hookpoint AS T1 LEFT JOIN dtb_plugin AS T2 ON T1.plugin_id = T2.plugin_id'; foreach ($hookPoints as $hookPoint) { diff --git a/data/class/SC_Product.php b/data/Eccube/Common/Product.php similarity index 83% rename from data/class/SC_Product.php rename to data/Eccube/Common/Product.php index c5ea95f79ed..ed1d002e525 100644 --- a/data/class/SC_Product.php +++ b/data/Eccube/Common/Product.php @@ -1,34 +1,30 @@ setWhere($where, $arrProductId); $arrProducts = $this->lists($objQuery); // 配列のキーを商品IDに - $arrProducts = SC_Utils_Ex::makeArrayIDToKey('product_id', $arrProducts); + $arrProducts = Utils::makeArrayIDToKey('product_id', $arrProducts); - // SC_Query::setOrder() の指定がない場合、$arrProductId で指定された商品IDの順に配列要素を並び替え + // Query::setOrder() の指定がない場合、$arrProductId で指定された商品IDの順に配列要素を並び替え if (strlen($objQuery->order) === 0) { $arrTmp = array(); foreach ($arrProductId as $product_id) { @@ -186,7 +182,7 @@ public function getListByProductIds(&$objQuery, $arrProductId = array()) } // 税込金額を設定する - SC_Product_Ex::setIncTaxToProducts($arrProducts); + static::setIncTaxToProducts($arrProducts); return $arrProducts; } @@ -199,7 +195,7 @@ public function getListByProductIds(&$objQuery, $arrProductId = array()) */ public function getDetail($product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query2::getSingletonInstance(); $from = $this->alldtlSQL(); $where = 'product_id = ?'; @@ -207,7 +203,7 @@ public function getDetail($product_id) $arrProduct = (array)$objQuery->getRow('*', $from, $where, $arrWhereVal); // 税込金額を設定する - SC_Product_Ex::setIncTaxToProduct($arrProduct); + static::setIncTaxToProduct($arrProduct); return $arrProduct; } @@ -295,17 +291,17 @@ public function setProductsClassByProductIds($arrProductId, $has_deleted = false // TODO: ここでprice01,price02を税込みにしてよいのか? _inctax を付けるべき?要検証 $arrClassCats2['price01'] = strlen($arrProductsClass['price01']) - ? number_format(SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProductsClass['price01'], $productId, $arrProductsClass['product_class_id'])) + ? number_format(TaxRuleHelper::sfCalcIncTax($arrProductsClass['price01'], $productId, $arrProductsClass['product_class_id'])) : ''; $arrClassCats2['price02'] = strlen($arrProductsClass['price02']) - ? number_format(SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProductsClass['price02'], $productId, $arrProductsClass['product_class_id'])) + ? number_format(TaxRuleHelper::sfCalcIncTax($arrProductsClass['price02'], $productId, $arrProductsClass['product_class_id'])) : ''; // ポイント $arrClassCats2['point'] - = number_format(SC_Utils_Ex::sfPrePoint($arrProductsClass['price02'], $arrProductsClass['point_rate'])); + = number_format(Utils::sfPrePoint($arrProductsClass['price02'], $arrProductsClass['point_rate'])); // 商品コード $arrClassCats2['product_code'] = $arrProductsClass['product_code']; @@ -333,9 +329,9 @@ public function setProductsClassByProductIds($arrProductId, $has_deleted = false } /** - * SC_Query インスタンスに設定された検索条件を使用して商品規格を取得する. + * Query インスタンスに設定された検索条件を使用して商品規格を取得する. * - * @param SC_Query $objQuery SC_Queryインスタンス + * @param Query $objQuery Queryインスタンス * @param array $params 検索パラメーターの配列 * @return array 商品規格の配列 */ @@ -396,18 +392,18 @@ public function getProductsClassByQuery(&$objQuery, $params) */ public function getProductsClass($productClassId) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query2::getSingletonInstance(); $objQuery->setWhere('product_class_id = ? AND T1.del_flg = 0'); $arrRes = $this->getProductsClassByQuery($objQuery, $productClassId); $arrProduct = (array) $arrRes[0]; // 税込計算 - if (!SC_Utils_Ex::isBlank($arrProduct['price01'])) { - $arrProduct['price01_inctax'] = SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price01'], $arrProduct['product_id'], $productClassId); + if (!Utils::isBlank($arrProduct['price01'])) { + $arrProduct['price01_inctax'] = TaxRuleHelper::sfCalcIncTax($arrProduct['price01'], $arrProduct['product_id'], $productClassId); } - if (!SC_Utils_Ex::isBlank($arrProduct['price02'])) { - $arrProduct['price02_inctax'] = SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price02'], $arrProduct['product_id'], $productClassId); + if (!Utils::isBlank($arrProduct['price02'])) { + $arrProduct['price02_inctax'] = TaxRuleHelper::sfCalcIncTax($arrProduct['price02'], $arrProduct['product_id'], $productClassId); } return $arrProduct; @@ -425,8 +421,8 @@ public function getProductsClassByProductIds($productIds = array(), $has_deleted if (empty($productIds)) { return array(); } - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $where = 'product_id IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', count($productIds)) . ')'; + $objQuery = Query2::getSingletonInstance(); + $where = 'product_id IN (' . Utils::repeatStrWithSeparator('?', count($productIds)) . ')'; if (!$has_deleted) { $where .= ' AND T1.del_flg = 0'; } @@ -460,10 +456,10 @@ public function getProductStatus($productIds) if (empty($productIds)) { return array(); } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query2::getSingletonInstance(); $cols = 'product_id, product_status_id'; $from = 'dtb_product_status'; - $where = 'del_flg = 0 AND product_id IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', count($productIds)) . ')'; + $where = 'del_flg = 0 AND product_id IN (' . Utils::repeatStrWithSeparator('?', count($productIds)) . ')'; $productStatus = $objQuery->select($cols, $from, $where, $productIds); $results = array(); foreach ($productStatus as $status) { @@ -489,7 +485,7 @@ public function setProductStatus($productId, $productStatusIds) $val['update_date'] = 'CURRENT_TIMESTAMP'; $val['del_flg'] = '0'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query2::getSingletonInstance(); $objQuery->delete('dtb_product_status', 'product_id = ?', array($productId)); foreach ($productStatusIds as $productStatusId) { if ($productStatusId == '') continue; @@ -539,7 +535,7 @@ public function reduceStock($productClassId, $quantity) return false; } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query2::getSingletonInstance(); $objQuery->update('dtb_products_class', array(), 'product_class_id = ?', array($productClassId), array('stock' => 'stock - ?'), array($quantity)); @@ -569,7 +565,7 @@ public static function setPriceTaxTo(&$arrProducts) $arrProduct['price02_min_format'] = number_format($arrProduct['price02_min']); $arrProduct['price02_max_format'] = number_format($arrProduct['price02_max']); - SC_Product_Ex::setIncTaxToProduct($arrProduct); + static::setIncTaxToProduct($arrProduct); $arrProduct['price01_min_inctax_format'] = number_format($arrProduct['price01_min_inctax']); $arrProduct['price01_max_inctax_format'] = number_format($arrProduct['price01_max_inctax']); @@ -599,7 +595,7 @@ public static function setPriceTaxTo(&$arrProducts) public static function setIncTaxToProducts(&$arrProducts) { foreach ($arrProducts as &$arrProduct) { - SC_Product_Ex::setIncTaxToProduct($arrProduct); + static::setIncTaxToProduct($arrProduct); } } @@ -611,10 +607,10 @@ public static function setIncTaxToProducts(&$arrProducts) */ public static function setIncTaxToProduct(&$arrProduct) { - $arrProduct['price01_min_inctax'] = isset($arrProduct['price01_min']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price01_min'], $arrProduct['product_id']) : null; - $arrProduct['price01_max_inctax'] = isset($arrProduct['price01_max']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price01_max'], $arrProduct['product_id']) : null; - $arrProduct['price02_min_inctax'] = isset($arrProduct['price02_min']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price02_min'], $arrProduct['product_id']) : null; - $arrProduct['price02_max_inctax'] = isset($arrProduct['price02_max']) ? SC_Helper_TaxRule_Ex::sfCalcIncTax($arrProduct['price02_max'], $arrProduct['product_id']) : null; + $arrProduct['price01_min_inctax'] = isset($arrProduct['price01_min']) ? TaxRuleHelper::sfCalcIncTax($arrProduct['price01_min'], $arrProduct['product_id']) : null; + $arrProduct['price01_max_inctax'] = isset($arrProduct['price01_max']) ? TaxRuleHelper::sfCalcIncTax($arrProduct['price01_max'], $arrProduct['product_id']) : null; + $arrProduct['price02_min_inctax'] = isset($arrProduct['price02_min']) ? TaxRuleHelper::sfCalcIncTax($arrProduct['price02_min'], $arrProduct['product_id']) : null; + $arrProduct['price02_max_inctax'] = isset($arrProduct['price02_max']) ? TaxRuleHelper::sfCalcIncTax($arrProduct['price02_max'], $arrProduct['product_id']) : null; } /** @@ -625,7 +621,7 @@ public static function setIncTaxToProduct(&$arrProduct) */ public function alldtlSQL($where_products_class = '') { - $objDBFactory = SC_DB_DBFactory_Ex::getInstance(); + $objDBFactory = DBFactory::getInstance(); return $objDBFactory->alldtlSQL($where_products_class); } @@ -641,7 +637,7 @@ public function alldtlSQL($where_products_class = '') public function prdclsSQL($where = '') { $where_clause = ''; - if (!SC_Utils_Ex::isBlank($where)) { + if (!Utils::isBlank($where)) { $where_clause = ' WHERE ' . $where; } $sql = <<< __EOS__ @@ -700,7 +696,7 @@ public function getProductDispConditions($tablename = null) */ public function getCategoryIds($product_id, $include_hidden = false) { if ($this->isValidProductId($product_id, $include_hidden)) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query2::getSingletonInstance(); $category_id = $objQuery->getCol('category_id', 'dtb_product_categories', 'product_id = ?', array($product_id)); } else { // 不正な場合は、空の配列を返す。 @@ -730,9 +726,9 @@ public function isValidProductId($product_id, $include_hidden = false, $include_ $where .= 'del_flg = 0'; } if ( - SC_Utils_Ex::sfIsInt($product_id) - && !SC_Utils_Ex::sfIsZeroFilling($product_id) - && SC_Helper_DB_Ex::sfIsRecord('dtb_products', 'product_id', array($product_id), $where) + Utils::sfIsInt($product_id) + && !Utils::sfIsZeroFilling($product_id) + && DbHelper::isRecord('dtb_products', 'product_id', array($product_id), $where) ) { return true; } diff --git a/data/class/SC_Query.php b/data/Eccube/Common/Query.php similarity index 83% rename from data/class/SC_Query.php rename to data/Eccube/Common/Query.php index c9d0988362d..5933f3cfeab 100644 --- a/data/class/SC_Query.php +++ b/data/Eccube/Common/Query.php @@ -1,35 +1,27 @@ conn = MDB2::connect($dsn, $options); + $this->conn = \MDB2::connect($dsn, $options); } else { - $this->conn = MDB2::singleton($dsn, $options); + $this->conn = \MDB2::singleton($dsn, $options); } - if (!PEAR::isError($this->conn)) { + if (!\PEAR::isError($this->conn)) { $this->conn->setCharset('utf8'); $this->conn->setFetchMode(MDB2_FETCHMODE_ASSOC); } // XXX 上書きインストール時にDBを変更するケースを想定し第1引数を与えている。 - $this->dbFactory = SC_DB_DBFactory_Ex::getInstance($this->conn->dsn['phptype']); + $this->dbFactory = DB\DBFactory::getInstance($this->conn->dsn['phptype']); $this->dbFactory->initObjQuery($this); $this->force_run = $force_run; } /** - * シングルトンの SC_Query インスタンスを取得する. + * シングルトンの Query インスタンスを取得する. * * @param string $dsn データソース名 * @param boolean $force_run エラーが発生しても処理を続行する場合 true * @param boolean $new 新規に接続を行うかどうか - * @return SC_Query シングルトンの SC_Query インスタンス + * @return Query シングルトンの Query インスタンス */ public static function getSingletonInstance($dsn = '', $force_run = false, $new = false) { - $objThis = SC_Query_Ex::getPoolInstance($dsn); + $objThis = static::getPoolInstance($dsn); if (is_null($objThis)) { - $objThis = SC_Query_Ex::setPoolInstance(new SC_Query_Ex($dsn, $force_run, $new), $dsn); + $objThis = static::setPoolInstance(new static($dsn, $force_run, $new), $dsn); } /* * 歴史的な事情で、このメソッドの呼び出し元は参照で受け取る確率がある。 - * 退避しているインスタンスをそのまま返すと、退避している SC_Query の + * 退避しているインスタンスをそのまま返すと、退避している Query の * プロパティを直接書き換えることになる。これを回避するため、クローンを返す。 * 厳密な意味でのシングルトンではないが、パフォーマンス的に大差は無い。 */ @@ -117,12 +109,12 @@ public static function getSingletonInstance($dsn = '', $force_run = false, $new /** * エラー判定を行う. * - * @deprecated PEAR::isError() を使用して下さい + * @deprecated \PEAR::isError() を使用して下さい * @return boolean */ public function isError() { - if (PEAR::isError($this->conn)) { + if (\PEAR::isError($this->conn)) { return true; } @@ -166,10 +158,10 @@ public function exists($table, $where = '', $arrWhereVal = array()) * @param string $from テーブル名 * @param string $where WHERE句 * @param array $arrWhereVal プレースホルダ - * @param integer $fetchmode 使用するフェッチモード。デフォルトは MDB2_FETCHMODE_ASSOC。 + * @param integer $fetchmode 使用するフェッチモード。デフォルトは \MDB2_FETCHMODE_ASSOC。 * @return array|null */ - public function select($cols, $from = '', $where = '', $arrWhereVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) + public function select($cols, $from = '', $where = '', $arrWhereVal = array(), $fetchmode = \MDB2_FETCHMODE_ASSOC) { $sqlse = $this->getSql($cols, $from, $where, $arrWhereVal); @@ -195,8 +187,8 @@ public function getLastQuery($disp = true) /** * トランザクションをコミットする. * - * @return MDB2_OK 成功した場合は MDB2_OK; - * 失敗した場合は PEAR::Error オブジェクト + * @return \MDB2_OK 成功した場合は \MDB2_OK; + * 失敗した場合は \PEAR::Error オブジェクト */ public function commit() { @@ -210,8 +202,8 @@ public function commit() /** * トランザクションを開始する. * - * @return MDB2_OK 成功した場合は MDB2_OK; - * 失敗した場合は PEAR::Error オブジェクト + * @return \MDB2_OK 成功した場合は \MDB2_OK; + * 失敗した場合は \PEAR::Error オブジェクト */ public function begin() { @@ -221,8 +213,8 @@ public function begin() /** * トランザクションをロールバックする. * - * @return MDB2_OK 成功した場合は MDB2_OK; - * 失敗した場合は PEAR::Error オブジェクト + * @return \MDB2_OK 成功した場合は \MDB2_OK; + * 失敗した場合は \PEAR::Error オブジェクト */ public function rollback() { @@ -246,9 +238,9 @@ public function inTransaction() /** * 更新系の SQL を実行する. * - * この関数は SC_Query::query() のエイリアスです. + * この関数は Query::query() のエイリアスです. * - * FIXME MDB2::exec() の実装であるべき + * FIXME \MDB2::exec() の実装であるべき */ public function exec($str, $arrVal = array()) { @@ -264,17 +256,17 @@ public function exec($str, $arrVal = array()) * @param integer $fetchmode 使用するフェッチモード。デフォルトは DB_FETCHMODE_ASSOC。 * @return boolean 結果 */ - public function doCallbackAll($cbFunc, $sql, $arrVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) + public function doCallbackAll($cbFunc, $sql, $arrVal = array(), $fetchmode = \MDB2_FETCHMODE_ASSOC) { $sql = $this->dbFactory->sfChangeMySQL($sql); $sth =& $this->prepare($sql); - if (PEAR::isError($sth) && $this->force_run) { + if (\PEAR::isError($sth) && $this->force_run) { return; } $affected =& $this->execute($sth, $arrVal); - if (PEAR::isError($affected) && $this->force_run) { + if (\PEAR::isError($affected) && $this->force_run) { return; } @@ -297,17 +289,17 @@ public function doCallbackAll($cbFunc, $sql, $arrVal = array(), $fetchmode = MDB * @param integer $fetchmode 使用するフェッチモード。デフォルトは DB_FETCHMODE_ASSOC。 * @return array データを含む2次元配列。失敗した場合に 0 または DB_Error オブジェクトを返します。 */ - public function getAll($sql, $arrVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) + public function getAll($sql, $arrVal = array(), $fetchmode = \MDB2_FETCHMODE_ASSOC) { $sql = $this->dbFactory->sfChangeMySQL($sql); $sth =& $this->prepare($sql); - if (PEAR::isError($sth) && $this->force_run) { + if (\PEAR::isError($sth) && $this->force_run) { return; } $affected =& $this->execute($sth, $arrVal); - if (PEAR::isError($affected) && $this->force_run) { + if (\PEAR::isError($affected) && $this->force_run) { return; } @@ -332,7 +324,7 @@ public function getAll($sql, $arrVal = array(), $fetchmode = MDB2_FETCHMODE_ASSO */ public function getSql($cols, $from = '', $where = '', &$arrWhereVal = null) { - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DB\DBFactory::getInstance(); $sqlse = "SELECT $cols"; @@ -362,10 +354,10 @@ public function getSql($cols, $from = '', $where = '', &$arrWhereVal = null) /** * SELECT 文の末尾に付与する SQL を設定する. * - * この関数で設定した値は SC_Query::getSql() で使用されます. + * この関数で設定した値は Query::getSql() で使用されます. * * @param string $str 付与する SQL 文 - * @return SC_Query 自分自身のインスタンス + * @return Query 自分自身のインスタンス */ public function setOption($str) { @@ -377,11 +369,11 @@ public function setOption($str) /** * SELECT 文に付与する LIMIT, OFFSET 句を設定する. * - * この関数で設定した値は SC_Query::getSql() で使用されます. + * この関数で設定した値は Query::getSql() で使用されます. * * @param integer $limit LIMIT 句に付与する値 * @param integer $offset OFFSET 句に付与する値 - * @return SC_Query 自分自身のインスタンス + * @return Query 自分自身のインスタンス */ public function setLimitOffset($limit, $offset = 0) { @@ -395,10 +387,10 @@ public function setLimitOffset($limit, $offset = 0) /** * SELECT 文に付与する GROUP BY 句を設定する. * - * この関数で設定した値は SC_Query::getSql() で使用されます. + * この関数で設定した値は Query::getSql() で使用されます. * * @param string $str GROUP BY 句に付与する文字列 - * @return SC_Query 自分自身のインスタンス + * @return Query 自分自身のインスタンス */ public function setGroupBy($str) { @@ -414,10 +406,10 @@ public function setGroupBy($str) /** * SELECT 文の WHERE 句に付与する AND 条件を設定する. * - * この関数で設定した値は SC_Query::getSql() で使用されます. + * この関数で設定した値は Query::getSql() で使用されます. * * @param string $str WHERE 句に付与する AND 条件の文字列 - * @return SC_Query 自分自身のインスタンス + * @return Query 自分自身のインスタンス */ public function andWhere($str) { @@ -433,10 +425,10 @@ public function andWhere($str) /** * SELECT 文の WHERE 句に付与する OR 条件を設定する. * - * この関数で設定した値は SC_Query::getSql() で使用されます. + * この関数で設定した値は Query::getSql() で使用されます. * * @param string $str WHERE 句に付与する OR 条件の文字列 - * @return SC_Query 自分自身のインスタンス + * @return Query 自分自身のインスタンス */ public function orWhere($str) { @@ -452,11 +444,11 @@ public function orWhere($str) /** * SELECT 文に付与する WHERE 句を設定する. * - * この関数で設定した値は SC_Query::getSql() で使用されます. + * この関数で設定した値は Query::getSql() で使用されます. * * @param string $where WHERE 句に付与する文字列 * @param mixed $arrWhereVal プレースホルダ - * @return SC_Query 自分自身のインスタンス + * @return Query 自分自身のインスタンス */ public function setWhere($where = '', $arrWhereVal = array()) { @@ -469,10 +461,10 @@ public function setWhere($where = '', $arrWhereVal = array()) /** * SELECT 文に付与する ORDER BY 句を設定する. * - * この関数で設定した値は SC_Query::getSql() で使用されます. + * この関数で設定した値は Query::getSql() で使用されます. * * @param string $str ORDER BY 句に付与する文字列 - * @return SC_Query 自分自身のインスタンス + * @return Query 自分自身のインスタンス */ public function setOrder($str) { @@ -488,10 +480,10 @@ public function setOrder($str) /** * SELECT 文に付与する LIMIT 句を設定する. * - * この関数で設定した値は SC_Query::getSql() で使用されます. + * この関数で設定した値は Query::getSql() で使用されます. * * @param integer $limit LIMIT 句に設定する値 - * @return SC_Query 自分自身のインスタンス + * @return Query 自分自身のインスタンス */ public function setLimit($limit) { @@ -505,10 +497,10 @@ public function setLimit($limit) /** * SELECT 文に付与する OFFSET 句を設定する. * - * この関数で設定した値は SC_Query::getSql() で使用されます. + * この関数で設定した値は Query::getSql() で使用されます. * * @param integer $offset OFFSET 句に設定する値 - * @return SC_Query 自分自身のインスタンス + * @return Query 自分自身のインスタンス */ public function setOffset($offset) { @@ -572,7 +564,7 @@ public function insert($table, $arrVal, $arrSql = array(), $arrSqlVal = array(), } // INSERT文の実行 - $ret = $this->query($sqlin, $arrValForQuery, false, null, MDB2_PREPARE_MANIP); + $ret = $this->query($sqlin, $arrValForQuery, false, null, \MDB2_PREPARE_MANIP); return $ret; } @@ -632,7 +624,7 @@ public function update($table, $arrVal, $where = '', $arrWhereVal = array(), $ar } // UPDATE文の実行 - return $this->query($sqlup, $arrValForQuery, false, null, MDB2_PREPARE_MANIP); + return $this->query($sqlup, $arrValForQuery, false, null, \MDB2_PREPARE_MANIP); } /** @@ -697,12 +689,12 @@ public function getOne($sql, $arrVal = array()) $sql = $this->dbFactory->sfChangeMySQL($sql); $sth =& $this->prepare($sql); - if (PEAR::isError($sth) && $this->force_run) { + if (\PEAR::isError($sth) && $this->force_run) { return; } $affected =& $this->execute($sth, $arrVal); - if (PEAR::isError($affected) && $this->force_run) { + if (\PEAR::isError($affected) && $this->force_run) { return; } @@ -722,21 +714,21 @@ public function getOne($sql, $arrVal = array()) * @param string $col カラム名 * @param string $where WHERE句 * @param array $arrWhereVal プレースホルダ配列 - * @param integer $fetchmode 使用するフェッチモード。デフォルトは MDB2_FETCHMODE_ASSOC。 + * @param integer $fetchmode 使用するフェッチモード。デフォルトは \MDB2_FETCHMODE_ASSOC。 * @return array array('カラム名' => '値', ...)の連想配列 */ - public function getRow($col, $table = '', $where = '', $arrWhereVal = array(), $fetchmode = MDB2_FETCHMODE_ASSOC) + public function getRow($col, $table = '', $where = '', $arrWhereVal = array(), $fetchmode = \MDB2_FETCHMODE_ASSOC) { $sql = $this->getSql($col, $table, $where, $arrWhereVal); $sql = $this->dbFactory->sfChangeMySQL($sql); $sth =& $this->prepare($sql); - if (PEAR::isError($sth) && $this->force_run) { + if (\PEAR::isError($sth) && $this->force_run) { return; } $affected =& $this->execute($sth, $arrWhereVal); - if (PEAR::isError($affected) && $this->force_run) { + if (\PEAR::isError($affected) && $this->force_run) { return; } @@ -764,12 +756,12 @@ public function getCol($col, $table = '', $where = '', $arrWhereVal = array()) $sql = $this->dbFactory->sfChangeMySQL($sql); $sth =& $this->prepare($sql); - if (PEAR::isError($sth) && $this->force_run) { + if (\PEAR::isError($sth) && $this->force_run) { return; } $affected =& $this->execute($sth, $arrWhereVal); - if (PEAR::isError($affected) && $this->force_run) { + if (\PEAR::isError($affected) && $this->force_run) { return; } @@ -797,7 +789,7 @@ public function delete($table, $where = '', $arrWhereVal = array()) } else { $sqlde = 'DELETE FROM ' . $this->conn->quoteIdentifier($table) . ' WHERE ' . $where; } - $ret = $this->query($sqlde, $arrWhereVal, false, null, MDB2_PREPARE_MANIP); + $ret = $this->query($sqlde, $arrWhereVal, false, null, \MDB2_PREPARE_MANIP); return $ret; } @@ -829,7 +821,7 @@ public function currVal($seq_name) * * @param string $seq_name シーケンス名 * @param integer $start 設定するシーケンス値 - * @return MDB2_OK + * @return \MDB2_OK */ public function setVal($seq_name, $start) { @@ -837,12 +829,12 @@ public function setVal($seq_name, $start) // XXX 値変更の役割のため、存在チェックは行なわない。存在しない場合、ここでエラーとなる。 $ret = $objManager->dropSequence($seq_name); - if (PEAR::isError($ret)) { + if (\PEAR::isError($ret)) { $this->error("setVal -> dropSequence [$seq_name]"); } $ret = $objManager->createSequence($seq_name, $start); - if (PEAR::isError($ret)) { + if (\PEAR::isError($ret)) { $this->error("setVal -> createSequence [$seq_name] [$start]"); } @@ -856,22 +848,22 @@ public function setVal($seq_name, $start) * * @param string $n 実行する SQL 文 * @param array $arr プレースホルダに挿入する値 - * @param boolean $ignore_err MDB2切替で無効化されている (エラーが発生しても処理を続行する場合 true) + * @param boolean $ignore_err \MDB2切替で無効化されている (エラーが発生しても処理を続行する場合 true) * @param mixed $types プレースホルダの型指定 デフォルトnull = string * @param mixed $result_types 返値の型指定またはDML実行(MDB2_PREPARE_MANIP) * @return array SQL の実行結果の配列 */ - public function query($n ,$arr = array(), $ignore_err = false, $types = null, $result_types = MDB2_PREPARE_RESULT) + public function query($n ,$arr = array(), $ignore_err = false, $types = null, $result_types = \MDB2_PREPARE_RESULT) { $n = $this->dbFactory->sfChangeMySQL($n); $sth =& $this->prepare($n, $types, $result_types); - if (PEAR::isError($sth) && $this->force_run) { + if (\PEAR::isError($sth) && $this->force_run) { return $sth; } $result = $this->execute($sth, $arr); - if (PEAR::isError($result) && $this->force_run) { + if (\PEAR::isError($result) && $this->force_run) { return $sth; } @@ -974,11 +966,11 @@ public function getTableInfo($table) /** * 値を適切にクォートする. * - * TODO MDB2 に対応するための暫定的な措置. + * TODO \MDB2 に対応するための暫定的な措置. * プレースホルダが使用できない実装があるため. - * 本来であれば, MDB2::prepare() を適切に使用するべき + * 本来であれば, \MDB2::prepare() を適切に使用するべき * - * @see MDB2::quote() + * @see \MDB2::quote() * @param string $val クォートを行う文字列 * @return string クォートされた文字列 */ @@ -1014,12 +1006,12 @@ public function extractOnlyColsOf($table, $arrParams) * @param string $sql プリペアドステートメントを構築する SQL * @param mixed $types プレースホルダの型指定 デフォルト null * @param mixed $result_types 返値の型指定またはDML実行(MDB2_PREPARE_MANIP)、nullは指定無し - * @return MDB2_Statement_Common プリペアドステートメントインスタンス + * @return \MDB2_Statement_Common プリペアドステートメントインスタンス */ - public function prepare($sql, $types = null, $result_types = MDB2_PREPARE_RESULT) + public function prepare($sql, $types = null, $result_types = \MDB2_PREPARE_RESULT) { - $sth =& $this->conn->prepare($sql, $types, $result_types); - if (PEAR::isError($sth)) { + $sth = $this->conn->prepare($sql, $types, $result_types); + if (\PEAR::isError($sth)) { $msg = $this->traceError($sth, $sql); $this->error($msg); } @@ -1031,16 +1023,16 @@ public function prepare($sql, $types = null, $result_types = MDB2_PREPARE_RESULT * プリペアドクエリを実行する. * * @access private - * @param MDB2_Statement_Common プリペアドステートメントインスタンス + * @param \MDB2_Statement_Common プリペアドステートメントインスタンス * @param array $arrVal プレースホルダに挿入する配列 - * @return MDB2_Result 結果セットのインスタンス + * @return \MDB2_Result 結果セットのインスタンス */ public function execute(&$sth, $arrVal = array()) { - // #1658 (SC_Query の各種メソッドでプレースホルダの数に誤りがあるとメモリリークが発生する) 対応 - // TODO 現状は PEAR 内のバックトレースを抑制することで、メモリーリークの影響を小さくしている。 + // #1658 (Query の各種メソッドでプレースホルダの数に誤りがあるとメモリリークが発生する) 対応 + // TODO 現状は \PEAR 内のバックトレースを抑制することで、メモリーリークの影響を小さくしている。 // 根本的には、そのバックトレースが、どこに居座っているかを特定して、対策すべき。 - $pear_property =& PEAR5::getStaticProperty('PEAR_Error', 'skiptrace'); + $pear_property =& \PEAR5::getStaticProperty('\PEAR_Error', 'skiptrace'); $bak = $pear_property; $pear_property = true; @@ -1050,7 +1042,7 @@ public function execute(&$sth, $arrVal = array()) $pear_property = $bak; - if (PEAR::isError($affected)) { + if (\PEAR::isError($affected)) { $sql = isset($sth->query) ? $sth->query : ''; $msg = $this->traceError($affected, $sql, $arrVal); $this->error($msg); @@ -1066,7 +1058,7 @@ public function execute(&$sth, $arrVal = array()) * XXX trigger_error で処理する場合、1024文字以内に抑える必要がある。 * XXX 重要な情報を先頭に置き、冗長になりすぎないように留意する。 * @access private - * @param PEAR::Error $error PEAR::Error インスタンス + * @param \PEAR::Error $error \PEAR::Error インスタンス * @param string $sql エラーの発生した SQL 文 * @param array $arrVal プレースホルダ * @return string トレースしたエラー文字列 @@ -1080,8 +1072,8 @@ public function traceError($error, $sql = '', $arrVal = false) $err .= $error->getMessage() . "\n"; $err .= rtrim($error->getUserInfo()) . "\n"; - // PEAR::MDB2 内部のスタックトレースを出力する場合、下記のコメントを外す。 - // $err .= GC_Utils_Ex::toStringBacktrace($error->getBackTrace()); + // \PEAR::MDB2 内部のスタックトレースを出力する場合、下記のコメントを外す。 + // $err .= GcUtils::toStringBacktrace($error->getBackTrace()); return $err; } @@ -1094,7 +1086,7 @@ public function error($msg) if (!$this->force_run) { trigger_error($msg, E_USER_ERROR); } else { - GC_Utils_Ex::gfPrintLog($msg, ERROR_LOG_REALFILE, true); + GcUtils::gfPrintLog($msg, ERROR_LOG_REALFILE, true); } } @@ -1108,17 +1100,17 @@ public function error($msg) * @param mixed $result_types 返値の型指定またはDML実行(MDB2_PREPARE_MANIP) * @return array 実行結果の配列 */ - public function getQueryDefsFields($n ,$arr = array(), $ignore_err = false, $types = null, $result_types = MDB2_PREPARE_RESULT) + public function getQueryDefsFields($n ,$arr = array(), $ignore_err = false, $types = null, $result_types = \MDB2_PREPARE_RESULT) { $n = $this->dbFactory->sfChangeMySQL($n); $sth =& $this->prepare($n, $types, $result_types); - if (PEAR::isError($sth) && ($this->force_run || $ignore_err)) { + if (\PEAR::isError($sth) && ($this->force_run || $ignore_err)) { return; } $result = $this->execute($sth, $arr); - if (PEAR::isError($result) && ($this->force_run || $ignore_err)) { + if (\PEAR::isError($result) && ($this->force_run || $ignore_err)) { return; } $arrRet = $result->getColumnNames(); @@ -1140,11 +1132,15 @@ private function lfStartDbTraceLog(&$objSth, &$arrVal) if (!defined('SQL_QUERY_LOG_MODE') || SQL_QUERY_LOG_MODE === 0) { return; } - $arrInfo =& $GLOBALS['_SC_Query_TraceLogInfo']; + $arrInfo =& $GLOBALS['_Query_TraceLogInfo']; if (!isset($arrInfo['http_request_id'])) { $arrInfo['http_request_id'] = uniqid(); } + if (!array_key_exists('coun', $arrInfo)) { + $arrInfo['count'] = 0; + } + $arrStartInfo = array( 'http_request_id' => $arrInfo['http_request_id'], 'time_start' => microtime(true), @@ -1159,7 +1155,7 @@ private function lfStartDbTraceLog(&$objSth, &$arrVal) $msg = "[execute start {$arrStartInfo['http_request_id']}#{$arrStartInfo['count']}]\n" . 'SQL: ' . $objSth->query . "\n" . 'PlaceHolder: ' . var_export($arrVal, true) . "\n"; - GC_Utils_Ex::gfPrintLog($msg, DB_LOG_REALFILE); + GcUtils::gfPrintLog($msg, DB_LOG_REALFILE); return $arrStartInfo; } @@ -1193,34 +1189,34 @@ private function lfEndDbTraceLog(&$arrStartInfo, &$objSth, &$arrVal) } $msg .= 'execution time: ' . sprintf('%.2f sec', $timeExecTime) . "\n"; - GC_Utils_Ex::gfPrintLog($msg, DB_LOG_REALFILE); + GcUtils::gfPrintLog($msg, DB_LOG_REALFILE); } /** * インスタンスをプールする * - * @param SC_Query $objThis プールするインスタンス + * @param Query $objThis プールするインスタンス * @param string $dsn データソース名 - * @return SC_Query プールしたインスタンス + * @return Query プールしたインスタンス */ public static function setPoolInstance(&$objThis, $dsn = '') { $key_str = serialize($dsn); - return SC_Query_Ex::$arrPoolInstance[$key_str] = $objThis; + return static::$arrPoolInstance[$key_str] = $objThis; } /** * プールしているインスタンスを取得する * * @param string $dsn データソース名 - * @return SC_Query|null + * @return Query|null */ public static function getPoolInstance($dsn = '') { $key_str = serialize($dsn); - if (isset(SC_Query_Ex::$arrPoolInstance[$key_str])) { - return SC_Query_Ex::$arrPoolInstance[$key_str]; + if (isset(static::$arrPoolInstance[$key_str])) { + return static::$arrPoolInstance[$key_str]; } } } diff --git a/data/class/SC_Response.php b/data/Eccube/Common/Response.php similarity index 88% rename from data/class/SC_Response.php rename to data/Eccube/Common/Response.php index 462cc912681..a388b78429e 100644 --- a/data/class/SC_Response.php +++ b/data/Eccube/Common/Response.php @@ -1,33 +1,30 @@ plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance(); if (is_object($objPlugin)) { $arrBacktrace = debug_backtrace(); @@ -127,10 +124,10 @@ public function actionExit() * @return void * @static */ - public function sendRedirect($location, $arrQueryString = array(), $inheritQueryString = false, $useSsl = null) + public static function sendRedirect($location, $arrQueryString = array(), $inheritQueryString = false, $useSsl = null) { // ローカルフックポイント処理 - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance(); if (is_object($objPlugin)) { $arrBacktrace = debug_backtrace(); @@ -160,7 +157,7 @@ public function sendRedirect($location, $arrQueryString = array(), $inheritQuery // url-path → URL 変換 if ($location[0] === '/') { - $netUrl = new Net_URL($location); + $netUrl = new \Net_URL($location); $location = $netUrl->getUrl(); } @@ -181,9 +178,9 @@ public function sendRedirect($location, $arrQueryString = array(), $inheritQuery // 現在のURLからのパス } else { if (!is_bool($useSsl)) { - $useSsl = SC_Utils_Ex::sfIsHTTPS(); + $useSsl = Utils::sfIsHTTPS(); } - $netUrl = new Net_URL($useSsl ? HTTPS_URL : HTTP_URL); + $netUrl = new \Net_URL($useSsl ? HTTPS_URL : HTTP_URL); $netUrl->path = dirname($_SERVER['SCRIPT_NAME']) . '/' . $location; $url = $netUrl->getUrl(); } @@ -195,7 +192,7 @@ public function sendRedirect($location, $arrQueryString = array(), $inheritQuery trigger_error('', E_USER_ERROR); } - $netUrl = new Net_URL($url); + $netUrl = new \Net_URL($url); if ($inheritQueryString && !empty($_SERVER['QUERY_STRING'])) { $arrQueryStringBackup = $netUrl->querystring; @@ -206,14 +203,14 @@ public function sendRedirect($location, $arrQueryString = array(), $inheritQuery $netUrl->querystring = array_merge($netUrl->querystring, $arrQueryString); - $session = SC_SessionFactory_Ex::getInstance(); - if ((SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) + $session = SessionFactory::getInstance(); + if ((Display::detectDevice() == DEVICE_TYPE_MOBILE) || ($session->useCookie() == false) ) { $netUrl->addQueryString(session_name(), session_id()); } - $netUrl->addQueryString(TRANSACTION_ID_NAME, SC_Helper_Session_Ex::getToken()); + $netUrl->addQueryString(TRANSACTION_ID_NAME, SessionHelper::getToken()); $url = $netUrl->getURL(); header("Location: $url"); @@ -231,23 +228,23 @@ public function sendRedirect($location, $arrQueryString = array(), $inheritQuery public function sendRedirectFromUrlPath($location, $arrQueryString = array(), $inheritQueryString = false, $useSsl = null) { $location = ROOT_URLPATH . ltrim($location, '/'); - SC_Response_Ex::sendRedirect($location, $arrQueryString, $inheritQueryString, $useSsl); + static::sendRedirect($location, $arrQueryString, $inheritQueryString, $useSsl); } /** * @static */ - public function reload($arrQueryString = array(), $removeQueryString = false) + public static function reload($arrQueryString = array(), $removeQueryString = false) { // 現在の URL を取得 - $netUrl = new Net_URL($_SERVER['REQUEST_URI']); + $netUrl = new \Net_URL($_SERVER['REQUEST_URI']); if (!$removeQueryString) { $arrQueryString = array_merge($netUrl->querystring, $arrQueryString); } $netUrl->querystring = array(); - SC_Response_Ex::sendRedirect($netUrl->getURL(), $arrQueryString); + static::sendRedirect($netUrl->getURL(), $arrQueryString); } public function setHeader($headers) diff --git a/data/class/SC_SelectSql.php b/data/Eccube/Common/SelectSql.php similarity index 89% rename from data/class/SC_SelectSql.php rename to data/Eccube/Common/SelectSql.php index 6d2da8ac70e..f72ed67cb07 100644 --- a/data/class/SC_SelectSql.php +++ b/data/Eccube/Common/SelectSql.php @@ -1,28 +1,21 @@ host = SMTP_HOST; $this->port = SMTP_PORT; - // PEAR::Mailを使ってメール送信オブジェクト作成 - $this->objMail =& Mail::factory($this->backend, + // \PEAR::Mailを使ってメール送信オブジェクト作成 + $this->objMail = \Mail::factory($this->backend, $this->getBackendParams($this->backend)); - if (PEAR::isError($this->objMail)) { + if (\PEAR::isError($this->objMail)) { // XXX 環境によっては文字エンコードに差異がないか些か心配 trigger_error($this->objMail->getMessage(), E_USER_ERROR); } @@ -158,8 +152,8 @@ public function setHost($host) 'host' => $this->host, 'port' => $this->port ); - // PEAR::Mailを使ってメール送信オブジェクト作成 - $this->objMail =& Mail::factory('smtp', $arrHost); + // \PEAR::Mailを使ってメール送信オブジェクト作成 + $this->objMail = \Mail::factory('smtp', $arrHost); } /** @@ -175,8 +169,8 @@ public function setPort($port) 'host' => $this->host, 'port' => $this->port ); - // PEAR::Mailを使ってメール送信オブジェクト作成 - $this->objMail =& Mail::factory('smtp', $arrHost); + // \PEAR::Mailを使ってメール送信オブジェクト作成 + $this->objMail = \Mail::factory('smtp', $arrHost); } // 名前<メールアドレス>の形式を生成 @@ -299,7 +293,7 @@ public function getHTMLHeader() public function getRecip() { switch ($this->backend) { - // PEAR::Mail_mail#send は、(他のメーラーバックエンドと異なり) 第1引数を To: として扱う。Cc: や Bcc: は、ヘッダー情報から処理する。 + // \PEAR::Mail_mail#send は、(他のメーラーバックエンドと異なり) 第1引数を To: として扱う。Cc: や Bcc: は、ヘッダー情報から処理する。 case 'mail': return $this->to; @@ -323,12 +317,12 @@ public function sendMail($isHtml = false) $recip = $this->getRecip(); // メール送信 $result = $this->objMail->send($recip, $header, $this->body); - if (PEAR::isError($result)) { + if (\PEAR::isError($result)) { // XXX Windows 環境では SJIS でメッセージを受け取るようなので変換する。 $msg = mb_convert_encoding($result->getMessage(), CHAR_CODE, 'auto'); $msg = 'メール送信に失敗しました。[' . $msg . ']'; trigger_error($msg, E_USER_WARNING); - GC_Utils_Ex::gfDebugLog($header); + GcUtils::gfDebugLog($header); return false; } @@ -373,8 +367,8 @@ public function getBackendParams($backend) ); if (defined('SMTP_USER') && defined('SMTP_PASSWORD') - && !SC_Utils_Ex::isBlank(SMTP_USER) - && !SC_Utils_Ex::isBlank(SMTP_PASSWORD)) { + && !Utils::isBlank(SMTP_USER) + && !Utils::isBlank(SMTP_PASSWORD)) { $arrParams['auth'] = true; $arrParams['username'] = SMTP_USER; $arrParams['password'] = SMTP_PASSWORD; diff --git a/data/class/SC_Session.php b/data/Eccube/Common/Session.php similarity index 74% rename from data/class/SC_Session.php rename to data/Eccube/Common/Session.php index a2fe2c59d4d..e4d5eb71cdd 100644 --- a/data/class/SC_Session.php +++ b/data/Eccube/Common/Session.php @@ -1,28 +1,23 @@ login_id.' auth='.$this->authority.' sid='.$this->sid); + GcUtils::gfPrintLog('access : user='.$this->login_id.' auth='.$this->authority.' sid='.$this->sid); } else { // ログに記録する - GC_Utils_Ex::gfPrintLog('access error.'); + GcUtils::gfPrintLog('access error.'); } } /* 認証成功の判定 */ public function IsSuccess() { if ($this->cert == CERT_STRING) { - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $admin_path = strtolower(preg_replace('/\/+/', '/', $_SERVER['SCRIPT_NAME'])); $arrPERMISSION = array_change_key_case($masterData->getMasterData('mtb_permission')); if (isset($arrPERMISSION[$admin_path])) { @@ -125,7 +120,7 @@ public function getUniqId() public function setUniqId() { // 予測されないようにランダム文字列を付与する。 - $this->SetSession('uniqid', SC_Utils_Ex::sfGetUniqRandomId()); + $this->SetSession('uniqid', Utils::sfGetUniqRandomId()); } // 関連セッションのみ破棄する。 @@ -137,8 +132,8 @@ public function logout() unset($_SESSION['member_id']); unset($_SESSION['uniqid']); // トランザクショントークンを破棄 - SC_Helper_Session_Ex::destroyToken(); + \Eccube\Helper\Session::destroyToken(); // ログに記録する - GC_Utils_Ex::gfPrintLog('logout : user='.$this->login_id.' auth='.$this->authority.' sid='.$this->sid); + GcUtils::gfPrintLog('logout : user='.$this->login_id.' auth='.$this->authority.' sid='.$this->sid); } } diff --git a/data/class/SC_SessionFactory.php b/data/Eccube/Common/SessionFactory.php similarity index 78% rename from data/class/SC_SessionFactory.php rename to data/Eccube/Common/SessionFactory.php index 65539970dc5..0d992375f22 100644 --- a/data/class/SC_SessionFactory.php +++ b/data/Eccube/Common/SessionFactory.php @@ -1,26 +1,19 @@ initSession(); * - * @package SC_Session + * @package Session * @author LOCKON CO.,LTD. - * @version $Id$ */ -class SC_SessionFactory +class SessionFactory { /** * パラメーター管理で設定したセッション維持設定に従って適切なオブジェクトを返す. * - * @return SC_SessionFactory + * @return \Eccube\SessionFactory */ public static function getInstance() { $type = defined('SESSION_KEEP_METHOD') ? SESSION_KEEP_METHOD : ''; - switch ($type) { // セッションの維持にリクエストパラメーターを使用する case 'useRequest': - $session = new SC_SessionFactory_UseRequest_Ex; - SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE + $session = new \Eccube\SessionFactory\UseRequestSessionFactory(); + Display::detectDevice() == DEVICE_TYPE_MOBILE ? $session->setState('mobile') : $session->setState('pc'); break; @@ -66,16 +57,15 @@ public static function getInstance() // クッキーを使用する case 'useCookie': default: - // モバイルの場合はSC_SessionFactory_UseRequestを使用する - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { - $session = new SC_SessionFactory_UseRequest_Ex; + // モバイルの場合はEccube\SessionFactory\UseRequestを使用する + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { + $session = new \Eccube\Common\SessionFactory\UseRequestSessionFactory(); $session->setState('mobile'); } else { - $session = new SC_SessionFactory_UseCookie_Ex; + $session = new \Eccube\Common\SessionFactory\UseCookieSessionFactory(); } break; } - return $session; } @@ -136,7 +126,7 @@ public function sfSessClose() */ public function sfSessRead($id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->select('sess_data', 'dtb_session', 'sess_id = ?', array($id)); if (empty($arrRet)) { return ''; @@ -154,7 +144,7 @@ public function sfSessRead($id) */ public function sfSessWrite($id, $sess_data) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists('dtb_session', 'sess_id = ?', array($id)); $sqlval = array(); if ($exists) { @@ -186,7 +176,7 @@ public function sfSessWrite($id, $sess_data) */ public function sfSessDestroy($id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->delete('dtb_session', 'sess_id = ?', array($id)); return true; @@ -203,7 +193,7 @@ public function sfSessDestroy($id) public function sfSessGc($maxlifetime) { // MAX_LIFETIME以上更新されていないセッションを削除する。 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $limit = date("Y-m-d H:i:s", time() - MAX_LIFETIME); $where = "update_date < '". $limit . "' "; $objQuery->delete('dtb_session', $where); @@ -211,8 +201,3 @@ public function sfSessGc($maxlifetime) return true; } } -/* - * Local variables: - * coding: utf-8 - * End: - */ diff --git a/data/class/sessionfactory/SC_SessionFactory_UseCookie.php b/data/Eccube/Common/SessionFactory/UseCookieSessionFactory.php similarity index 57% rename from data/class/sessionfactory/SC_SessionFactory_UseCookie.php rename to data/Eccube/Common/SessionFactory/UseCookieSessionFactory.php index c8271707a06..7628423d065 100644 --- a/data/class/sessionfactory/SC_SessionFactory_UseCookie.php +++ b/data/Eccube/Common/SessionFactory/UseCookieSessionFactory.php @@ -1,38 +1,30 @@ state->getLifeTime(); $time = date('Y-m-d H:i:s', time() - $lifetime); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); foreach ($_REQUEST as $key => $value) { $session_id = $objQuery->get('session_id', 'dtb_mobile_ext_session_id', @@ -106,7 +102,7 @@ public function getExtSessionId() */ public function setExtSessionId($param_key, $param_value, $url) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // GC $lifetime = $this->state->getLifeTime(); @@ -163,7 +159,7 @@ public function getSessionId() // AU動画音声ファイルダウンロード対策 // キャリアがAUで、動画、音声ファイルをダウンロードする際に // SESSIONIDの後に余計なパラメータが付与され、セッションが無効になるケースがある - if (SC_MobileUserAgent::getCarrier() == 'ezweb') { + if (MobileUserAgent::getCarrier() == 'ezweb') { $idArray = split("\?", $sessionId); $sessionId = $idArray[0]; } @@ -177,7 +173,7 @@ public function getSessionId() // セッションIDの存在をチェックする。 if ($this->sfSessRead($sessionId) === null) { - GC_Utils_Ex::gfPrintLog("Non-existent session id : sid=$sessionId"); + GcUtils::gfPrintLog("Non-existent session id : sid=$sessionId"); return false; } @@ -224,7 +220,7 @@ public function initSession() // 新しいセッションIDを付加してリダイレクトする。 if ($_SERVER['REQUEST_METHOD'] == 'GET') { // GET の場合は同じページにリダイレクトする。 - $objMobile = new SC_Helper_Mobile_Ex; + $objMobile = new MobileHelper; header('Location: ' . $objMobile->gfAddSessionId()); } else { // GET 以外の場合はトップページへリダイレクトする。 @@ -283,7 +279,7 @@ public function validateNameSpace() if (isset($_SESSION[$namespace]) && is_array($_SESSION[$namespace])) { return true; } - GC_Utils_Ex::gfPrintLog("NameSpace $namespace not found in session data : sid=" . session_id()); + GcUtils::gfPrintLog("NameSpace $namespace not found in session data : sid=" . session_id()); return false; } @@ -349,7 +345,7 @@ public function validateExpire() return true; } $date = date('Y/m/d H:i:s', $expire); - GC_Utils_Ex::gfPrintLog("Session expired at $date : sid=" . session_id()); + GcUtils::gfPrintLog("Session expired at $date : sid=" . session_id()); return false; } @@ -387,7 +383,7 @@ public function validateIp() } $msg = sprintf('Ip Addr mismatch : %s != %s(expected) : sid=%s', $_SERVER['REMOTE_ADDR'], $ip, session_id()); - GC_Utils_Ex::gfPrintLog($msg); + GcUtils::gfPrintLog($msg); return false; } @@ -474,7 +470,7 @@ public function validateModel() } $msg = sprintf('User agent model mismatch : %s != %s(expected), sid=%s', $_SERVER['HTTP_USER_AGENT'], $ua, session_id()); - GC_Utils_Ex::gfPrintLog($msg); + GcUtils::gfPrintLog($msg); return false; } @@ -523,7 +519,7 @@ public function LC_UseRequest_State_Mobile() */ public function updateModel() { - $this->setValue('model', SC_MobileUserAgent_Ex::getModel()); + $this->setValue('model', MobileUserAgent::getModel()); } /** @@ -534,7 +530,7 @@ public function updateModel() public function validateModel() { $modelInSession = $this->getModel(); - $model = SC_MobileUserAgent_Ex::getModel(); + $model = MobileUserAgent::getModel(); if (!empty($model) && $model === $modelInSession) { return true; } @@ -558,7 +554,7 @@ public function getPhoneId() */ public function updatePhoneId() { - $this->setValue('phone_id', SC_MobileUserAgent_Ex::getId()); + $this->setValue('phone_id', MobileUserAgent::getId()); } /** @@ -574,8 +570,3 @@ public function inisializeSessionData() $this->updatePhoneId(); } } -/* - * Local variables: - * coding: utf-8 - * End: - */ diff --git a/data/class/SC_SiteSession.php b/data/Eccube/Common/SiteSession.php similarity index 74% rename from data/class/SC_SiteSession.php rename to data/Eccube/Common/SiteSession.php index 1c5b93b23ed..22bddd7b033 100644 --- a/data/class/SC_SiteSession.php +++ b/data/Eccube/Common/SiteSession.php @@ -1,28 +1,21 @@ isMobile() && !$detect->isTablet()) && !SC_SmartphoneUserAgent_Ex::getSmartphonePcFlag(); + return ($detect->isMobile() && !$detect->isTablet()) && !static::getSmartphonePcFlag(); } /** @@ -49,7 +40,7 @@ public function isSmartphone() */ public function isNonSmartphone() { - return !SC_SmartphoneUserAgent_Ex::isSmartphone(); + return !static::isSmartphone(); } /** diff --git a/data/class/SC_UploadFile.php b/data/Eccube/Common/UploadFile.php similarity index 91% rename from data/class/SC_UploadFile.php rename to data/Eccube/Common/UploadFile.php index 35bac5bceb7..e27b4289932 100644 --- a/data/class/SC_UploadFile.php +++ b/data/Eccube/Common/UploadFile.php @@ -1,28 +1,24 @@ checkUploadError($keyname, $objErr); if ($check) { @@ -131,10 +127,10 @@ public function makeTempFile($keyname, $rename = IMAGE_RENAME) $this->temp_file[$cnt] = $_FILES[$keyname]['name']; } if (move_uploaded_file($_FILES[$keyname]['tmp_name'], $this->temp_dir . $this->temp_file[$cnt])) { - GC_Utils_Ex::gfPrintLog($_FILES[$keyname]['name'].' -> '. $this->temp_dir . $this->temp_file[$cnt]); + GcUtils::gfPrintLog($_FILES[$keyname]['name'].' -> '. $this->temp_dir . $this->temp_file[$cnt]); } else { $objErr->arrErr[$keyname] = '※ ファイルのアップロードに失敗しました。
'; - GC_Utils_Ex::gfPrintLog('File Upload Error!: ' . $_FILES[$keyname]['name'].' -> '. $this->temp_dir . $this->temp_file[$cnt]); + GcUtils::gfPrintLog('File Upload Error!: ' . $_FILES[$keyname]['name'].' -> '. $this->temp_dir . $this->temp_file[$cnt]); } } } @@ -149,7 +145,7 @@ public function makeTempFile($keyname, $rename = IMAGE_RENAME) // アップロードされたダウンロードファイルを保存する。 public function makeTempDownFile($keyname='down_file') { - $objErr = new SC_CheckError_Ex(); + $objErr = new CheckError(); $cnt = 0; $check = $this->checkUploadError($keyname, $objErr); if ($check) { @@ -166,8 +162,8 @@ public function makeTempDownFile($keyname='down_file') $uniqname = date('mdHi') . '_' . uniqid('').'.'; $this->temp_file[$cnt] = preg_replace("/^.*\./", $uniqname, $_FILES[$keyname]['name']); $result = copy($_FILES[$keyname]['tmp_name'], $this->temp_dir . $this->temp_file[$cnt]); - GC_Utils_Ex::gfPrintLog($result.' -> '. $this->temp_dir . $this->temp_file[$cnt]); - SC_Utils_Ex::extendTimeOut(); + GcUtils::gfPrintLog($result.' -> '. $this->temp_dir . $this->temp_file[$cnt]); + Utils::extendTimeOut(); } } $cnt++; @@ -180,7 +176,7 @@ public function makeTempDownFile($keyname='down_file') // 画像を削除する。 public function deleteFile($keyname) { - $objImage = new SC_Image_Ex($this->temp_dir); + $objImage = new Image($this->temp_dir); $cnt = 0; foreach ($this->keyname as $val) { if ($val == $keyname) { @@ -198,7 +194,7 @@ public function deleteFile($keyname) // 画像を削除する。 public function deleteKikakuFile($keyname) { - $objImage = new SC_Image_Ex($this->temp_dir); + $objImage = new Image($this->temp_dir); $cnt = 0; foreach ($this->keyname as $val) { if ($val == $keyname) { @@ -237,7 +233,7 @@ public function getTempFilePath($keyname) // 一時ファイルを保存ディレクトリに移す public function moveTempFile() { - $objImage = new SC_Image_Ex($this->temp_dir); + $objImage = new Image($this->temp_dir); for ($cnt = 0; $cnt < count($this->keyname); $cnt++) { if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { @@ -257,7 +253,7 @@ public function moveTempFile() // ダウンロード一時ファイルを保存ディレクトリに移す public function moveTempDownFile() { - $objImage = new SC_Image_Ex($this->temp_dir); + $objImage = new Image($this->temp_dir); for ($cnt = 0; $cnt < count($this->keyname); $cnt++) { if (isset($this->temp_file[$cnt]) && $this->temp_file[$cnt] != '') { $objImage->moveTempImage($this->temp_file[$cnt], $this->save_dir); @@ -456,7 +452,7 @@ public function setDBImageList($arrVal) // DB上のファイルの内削除要求があったファイルを削除する。 public function deleteDBFile($arrVal) { - $objImage = new SC_Image_Ex($this->temp_dir); + $objImage = new Image($this->temp_dir); $cnt = 0; foreach ($this->keyname as $val) { if ($arrVal[$val] != '') { @@ -471,7 +467,7 @@ public function deleteDBFile($arrVal) // DB上のダウンロードファイルの内削除要求があったファイルを削除する。 public function deleteDBDownFile($arrVal) { - $objImage = new SC_Image_Ex($this->temp_dir); + $objImage = new Image($this->temp_dir); $cnt = 0; if ($arrVal['down_realfilename'] != '') { if ($this->save_file[$cnt] == '' && !preg_match('|^sub/|', $arrVal['down_realfilename'])) { @@ -546,10 +542,10 @@ public function lfGetTmpImageName($rename, $keyname = '', $uploadfile = '') * ファイルのアップロードのエラーを確認 * * @param string $keyname ファイルinputタグのname - * @param SC_CheckError $objErr SC_CheckErrorインスタンス + * @param CheckError $objErr CheckErrorインスタンス * @return boolean */ - public function checkUploadError($keyname, SC_CheckError &$objErr) + public function checkUploadError($keyname, CheckError &$objErr) { $index = array_search($keyname, $this->keyname); diff --git a/data/class/util/GC_Utils.php b/data/Eccube/Common/Util/GcUtils.php similarity index 86% rename from data/class/util/GC_Utils.php rename to data/Eccube/Common/Util/GcUtils.php index e4dc6a7656a..b726cd64e1d 100644 --- a/data/class/util/GC_Utils.php +++ b/data/Eccube/Common/Util/GcUtils.php @@ -1,26 +1,17 @@ init(); $objPage->type = $type; $objPage->process(); @@ -139,15 +134,13 @@ public static function sfDispError($type) /* サイトエラーページの表示 */ public static function sfDispSiteError($type, $objSiteSess = '', $return_top = false, $err_msg = '') { - require_once CLASS_EX_REALDIR . 'page_extends/error/LC_Page_Error_Ex.php'; - - $objPage = new LC_Page_Error_Ex(); + $objPage = new \Eccube\Page\Error\Index(); $objPage->init(); $objPage->type = $type; $objPage->objSiteSess = $objSiteSess; $objPage->return_top = $return_top; $objPage->err_msg = $err_msg; - $objPage->is_mobile = SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE; + $objPage->is_mobile = Display::detectDevice() == DEVICE_TYPE_MOBILE; $objPage->process(); exit; } @@ -166,17 +159,17 @@ public function sfDispException($debugMsg = null) /** * 認証の可否判定 * - * @param SC_Session $objSess + * @param Session $objSess * @param bool $disp_error * @return bool */ - public static function sfIsSuccess(SC_Session $objSess, $disp_error = true) + public static function sfIsSuccess(Session $objSess, $disp_error = true) { $ret = $objSess->IsSuccess(); if ($ret != SUCCESS) { if ($disp_error) { // エラーページの表示 - SC_Utils_Ex::sfDispError($ret); + static::sfDispError($ret); } return false; @@ -188,13 +181,13 @@ public static function sfIsSuccess(SC_Session $objSess, $disp_error = true) // TODO 警告表示させる? // sfErrorHeader('>> referrerが無効になっています。'); } else { - $domain = SC_Utils_Ex::sfIsHTTPS() ? HTTPS_URL : HTTP_URL; + $domain = static::sfIsHTTPS() ? HTTPS_URL : HTTP_URL; $pattern = sprintf('|^%s.*|', $domain); $referer = $_SERVER['HTTP_REFERER']; // 管理画面から以外の遷移の場合はエラー画面を表示 if (!preg_match($pattern, $referer)) { - if ($disp_error) SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR); + if ($disp_error) static::sfDispError(INVALID_MOVE_ERRORR); return false; } } @@ -241,7 +234,7 @@ public static function sfIsHTTPS() * * 使用されていない. * - * @param obj SC_Session, SC_SiteSession + * @param obj Session, SiteSession * @return bool */ public function sfIsValidTransition($objSess) @@ -334,7 +327,7 @@ public static function sfIsZeroFilling($value) public static function sfGetCSVData($data, $prefix = '') { if ($prefix == '') { - $dir_name = SC_Utils_Ex::sfUpDirName(); + $dir_name = static::sfUpDirName(); $file_name = $dir_name . date('ymdHis') .'.csv'; } else { $file_name = $prefix . date('ymdHis') .'.csv'; @@ -516,7 +509,7 @@ public static function sfArrKeyValue($arrList, $keyname, $valname, $len_max = '' for ($cnt = 0; $cnt < $max; $cnt++) { if ($keysize != '') { - $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); + $key = static::sfCutString($arrList[$cnt][$keyname], $keysize); } else { $key = $arrList[$cnt][$keyname]; } @@ -546,7 +539,7 @@ public function sfArrKeyValues($arrList, $keyname, $valname, $len_max = '', $key $keyValues = array(); for ($cnt = 0; $cnt < $max; $cnt++) { if ($keysize != '') { - $key = SC_Utils_Ex::sfCutString($arrList[$cnt][$keyname], $keysize); + $key = static::sfCutString($arrList[$cnt][$keyname], $keysize); } else { $key = $arrList[$cnt][$keyname]; } @@ -640,7 +633,7 @@ public function sfCheckSetTerm($start_year, $start_month, $start_day, $end_year, return array($date1, $date2, $error); } - // エラー箇所の背景色を変更するためのfunction SC_Viewで読み込む + // エラー箇所の背景色を変更するためのfunction Viewで読み込む public function sfSetErrorStyle() { return 'style="background-color:'.ERR_COLOR.'"'; @@ -696,7 +689,7 @@ public function sfTrim($str) /** * 税金額を返す * - * ・店舗基本情報に基づいた計算は SC_Helper_DB::sfTax() を使用する + * ・店舗基本情報に基づいた計算は \Eccube\Helper\DbHelper::tax() を使用する * * @param integer $price 計算対象の金額 * @param integer $tax 税率(%単位) @@ -708,7 +701,7 @@ public static function sfTax($price, $tax, $tax_rule) { $real_tax = $tax / 100; $ret = $price * $real_tax; - $ret = SC_Helper_TaxRule_Ex::roundByCalcRule($ret, $tax_rule); + $ret = TaxRuleHelper::roundByCalcRule($ret, $tax_rule); return $ret; } @@ -716,7 +709,7 @@ public static function sfTax($price, $tax, $tax_rule) /** * 税金付与した金額を返す * - * ・店舗基本情報に基づいた計算は SC_Helper_DB::sfTax() を使用する + * ・店舗基本情報に基づいた計算は \Eccube\Helper\DbHelper::tax() を使用する * * @param integer $price 計算対象の金額 * @param integer $tax 税率(%単位) @@ -726,7 +719,7 @@ public static function sfTax($price, $tax, $tax_rule) */ public static function sfCalcIncTax($price, $tax, $tax_rule) { - return $price + SC_Utils_Ex::sfTax($price, $tax, $tax_rule); + return $price + static::sfTax($price, $tax, $tax_rule); } /** @@ -739,7 +732,7 @@ public function sfRound($value, $pow = 0) $adjust = pow(10, $pow-1); // 整数且つ0でなければ桁数指定を行う - if (SC_Utils_Ex::sfIsInt($adjust) and $pow > 1) { + if (static::sfIsInt($adjust) and $pow > 1) { $ret = (round($value * $adjust)/$adjust); } @@ -760,7 +753,7 @@ public static function sfPrePoint($price, $point_rate, $rule = POINT_RULE) { $real_point = $point_rate / 100; $ret = $price * $real_point; - $ret = SC_Helper_TaxRule_Ex::roundByCalcRule($ret, $rule); + $ret = TaxRuleHelper::roundByCalcRule($ret, $rule); return $ret; } @@ -772,10 +765,10 @@ public static function sfGetClassCatCount() $sql.= 'from dtb_class inner join dtb_classcategory on dtb_class.class_id = dtb_classcategory.class_id '; $sql.= 'where dtb_class.del_flg = 0 AND dtb_classcategory.del_flg = 0 '; $sql.= 'group by dtb_class.class_id, dtb_class.name'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrList = $objQuery->getAll($sql); // キーと値をセットした配列を取得 - $arrRet = SC_Utils_Ex::sfArrKeyValue($arrList, 'class_id', 'count'); + $arrRet = static::sfArrKeyValue($arrList, 'class_id', 'count'); return $arrRet; } @@ -796,7 +789,7 @@ public static function sfGetProductClassId($product_id, $classcategory_id1=0, $c if (!$classcategory_id2) { $classcategory_id2 = 0; } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $ret = $objQuery->get('product_class_id', 'dtb_products_class', $where, Array($product_id, $classcategory_id1, $classcategory_id2)); return $ret; @@ -890,14 +883,14 @@ public function sfMultiply($num1, $num2) /** * 加算ポイントの計算 * - * ・店舗基本情報に基づいた計算は SC_Helper_DB::sfGetAddPoint() を使用する + * ・店舗基本情報に基づいた計算は \Eccube\Helper\DbHelper::getAddPoint() を使用する * * @param integer $totalpoint * @param integer $use_point * @param integer $point_rate * @return integer 加算ポイント */ - public static function sfGetAddPoint($totalpoint, $use_point, $point_rate) + public static function getAddPoint($totalpoint, $use_point, $point_rate) { // 購入商品の合計ポイントから利用したポイントのポイント換算価値を引く方式 $add_point = $totalpoint - intval($use_point * ($point_rate / 100)); @@ -913,7 +906,7 @@ public static function sfGetAddPoint($totalpoint, $use_point, $point_rate) public static function sfGetUniqRandomId($head = '') { // 予測されないようにランダム文字列を付与する。 - $random = GC_Utils_Ex::gfMakePassword(8); + $random = GcUtils::gfMakePassword(8); // 同一ホスト内で一意なIDを生成 $id = uniqid($head); @@ -982,7 +975,7 @@ public static function sfEncodeFile($filepath, $enc_type, $out_dir) fclose($ifp); // ファイルが開けなかった場合はエラーページを表示 } else { - SC_Utils_Ex::sfDispError(''); + static::sfDispError(''); exit; } @@ -1092,7 +1085,7 @@ public static function sfMakeHiddenArray($arrSrc, $arrDst = array(), $parent_key $keyname = $key; } if (is_array($val)) { - $arrDst = SC_Utils_Ex::sfMakeHiddenArray($val, $arrDst, $keyname); + $arrDst = static::sfMakeHiddenArray($val, $arrDst, $keyname); } else { $arrDst[$keyname] = $val; } @@ -1161,7 +1154,7 @@ public static function sfGetUnderChildrenArray($arrData, $pid_name, $id_name, $p /** * SQLシングルクォート対応 - * @deprecated SC_Query::quote() を使用すること + * @deprecated Query::quote() を使用すること */ public static function sfQuoteSmart($in) { @@ -1189,14 +1182,14 @@ public static function sfMakeDir($path) if (is_writable(dirname($dir))) { if (!file_exists($dir)) { mkdir($dir); - GC_Utils_Ex::gfPrintLog("mkdir $dir"); + GcUtils::gfPrintLog("mkdir $dir"); } } else { - SC_Utils_Ex::sfMakeDir($dir); + static::sfMakeDir($dir); if (is_writable(dirname($dir))) { if (!file_exists($dir)) { mkdir($dir); - GC_Utils_Ex::gfPrintLog("mkdir $dir"); + GcUtils::gfPrintLog("mkdir $dir"); } } } @@ -1245,7 +1238,7 @@ public static function sfCopyDir($src, $des, $mess = '', $override = false) mb_ereg("^(.*[\/])(.*)", $data_, $matches); $data=$matches[2]; if (is_dir($data_)) { - $mess = SC_Utils_Ex::sfCopyDir($data_.'/', $des.$data.'/', $mess); + $mess = static::sfCopyDir($data_.'/', $des.$data.'/', $mess); } else { if (!$override && file_exists($des.$data)) { $mess.= $des.$data . ":ファイルが存在します\n"; @@ -1377,12 +1370,12 @@ public static function sfArrayIntersectKeys($arrSrc, $arrKey) /** * 前方互換用 * - * @deprecated 2.12.0 GC_Utils_Ex::printXMLDeclaration を使用すること + * @deprecated 2.12.0 GcUtils::printXMLDeclaration を使用すること */ public function printXMLDeclaration() { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - GC_Utils_Ex::printXMLDeclaration(); + GcUtils::printXMLDeclaration(); } /** @@ -1426,7 +1419,7 @@ public static function getSaveImagePath($filename) $file = NO_IMAGE_REALFILE; // ファイル名が与えられており、ファイルが存在する場合だけ、$fileを設定 - if (!SC_Utils_Ex::isBlank($filename) && file_exists(IMAGE_SAVE_REALDIR . $filename)) { + if (!static::isBlank($filename) && file_exists(IMAGE_SAVE_REALDIR . $filename)) { $file = IMAGE_SAVE_REALDIR . $filename; } @@ -1487,67 +1480,67 @@ public static function sfPrintR($obj) */ public static function sfGetRandomString($length = 1) { - return Text_Password::create($length); + return \Text_Password::create($length); } /** * 前方互換用 * - * @deprecated 2.12.0 GC_Utils_Ex::getUrl を使用すること + * @deprecated 2.12.0 GcUtils::getUrl を使用すること */ public function sfGetUrl() { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - return GC_Utils_Ex::getUrl(); + return GcUtils::getUrl(); } /** * 前方互換用 * - * @deprecated 2.12.0 GC_Utils_Ex::toStringBacktrace を使用すること + * @deprecated 2.12.0 GcUtils::toStringBacktrace を使用すること */ public function sfBacktraceToString($arrBacktrace) { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - return GC_Utils_Ex::toStringBacktrace($arrBacktrace); + return GcUtils::toStringBacktrace($arrBacktrace); } /** * 前方互換用 * - * @deprecated 2.12.0 GC_Utils_Ex::isAdminFunction を使用すること + * @deprecated 2.12.0 GcUtils::isAdminFunction を使用すること */ public function sfIsAdminFunction() { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - return GC_Utils_Ex::isAdminFunction(); + return GcUtils::isAdminFunction(); } /** * 前方互換用 * - * @deprecated 2.12.0 GC_Utils_Ex::isFrontFunction を使用すること + * @deprecated 2.12.0 GcUtils::isFrontFunction を使用すること */ public function sfIsFrontFunction() { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - return GC_Utils_Ex::isFrontFunction(); + return GcUtils::isFrontFunction(); } /** * 前方互換用 * - * @deprecated 2.12.0 GC_Utils_Ex::isInstallFunction を使用すること + * @deprecated 2.12.0 GcUtils::isInstallFunction を使用すること */ public function sfIsInstallFunction() { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - return GC_Utils_Ex::isInstallFunction(); + return GcUtils::isInstallFunction(); } // 郵便番号から住所の取得 @@ -1557,9 +1550,9 @@ public function sfIsInstallFunction() */ public static function sfGetAddress($zipcode) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $arrPref = $masterData->getMasterData('mtb_pref'); // インデックスと値を反転させる。 $arrREV_PREF = array_flip($arrPref); @@ -1639,10 +1632,10 @@ public static function isBlank($val, $greedy = true) $array_result = true; foreach ($val as $in) { /* - * SC_Utils_Ex への再帰は無限ループやメモリリークの懸念 + * Utils への再帰は無限ループやメモリリークの懸念 * 自クラスへ再帰する. */ - $array_result = SC_Utils::isBlank($in, $greedy); + $array_result = static::isBlank($in, $greedy); if (!$array_result) { return false; } @@ -1676,7 +1669,7 @@ public static function isBlank($val, $greedy = true) */ public static function sfIsInternalDomain($url) { - $netURL = new Net_URL(HTTP_URL); + $netURL = new \Net_URL(HTTP_URL); $host = $netURL->host; if (!$host) return false; $host = preg_quote($host, '#'); @@ -1727,7 +1720,7 @@ public static function sfIsMatchHashPassword($pass, $hashpass, $salt) // 旧バージョン(2.11未満)からの移行を考慮 $hash = sha1($pass . ':' . AUTH_MAGIC); } else { - $hash = SC_Utils_Ex::sfGetHashString($pass, $salt); + $hash = static::sfGetHashString($pass, $salt); } if ($hash === $hashpass) { $res = true; @@ -1749,7 +1742,7 @@ public static function sfIsMatchHashPassword($pass, $hashpass, $salt) */ public static function sfGetSearchPageMax($search_page_max) { - if (SC_Utils_Ex::sfIsInt($search_page_max) && $search_page_max > 0) { + if (static::sfIsInt($search_page_max) && $search_page_max > 0) { $page_max = intval($search_page_max); } else { $page_max = SEARCH_PMAX; @@ -1775,7 +1768,7 @@ public static function jsonEncode($value) if (function_exists('json_encode')) { return json_encode($value); } else { - GC_Utils_Ex::gfPrintLog(' *use Services_JSON::encode(). faster than using the json_encode!'); + GcUtils::gfPrintLog(' *use Services_JSON::encode(). faster than using the json_encode!'); $objJson = new Services_JSON(); return $objJson->encode($value); @@ -1799,7 +1792,7 @@ public static function jsonDecode($json) if (function_exists('json_decode')) { return json_decode($json); } else { - GC_Utils_Ex::gfPrintLog(' *use Services_JSON::decode(). faster than using the json_decode!'); + GcUtils::gfPrintLog(' *use Services_JSON::decode(). faster than using the json_decode!'); $objJson = new Services_JSON(); return $objJson->decode($json); @@ -1883,10 +1876,10 @@ public static function extendTimeOut($seconds = null) public static function clearCompliedTemplate() { // コンパイルファイルの削除処理 - SC_Helper_FileManager_Ex::deleteFile(COMPILE_REALDIR, false); - SC_Helper_FileManager_Ex::deleteFile(COMPILE_ADMIN_REALDIR, false); - SC_Helper_FileManager_Ex::deleteFile(SMARTPHONE_COMPILE_REALDIR, false); - SC_Helper_FileManager_Ex::deleteFile(MOBILE_COMPILE_REALDIR, false); + FileManagerHelper::deleteFile(COMPILE_REALDIR, false); + FileManagerHelper::deleteFile(COMPILE_ADMIN_REALDIR, false); + FileManagerHelper::deleteFile(SMARTPHONE_COMPILE_REALDIR, false); + FileManagerHelper::deleteFile(MOBILE_COMPILE_REALDIR, false); } /** @@ -1906,7 +1899,7 @@ public static function copyDirectory($source_path, $dest_path) // ディレクトリの場合 // コピー先に無いディレクトリの場合、ディレクトリ作成. if (!empty($filename) && !file_exists($dest_file_path)) mkdir($dest_file_path); - SC_Utils_Ex::copyDirectory($cur_path . '/', $dest_file_path . '/'); + static::copyDirectory($cur_path . '/', $dest_file_path . '/'); } else { if (file_exists($dest_file_path)) unlink($dest_file_path); copy($cur_path, $dest_file_path); @@ -1947,7 +1940,7 @@ public static function encodeRFC3986($str) */ public static function trim($str, $charlist = null) { - $re = SC_Utils_Ex::getTrimPregPattern($charlist); + $re = static::getTrimPregPattern($charlist); return preg_replace('/(^' . $re . ')|(' . $re . '$)/us', '', $str); } @@ -1961,7 +1954,7 @@ public static function trim($str, $charlist = null) */ public static function ltrim($str, $charlist = null) { - $re = SC_Utils_Ex::getTrimPregPattern($charlist); + $re = static::getTrimPregPattern($charlist); return preg_replace('/^' . $re . '/us', '', $str); } @@ -1975,7 +1968,7 @@ public static function ltrim($str, $charlist = null) */ public static function rtrim($str, $charlist = null) { - $re = SC_Utils_Ex::getTrimPregPattern($charlist); + $re = static::getTrimPregPattern($charlist); return preg_replace('/' . $re . '$/us', '', $str); } @@ -2032,7 +2025,7 @@ public static function buildTree($primary_key, $glue_key, $max_depth, $correctio } $arrTree = $children[$root_id]; foreach ($arrTree as &$child) { - SC_Utils_Ex::addChild($child, $primary_key, 1, $max_depth, $children); + static::addChild($child, $primary_key, 1, $max_depth, $children); } return $arrTree; @@ -2054,7 +2047,7 @@ public static function addChild(&$target, $primary_key, $level, $max_depth, &$ch $target['children'] = $children[$target[$primary_key]]; if ($level + 1 < $max_depth) { foreach ($target['children'] as &$child) { - SC_Utils_Ex::addChild($child, $primary_key, $level+1, $max_depth, $children); + static::addChild($child, $primary_key, $level+1, $max_depth, $children); } } } @@ -2096,11 +2089,11 @@ public static function getTreeTrail($start_id, $primary_key, $glue_key, $correct if ($cid_is_key) { $arrIDToKay = $correction; } else { - $arrIDToKay = SC_Utils_Ex::makeArrayIDToKey($primary_key, $correction); + $arrIDToKay = static::makeArrayIDToKey($primary_key, $correction); } $id = $start_id; $arrTrail = array(); - while ($id != $root_id && !SC_Utils_Ex::isBlank($id)) { + while ($id != $root_id && !static::isBlank($id)) { if ($id_only) { $arrTrail[] = $id; } else { diff --git a/data/Eccube/Common/View.php b/data/Eccube/Common/View.php new file mode 100644 index 00000000000..b98beea7a06 --- /dev/null +++ b/data/Eccube/Common/View.php @@ -0,0 +1,228 @@ +init(); + } + + public function init() + { + $this->_smarty = new \Smarty; + $this->_smarty->left_delimiter = ''; + $this->_smarty->plugins_dir = array(realpath(dirname(__FILE__) . '/../../smarty_extends'), 'plugins'); + $this->_smarty->register_modifier('sfDispDBDate', array('\\Eccube\\Common\\Util\\Utils', 'sfDispDBDate')); + $this->_smarty->register_modifier('sfGetErrorColor', array('\\Eccube\\Common\\Util\\Utils', 'sfGetErrorColor')); + $this->_smarty->register_modifier('sfTrim', array('\\Eccube\\Common\\Util\\Utils', 'sfTrim')); + $this->_smarty->register_modifier('sfCalcIncTax', array('\\Eccube\\Common\\Helper\\DbHelper', 'calcIncTax')); + $this->_smarty->register_modifier('sfPrePoint', array('\\Eccube\\Common\\Util\\Utils', 'sfPrePoint')); + $this->_smarty->register_modifier('sfGetChecked', array('\\Eccube\\Common\\Util\\Utils', 'sfGetChecked')); + $this->_smarty->register_modifier('sfTrimURL', array('\\Eccube\\Common\\Util\\Utils', 'sfTrimURL')); + $this->_smarty->register_modifier('sfMultiply', array('\\Eccube\\Common\\Util\\Utils', 'sfMultiply')); + $this->_smarty->register_modifier('sfRmDupSlash', array('\\Eccube\\Common\\Util\\Utils', 'sfRmDupSlash')); + $this->_smarty->register_modifier('sfCutString', array('\\Eccube\\Common\\Util\\Utils', 'sfCutString')); + $this->_smarty->register_modifier('sfMbConvertEncoding', array('\\Eccube\\Common\\Util\\Utils', 'sfMbConvertEncoding')); + $this->_smarty->register_modifier('sfGetEnabled', array('\\Eccube\\Common\\Util\\Utils', 'sfGetEnabled')); + $this->_smarty->register_modifier('sfNoImageMainList', array('\\Eccube\\Common\\Util\\Utils', 'sfNoImageMainList')); + // XXX register_function で登録すると if で使用できないのではないか? + $this->_smarty->register_function('sfIsHTTPS', array('\\Eccube\\Common\\Util\\Utils', 'sfIsHTTPS')); + $this->_smarty->register_function('sfSetErrorStyle', array('\\Eccube\\Common\\Util\\Utils', 'sfSetErrorStyle')); + $this->_smarty->register_function('printXMLDeclaration', array('\\Eccube\\Common\\Util\\GcUtils', 'printXMLDeclaration')); + $this->_smarty->default_modifiers = array('script_escape'); + + if (ADMIN_MODE == '1') { + $this->time_start = microtime(true); + } + + $this->_smarty->force_compile = SMARTY_FORCE_COMPILE_MODE === true; + // 各filterをセットします. + $this->registFilter(); + } + + // テンプレートに値を割り当てる + + /** + * @param string $val1 + */ + public function assign($val1, $val2) + { + $this->_smarty->assign($val1, $val2); + } + + // テンプレートの処理結果を取得 + public function fetch($template) + { + return $this->_smarty->fetch($template); + } + + /** + * Display用にレスポンスを返す + * + * @global string $GLOBAL_ERR + * @param array $template + * @param boolean $no_error + * @return string + */ + public function getResponse($template, $no_error = false) + { + if (!$no_error) { + global $GLOBAL_ERR; + if (!defined('OUTPUT_ERR')) { + // GLOBAL_ERR を割り当て + $this->assign('GLOBAL_ERR', $GLOBAL_ERR); + define('OUTPUT_ERR', 'ON'); + } + } + $res = $this->_smarty->fetch($template); + if (ADMIN_MODE == '1') { + $time_end = microtime(true); + $time = $time_end - $this->time_start; + $res .= '処理時間: ' . sprintf('%.3f', $time) . '秒'; + } + + return $res; + } + + /** + * Pageオブジェクトをセットします. + * @param LC_Page_Ex $objPage + * @return void + */ + public function setPage($objPage) + { + $this->objPage = $objPage; + } + + /** + * Smartyのfilterをセットします. + * @return void + */ + public function registFilter() + { + $this->_smarty->register_prefilter(array(&$this, 'prefilter_transform')); + $this->_smarty->register_outputfilter(array(&$this, 'outputfilter_transform')); + } + + /** + * prefilter用のフィルタ関数。プラグイン用のフックポイント処理を実行 + * @param string $source ソース + * @param Smarty_Compiler $smarty Smartyのコンパイラクラス + * @return string $source ソース + */ + public function prefilter_transform($source, &$smarty) + { + if (!is_null($this->objPage)) { + // フックポイントを実行. + $objPlugin = PluginHelper::getSingletonInstance($this->objPage->plugin_activate_flg); + if (is_object($objPlugin)) { + $objPlugin->doAction('prefilterTransform', array(&$source, $this->objPage, $smarty->_current_file)); + } + } + + return $source; + } + + /** + * outputfilter用のフィルタ関数。プラグイン用のフックポイント処理を実行 + * @param string $source ソース + * @param Smarty_Compiler $smarty Smartyのコンパイラクラス + * @return string $source ソース + */ + public function outputfilter_transform($source, &$smarty) + { + if (!is_null($this->objPage)) { + // フックポイントを実行. + $objPlugin = PluginHelper::getSingletonInstance($this->objPage->plugin_activate_flg); + if (is_object($objPlugin)) { + $objPlugin->doAction('outputfilterTransform', array(&$source, $this->objPage, $smarty->_current_file)); + } + } + + return $source; + } + + // テンプレートの処理結果を表示 + public function display($template, $no_error = false) + { + if (!$no_error) { + global $GLOBAL_ERR; + if (!defined('OUTPUT_ERR')) { + // GLOBAL_ERR を割り当て + $this->assign('GLOBAL_ERR', $GLOBAL_ERR); + define('OUTPUT_ERR', 'ON'); + } + } + + $this->_smarty->display($template); + if (ADMIN_MODE == '1') { + $time_end = microtime(true); + $time = $time_end - $this->time_start; + echo '処理時間: ' . sprintf('%.3f', $time) . '秒'; + } + } + + // オブジェクト内の変数を全て割り当てる。 + public function assignobj($obj) + { + $data = get_object_vars($obj); + + foreach ($data as $key => $value) { + $this->_smarty->assign($key, $value); + } + } + + // 連想配列内の変数を全て割り当てる。 + public function assignarray($array) + { + foreach ($array as $key => $val) { + $this->_smarty->assign($key, $val); + } + } + + /** + * テンプレートパスをアサインする. + * + * @param integer $device_type_id 端末種別ID + */ + public function assignTemplatePath($device_type_id) + { + // テンプレート変数を割り当て + $this->assign('TPL_URLPATH', PageLayoutHelper::getUserDir($device_type_id, true)); + + // ヘッダとフッタを割り当て + $templatePath = PageLayoutHelper::getTemplatePath($device_type_id); + $header_tpl = $templatePath . 'header.tpl'; + $footer_tpl = $templatePath . 'footer.tpl'; + + $this->assign('header_tpl', $header_tpl); + $this->assign('footer_tpl', $footer_tpl); + } + + // デバッグ + public function debug($var = true) + { + $this->_smarty->debugging = $var; + } +} diff --git a/data/class/SC_AdminView.php b/data/Eccube/Common/View/AdminView.php similarity index 50% rename from data/class/SC_AdminView.php rename to data/Eccube/Common/View/AdminView.php index 3dad548ab0a..948c8b605f6 100644 --- a/data/class/SC_AdminView.php +++ b/data/Eccube/Common/View/AdminView.php @@ -1,27 +1,20 @@ _smarty->template_dir = realpath($template_dir); + $this->_smarty->compile_dir = realpath($compile_dir); + } +} diff --git a/data/Eccube/Common/View/MobileView.php b/data/Eccube/Common/View/MobileView.php new file mode 100644 index 00000000000..76c119c63d7 --- /dev/null +++ b/data/Eccube/Common/View/MobileView.php @@ -0,0 +1,32 @@ +_smarty->template_dir = realpath(MOBILE_TEMPLATE_REALDIR); + $this->_smarty->compile_dir = realpath(MOBILE_COMPILE_REALDIR); + $this->assignTemplatePath(DEVICE_TYPE_MOBILE); + } +} diff --git a/data/class/SC_SiteView.php b/data/Eccube/Common/View/SiteView.php similarity index 60% rename from data/class/SC_SiteView.php rename to data/Eccube/Common/View/SiteView.php index a6bc738eb88..e048cebe435 100644 --- a/data/class/SC_SiteView.php +++ b/data/Eccube/Common/View/SiteView.php @@ -1,27 +1,22 @@ setPrevURL(); } - SC_Helper_Plugin_Ex::hook("SC_SiteView_Construct_After", array($this)); + PluginHelper::hook("SiteView.Construct.After", array($this)); } public function setPrevURL() { - $objCartSess = new SC_CartSession_Ex(); + $objCartSess = new CartSession(); $objCartSess->setPrevURL($_SERVER['REQUEST_URI']); } } diff --git a/data/Eccube/Common/View/SmartphoneView.php b/data/Eccube/Common/View/SmartphoneView.php new file mode 100644 index 00000000000..cd8a2348f5b --- /dev/null +++ b/data/Eccube/Common/View/SmartphoneView.php @@ -0,0 +1,32 @@ +_smarty->template_dir = realpath(SMARTPHONE_TEMPLATE_REALDIR); + $this->_smarty->compile_dir = realpath(SMARTPHONE_COMPILE_REALDIR); + $this->assignTemplatePath(DEVICE_TYPE_SMARTPHONE); + } +} diff --git a/data/Eccube/Page/Abouts/Index.php b/data/Eccube/Page/Abouts/Index.php new file mode 100644 index 00000000000..c6c93f06608 --- /dev/null +++ b/data/Eccube/Page/Abouts/Index.php @@ -0,0 +1,59 @@ +tpl_title = '当サイトについて'; + $masterData = new MasterData(); + $this->arrPref = $masterData->getMasterData('mtb_pref'); + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + parent::process(); + $this->action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/class/pages/LC_Page.php b/data/Eccube/Page/AbstractPage.php similarity index 82% rename from data/class/pages/LC_Page.php rename to data/Eccube/Page/AbstractPage.php index 7f724d817f2..52e83a6d9a4 100644 --- a/data/class/pages/LC_Page.php +++ b/data/Eccube/Page/AbstractPage.php @@ -1,26 +1,26 @@ app = $app; + } + /** * Page を初期化する. * @@ -91,24 +97,22 @@ public function init() { // 開始時刻を設定する。 $this->timeStart = microtime(true); - - $this->tpl_authority = $_SESSION['authority']; + $this->tpl_authority = isset($_SESSION['authority']) ? $_SESSION['authority'] : null; // ディスプレイクラス生成 - $this->objDisplay = new SC_Display_Ex(); - + $this->objDisplay = new Display(); if (!$this->skip_load_page_layout) { - $layout = new SC_Helper_PageLayout_Ex(); + $layout = new PageLayoutHelper(); $layout->sfGetPageLayout($this, false, $_SERVER['SCRIPT_NAME'], $this->objDisplay->detectDevice()); } // スーパーフックポイントを実行. - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); - $objPlugin->doAction('LC_Page_preProcess', array($this)); + $objPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); + $objPlugin->doAction('Eccube.Page.preProcess', array($this)); // 店舗基本情報取得 - $this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $this->arrSiteInfo = DbHelper::getBasisData(); // トランザクショントークンの検証と生成 $this->doValidToken(); @@ -136,7 +140,7 @@ public function process() */ public function sendResponse() { - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); // ローカルフックポイントを実行. $this->doLocalHookpointAfter($objPlugin); @@ -144,12 +148,12 @@ public function sendResponse() $objPlugin->setHeadNaviBlocs($this->arrPageLayout['HeadNavi']); // スーパーフックポイントを実行. - $objPlugin->doAction('LC_Page_process', array($this)); + $objPlugin->doAction('Eccube.Page.process', array($this)); // ページクラス名をテンプレートに渡す $arrBacktrace = debug_backtrace(); if (strlen($this->tpl_page_class_name) === 0) { - $this->tpl_page_class_name = preg_replace('/_Ex$/', '', $arrBacktrace[1]['class']); + $this->tpl_page_class_name = preg_replace('/Eccube(\\\\Plugin\\\\\w+)?\\\\Page\\\\/', '', $arrBacktrace[1]['class']); } $this->objDisplay->prepare($this); @@ -174,13 +178,13 @@ public function sendResponseCSV($file_name, $data) $this->objDisplay->response->body = $data; $this->objDisplay->response->write(); - SC_Response_Ex::actionExit(); + Response::actionExit(); } /** * デストラクタ * - * ・ブロックの基底クラス (LC_Page_FrontParts_Bloc) では、継承していない。 + * ・ブロックの基底クラス (Ecube\\Page\\Bloc) では、継承していない。 * @return void */ public function __destruct() @@ -192,7 +196,7 @@ public function __destruct() $timeExecTime = $timeEnd - $this->timeStart; if (defined('PAGE_DISPLAY_TIME_LOG_MIN_EXEC_TIME') && $timeExecTime >= (float) PAGE_DISPLAY_TIME_LOG_MIN_EXEC_TIME) { $logMsg = sprintf('PAGE_DISPLAY_TIME_LOG [%.2fsec]', $timeExecTime); - GC_Utils_Ex::gfPrintLog($logMsg); + GcUtils::gfPrintLog($logMsg); } } } @@ -200,38 +204,42 @@ public function __destruct() /** * ローカルフックポイントを生成し、実行します. * - * @param SC_Helper_Plugin_Ex $objPlugin + * @param PluginHelper $objPlugin * @return void */ - public function doLocalHookpointBefore(SC_Helper_Plugin_Ex $objPlugin) + public function doLocalHookpointBefore(PluginHelper $objPlugin) { // ローカルフックポイントを実行 $parent_class_name = get_parent_class($this); - if ($parent_class_name != 'LC_Page') { - $objPlugin->doAction($parent_class_name . '_action_before', array($this)); + if ($parent_class_name != 'Eccube\\Page\\AbstractPage') { + $hook_point = str_replace('\\', '.', $parent_class_name) . '.action_before'; + $objPlugin->doAction($hook_point, array($this)); } $class_name = get_class($this); - if ($parent_class_name != 'LC_Page' && $class_name != $parent_class_name) { - $objPlugin->doAction($class_name . '_action_before', array($this)); + if ($class_name != $parent_class_name) { + $hook_point = str_replace('\\', '.', $class_name) . '.action_before'; + $objPlugin->doAction($hook_point, array($this)); } } /** * ローカルフックポイントを生成し、実行します. * - * @param SC_Helper_Plugin_Ex $objPlugin + * @param PluginHelper $objPlugin * @return void */ - public function doLocalHookpointAfter(SC_Helper_Plugin_Ex $objPlugin) + public function doLocalHookpointAfter(PluginHelper $objPlugin) { // ローカルフックポイントを実行 $parent_class_name = get_parent_class($this); - if ($parent_class_name != 'LC_Page') { - $objPlugin->doAction($parent_class_name . '_action_after', array($this)); + if ($parent_class_name != 'Eccube\\Page\\AbstractPage') { + $hook_point = str_replace('\\', '.', $parent_class_name) . '.action_after'; + $objPlugin->doAction($hook_point, array($this)); } $class_name = get_class($this); - if ($parent_class_name != 'LC_Page' && $class_name != $parent_class_name) { - $objPlugin->doAction($class_name . '_action_after', array($this)); + if ($class_name != $parent_class_name) { + $hook_point = str_replace('\\', '.', $class_name) . '.action_after'; + $objPlugin->doAction($hook_point, array($this)); } } @@ -271,7 +279,7 @@ public function setTemplate($template) * HTTP_URL を使用する場合 false, * デフォルト 'escape' 現在のスキーマを使用 * @return string $path の存在する http(s):// から始まる絶対パス - * @see Net_URL + * @see \Net_URL */ public function getLocation($path, $param = array(), $useSSL = 'escape') { @@ -283,7 +291,7 @@ public function getLocation($path, $param = array(), $useSSL = 'escape') } elseif ($useSSL === false) { $url = HTTP_URL . $rootPath; } elseif ($useSSL == 'escape') { - if (SC_Utils_Ex::sfIsHTTPS()) { + if (Utils::sfIsHTTPS()) { $url = HTTPS_URL . $rootPath; } else { $url = HTTP_URL . $rootPath; @@ -292,7 +300,7 @@ public function getLocation($path, $param = array(), $useSSL = 'escape') die("[BUG] Illegal Parametor of \$useSSL "); } - $netURL = new Net_URL($url); + $netURL = new \Net_URL($url); // QUERY_STRING 生成 foreach ($param as $key => $val) { $netURL->addQueryString($key, $val); @@ -439,13 +447,13 @@ public function getMode() public function doValidToken($is_admin = false) { if ($_SERVER['REQUEST_METHOD'] == 'POST') { - if (!SC_Helper_Session_Ex::isValidToken(false)) { + if (!SessionHelper::isValidToken(false)) { if ($is_admin) { - SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR); + Utils::sfDispError(INVALID_MOVE_ERRORR); } else { - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); + Utils::sfDispSiteError(PAGE_ERROR, '', true); } - SC_Response_Ex::actionExit(); + $this->app['ecube.response.action_exit']; } } } @@ -458,13 +466,13 @@ public function doValidToken($is_admin = false) */ public function setTokenTo() { - $this->transactionid = SC_Helper_Session_Ex::getToken(); + $this->transactionid = SessionHelper::getToken(); } /** * 前方互換用 * - * @deprecated 2.12.0 GC_Utils_Ex::gfPrintLog を使用すること + * @deprecated 2.12.0 GcUtils::gfPrintLog を使用すること */ public function log($mess, $log_level) { @@ -475,7 +483,7 @@ public function log($mess, $log_level) } // ログ出力 - GC_Utils_Ex::gfPrintLog($mess, '', true); + GcUtils::gfPrintLog($mess, '', true); } /** @@ -489,7 +497,7 @@ public function log($mess, $log_level) */ public function p($val) { - SC_Utils_Ex::sfPrintR($val); + Utils::sfPrintR($val); } /** diff --git a/data/class/pages/admin/LC_Page_Admin.php b/data/Eccube/Page/Admin/AbstractAdminPage.php similarity index 68% rename from data/class/pages/admin/LC_Page_Admin.php rename to data/Eccube/Page/Admin/AbstractAdminPage.php index 3b03292e2f7..3fd6d2288c3 100644 --- a/data/class/pages/admin/LC_Page_Admin.php +++ b/data/Eccube/Page/Admin/AbstractAdminPage.php @@ -1,36 +1,31 @@ 0) { if (array_search($_SERVER['REMOTE_ADDR'], $allow_hosts) === FALSE) { - SC_Utils_Ex::sfDispError(AUTH_ERROR); + Utils::sfDispError(AUTH_ERROR); } } //SSL制限チェック if (ADMIN_FORCE_SSL == TRUE) { - if (SC_Utils_Ex::sfIsHTTPS() === false) { - SC_Response_Ex::sendRedirect($_SERVER['REQUEST_URI'], $_GET, FALSE, TRUE); + if (Utils::sfIsHTTPS() === false) { + Response::sendRedirect($_SERVER['REQUEST_URI'], $_GET, FALSE, TRUE); } } $this->tpl_authority = $_SESSION['authority']; // ディスプレイクラス生成 - $this->objDisplay = new SC_Display_Ex(); + $this->objDisplay = new Display(); // スーパーフックポイントを実行. - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); $objPlugin->doAction('LC_Page_preProcess', array($this)); // トランザクショントークンの検証と生成 @@ -98,7 +93,7 @@ public function process() */ public function sendResponse() { - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); // ローカルフックポイントを実行 $parent_class_name = get_parent_class($this); $objPlugin->doAction($parent_class_name . '_action_after', array($this)); @@ -120,7 +115,7 @@ public function sendResponse() /** * 前方互換用 * - * @deprecated 2.12.0 GC_Utils_Ex::gfPrintLog を使用すること + * @deprecated 2.12.0 GcUtils::gfPrintLog を使用すること */ public function log($mess, $log_level='Info') { @@ -131,6 +126,6 @@ public function log($mess, $log_level='Info') } // ログ出力 - GC_Utils_Ex::gfPrintLog($mess, ''); + GcUtils::gfPrintLog($mess, ''); } } diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Delivery.php b/data/Eccube/Page/Admin/Basis/Delivery.php similarity index 71% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_Delivery.php rename to data/Eccube/Page/Admin/Basis/Delivery.php index e3a03bc55a2..7d7d81cbfb8 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Delivery.php +++ b/data/Eccube/Page/Admin/Basis/Delivery.php @@ -1,36 +1,29 @@ tpl_mainpage = 'basis/delivery.tpl'; $this->tpl_subno = 'delivery'; $this->tpl_mainno = 'basis'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrTAXRULE = $masterData->getMasterData('mtb_taxrule'); $this->tpl_maintitle = '基本情報管理'; @@ -68,11 +61,11 @@ public function process() */ public function action() { - $objDeliv = new SC_Helper_Delivery_Ex(); + $objDeliv = new DeliveryHelper(); $mode = $this->getMode(); if (!empty($_POST)) { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $objFormParam->setParam($_POST); $this->arrErr = $this->lfCheckError($mode, $objFormParam); @@ -110,7 +103,7 @@ public function action() * 入力エラーチェック * * @param string $mode - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return array */ public function lfCheckError($mode, &$objFormParam) diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_DeliveryInput.php b/data/Eccube/Page/Admin/Basis/DeliveryInput.php similarity index 84% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_DeliveryInput.php rename to data/Eccube/Page/Admin/Basis/DeliveryInput.php index ebfaf658f08..0a6d35b0715 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_DeliveryInput.php +++ b/data/Eccube/Page/Admin/Basis/DeliveryInput.php @@ -1,36 +1,31 @@ tpl_mainpage = 'basis/delivery_input.tpl'; $this->tpl_subno = 'delivery'; $this->tpl_mainno = 'basis'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrProductType = $masterData->getMasterData('mtb_product_type'); - $this->arrPayments = SC_Helper_Payment_Ex::getIDValueList(); + $this->arrPayments = PaymentHelper::getIDValueList(); $this->tpl_maintitle = '基本情報管理'; $this->tpl_subtitle = '配送方法設定'; $this->mode = $this->getMode(); @@ -70,7 +65,7 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($this->mode, $objFormParam); $objFormParam->setParam($_POST); @@ -101,7 +96,7 @@ public function action() /* パラメーター情報の初期化 */ public function lfInitParam($mode, &$objFormParam) { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); switch ($mode) { case 'edit': @@ -140,7 +135,7 @@ public function lfInitParam($mode, &$objFormParam) */ public function lfRegistData($arrRet, $member_id) { - $objDelivery = new SC_Helper_Delivery_Ex(); + $objDelivery = new DeliveryHelper(); // 入力データを渡す。 $sqlval['deliv_id'] = $arrRet['deliv_id']; @@ -190,7 +185,7 @@ public function lfRegistData($arrRet, $member_id) /* 配送業者情報の取得 */ public function lfGetDelivData(&$objFormParam) { - $objDelivery = new SC_Helper_Delivery_Ex(); + $objDelivery = new DeliveryHelper(); $deliv_id = $objFormParam->getValue('deliv_id'); @@ -225,12 +220,12 @@ public function lfCheckError(&$objFormParam) { // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrRet); + $objErr = new CheckError($arrRet); $objErr->arrErr = $objFormParam->checkError(); if (!isset($objErr->arrErr['name'])) { // 既存チェック - $objDelivery = new SC_Helper_Delivery_Ex(); + $objDelivery = new DeliveryHelper(); if ($objDelivery->checkExist($arrRet)) { $objErr->arrErr['service_name'] = '※ 同じ名称の組み合わせは登録できません。
'; } diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Holiday.php b/data/Eccube/Page/Admin/Basis/Holiday.php similarity index 78% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_Holiday.php rename to data/Eccube/Page/Admin/Basis/Holiday.php index 2ae27f227fd..7d912adffdb 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Holiday.php +++ b/data/Eccube/Page/Admin/Basis/Holiday.php @@ -1,36 +1,30 @@ arrMonth = $objDate->getMonth(); $this->arrDay = $objDate->getDay(); $mode = $this->getMode(); - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($mode, $objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); @@ -85,7 +79,7 @@ public function action() // 編集処理 case 'edit': $this->arrErr = $this->lfCheckError($objFormParam, $objHoliday); - if (!SC_Utils_Ex::isBlank($this->arrErr['holiday_id'])) { + if (!Utils::isBlank($this->arrErr['holiday_id'])) { trigger_error('', E_USER_ERROR); return; @@ -145,10 +139,10 @@ public function action() * * @param integer $holiday_id * @param array $sqlval - * @param SC_Helper_Holiday_Ex $objHoliday + * @param HolidayHelper $objHoliday * @return multiple */ - public function doRegist($holiday_id, $sqlval, SC_Helper_Holiday_Ex $objHoliday) + public function doRegist($holiday_id, $sqlval, HolidayHelper $objHoliday) { $sqlval['holiday_id'] = $holiday_id; $sqlval['creator_id'] = $_SESSION['member_id']; @@ -158,7 +152,7 @@ public function doRegist($holiday_id, $sqlval, SC_Helper_Holiday_Ex $objHoliday) /** * @param string|null $mode - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam($mode, &$objFormParam) { @@ -182,11 +176,11 @@ public function lfInitParam($mode, &$objFormParam) /** * 入力エラーチェック * - * @param SC_FormParam_Ex $objFormParam - * @param SC_Helper_Holiday_Ex $objHoliday + * @param FormParam $objFormParam + * @param HolidayHelper $objHoliday * @return array */ - public function lfCheckError(&$objFormParam, SC_Helper_Holiday_Ex &$objHoliday) + public function lfCheckError(&$objFormParam, HolidayHelper &$objHoliday) { $arrErr = $objFormParam->checkError(); $arrForm = $objFormParam->getHashArray(); diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis.php b/data/Eccube/Page/Admin/Basis/Index.php similarity index 84% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis.php rename to data/Eccube/Page/Admin/Basis/Index.php index 89d6ef24e94..21a218d0fb1 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis.php +++ b/data/Eccube/Page/Admin/Basis/Index.php @@ -1,36 +1,31 @@ tpl_mainpage = 'basis/index.tpl'; $this->tpl_subno = 'index'; $this->tpl_mainno = 'basis'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrTAXRULE = $masterData->getMasterData('mtb_taxrule'); $this->tpl_maintitle = '基本情報管理'; @@ -77,8 +72,8 @@ public function process() */ public function action() { - $objDb = new SC_Helper_DB_Ex(); - $objFormParam = new SC_FormParam_Ex(); + $objDb = new DbHelper(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam, $_POST); $objFormParam->setParam($_POST); $objFormParam->convParam(); @@ -101,14 +96,14 @@ public function action() case 'complete': $arrData = $objFormParam->getDbArray(); - SC_Helper_DB_Ex::registerBasisData($arrData); + DbHelper::registerBasisData($arrData); // キャッシュファイル更新 - $objDb->sfCreateBasisDataCache(); + $objDb->createBasisDataCache(); $this->tpl_onload .= "window.alert('SHOPマスターの登録が完了しました。');"; // breakはつけない default: - $arrRet = $objDb->sfGetBasisData(true); + $arrRet = $objDb->getBasisData(true); $objFormParam->setParam($arrRet); $this->arrForm = $objFormParam->getHashArray(); $this->arrForm['regular_holiday_ids'] = explode('|', $this->arrForm['regular_holiday_ids']); @@ -124,7 +119,7 @@ public function action() public function lfUpdateData($arrData) { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - SC_Helper_DB_Ex::registerBasisData($arrData); + DbHelper::registerBasisData($arrData); } /** @@ -135,11 +130,11 @@ public function lfUpdateData($arrData) public function lfInsertData($arrData) { trigger_error('前方互換用メソッドが使用されました。', E_USER_WARNING); - SC_Helper_DB_Ex::registerBasisData($arrData); + DbHelper::registerBasisData($arrData); } /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam, $post) { @@ -193,14 +188,14 @@ public function lfInitParam(&$objFormParam, $post) // 入力エラーチェック /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfCheckError(&$objFormParam) { $arrErr = $objFormParam->checkError(); $post = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($post); + $objErr = new CheckError($post); $objErr->doFunc(array('郵便番号', 'zip01', 'zip02'), array('ALL_EXIST_CHECK')); // 電話番号チェック diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Kiyaku.php b/data/Eccube/Page/Admin/Basis/Kiyaku.php similarity index 77% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_Kiyaku.php rename to data/Eccube/Page/Admin/Basis/Kiyaku.php index 574d0457268..b522b14d6e8 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Kiyaku.php +++ b/data/Eccube/Page/Admin/Basis/Kiyaku.php @@ -1,36 +1,29 @@ getMode(); - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($mode, $objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); @@ -81,13 +74,13 @@ public function action() case 'confirm': // エラーチェック $this->arrErr = $this->lfCheckError($objFormParam, $objKiyaku); - if (!SC_Utils_Ex::isBlank($this->arrErr['kiyaku_id'])) { + if (!Utils::isBlank($this->arrErr['kiyaku_id'])) { trigger_error('', E_USER_ERROR); return; } - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { // POST値の引き継ぎ $arrParam = $objFormParam->getHashArray(); // 登録実行 @@ -146,10 +139,10 @@ public function action() * * @param integer $kiyaku_id * @param array $sqlval - * @param SC_Helper_Kiyaku_Ex $objKiyaku + * @param KiyakuHelper $objKiyaku * @return multiple */ - public function doRegist($kiyaku_id, $sqlval, SC_Helper_Kiyaku_Ex &$objKiyaku) + public function doRegist($kiyaku_id, $sqlval, KiyakuHelper &$objKiyaku) { $sqlval['kiyaku_id'] = $kiyaku_id; $sqlval['creator_id'] = $_SESSION['member_id']; @@ -159,7 +152,7 @@ public function doRegist($kiyaku_id, $sqlval, SC_Helper_Kiyaku_Ex &$objKiyaku) /** * @param string|null $mode - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam($mode, &$objFormParam) { @@ -182,11 +175,11 @@ public function lfInitParam($mode, &$objFormParam) /** * 入力エラーチェック * - * @param SC_Helper_Kiyaku_Ex $objKiyaku - * @param SC_FormParam_Ex $objFormParam + * @param KiyakuHelper $objKiyaku + * @param FormParam $objFormParam * @return array */ - public function lfCheckError($objFormParam, SC_Helper_Kiyaku_Ex &$objKiyaku) + public function lfCheckError($objFormParam, KiyakuHelper &$objKiyaku) { $arrErr = $objFormParam->checkError(); $arrForm = $objFormParam->getHashArray(); diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Mail.php b/data/Eccube/Page/Admin/Basis/Mail.php similarity index 74% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_Mail.php rename to data/Eccube/Page/Admin/Basis/Mail.php index ffe62c64fa3..6f50ce46f4a 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Mail.php +++ b/data/Eccube/Page/Admin/Basis/Mail.php @@ -1,36 +1,29 @@ getMode(); if (!empty($_POST)) { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($mode, $objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); @@ -112,7 +105,7 @@ public function action() } - public function lfRegistMailTemplate($post, $member_id, SC_Helper_Mailtemplate_Ex $objMailtemplate) + public function lfRegistMailTemplate($post, $member_id, MailtemplateHelper $objMailtemplate) { $post['creator_id'] = $member_id; $objMailtemplate->save($post); @@ -120,7 +113,7 @@ public function lfRegistMailTemplate($post, $member_id, SC_Helper_Mailtemplate_E /** * @param string|null $mode - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam($mode, &$objFormParam) { diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Payment.php b/data/Eccube/Page/Admin/Basis/Payment.php similarity index 68% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_Payment.php rename to data/Eccube/Page/Admin/Basis/Payment.php index 75885a04e7f..4703fa26ee4 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Payment.php +++ b/data/Eccube/Page/Admin/Basis/Payment.php @@ -1,36 +1,28 @@ addParam('支払方法ID', 'payment_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); $objFormParam->setParam($_POST); $objFormParam->convParam(); diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_PaymentInput.php b/data/Eccube/Page/Admin/Basis/PaymentInput.php similarity index 86% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_PaymentInput.php rename to data/Eccube/Page/Admin/Basis/PaymentInput.php index 9aaf37cff9e..16a17cf69a8 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_PaymentInput.php +++ b/data/Eccube/Page/Admin/Basis/PaymentInput.php @@ -1,38 +1,32 @@ getMode(); $this->lfInitParam($mode, $objFormParam); // ファイル管理クラス - $this->objUpFile = new SC_UploadFile_Ex(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR); + $this->objUpFile = new UploadFile(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR); // ファイル情報の初期化 $this->objUpFile = $this->lfInitFile(); // Hiddenからのデータを引き継ぐ @@ -161,7 +155,7 @@ public function lfInitFile() /** * @param string|null $mode - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam($mode, &$objFormParam) { @@ -206,9 +200,9 @@ public function lfInitParam($mode, &$objFormParam) /* DBへデータを登録する */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ - public function lfRegistData(&$objFormParam, SC_Helper_Payment_Ex $objPayment, $member_id, $payment_id = '') + public function lfRegistData(&$objFormParam, PaymentHelper $objPayment, $member_id, $payment_id = '') { $sqlval = array_merge($objFormParam->getHashArray(), $this->objUpFile->getDBFileList()); $sqlval['payment_id'] = $payment_id; @@ -226,9 +220,9 @@ public function lfRegistData(&$objFormParam, SC_Helper_Payment_Ex $objPayment, $ /* 入力内容のチェック */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ - public function lfCheckError($post, $objFormParam, SC_Helper_Payment_Ex $objPayment) + public function lfCheckError($post, $objFormParam, PaymentHelper $objPayment) { // DBのデータを取得 $arrPaymentData = $objPayment->get($post['payment_id']); @@ -240,7 +234,7 @@ public function lfCheckError($post, $objFormParam, SC_Helper_Payment_Ex $objPaym // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrRet); + $objErr = new CheckError($arrRet); $objErr->arrErr = $objFormParam->checkError(); // 利用条件(下限)チェック diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Point.php b/data/Eccube/Page/Admin/Basis/Point.php similarity index 72% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_Point.php rename to data/Eccube/Page/Admin/Basis/Point.php index a8f9e70bb13..73774f74b66 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Point.php +++ b/data/Eccube/Page/Admin/Basis/Point.php @@ -1,36 +1,29 @@ lfInitParam($objFormParam); // POST値の取得 $objFormParam->setParam($_POST); - if ($objDb->sfGetBasisExists()) { + if ($objDb->getBasisExists()) { $this->tpl_mode = 'update'; } else { $this->tpl_mode = 'insert'; @@ -99,7 +92,7 @@ public function action() $this->tpl_onload = "window.alert('ポイント設定が完了しました。');"; } } else { - $arrRet = $objDb->sfGetBasisData(); + $arrRet = $objDb->getBasisData(); $objFormParam->setParam($arrRet); } $this->arrForm = $objFormParam->getFormParamList(); @@ -108,7 +101,7 @@ public function action() /* パラメーター情報の初期化 */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -121,7 +114,7 @@ public function lfUpdateData($post) // 入力データを渡す。 $sqlval = $post; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // UPDATEの実行 $objQuery->update('dtb_baseinfo', $sqlval); } @@ -132,7 +125,7 @@ public function lfInsertData($post) $sqlval = $post; $sqlval['id'] = 1; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // INSERTの実行 $objQuery->insert('dtb_baseinfo', $sqlval); } diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php b/data/Eccube/Page/Admin/Basis/Tax.php similarity index 80% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php rename to data/Eccube/Page/Admin/Basis/Tax.php index b3656fbf2b8..c25094d9a86 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tax.php +++ b/data/Eccube/Page/Admin/Basis/Tax.php @@ -1,36 +1,33 @@ tpl_mainno = 'basis'; $this->tpl_maintitle = '基本情報管理'; $this->tpl_subtitle = '税率設定'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrTAXCALCRULE = $masterData->getMasterData('mtb_taxrule'); //適用時刻の項目値設定 - $this->objDate = new SC_Date(); + $this->objDate = new Date(); //適用時間の年を、「現在年~現在年+2」の範囲に設定 for ($year=date("Y"); $year<=date("Y") + 2;$year++) { $arrYear[$year] = $year; @@ -87,8 +84,8 @@ public function process() */ public function action() { - $objTaxRule = new SC_Helper_TaxRule_Ex(); - $objFormParam = new SC_FormParam_Ex(); + $objTaxRule = new TaxRuleHelper(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); @@ -107,7 +104,7 @@ public function action() // 共通設定登録 case 'param_edit': $arrErr = $this->lfCheckError($objFormParam, $objTaxRule); - if (SC_Utils_Ex::isBlank($arrErr['product_tax_flg'])) { + if (Utils::isBlank($arrErr['product_tax_flg'])) { // POST値の引き継ぎ $arrParam = $objFormParam->getHashArray(); // 登録実行 @@ -137,9 +134,9 @@ public function action() $this->tpl_onload = "alert('登録が完了しました。');"; // リロード - SC_Response_Ex::reload(); + Response::reload(); } - } elseif (SC_Utils_Ex::isBlank($this->arrErr['tax_rule_id'])) { + } elseif (Utils::isBlank($this->arrErr['tax_rule_id'])) { // 税率ID以外のエラーの場合、ID情報を引き継ぐ $this->tpl_tax_rule_id = $tax_rule_id; } @@ -170,7 +167,7 @@ public function action() $objTaxRule->deleteTaxRuleData($tax_rule_id); // リロード - SC_Response_Ex::reload(); + Response::reload(); break; default: @@ -186,7 +183,7 @@ public function action() /** * パラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -208,12 +205,12 @@ public function lfInitParam(&$objFormParam) * 登録処理を実行. * * @param integer $tax_rule_id - * @param SC_Helper_TaxRule_Ex $objTaxRule + * @param TaxRuleHelper $objTaxRule * @return multiple */ - public function doRegist($tax_rule_id, $arrParam, SC_Helper_TaxRule_Ex $objTaxRule) + public function doRegist($tax_rule_id, $arrParam, TaxRuleHelper $objTaxRule) { - $apply_date = SC_Utils_Ex::sfGetTimestampistime( + $apply_date = Utils::sfGetTimestampistime( $arrParam['apply_date_year'], sprintf("%02d", $arrParam['apply_date_month']), sprintf("%02d", $arrParam['apply_date_day']), @@ -244,7 +241,7 @@ public function doParamRegist($arrParam) default: } } - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); // DBのデータを更新 $res = $masterData->updateMasterData('mtb_constants', array(), $arrData); // キャッシュを生成 @@ -256,18 +253,18 @@ public function doParamRegist($arrParam) /** * 入力エラーチェック. * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return array $objErr->arrErr エラー内容 */ - public function lfCheckError(&$objFormParam, SC_Helper_TaxRule_Ex &$objTaxRule) + public function lfCheckError(&$objFormParam, TaxRuleHelper &$objTaxRule) { $arrErr = $objFormParam->checkError(); $arrForm = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrForm); + $objErr = new CheckError($arrForm); // tax_rule_id の正当性チェック if (!empty($arrForm['tax_rule_id'])) { - if (!SC_Utils_Ex::sfIsInt($arrForm['tax_rule_id']) + if (!Utils::sfIsInt($arrForm['tax_rule_id']) || !$objTaxRule->getTaxRuleData($arrForm['tax_rule_id']) ) { // tax_rule_idが指定されていて、且つその値が不正と思われる場合はエラー @@ -277,8 +274,8 @@ public function lfCheckError(&$objFormParam, SC_Helper_TaxRule_Ex &$objTaxRule) // 適用日時チェック $objErr->doFunc(array('適用日時', 'apply_date_year', 'apply_date_month', 'apply_date_day'), array('CHECK_DATE')); - if (SC_Utils_Ex::isBlank($objErr->arrErr['apply_date_year']) && $arrForm['tax_rule_id'] != '0') { - $apply_date = SC_Utils_Ex::sfGetTimestampistime( + if (Utils::isBlank($objErr->arrErr['apply_date_year']) && $arrForm['tax_rule_id'] != '0') { + $apply_date = Utils::sfGetTimestampistime( $arrForm['apply_date_year'], sprintf("%02d", $arrForm['apply_date_month']), sprintf("%02d", $arrForm['apply_date_day']), @@ -291,14 +288,14 @@ public function lfCheckError(&$objFormParam, SC_Helper_TaxRule_Ex &$objTaxRule) // 編集中のレコード以外に同じ消費税率、課税規則が存在する場合 if ( - !SC_Utils_Ex::isBlank($arrTaxRuleByTime) + !Utils::isBlank($arrTaxRuleByTime) && $arrTaxRuleByTime['tax_rule_id'] != $arrForm['tax_rule_id'] && $arrTaxRuleByTime['apply_date'] == $apply_date ) { $arrErr['apply_date'] = '※ 既に同じ適用日時で登録が存在します。
'; } } - if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { + if (!Utils::isBlank($objErr->arrErr)) { $arrErr = array_merge($arrErr, $objErr->arrErr); } diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tradelaw.php b/data/Eccube/Page/Admin/Basis/Tradelaw.php similarity index 81% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_Tradelaw.php rename to data/Eccube/Page/Admin/Basis/Tradelaw.php index 502548235f6..062fdc8998c 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_Tradelaw.php +++ b/data/Eccube/Page/Admin/Basis/Tradelaw.php @@ -1,36 +1,31 @@ tpl_mainpage = 'basis/tradelaw.tpl'; $this->tpl_subno = 'tradelaw'; $this->tpl_mainno = 'basis'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrTAXRULE = $masterData->getMasterData('mtb_taxrule'); $this->tpl_maintitle = '基本情報管理'; @@ -68,13 +63,13 @@ public function process() */ public function action() { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); - if ($objDb->sfGetBasisExists()) { + if ($objDb->getBasisExists()) { $this->tpl_mode = 'update'; } else { $this->tpl_mode = 'insert'; @@ -100,7 +95,7 @@ public function action() $this->tpl_onload = "window.alert('特定商取引法の登録が完了しました。');"; } } else { - $arrRet = $objDb->sfGetBasisData(); + $arrRet = $objDb->getBasisData(); $objFormParam->setParam($arrRet); } $this->arrForm = $objFormParam->getFormParamList(); @@ -109,7 +104,7 @@ public function action() /* パラメーター情報の初期化 */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -139,7 +134,7 @@ public function lfInitParam(&$objFormParam) public function lfUpdateData($sqlval) { $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // UPDATEの実行 $objQuery->update('dtb_baseinfo', $sqlval); } @@ -147,7 +142,7 @@ public function lfUpdateData($sqlval) public function lfInsertData($sqlval) { $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // INSERTの実行 $objQuery->insert('dtb_baseinfo', $sqlval); } @@ -155,13 +150,13 @@ public function lfInsertData($sqlval) /* 入力内容のチェック */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfCheckError(&$objFormParam) { // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrRet); + $objErr = new CheckError($arrRet); $objErr->arrErr = $objFormParam->checkError(); // 電話番号チェック diff --git a/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php b/data/Eccube/Page/Admin/Basis/ZipInstall.php similarity index 89% rename from data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php rename to data/Eccube/Page/Admin/Basis/ZipInstall.php index 86ace6a6019..b3b66601ba0 100644 --- a/data/class/pages/admin/basis/LC_Page_Admin_Basis_ZipInstall.php +++ b/data/Eccube/Page/Admin/Basis/ZipInstall.php @@ -1,27 +1,22 @@ lfInitParam($this->tpl_mode, $objFormParam); $objFormParam->setParam($_GET); @@ -118,7 +112,7 @@ public function action() $this->insertMtbZip($this->arrForm['startRowNum']); break; } - SC_Response_Ex::actionExit(); + Response::actionExit(); } switch ($this->tpl_mode) { @@ -158,7 +152,7 @@ public function action() public function lfAutoCommitZip() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // DB更新 $objQuery->begin(); @@ -174,7 +168,7 @@ public function lfAutoCommitZip() */ public function lfDeleteZip() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // DB $objQuery->delete('mtb_zip'); @@ -186,7 +180,7 @@ public function lfDeleteZip() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return void */ public function lfInitParam($tpl_mode, &$objFormParam) @@ -203,7 +197,7 @@ public function lfInitParam($tpl_mode, &$objFormParam) */ public function insertMtbZip($start = 1) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $img_path = USER_URL . USER_PACKAGE_DIR . 'admin/img/basis/'; // 画像パスは admin 固定 @@ -217,11 +211,11 @@ public function insertMtbZip($start = 1)

'; echo ''; - SC_Utils_Ex::sfFlush(); + Utils::sfFlush(); // 画像を一個表示する件数を求める。 $line_all = $this->countZipCsv(); @@ -252,10 +246,10 @@ public function insertMtbZip($start = 1) // $disp_line件ごとに進捗表示する if ($cntCurrentLine % $disp_line == 0 && $img_cnt < IMAGE_MAX) { echo ''; - SC_Utils_Ex::sfFlush(); + Utils::sfFlush(); $img_cnt++; } - SC_Utils_Ex::extendTimeOut(); + Utils::extendTimeOut(); } fclose($fp); @@ -319,7 +313,7 @@ public function convertZipCsv() public function countMtbZip() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->count('mtb_zip'); } diff --git a/data/class/pages/admin/contents/LC_Page_Admin_Contents_CSV.php b/data/Eccube/Page/Admin/Contents/Csv.php similarity index 81% rename from data/class/pages/admin/contents/LC_Page_Admin_Contents_CSV.php rename to data/Eccube/Page/Admin/Contents/Csv.php index 2dc19981028..adf771f2f61 100644 --- a/data/class/pages/admin/contents/LC_Page_Admin_Contents_CSV.php +++ b/data/Eccube/Page/Admin/Contents/Csv.php @@ -1,36 +1,30 @@ tpl_maintitle = 'コンテンツ管理'; $this->tpl_subtitle = 'CSV出力設定'; - $objCSV = new SC_Helper_CSV_Ex(); + $objCSV = new CsvHelper(); $this->arrSubnavi = $objCSV->arrSubnavi; // 別名 $this->tpl_subno_csv = $objCSV->arrSubnavi[1]; //デフォルト $this->arrSubnaviName = $objCSV->arrSubnaviName; // 表示名 @@ -71,7 +65,7 @@ public function process() public function action() { // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター設定 $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); @@ -86,7 +80,7 @@ public function action() case 'confirm': // 入力パラメーターチェック $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { // 更新 $this->tpl_is_update = $this->lfUpdCsvOutput($this->tpl_csv_id, $objFormParam->getValue('output_list')); } @@ -111,7 +105,7 @@ public function action() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ public function lfInitParam(&$objFormParam) @@ -131,14 +125,14 @@ public function lfInitParam(&$objFormParam) */ public function lfGetCSVColumn($csv_id, $csv_status_flg = '', $order ='rank, no') { - $objCSV = new SC_Helper_CSV_Ex(); - if (SC_Utils_Ex::sfIsInt($csv_id)) { + $objCSV = new CsvHelper(); + if (Utils::sfIsInt($csv_id)) { if ($csv_status_flg !='') { $arrData = $objCSV->sfGetCsvOutput($csv_id, 'status = ?', array($csv_status_flg), $order); } else { $arrData = $objCSV->sfGetCsvOutput($csv_id, '', array(), $order); } - $arrData = SC_Utils_Ex::sfSwapArray($arrData); + $arrData = Utils::sfSwapArray($arrData); } else { $arrData = array(); } @@ -175,7 +169,7 @@ public function lfGetOptions($csv_id) $arrData['no'] = array(); $arrData['disp_name'] = array(); } - $arrData = SC_Utils_Ex::sfArrCombine($arrData['no'], $arrData['disp_name']); + $arrData = Utils::sfArrCombine($arrData['no'], $arrData['disp_name']); return $arrData; } @@ -188,10 +182,10 @@ public function lfGetOptions($csv_id) */ public function lfGetCsvId($subno_csv) { - $objCSV = new SC_Helper_CSV_Ex(); + $objCSV = new CsvHelper(); $arrKey = array_keys($objCSV->arrSubnavi, $subno_csv); $csv_id = $arrKey[0]; - if (!SC_Utils_Ex::sfIsInt($csv_id)) { + if (!Utils::sfIsInt($csv_id)) { //初期値取りだし $arrKey = array_keys($objCSV->arrSubnavi); $csv_id = $arrKey[0]; @@ -225,7 +219,7 @@ public function lfSetDefaultCsvOutput($csv_id) */ public function lfUpdCsvOutput($csv_id, $arrData = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // ひとまず、全部使用しないで更新する $table = 'dtb_csv'; $where = 'csv_id = ?'; diff --git a/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php b/data/Eccube/Page/Admin/Contents/CsvSql.php similarity index 78% rename from data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php rename to data/Eccube/Page/Admin/Contents/CsvSql.php index ff713c9cf33..6c309818494 100644 --- a/data/class/pages/admin/contents/LC_Page_Admin_Contents_CsvSql.php +++ b/data/Eccube/Page/Admin/Contents/CsvSql.php @@ -1,36 +1,32 @@ lfInitParam($objFormParam); $objFormParam->setParam($_POST); @@ -78,7 +74,7 @@ public function action() // データの登録 case 'confirm': $this->arrErr = $this->lfCheckConfirmError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { // データの更新 $this->arrForm['sql_id'] = $this->lfUpdData($objFormParam->getValue('sql_id'), $objFormParam->getDbArray()); // 完了メッセージ表示 @@ -88,7 +84,7 @@ public function action() // 確認画面 case 'preview': $this->arrErr = $this->lfCheckPreviewError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->sqlerr = $this->lfCheckSQL($objFormParam->getValue('csv_sql')); } $this->setTemplate('contents/csv_sql_view.tpl'); @@ -98,28 +94,28 @@ public function action() // 新規作成 case 'new_page': // リロード - SC_Response_Ex::reload(); + Response::reload(); break; // データ削除 case 'delete': $this->arrErr = $this->lfCheckDeleteError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->lfDelData($objFormParam->getValue('sql_id')); - SC_Response_Ex::reload(); - SC_Response_Ex::actionExit(); + Response::reload(); + Response::actionExit(); } break; // CSV出力 case 'csv_output': $this->arrErr = $this->lfCheckOutputError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->lfDoCsvOutput($objFormParam->getValue('csv_output_id')); - SC_Response_Ex::actionExit(); + Response::actionExit(); } break; default: $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { // 設定内容を取得する $this->arrForm = $this->lfGetSqlData($objFormParam); // カラム一覧を取得する @@ -137,7 +133,7 @@ public function action() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ public function lfInitParam(&$objFormParam) @@ -152,7 +148,7 @@ public function lfInitParam(&$objFormParam) /** * SQL登録エラーチェック * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckConfirmError(&$objFormParam) @@ -160,17 +156,17 @@ public function lfCheckConfirmError(&$objFormParam) // パラメーターの基本チェック $arrErr = $objFormParam->checkError(); // 拡張エラーチェック - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->doFunc(array('名称', 'sql_name'), array('EXIST_CHECK')); $objErr->doFunc(array('SQL文', 'csv_sql', '30000'), array('EXIST_CHECK', 'MAX_LENGTH_CHECK')); $objErr->doFunc(array('SQL文には読み込み関係以外のSQLコマンドおよび";"記号', 'csv_sql', $this->lfGetSqlDenyList()), array('PROHIBITED_STR_CHECK')); - if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { + if (!Utils::isBlank($objErr->arrErr)) { $arrErr = array_merge($arrErr, $objErr->arrErr); } // SQL文自体の確認、エラーが無い時のみ実行 - if (SC_Utils_Ex::isBlank($arrErr)) { + if (Utils::isBlank($arrErr)) { $sql_error = $this->lfCheckSQL($objFormParam->getValue('csv_sql')); - if (!SC_Utils_Ex::isBlank($sql_error)) { + if (!Utils::isBlank($sql_error)) { $arrErr['csv_sql'] = '※ SQL文が不正です。SQL文を見直してください'; } } @@ -181,7 +177,7 @@ public function lfCheckConfirmError(&$objFormParam) /** * SQL確認エラーチェック * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckPreviewError(&$objFormParam) @@ -189,10 +185,10 @@ public function lfCheckPreviewError(&$objFormParam) // パラメーターの基本チェック $arrErr = $objFormParam->checkError(); // 拡張エラーチェック - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->doFunc(array('SQL文', 'csv_sql', '30000'), array('EXIST_CHECK', 'MAX_LENGTH_CHECK')); $objErr->doFunc(array('SQL文には読み込み関係以外のSQLコマンドおよび";"記号', 'csv_sql', $this->lfGetSqlDenyList()), array('PROHIBITED_STR_CHECK')); - if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { + if (!Utils::isBlank($objErr->arrErr)) { $arrErr = array_merge($arrErr, $objErr->arrErr); } @@ -202,7 +198,7 @@ public function lfCheckPreviewError(&$objFormParam) /** * SQL設定 削除エラーチェック * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckDeleteError(&$objFormParam) @@ -210,9 +206,9 @@ public function lfCheckDeleteError(&$objFormParam) // パラメーターの基本チェック $arrErr = $objFormParam->checkError(); // 拡張エラーチェック - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->doFunc(array('SQL ID', 'sql_id'), array('EXIST_CHECK')); - if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { + if (!Utils::isBlank($objErr->arrErr)) { $arrErr = array_merge($arrErr, $objErr->arrErr); } @@ -222,7 +218,7 @@ public function lfCheckDeleteError(&$objFormParam) /** * SQL設定 CSV出力エラーチェック * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckOutputError(&$objFormParam) @@ -230,9 +226,9 @@ public function lfCheckOutputError(&$objFormParam) // パラメーターの基本チェック $arrErr = $objFormParam->checkError(); // 拡張エラーチェック - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->doFunc(array('CSV出力対象SQL ID', 'csv_output_id'), array('EXIST_CHECK')); - if (!SC_Utils_Ex::isBlank($objErr->arrErr)) { + if (!Utils::isBlank($objErr->arrErr)) { $arrErr = array_merge($arrErr, $objErr->arrErr); } @@ -246,10 +242,10 @@ public function lfCheckOutputError(&$objFormParam) */ public function lfGetTableList() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 実テーブル上のカラム設定を見に行く仕様に変更 ref #476 $arrTable = $objQuery->listTables(); - if (SC_Utils_Ex::isBlank($arrTable)) { + if (Utils::isBlank($arrTable)) { return array(); } $arrRet = array(); @@ -271,13 +267,13 @@ public function lfGetTableList() */ public function lfGetColList($table) { - if (SC_Utils_Ex::isBlank($table)) { + if (Utils::isBlank($table)) { return array(); } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 実テーブル上のカラム設定を見に行く仕様に変更 ref #476 $arrColList = $objQuery->listTableFields($table); - $arrColList= SC_Utils_Ex::sfArrCombine($arrColList, $arrColList); + $arrColList= Utils::sfArrCombine($arrColList, $arrColList); return $arrColList; } @@ -291,7 +287,7 @@ public function lfGetColList($table) */ public function lfGetSqlList($where = '' , $arrVal = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_csv_sql'; $objQuery->setOrder('sql_id'); @@ -306,12 +302,12 @@ public function lfGetSqlList($where = '' , $arrVal = array()) */ public function lfCheckSQL($sql) { - // FIXME: 意図的に new SC_Query しています。 force_runをtrueにする必要があるので.本当はqueryの引数で制御したい。ref SC_Query - $objQuery = new SC_Query_Ex('', true); + // FIXME: 意図的に new Query しています。 force_runをtrueにする必要があるので.本当はqueryの引数で制御したい。ref Query + $objQuery = new Query('', true); $err = ''; $sql = 'SELECT ' . $sql . ' '; $objErrMsg = $objQuery->query($sql); - if (PEAR::isError($objErrMsg)) { + if (\PEAR::isError($objErrMsg)) { $err = $objErrMsg->message . "\n" . $objErrMsg->userinfo; } @@ -321,19 +317,19 @@ public function lfCheckSQL($sql) /** * SQL詳細設定情報呼び出し (編集中データがある場合はそれを保持する) * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return mixed 表示用パラメーター */ public function lfGetSqlData(&$objFormParam) { // 編集中データがある場合 - if (!SC_Utils_Ex::isBlank($objFormParam->getValue('sql_name')) - || !SC_Utils_Ex::isBlank($objFormParam->getValue('csv_sql')) + if (!Utils::isBlank($objFormParam->getValue('sql_name')) + || !Utils::isBlank($objFormParam->getValue('csv_sql')) ) { return $objFormParam->getHashArray(); } $sql_id = $objFormParam->getValue('sql_id'); - if (!SC_Utils_Ex::isBlank($sql_id)) { + if (!Utils::isBlank($sql_id)) { $arrData = $this->lfGetSqlList('sql_id = ?', array($sql_id)); return $arrData[0]; @@ -350,13 +346,13 @@ public function lfGetSqlData(&$objFormParam) */ public function lfDoCsvOutput($sql_id) { - $objCSV = new SC_Helper_CSV_Ex(); + $objCSV = new CsvHelper(); $arrData = $this->lfGetSqlList('sql_id = ?', array($sql_id)); $sql = 'SELECT ' . $arrData[0]['csv_sql']; $objCSV->sfDownloadCsvFromSql($sql, array(), 'contents', null, true); - SC_Response_Ex::actionExit(); + Response::actionExit(); } /** @@ -368,10 +364,10 @@ public function lfDoCsvOutput($sql_id) */ public function lfUpdData($sql_id, $arrSqlVal) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_csv_sql'; $arrSqlVal['update_date'] = 'CURRENT_TIMESTAMP'; - if (SC_Utils_Ex::sfIsInt($sql_id)) { + if (Utils::sfIsInt($sql_id)) { //データ更新 $where = 'sql_id = ?'; $objQuery->update($table, $arrSqlVal, $where, array($sql_id)); @@ -394,10 +390,10 @@ public function lfUpdData($sql_id, $arrSqlVal) */ public function lfDelData($sql_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_csv_sql'; $where = 'sql_id = ?'; - if (SC_Utils_Ex::sfIsInt($sql_id)) { + if (Utils::sfIsInt($sql_id)) { $objQuery->delete($table, $where, array($sql_id)); return true; diff --git a/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php b/data/Eccube/Page/Admin/Contents/FileManager.php similarity index 81% rename from data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php rename to data/Eccube/Page/Admin/Contents/FileManager.php index 80f84565c88..b163b3c3a8b 100644 --- a/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileManager.php +++ b/data/Eccube/Page/Admin/Contents/FileManager.php @@ -1,36 +1,31 @@ lfInitParam($objFormParam); $objFormParam->setParam($this->createSetParam($_POST)); $objFormParam->convParam(); // ファイル管理クラス - $objUpFile = new SC_UploadFile_Ex($objFormParam->getValue('now_dir'), $objFormParam->getValue('now_dir')); + $objUpFile = new UploadFile($objFormParam->getValue('now_dir'), $objFormParam->getValue('now_dir')); // ファイル情報の初期化 $this->lfInitFile($objUpFile); // ファイル操作クラス - $objFileManager = new SC_Helper_FileManager_Ex(); + $objFileManager = new FileManagerHelper(); switch ($this->getMode()) { // フォルダ移動 case 'move': - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParamModeMove($objFormParam); $objFormParam->setParam($this->createSetParam($_POST)); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $now_dir = $this->lfCheckSelectDir($objFormParam, $objFormParam->getValue('tree_select_file')); $objFormParam->setValue('now_dir', $now_dir); } @@ -97,13 +92,13 @@ public function action() // ファイル表示 case 'view': - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParamModeView($objFormParam); $objFormParam->setParam($this->createSetParam($_POST)); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { if ($this->tryView($objFormParam)) { $pattern = '/' . preg_quote($objFormParam->getValue('top_dir'), '/') . '/'; $file_url = htmlspecialchars(preg_replace($pattern, '', $objFormParam->getValue('select_file'))); @@ -115,47 +110,47 @@ public function action() // ファイルダウンロード case 'download': - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParamModeView($objFormParam); $objFormParam->setParam($this->createSetParam($_POST)); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { if (is_dir($objFormParam->getValue('select_file'))) { $disp_error = '※ ディレクトリをダウンロードすることは出来ません。
'; $this->setDispError('select_file', $disp_error); } else { - $path_exists = SC_Utils_Ex::checkFileExistsWithInBasePath($objFormParam->getValue('select_file'), USER_REALDIR); + $path_exists = Utils::checkFileExistsWithInBasePath($objFormParam->getValue('select_file'), USER_REALDIR); if ($path_exists) { // ファイルダウンロード $objFileManager->sfDownloadFile($objFormParam->getValue('select_file')); - SC_Response_Ex::actionExit(); + Response::actionExit(); } } } break; // ファイル削除 case 'delete': - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParamModeView($objFormParam); $objFormParam->setParam($this->createSetParam($_POST)); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); - $path_exists = SC_Utils::checkFileExistsWithInBasePath($objFormParam->getValue('select_file'), USER_REALDIR); - if (SC_Utils_Ex::isBlank($this->arrErr) && ($path_exists)) { - SC_Helper_FileManager_Ex::deleteFile($objFormParam->getValue('select_file')); + $path_exists = Utils::checkFileExistsWithInBasePath($objFormParam->getValue('select_file'), USER_REALDIR); + if (Utils::isBlank($this->arrErr) && ($path_exists)) { + FileManagerHelper::deleteFile($objFormParam->getValue('select_file')); } break; // ファイル作成 case 'create': - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParamModeCreate($objFormParam); $objFormParam->setParam($this->createSetParam($_POST)); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { if (!$this->tryCreateDir($objFileManager, $objFormParam)) { $disp_error = '※ '.htmlspecialchars($objFormParam->getValue('create_file'), ENT_QUOTES).'の作成に失敗しました。
'; $this->setDispError('create_file', $disp_error); @@ -169,7 +164,7 @@ public function action() case 'upload': // 画像保存処理 $ret = $objUpFile->makeTempFile('upload_file', false); - if (SC_Utils_Ex::isBlank($ret)) { + if (Utils::isBlank($ret)) { $tpl_onload = "alert('ファイルをアップロードしました。');"; $this->setTplOnLoad($tpl_onload); } else { @@ -200,7 +195,7 @@ public function action() /** * 初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -212,7 +207,7 @@ public function lfInitParam(&$objFormParam) /** * ディレクトリ移動時、パラメーター定義 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParamModeMove(&$objFormParam) @@ -225,7 +220,7 @@ public function lfInitParamModeMove(&$objFormParam) /** * ファイル表示時、パラメーター定義 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParamModeView(&$objFormParam) @@ -238,7 +233,7 @@ public function lfInitParamModeView(&$objFormParam) /** * ファイル表示時、パラメーター定義 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParamModeCreate(&$objFormParam) @@ -252,7 +247,7 @@ public function lfInitParamModeCreate(&$objFormParam) /** * ファイル表示時、パラメーター定義 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParamCommon(&$objFormParam) @@ -267,7 +262,7 @@ public function lfInitParamCommon(&$objFormParam) /* * ファイル情報の初期化 * - * @param object $objUpFile SC_UploadFileインスタンス + * @param object $objUpFile UploadFileインスタンス * @return void */ public function lfInitFile(&$objUpFile) @@ -287,7 +282,7 @@ public function createSetParam($arrVal) // Windowsの場合は, ディレクトリの区切り文字を\から/に変換する $setParam['top_dir'] = (strpos(PHP_OS, 'WIN') === false) ? USER_REALDIR : str_replace('\\', '/', USER_REALDIR); // 初期表示はルートディレクトリ(user_data/)を表示 - if (SC_Utils_Ex::isBlank($this->getMode())) { + if (Utils::isBlank($this->getMode())) { $setParam['now_dir'] = $setParam['top_dir']; } @@ -309,8 +304,8 @@ public function setDispParam($key, $val) /** * ディレクトリを作成 * - * @param SC_Helper_FileManager_Ex $objFileManager SC_Helper_FileManager_Exインスタンス - * @param SC_FormParam $objFormParam SC_FormParamインスタンス + * @param FileManagerHelper $objFileManager FileManagerHelperインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return boolean ディレクトリ作成できたかどうか */ public function tryCreateDir($objFileManager, $objFormParam) @@ -328,7 +323,7 @@ public function tryCreateDir($objFileManager, $objFormParam) /** * ファイル表示を行う * - * @param SC_FormParam $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return boolean ファイル表示するかどうか */ public function tryView(&$objFormParam) @@ -346,7 +341,7 @@ public function tryView(&$objFormParam) /** * 現在の階層の一つ上の階層のディレクトリをテンプレートに渡す * - * @param SC_FormParam $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function setParentDir($objFormParam) @@ -358,7 +353,7 @@ public function setParentDir($objFormParam) /** * 現在の階層のパスをテンプレートに渡す * - * @param SC_FormParam $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function setDispPath($objFormParam) @@ -366,7 +361,7 @@ public function setDispPath($objFormParam) // Windows 環境で DIRECTORY_SEPARATOR が JavaScript に渡るとエスケープ文字と勘違いするので置換 $html_realdir = str_replace(DIRECTORY_SEPARATOR, '/', HTML_REALDIR); $arrNowDir = preg_split('/\//', str_replace($html_realdir, '', $objFormParam->getValue('now_dir'))); - $this->setDispParam('tpl_now_dir', SC_Utils_Ex::jsonEncode($arrNowDir)); + $this->setDispParam('tpl_now_dir', Utils::jsonEncode($arrNowDir)); $this->setDispParam('tpl_file_path', $html_realdir); } @@ -380,7 +375,7 @@ public function setDispPath($objFormParam) public function setDispError($key, $value) { // 既にエラーがある場合は、処理しない - if (SC_Utils_Ex::isBlank($this->arrErr[$key])) { + if (Utils::isBlank($this->arrErr[$key])) { $this->arrErr[$key] = $value; } } @@ -399,7 +394,7 @@ public function setTplOnLoad($tpl_onload) /* * 選択ディレクトリがUSER_REALDIR以下かチェック * - * @param object $objFormParam SC_FormParamインスタンス + * @param object $objFormParam FormParamインスタンス * @param string $dir ディレクトリ * @return string $select_dir 選択ディレクトリ */ @@ -447,8 +442,8 @@ public function lfGetParentDir($dir) /** * ディレクトリツリー生成 * - * @param SC_Helper_FileManager_Ex $objFileManager SC_Helper_FileManager_Exインスタンス - * @param SC_FormParam $objFormParam SC_FormParamインスタンス + * @param FileManagerHelper $objFileManager FileManagerHelperインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function setDispTree($objFileManager, $objFormParam) @@ -481,7 +476,7 @@ public function setDispTree($objFileManager, $objFormParam) /** * 現在の階層がルートディレクトリかどうかテンプレートに渡す * - * @param SC_FormParam $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function setIsTopDir($objFormParam) diff --git a/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileView.php b/data/Eccube/Page/Admin/Contents/FileView.php similarity index 66% rename from data/class/pages/admin/contents/LC_Page_Admin_Contents_FileView.php rename to data/Eccube/Page/Admin/Contents/FileView.php index 059ea5f0d66..f94b5a7c1c5 100644 --- a/data/class/pages/admin/contents/LC_Page_Admin_Contents_FileView.php +++ b/data/Eccube/Page/Admin/Contents/FileView.php @@ -1,36 +1,30 @@ getMode()) { default: // フォーム操作クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); $objFormParam->setParam($_GET); @@ -73,10 +67,10 @@ public function action() if ($this->checkErrorDispFile($objFormParam)) { $this->execFileView($objFormParam); } else { - SC_Utils_Ex::sfDispError(''); + Utils::sfDispError(''); } - SC_Response_Ex::actionExit(); + Response::actionExit(); break; } } @@ -84,7 +78,7 @@ public function action() /** * 初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -95,7 +89,7 @@ public function lfInitParam(&$objFormParam) /** * 表示するファイルにエラーチェックを行う * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return boolean $file_check_flg エラーチェックの結果 */ public function checkErrorDispFile($objFormParam) @@ -103,7 +97,7 @@ public function checkErrorDispFile($objFormParam) $file_check_flg = false; // FIXME パスのチェック関数が必要 $file = $objFormParam->getValue('file'); - $path_exists = SC_Utils::checkFileExistsWithInBasePath($file, USER_REALDIR); + $path_exists = Utils::checkFileExistsWithInBasePath($file, USER_REALDIR); if ($path_exists) { $file_check_flg = true; } @@ -132,12 +126,12 @@ public function execFileView($objFormParam) $extension = pathinfo($file, PATHINFO_EXTENSION); if (in_array($extension, $arrViewFile)) { - $objFileManager = new SC_Helper_FileManager_Ex(); + $objFileManager = new FileManagerHelper(); // ファイルを読み込んで表示 header("Content-type: text/plain\n\n"); echo $objFileManager->sfReadFile(USER_REALDIR . $file); } else { - SC_Response_Ex::sendRedirect(USER_URL . $file); + Response::sendRedirect(USER_URL . $file); } } } diff --git a/data/class/pages/admin/contents/LC_Page_Admin_Contents.php b/data/Eccube/Page/Admin/Contents/Index.php similarity index 81% rename from data/class/pages/admin/contents/LC_Page_Admin_Contents.php rename to data/Eccube/Page/Admin/Contents/Index.php index fef419d5050..fbe236e05ff 100644 --- a/data/class/pages/admin/contents/LC_Page_Admin_Contents.php +++ b/data/Eccube/Page/Admin/Contents/Index.php @@ -1,36 +1,32 @@ tpl_maintitle = 'コンテンツ管理'; $this->tpl_subtitle = '新着情報管理'; //---- 日付プルダウン設定 - $objDate = new SC_Date_Ex(ADMIN_NEWS_STARTYEAR); + $objDate = new Date(ADMIN_NEWS_STARTYEAR); $this->arrYear = $objDate->getYear(); $this->arrMonth = $objDate->getMonth(); $this->arrDay = $objDate->getDay(); @@ -75,9 +71,9 @@ public function process() */ public function action() { - $objNews = new SC_Helper_News_Ex(); + $objNews = new NewsHelper(); - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); @@ -88,7 +84,7 @@ public function action() switch ($this->getMode()) { case 'edit': $this->arrErr = $this->lfCheckError($objFormParam); - if (!SC_Utils_Ex::isBlank($this->arrErr['news_id'])) { + if (isset($this->arrErr['news_id']) && !Utils::isBlank($this->arrErr['news_id'])) { trigger_error('', E_USER_ERROR); return; @@ -122,7 +118,7 @@ public function action() //---- データ削除 $objNews->deleteNews($news_id); //自分にリダイレクト(再読込による誤動作防止) - SC_Response_Ex::reload(); + Response::reload(); break; //---- 表示順位移動 @@ -130,23 +126,23 @@ public function action() $objNews->rankUp($news_id); // リロード - SC_Response_Ex::reload(); + Response::reload(); break; case 'down': $objNews->rankDown($news_id); // リロード - SC_Response_Ex::reload(); + Response::reload(); break; case 'moveRankSet': //---- 指定表示順位移動 $input_pos = $this->getPostRank($news_id); - if (SC_Utils_Ex::sfIsInt($input_pos)) { + if (Utils::sfIsInt($input_pos)) { $objNews->moveRank($news_id, $input_pos); } - SC_Response_Ex::reload(); + Response::reload(); break; default: @@ -161,12 +157,12 @@ public function action() /** * 入力されたパラメーターのエラーチェックを行う。 - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return Array エラー内容 */ public function lfCheckError(&$objFormParam) { - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->arrErr = $objFormParam->checkError(); $objErr->doFunc(array('日付', 'year', 'month', 'day'), array('CHECK_DATE')); @@ -175,7 +171,7 @@ public function lfCheckError(&$objFormParam) /** * パラメーターの初期化を行う - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -194,10 +190,10 @@ public function lfInitParam(&$objFormParam) * * @param integer $news_id * @param array $sqlval - * @param SC_Helper_News_Ex $objNews + * @param NewsHelper $objNews * @return multiple */ - public function doRegist($news_id, $sqlval, SC_Helper_News_Ex $objNews) + public function doRegist($news_id, $sqlval, NewsHelper $objNews) { $sqlval['news_id'] = $news_id; $sqlval['creator_id'] = $_SESSION['member_id']; diff --git a/data/class/pages/admin/contents/LC_Page_Admin_Contents_Recommend.php b/data/Eccube/Page/Admin/Contents/Recommend.php similarity index 79% rename from data/class/pages/admin/contents/LC_Page_Admin_Contents_Recommend.php rename to data/Eccube/Page/Admin/Contents/Recommend.php index 81d7a167bcb..4266fcc7524 100644 --- a/data/class/pages/admin/contents/LC_Page_Admin_Contents_Recommend.php +++ b/data/Eccube/Page/Admin/Contents/Recommend.php @@ -1,36 +1,33 @@ lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); $arrPost = $objFormParam->getHashArray(); - $objRecommend = new SC_Helper_BestProducts_Ex(); + $objRecommend = new BestProductsHelper(); switch ($this->getMode()) { case 'down': //商品の並び替えをする。 @@ -89,7 +86,7 @@ public function action() case 'regist': // 商品を登録する。 $this->arrErr[$arrPost['rank']] = $this->lfCheckError($objFormParam); // 登録処理にエラーがあった場合は商品選択の時と同じ処理を行う。 - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $member_id = $_SESSION['member_id']; $this->insertRecommendProduct($arrPost, $member_id, $objRecommend); $arrItems = $this->getRecommendProducts($objRecommend); @@ -114,7 +111,7 @@ public function action() break; case 'set_item': // 商品を選択する。 $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr['rank']) && SC_Utils_Ex::isBlank($this->arrErr['product_id'])) { + if (Utils::isBlank($this->arrErr['rank']) && Utils::isBlank($this->arrErr['product_id'])) { $arrItems = $this->setProducts($arrPost, $this->getRecommendProducts($objRecommend)); $this->checkRank = $arrPost['rank']; } @@ -128,13 +125,13 @@ public function action() $this->arrItems = $arrItems; // カテゴリ取得 - $objDb = new SC_Helper_DB_Ex(); - $this->arrCatList = $objDb->sfGetCategoryList('level = 1'); + $objDb = new DbHelper(); + $this->arrCatList = $objDb->getCategoryList('level = 1'); } /** * パラメーターの初期化を行う - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -147,12 +144,12 @@ public function lfInitParam(&$objFormParam) /** * 入力されたパラメーターのエラーチェックを行う。 - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return Array エラー内容 */ public function lfCheckError(&$objFormParam) { - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->arrErr = $objFormParam->checkError(); return $objErr->arrErr; @@ -160,10 +157,10 @@ public function lfCheckError(&$objFormParam) /** * 既に登録されている内容を取得する - * @param SC_Helper_BestProducts_Ex $objRecommend + * @param BestProductsHelper $objRecommend * @return Array $arrReturnProducts データベースに登録されているおすすめ商品の配列 */ - public function getRecommendProducts(SC_Helper_BestProducts_Ex &$objRecommend) + public function getRecommendProducts(BestProductsHelper &$objRecommend) { $arrList = $objRecommend->getList(); // product_id の一覧を作成 @@ -172,8 +169,8 @@ public function getRecommendProducts(SC_Helper_BestProducts_Ex &$objRecommend) $product_ids[] = $value['product_id']; } - $objProduct = new SC_Product_Ex; - $objQuery = $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objProduct = new Product; + $objQuery = $objQuery = Query::getSingletonInstance(); $arrProducts = $objProduct->getListByProductIds($objQuery, $product_ids); $arrReturnProducts = array(); @@ -190,9 +187,9 @@ public function getRecommendProducts(SC_Helper_BestProducts_Ex &$objRecommend) * おすすめ商品の新規登録を行う。 * @param Array $arrPost POSTの値を格納した配列 * @param Integer $member_id 登録した管理者を示すID - * @param SC_Helper_BestProducts_Ex $objRecommend + * @param BestProductsHelper $objRecommend */ - public function insertRecommendProduct($arrPost, $member_id, SC_Helper_BestProducts_Ex &$objRecommend) + public function insertRecommendProduct($arrPost, $member_id, BestProductsHelper &$objRecommend) { $sqlval = array(); $sqlval['best_id'] = $arrPost['best_id']; @@ -208,10 +205,10 @@ public function insertRecommendProduct($arrPost, $member_id, SC_Helper_BestProdu /** * データを削除する * @param Array $arrPost POSTの値を格納した配列 - * @param SC_Helper_BestProducts_Ex $objRecommend + * @param BestProductsHelper $objRecommend * @return void */ - public function deleteProduct($arrPost, SC_Helper_BestProducts_Ex &$objRecommend) + public function deleteProduct($arrPost, BestProductsHelper &$objRecommend) { if ($arrPost['best_id']) { $target = $arrPost['best_id']; @@ -229,7 +226,7 @@ public function deleteProduct($arrPost, SC_Helper_BestProducts_Ex &$objRecommend */ public function getProduct($product_id) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $arrProduct = $objProduct->getDetail($product_id); $return = array( 'product_id' => $arrProduct['product_id'], diff --git a/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php b/data/Eccube/Page/Admin/Contents/RecommendSearch.php similarity index 73% rename from data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php rename to data/Eccube/Page/Admin/Contents/RecommendSearch.php index 1b908402871..2ef3ef4c0b0 100644 --- a/data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php +++ b/data/Eccube/Page/Admin/Contents/RecommendSearch.php @@ -1,36 +1,33 @@ lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); @@ -79,16 +76,16 @@ public function action() $arrPost = $objFormParam->getHashArray(); // 入力された値にエラーがない場合、検索処理を行う。 // 検索結果の数に応じてページャの処理も入れる。 - if (SC_Utils_Ex::isBlank($this->arrErr)) { - $objProduct = new SC_Product_Ex(); + if (Utils::isBlank($this->arrErr)) { + $objProduct = new Product(); $wheres = $this->createWhere($objFormParam, $objDb); $this->tpl_linemax = $this->getLineCount($wheres, $objProduct); - $page_max = SC_Utils_Ex::sfGetSearchPageMax($arrPost['search_page_max']); + $page_max = Utils::sfGetSearchPageMax($arrPost['search_page_max']); // ページ送りの取得 - $objNavi = new SC_PageNavi_Ex($arrPost['search_pageno'], $this->tpl_linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX); + $objNavi = new PageNavi($arrPost['search_pageno'], $this->tpl_linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX); $this->tpl_strnavi = $objNavi->strnavi; // 表示文字列 $startno = $objNavi->start_row; @@ -102,14 +99,14 @@ public function action() } // カテゴリ取得 - $this->arrCatList = $objDb->sfGetCategoryList(); + $this->arrCatList = $objDb->getCategoryList(); $this->rank = $rank; $this->setTemplate('contents/recommend_search.tpl'); } /** * パラメーターの初期化を行う - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -122,12 +119,12 @@ public function lfInitParam(&$objFormParam) /** * 入力されたパラメーターのエラーチェックを行う。 - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return Array エラー内容 */ public function lfCheckError(&$objFormParam) { - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->arrErr = $objFormParam->checkError(); return $objErr->arrErr; @@ -137,8 +134,8 @@ public function lfCheckError(&$objFormParam) * * POSTされた値からSQLのWHEREとBINDを配列で返す。 * @return array ('where' => where string, 'bind' => databind array) - * @param SC_FormParam $objFormParam - * @param SC_Helper_DB_Ex $objDb + * @param FormParam $objFormParam + * @param DbHelper $objDb */ public function createWhere(&$objFormParam, &$objDb) { @@ -156,7 +153,7 @@ public function createWhere(&$objFormParam, &$objDb) $bind[] = '%'.$val.'%'; break; case 'search_category_id': - list($tmp_where, $tmp_bind) = $objDb->sfGetCatWhere($val); + list($tmp_where, $tmp_bind) = $objDb->getCatWhere($val); if ($tmp_where != '') { $where.= ' AND alldtl.product_id IN (SELECT product_id FROM dtb_product_categories WHERE ' . $tmp_where . ')'; $bind = array_merge((array) $bind, (array) $tmp_bind); @@ -185,14 +182,14 @@ public function createWhere(&$objFormParam, &$objDb) * * 検索結果対象となる商品の数を返す。 * @param array $whereAndBind - * @param SC_Product $objProduct + * @param Product $objProduct */ - public function getLineCount($whereAndBind, &$objProduct) + public function getLineCount($whereAndBind, Product &$objProduct) { $where = $whereAndBind['where']; $bind = $whereAndBind['bind']; // 検索結果対象となる商品の数を取得 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setWhere($where); $linemax = $objProduct->findProductCount($objQuery, $bind); @@ -202,14 +199,14 @@ public function getLineCount($whereAndBind, &$objProduct) /** * 検索結果の取得 * @param array $whereAndBind string whereと array bindの連想配列 - * @param SC_Product $objProduct + * @param Product $objProduct * @param integer $page_max */ - public function getProducts($whereAndBind, &$objProduct, $page_max, $startno) + public function getProducts($whereAndBind, Product &$objProduct, $page_max, $startno) { $where = $whereAndBind['where']; $bind = $whereAndBind['bind']; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setWhere($where); // 取得範囲の指定(開始行番号、行数のセット) $objQuery->setLimitOffset($page_max, $startno); @@ -221,11 +218,11 @@ public function getProducts($whereAndBind, &$objProduct, $page_max, $startno) * 商品取得 * * @param array $arrProductId - * @param SC_Product $objProduct + * @param Product $objProduct */ - public function getProductList($arrProductId, &$objProduct) + public function getProductList($arrProductId, Product &$objProduct) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 表示順序 $order = 'update_date DESC, product_id DESC'; diff --git a/data/class/pages/admin/customer/LC_Page_Admin_Customer_Edit.php b/data/Eccube/Page/Admin/Customer/Edit.php similarity index 79% rename from data/class/pages/admin/customer/LC_Page_Admin_Customer_Edit.php rename to data/Eccube/Page/Admin/Customer/Edit.php index 7d8096647e9..4028723d1fb 100644 --- a/data/class/pages/admin/customer/LC_Page_Admin_Customer_Edit.php +++ b/data/Eccube/Page/Admin/Customer/Edit.php @@ -1,36 +1,34 @@ tpl_maintitle = '会員管理'; $this->tpl_subtitle = '会員登録'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->arrJob = $masterData->getMasterData('mtb_job'); @@ -57,13 +55,13 @@ public function init() $this->arrMailMagazineType = $masterData->getMasterData('mtb_mail_magazine_type'); // 日付プルダウン設定 - $objDate = new SC_Date_Ex(BIRTH_YEAR); + $objDate = new Date(BIRTH_YEAR); $this->arrYear = $objDate->getYear(); $this->arrMonth = $objDate->getMonth(); $this->arrDay = $objDate->getDay(); // 支払い方法種別 - $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); + $this->arrPayment = PaymentHelper::getIDValueList(); } /** @@ -85,9 +83,9 @@ public function process() public function action() { // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // 検索引き継ぎ用パラメーター管理クラス - $objFormSearchParam = new SC_FormParam_Ex(); + $objFormSearchParam = new FormParam(); // モードによる処理切り替え switch ($this->getMode()) { @@ -97,11 +95,11 @@ public function action() $objFormSearchParam->setParam($_REQUEST); $this->arrErr = $this->lfCheckErrorSearchParam($objFormSearchParam); $this->arrSearchData = $objFormSearchParam->getSearchArray(); - if (!SC_Utils_Ex::isBlank($this->arrErr)) { + if (!Utils::isBlank($this->arrErr)) { return; } // 指定会員の情報をセット - $this->arrForm = SC_Helper_Customer_Ex::sfGetCustomerData($objFormSearchParam->getValue('edit_customer_id'), true); + $this->arrForm = CustomerHelper::sfGetCustomerData($objFormSearchParam->getValue('edit_customer_id'), true); // 購入履歴情報の取得 list($this->tpl_linemax, $this->arrPurchaseHistory, $this->objNavi) = $this->lfPurchaseHistory($objFormSearchParam->getValue('edit_customer_id')); $this->arrPagenavi = $this->objNavi->arrPagenavi; @@ -121,7 +119,7 @@ public function action() $objFormSearchParam->setParam($objFormParam->getValue('search_data')); $this->arrSearchErr = $this->lfCheckErrorSearchParam($objFormSearchParam); $this->arrSearchData = $objFormSearchParam->getSearchArray(); - if (!SC_Utils_Ex::isBlank($this->arrErr) or !SC_Utils_Ex::isBlank($this->arrSearchErr)) { + if (!Utils::isBlank($this->arrErr) or !Utils::isBlank($this->arrSearchErr)) { return; } // 確認画面テンプレートに切り替え @@ -140,7 +138,7 @@ public function action() $objFormSearchParam->setParam($objFormParam->getValue('search_data')); $this->arrSearchErr = $this->lfCheckErrorSearchParam($objFormSearchParam); $this->arrSearchData = $objFormSearchParam->getSearchArray(); - if (!SC_Utils_Ex::isBlank($this->arrErr) or !SC_Utils_Ex::isBlank($this->arrSearchErr)) { + if (!Utils::isBlank($this->arrErr) or !Utils::isBlank($this->arrSearchErr)) { return; } // 購入履歴情報の取得 @@ -164,7 +162,7 @@ public function action() $objFormSearchParam->setParam($objFormParam->getValue('search_data')); $this->arrSearchErr = $this->lfCheckErrorSearchParam($objFormSearchParam); $this->arrSearchData = $objFormSearchParam->getSearchArray(); - if (!SC_Utils_Ex::isBlank($this->arrErr) or !SC_Utils_Ex::isBlank($this->arrSearchErr)) { + if (!Utils::isBlank($this->arrErr) or !Utils::isBlank($this->arrSearchErr)) { return; } $this->lfRegistData($objFormParam); @@ -179,7 +177,7 @@ public function action() $objFormSearchParam->setParam($objFormParam->getValue('search_data')); $this->arrSearchErr = $this->lfCheckErrorSearchParam($objFormSearchParam); $this->arrSearchData = $objFormSearchParam->getSearchArray(); - if (!SC_Utils_Ex::isBlank($this->arrSearchErr)) { + if (!Utils::isBlank($this->arrSearchErr)) { return; } default: @@ -199,7 +197,7 @@ public function action() public function lfInitParam(&$objFormParam) { // 会員項目のパラメーター取得 - SC_Helper_Customer_Ex::sfCustomerEntryParam($objFormParam, true); + CustomerHelper::sfCustomerEntryParam($objFormParam, true); // 検索結果一覧画面への戻り用パラメーター $objFormParam->addParam('検索用データ', 'search_data', '', '', array(), '', false); // 会員購入履歴ページング用 @@ -209,12 +207,12 @@ public function lfInitParam(&$objFormParam) /** * 検索パラメーター引き継ぎ用情報の初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ public function lfInitSearchParam(&$objFormParam) { - SC_Helper_Customer_Ex::sfSetSearchParam($objFormParam); + CustomerHelper::sfSetSearchParam($objFormParam); // 初回受け入れ時用 $objFormParam->addParam('編集対象会員ID', 'edit_customer_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); } @@ -222,12 +220,12 @@ public function lfInitSearchParam(&$objFormParam) /** * 検索パラメーターエラーチェック * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckErrorSearchParam(&$objFormParam) { - return SC_Helper_Customer_Ex::sfCheckErrorSearchParam($objFormParam); + return CustomerHelper::sfCheckErrorSearchParam($objFormParam); } /** @@ -238,10 +236,10 @@ public function lfCheckErrorSearchParam(&$objFormParam) */ public function lfCheckError(&$objFormParam) { - $arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam, true); + $arrErr = CustomerHelper::sfCustomerMypageErrorCheck($objFormParam, true); // メアド重複チェック(共通ルーチンは使えない) - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'email, email_mobile, customer_id'; $table = 'dtb_customer'; $where = 'del_flg <> 1 AND (email Like ? OR email_mobile Like ?)'; @@ -251,14 +249,14 @@ public function lfCheckError(&$objFormParam) $arrVal[] = $objFormParam->getValue('customer_id'); } $arrData = $objQuery->getRow($col, $table, $where, $arrVal); - if (!SC_Utils_Ex::isBlank($arrData['email'])) { + if (!Utils::isBlank($arrData['email'])) { if ($arrData['email'] == $objFormParam->getValue('email')) { $arrErr['email'] = '※ すでに他の会員(ID:' . $arrData['customer_id'] . ')が使用しているアドレスです。'; } elseif ($arrData['email'] == $objFormParam->getValue('email_mobile')) { $arrErr['email_mobile'] = '※ すでに他の会員(ID:' . $arrData['customer_id'] . ')が使用しているアドレスです。'; } } - if (!SC_Utils_Ex::isBlank($arrData['email_mobile'])) { + if (!Utils::isBlank($arrData['email_mobile'])) { if ($arrData['email_mobile'] == $objFormParam->getValue('email_mobile')) { $arrErr['email_mobile'] = '※ すでに他の会員(ID:' . $arrData['customer_id'] . ')が使用している携帯アドレスです。'; } elseif ($arrData['email_mobile'] == $objFormParam->getValue('email')) { @@ -282,7 +280,7 @@ public function lfRegistData(&$objFormParam) // 登録用データ取得 $arrData = $objFormParam->getDbArray(); // 足りないものを作る - if (!SC_Utils_Ex::isBlank($objFormParam->getValue('year'))) { + if (!Utils::isBlank($objFormParam->getValue('year'))) { $arrData['birth'] = $objFormParam->getValue('year') . '/' . $objFormParam->getValue('month') . '/' . $objFormParam->getValue('day') @@ -290,28 +288,28 @@ public function lfRegistData(&$objFormParam) } if (!is_numeric($arrData['customer_id'])) { - $arrData['secret_key'] = SC_Utils_Ex::sfGetUniqRandomId('r'); + $arrData['secret_key'] = Utils::sfGetUniqRandomId('r'); } else { - $arrOldCustomerData = SC_Helper_Customer_Ex::sfGetCustomerData($arrData['customer_id']); + $arrOldCustomerData = CustomerHelper::sfGetCustomerData($arrData['customer_id']); if ($arrOldCustomerData['status'] != $arrData['status']) { - $arrData['secret_key'] = SC_Utils_Ex::sfGetUniqRandomId('r'); + $arrData['secret_key'] = Utils::sfGetUniqRandomId('r'); } } - return SC_Helper_Customer_Ex::sfEditCustomerData($arrData, $arrData['customer_id']); + return CustomerHelper::sfEditCustomerData($arrData, $arrData['customer_id']); } /** * 購入履歴情報の取得 * - * @return array( integer 全体件数, mixed 会員データ一覧配列, mixed SC_PageNaviオブジェクト) + * @return array( integer 全体件数, mixed 会員データ一覧配列, mixed PageNaviオブジェクト) */ public function lfPurchaseHistory($customer_id, $pageno = 0) { - if (SC_Utils_Ex::isBlank($customer_id)) { + if (Utils::isBlank($customer_id)) { return array('0', array(), NULL); } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $page_max = SEARCH_PMAX; $table = 'dtb_order'; $where = 'customer_id = ? AND del_flg <> 1'; @@ -319,7 +317,7 @@ public function lfPurchaseHistory($customer_id, $pageno = 0) // 購入履歴の件数取得 $linemax = $objQuery->count($table, $where, $arrVal); // ページ送りの取得 - $objNavi = new SC_PageNavi_Ex($pageno, $linemax, $page_max, 'eccube.moveSecondSearchPage', NAVI_PMAX); + $objNavi = new PageNavi($pageno, $linemax, $page_max, 'eccube.moveSecondSearchPage', NAVI_PMAX); // 取得範囲の指定(開始行番号、行数のセット) $objQuery->setLimitOffset($page_max, $objNavi->start_row); // 表示順序 diff --git a/data/class/pages/admin/customer/LC_Page_Admin_Customer.php b/data/Eccube/Page/Admin/Customer/Index.php similarity index 74% rename from data/class/pages/admin/customer/LC_Page_Admin_Customer.php rename to data/Eccube/Page/Admin/Customer/Index.php index df1b9be6c2a..775ce4d233b 100644 --- a/data/class/pages/admin/customer/LC_Page_Admin_Customer.php +++ b/data/Eccube/Page/Admin/Customer/Index.php @@ -1,36 +1,36 @@ tpl_maintitle = '会員管理'; $this->tpl_subtitle = '会員マスター'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrJob = $masterData->getMasterData('mtb_job'); $this->arrJob['不明'] = '不明'; @@ -57,7 +57,7 @@ public function init() $this->arrMagazineType = $masterData->getMasterData('mtb_magazine_type'); // 日付プルダウン設定 - $objDate = new SC_Date_Ex(); + $objDate = new Date(); // 登録・更新日検索用 $objDate->setStartYear(RELEASE_YEAR); $objDate->setEndYear(DATE('Y')); @@ -71,8 +71,8 @@ public function init() $this->arrDay = $objDate->getDay(); // カテゴリ一覧設定 - $objDb = new SC_Helper_DB_Ex(); - $this->arrCatList = $objDb->sfGetCategoryList(); + $objDb = new DbHelper(); + $this->arrCatList = $objDb->getCategoryList(); $this->httpCacheControl('nocache'); } @@ -96,7 +96,7 @@ public function process() public function action() { // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター設定 $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); @@ -108,7 +108,7 @@ public function action() // 入力パラメーターチェック $this->arrErr = $this->lfCheckError($objFormParam); - if (!SC_Utils_Ex::isBlank($this->arrErr)) { + if (!Utils::isBlank($this->arrErr)) { return; } @@ -131,7 +131,7 @@ public function action() case 'csv': $this->lfDoCSV($objFormParam->getHashArray()); - SC_Response_Ex::actionExit(); + Response::actionExit(); break; default: break; @@ -142,24 +142,24 @@ public function action() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ public function lfInitParam(&$objFormParam) { - SC_Helper_Customer_Ex::sfSetSearchParam($objFormParam); + CustomerHelper::sfSetSearchParam($objFormParam); $objFormParam->addParam('編集対象会員ID', 'edit_customer_id', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); } /** * エラーチェック * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckError(&$objFormParam) { - return SC_Helper_Customer_Ex::sfCheckErrorSearchParam($objFormParam); + return CustomerHelper::sfCheckErrorSearchParam($objFormParam); } /** @@ -170,7 +170,7 @@ public function lfCheckError(&$objFormParam) */ public function lfDoDeleteCustomer($customer_id) { - return SC_Helper_Customer_Ex::delete($customer_id); + return CustomerHelper::delete($customer_id); } /** @@ -181,15 +181,15 @@ public function lfDoDeleteCustomer($customer_id) */ public function lfDoResendMail($customer_id) { - $arrData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id); - if (SC_Utils_Ex::isBlank($arrData) or $arrData['del_flg'] == 1) { + $arrData = CustomerHelper::sfGetCustomerDataFromId($customer_id); + if (Utils::isBlank($arrData) or $arrData['del_flg'] == 1) { //対象となるデータが見つからない、または削除済み return false; } //仮登録メール再送 $resend_flg = true; // 登録メール再送 - $objHelperMail = new SC_Helper_Mail_Ex(); + $objHelperMail = new MailHelper(); $objHelperMail->setPage($this); $objHelperMail->sfSendRegistMail($arrData['secret_key'], $customer_id, null, $resend_flg); return true; @@ -199,11 +199,11 @@ public function lfDoResendMail($customer_id) * 会員一覧を検索する処理 * * @param array $arrParam 検索パラメーター連想配列 - * @return array( integer 全体件数, mixed 会員データ一覧配列, mixed SC_PageNaviオブジェクト) + * @return array( integer 全体件数, mixed 会員データ一覧配列, mixed PageNaviオブジェクト) */ public function lfDoSearch($arrParam) { - return SC_Helper_Customer_Ex::sfGetSearchData($arrParam); + return CustomerHelper::sfGetSearchData($arrParam); } /** @@ -214,8 +214,8 @@ public function lfDoSearch($arrParam) */ public function lfDoCSV($arrParam) { - $objSelect = new SC_CustomerList_Ex($arrParam, 'customer'); - $objCSV = new SC_Helper_CSV_Ex(); + $objSelect = new CustomerList($arrParam, 'customer'); + $objCSV = new CsvHelper(); $order = 'update_date DESC, customer_id DESC'; diff --git a/data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php b/data/Eccube/Page/Admin/Customer/SearchCustomer.php similarity index 61% rename from data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php rename to data/Eccube/Page/Admin/Customer/SearchCustomer.php index c4aac7eb8e8..6689c966d0c 100644 --- a/data/class/pages/admin/customer/LC_Page_Admin_Customer_SearchCustomer.php +++ b/data/Eccube/Page/Admin/Customer/SearchCustomer.php @@ -1,36 +1,29 @@ lfInitParam($objFormParam); $objFormParam->setParam($_POST); @@ -73,7 +66,7 @@ public function action() $this->arrForm = $objFormParam->getFormParamList(); // 入力パラメーターチェック $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { // POSTのモードがsearchなら会員検索開始 switch ($this->getMode()) { case 'search': @@ -90,33 +83,33 @@ public function action() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ public function lfInitParam(&$objFormParam) { - SC_Helper_Customer_Ex::sfSetSearchParam($objFormParam); + CustomerHelper::sfSetSearchParam($objFormParam); } /** * エラーチェック * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckError(&$objFormParam) { - return SC_Helper_Customer_Ex::sfCheckErrorSearchParam($objFormParam); + return CustomerHelper::sfCheckErrorSearchParam($objFormParam); } /** * 会員一覧を検索する処理 * * @param array $arrParam 検索パラメーター連想配列 - * @return array( integer 全体件数, mixed 会員データ一覧配列, mixed SC_PageNaviオブジェクト) + * @return array( integer 全体件数, mixed 会員データ一覧配列, mixed PageNaviオブジェクト) */ public function lfDoSearch($arrParam) { - return SC_Helper_Customer_Ex::sfGetSearchData($arrParam); + return CustomerHelper::sfGetSearchData($arrParam); } } diff --git a/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php b/data/Eccube/Page/Admin/Design/Bloc.php similarity index 71% rename from data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php rename to data/Eccube/Page/Admin/Design/Bloc.php index b0000a64afb..7a099237643 100644 --- a/data/class/pages/admin/design/LC_Page_Admin_Design_Bloc.php +++ b/data/Eccube/Page/Admin/Design/Bloc.php @@ -1,36 +1,33 @@ tpl_mainno = 'design'; $this->tpl_maintitle = 'デザイン管理'; $this->tpl_subtitle = 'ブロック設定'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); } @@ -69,24 +66,24 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); - $is_error = (!SC_Utils_Ex::isBlank($this->arrErr)); + $is_error = (!Utils::isBlank($this->arrErr)); $this->bloc_id = $objFormParam->getValue('bloc_id'); $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); - $objBloc = new SC_Helper_Bloc_Ex($this->device_type_id); + $objBloc = new BlocHelper($this->device_type_id); switch ($this->getMode()) { // 登録/更新 case 'confirm': if (!$is_error) { $this->arrErr = $this->lfCheckError($objFormParam, $this->arrErr, $objBloc); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $result = $this->doRegister($objFormParam, $objBloc); if ($result !== false) { $arrPram = array( @@ -95,8 +92,8 @@ public function action() 'msg' => 'on', ); - SC_Response_Ex::reload($arrPram, true); - SC_Response_Ex::actionExit(); + Response::reload($arrPram, true); + Response::actionExit(); } } } @@ -111,8 +108,8 @@ public function action() 'msg' => 'on', ); - SC_Response_Ex::reload($arrPram, true); - SC_Response_Ex::actionExit(); + Response::reload($arrPram, true); + Response::actionExit(); } } break; @@ -129,13 +126,13 @@ public function action() // ブロック一覧を取得 $this->arrBlocList = $objBloc->getList(); // bloc_id が指定されている場合にはブロックデータの取得 - if (!SC_Utils_Ex::isBlank($this->bloc_id)) { + if (!Utils::isBlank($this->bloc_id)) { $arrBloc = $this->getBlocTemplate($this->bloc_id, $objBloc); $objFormParam->setParam($arrBloc); } } else { // 画面にエラー表示しないため, ログ出力 - GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); + GcUtils::gfPrintLog('Error: ' . print_r($this->arrErr, true)); } $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . '>' . $this->tpl_subtitle; $this->arrForm = $objFormParam->getFormParamList(); @@ -144,7 +141,7 @@ public function action() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -160,10 +157,10 @@ public function lfInitParam(&$objFormParam) * ブロックのテンプレートを取得する. * * @param integer $bloc_id ブロックID - * @param SC_Helper_Bloc_Ex $objBloc SC_Helper_Bloc_Ex インスタンス + * @param BlocHelper $objBloc BlocHelper インスタンス * @return array ブロック情報の配列 */ - public function getBlocTemplate($bloc_id, SC_Helper_Bloc_Ex &$objBloc) + public function getBlocTemplate($bloc_id, BlocHelper &$objBloc) { $arrBloc = $objBloc->getBloc($bloc_id); @@ -176,12 +173,12 @@ public function getBlocTemplate($bloc_id, SC_Helper_Bloc_Ex &$objBloc) * ファイルの作成に失敗した場合は, エラーメッセージを出力し, * データベースをロールバックする. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @param SC_Helper_Bloc $objBloc SC_Helper_Bloc インスタンス + * @param FormParam $objFormParam FormParam インスタンス + * @param BlocHelper $objBloc BlocHelper インスタンス * @return integer|boolean 登録が成功した場合, 登録したブロックID; * 失敗した場合 false */ - public function doRegister(&$objFormParam, SC_Helper_Bloc_Ex &$objBloc) + public function doRegister(&$objFormParam, BlocHelper &$objBloc) { $arrParams = $objFormParam->getHashArray(); $result = $objBloc->save($arrParams); @@ -196,11 +193,11 @@ public function doRegister(&$objFormParam, SC_Helper_Bloc_Ex &$objBloc) /** * 削除を実行する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @param SC_Helper_Bloc $objBloc SC_Helper_Bloc インスタンス + * @param FormParam $objFormParam FormParam インスタンス + * @param BlocHelper $objBloc BlocHelper インスタンス * @return boolean 登録が成功した場合 true; 失敗した場合 false */ - public function doDelete(&$objFormParam, SC_Helper_Bloc_Ex &$objBloc) + public function doDelete(&$objFormParam, BlocHelper &$objBloc) { $arrParams = $objFormParam->getHashArray(); $result = $objBloc->delete($arrParams['bloc_id']); @@ -215,13 +212,13 @@ public function doDelete(&$objFormParam, SC_Helper_Bloc_Ex &$objBloc) /** * エラーチェックを行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array エラーメッセージの配列 */ - public function lfCheckError(&$objFormParam, &$arrErr, SC_Helper_Bloc_Ex &$objBloc) + public function lfCheckError(&$objFormParam, &$arrErr, BlocHelper &$objBloc) { $arrParams = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrParams); + $objErr = new CheckError($arrParams); $objErr->arrErr =& $arrErr; $objErr->doFunc(array('ブロック名', 'bloc_name', STEXT_LEN), array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); $objErr->doFunc(array('ファイル名', 'filename', STEXT_LEN), array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK','FILE_NAME_CHECK_BY_NOUPLOAD')); @@ -230,12 +227,12 @@ public function lfCheckError(&$objFormParam, &$arrErr, SC_Helper_Bloc_Ex &$objBl $arrValues = array($arrParams['filename']); // 変更の場合は自ブロックを除外 - if (!SC_Utils_Ex::isBlank($arrParams['bloc_id'])) { + if (!Utils::isBlank($arrParams['bloc_id'])) { $where .= ' AND bloc_id <> ?'; $arrValues[] = $arrParams['bloc_id']; } $arrBloc = $objBloc->getWhere($where, $arrValues); - if (!SC_Utils_Ex::isBlank($arrBloc)) { + if (!Utils::isBlank($arrBloc)) { $objErr->arrErr['filename'] = '※ 同じファイル名のデータが存在しています。別のファイル名を入力してください。
'; } diff --git a/data/class/pages/admin/design/LC_Page_Admin_Design_CSS.php b/data/Eccube/Page/Admin/Design/Css.php similarity index 79% rename from data/class/pages/admin/design/LC_Page_Admin_Design_CSS.php rename to data/Eccube/Page/Admin/Design/Css.php index a050c54b98a..2f1e825b5f5 100644 --- a/data/class/pages/admin/design/LC_Page_Admin_Design_CSS.php +++ b/data/Eccube/Page/Admin/Design/Css.php @@ -1,36 +1,34 @@ tpl_mainno = 'design'; $this->tpl_maintitle = 'デザイン管理'; $this->tpl_subtitle = 'CSS設定'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); } @@ -68,14 +66,14 @@ public function process() */ public function action() { - $objLayout = new SC_Helper_PageLayout_Ex(); + $objLayout = new PageLayoutHelper(); - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); - $is_error = !SC_Utils_Ex::isBlank($this->arrErr); + $is_error = !Utils::isBlank($this->arrErr); // CSSファイル名を取得 $this->css_name = $objFormParam->getValue('css_name'); @@ -90,7 +88,7 @@ public function action() case 'confirm': if (!$is_error) { $this->arrErr = array_merge($this->arrErr, $this->lfCheckError($objFormParam, $this->arrErr)); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { if ($this->doRegister($css_dir, $this->css_name, $this->old_css_name, $css_path, $objFormParam->getValue('css_data'))) { $this->tpl_onload = "alert('登録が完了しました。');"; @@ -106,7 +104,7 @@ public function action() 'msg' => 'on', ); - SC_Response_Ex::reload($arrPram, true); + Response::reload($arrPram, true); } } break; @@ -118,14 +116,14 @@ public function action() break; } - if (SC_Utils_Ex::isBlank($this->arrErr) && $this->checkPath($this->css_name)) { + if (Utils::isBlank($this->arrErr) && $this->checkPath($this->css_name)) { // CSSファイルの読み込み - if (!SC_Utils_Ex::isBlank($this->css_name)) { + if (!Utils::isBlank($this->css_name)) { $objFormParam->setValue('css_data', file_get_contents($css_path)); } } else { // 画面にエラー表示しないため, ログ出力 - GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); + GcUtils::gfPrintLog('Error: ' . print_r($this->arrErr, true)); } // ファイルリストを取得 @@ -138,7 +136,7 @@ public function action() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -163,7 +161,7 @@ public function lfInitParam(&$objFormParam) */ public function doRegister($css_dir, $css_name, $old_css_name, $css_path, $css_data) { - if (!SC_Utils_Ex::isBlank($old_css_name) + if (!Utils::isBlank($old_css_name) && $old_css_name != $css_name) { if (!unlink($css_dir . $old_css_name . '.css')) { $this->arrErr['err'] = '※ 旧ファイルの削除に失敗しました
'; @@ -172,7 +170,7 @@ public function doRegister($css_dir, $css_name, $old_css_name, $css_path, $css_d } } - if (!SC_Helper_FileManager_Ex::sfWriteFile($css_path, $css_data)) { + if (!FileManagerHelper::sfWriteFile($css_path, $css_data)) { $this->arrErr['err'] = '※ CSSの書き込みに失敗しました
'; return false; @@ -206,7 +204,7 @@ public function doDelete($css_path) */ public function getCSSList($css_dir) { - $objFileManager = new SC_Helper_FileManager_Ex(); + $objFileManager = new FileManagerHelper(); $arrFileList = $objFileManager->sfGetFileList($css_dir); foreach ($arrFileList as $val) { @@ -224,13 +222,13 @@ public function getCSSList($css_dir) /** * エラーチェックを行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array エラーメッセージの配列 */ public function lfCheckError(&$objFormParam, &$arrErr) { $arrParams = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrParams); + $objErr = new CheckError($arrParams); $objErr->arrErr =& $arrErr; $objErr->doFunc(array('CSSファイル名', 'css_name', STEXT_LEN), array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK', 'FILE_NAME_CHECK_BY_NOUPLOAD')); @@ -240,11 +238,11 @@ public function lfCheckError(&$objFormParam, &$arrErr) $is_error = false; // 重複チェック - if (SC_Utils_Ex::isBlank($objErr->arrErr['css_name'])) { + if (Utils::isBlank($objErr->arrErr['css_name'])) { $arrCSSList = $this->getCSSList($this->getCSSDir($device_type_id)); foreach ($arrCSSList as $val) { if ($val['css_name'] == $css_name) { - if (SC_Utils_Ex::isBlank($old_css_name) + if (Utils::isBlank($old_css_name) || $old_css_name != $css_name) { $is_error = true; } @@ -266,7 +264,7 @@ public function lfCheckError(&$objFormParam, &$arrErr) */ public function getCSSDir($device_type_id) { - return SC_Helper_PageLayout_Ex::getTemplatePath($device_type_id, true) . 'css/'; + return PageLayoutHelper::getTemplatePath($device_type_id, true) . 'css/'; } /** diff --git a/data/class/pages/admin/design/LC_Page_Admin_Design_Header.php b/data/Eccube/Page/Admin/Design/Header.php similarity index 74% rename from data/class/pages/admin/design/LC_Page_Admin_Design_Header.php rename to data/Eccube/Page/Admin/Design/Header.php index d8ed08cb9a7..ab588d5d20a 100644 --- a/data/class/pages/admin/design/LC_Page_Admin_Design_Header.php +++ b/data/Eccube/Page/Admin/Design/Header.php @@ -1,36 +1,33 @@ tpl_mainno = 'design'; $this->tpl_maintitle = 'デザイン管理'; $this->tpl_subtitle = 'ヘッダー/フッター設定'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); } @@ -69,12 +66,12 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); - $is_error = (!SC_Utils_Ex::isBlank($this->arrErr)); + $is_error = (!Utils::isBlank($this->arrErr)); $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); @@ -82,7 +79,7 @@ public function action() // 登録 case 'regist': $this->arrErr = $this->lfCheckError($objFormParam, $this->arrErr); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { if ($this->doRegister($objFormParam)) { $this->tpl_onload = "alert('登録が完了しました。');"; } @@ -105,7 +102,7 @@ public function action() } } else { // 画面にエラー表示しないため, ログ出力 - GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); + GcUtils::gfPrintLog('Error: ' . print_r($this->arrErr, true)); } //サブタイトルの追加 @@ -115,7 +112,7 @@ public function action() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -129,13 +126,13 @@ public function lfInitParam(&$objFormParam) /** * エラーチェックを行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array エラーメッセージの配列 */ public function lfCheckError(&$objFormParam, &$arrErr) { $arrParams = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrParams); + $objErr = new CheckError($arrParams); $objErr->arrErr =& $arrErr; $objErr->doFunc(array('division', 'division', STEXT_LEN), array('EXIST_CHECK')); @@ -147,7 +144,7 @@ public function lfCheckError(&$objFormParam, &$arrErr) * * ファイルの作成に失敗した場合は, エラーメッセージを出力する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return boolean 登録が成功した場合 true; 失敗した場合 false */ public function doRegister(&$objFormParam) @@ -156,7 +153,7 @@ public function doRegister(&$objFormParam) $contents = $objFormParam->getValue($division); $tpl_path = $this->getTemplatePath($objFormParam->getValue('device_type_id'), $division); if ($tpl_path === false - || !SC_Helper_FileManager_Ex::sfWriteFile($tpl_path, $contents)) { + || !FileManagerHelper::sfWriteFile($tpl_path, $contents)) { $this->arrErr['err'] = '※ ファイルの書き込みに失敗しました
'; return false; @@ -174,7 +171,7 @@ public function doRegister(&$objFormParam) */ public function getTemplatePath($device_type_id, $division) { - $tpl_path = SC_Helper_PageLayout_Ex::getTemplatePath($device_type_id) . '/' . $division . '.tpl'; + $tpl_path = PageLayoutHelper::getTemplatePath($device_type_id) . '/' . $division . '.tpl'; if (file_exists($tpl_path)) { return $tpl_path; } else { diff --git a/data/class/pages/admin/design/LC_Page_Admin_Design.php b/data/Eccube/Page/Admin/Design/Index.php similarity index 80% rename from data/class/pages/admin/design/LC_Page_Admin_Design.php rename to data/Eccube/Page/Admin/Design/Index.php index 1d40d562eda..f52dad4010f 100644 --- a/data/class/pages/admin/design/LC_Page_Admin_Design.php +++ b/data/Eccube/Page/Admin/Design/Index.php @@ -1,36 +1,32 @@ tpl_mainno = 'design'; $this->tpl_maintitle = 'デザイン管理'; $this->tpl_subtitle = 'レイアウト設定'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrTarget = $masterData->getMasterData('mtb_target'); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); } @@ -68,8 +64,8 @@ public function process() */ public function action() { - $objLayout = new SC_Helper_PageLayout_Ex(); - $objFormParam = new SC_FormParam_Ex(); + $objLayout = new PageLayoutHelper(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam, intval($_REQUEST['bloc_cnt'])); $objFormParam->setParam($_REQUEST); @@ -80,15 +76,15 @@ public function action() // 新規ブロック作成 case 'new_bloc': - SC_Response_Ex::sendRedirect('bloc.php', array('device_type_id' => $this->device_type_id)); - SC_Response_Ex::actionExit(); + Response::sendRedirect('bloc.php', array('device_type_id' => $this->device_type_id)); + Response::actionExit(); break; // 新規ページ作成 case 'new_page': - SC_Response_Ex::sendRedirect('main_edit.php', array('device_type_id' => $this->device_type_id)); - SC_Response_Ex::actionExit(); + Response::sendRedirect('main_edit.php', array('device_type_id' => $this->device_type_id)); + Response::actionExit(); break; // プレビュー @@ -97,16 +93,16 @@ public function action() $filename = $this->savePreviewData($this->page_id, $objLayout); $_SESSION['preview'] = 'ON'; - SC_Response_Ex::sendRedirectFromUrlPath('preview/' . DIR_INDEX_PATH, array('filename' => $filename)); - SC_Response_Ex::actionExit(); + Response::sendRedirectFromUrlPath('preview/' . DIR_INDEX_PATH, array('filename' => $filename)); + Response::actionExit(); // 編集実行 case 'confirm': $this->placingBlocs($objFormParam); $arrQueryString = array('device_type_id' => $this->device_type_id, 'page_id' => $this->page_id, 'msg' => 'on'); - SC_Response_Ex::reload($arrQueryString, true); - SC_Response_Ex::actionExit(); + Response::reload($arrQueryString, true); + Response::actionExit(); break; @@ -116,8 +112,8 @@ public function action() if ($objLayout->isEditablePage($this->device_type_id, $this->page_id)) { $objLayout->lfDelPageData($this->page_id, $this->device_type_id); - SC_Response_Ex::reload(array('device_type_id' => $this->device_type_id), true); - SC_Response_Ex::actionExit(); + Response::reload(array('device_type_id' => $this->device_type_id), true); + Response::actionExit(); } break; @@ -142,7 +138,7 @@ public function action() /** * フォームパラメーターの初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス. + * @param FormParam $objFormParam FormParam インスタンス. * @param integer $bloc_cnt ブロック数 * @return void */ @@ -166,7 +162,7 @@ public function lfInitParam(&$objFormParam, $bloc_cnt = 0) * * @param integer $device_type_id 端末種別ID * @param integer $page_id ページID - * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス + * @param PageLayoutHelper $objLayout PageLayoutHelper インスタンス * @return array レイアウト情報の配列 */ public function getLayout($device_type_id, $page_id, &$objLayout) @@ -233,13 +229,13 @@ public function existsBloc($arrBloc, $arrToBlocs) * プレビューするデータを DB に保存する. * * @param integer $page_id プレビューを行うページID - * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス + * @param PageLayoutHelper $objLayout PageLayoutHelper インスタンス * @return string プレビューを行う tpl_mainpage ファイル名 */ public function savePreviewData($page_id, &$objLayout) { $arrPageData = $objLayout->getPageProperties(DEVICE_TYPE_PC, $page_id); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrPageData[0]['page_id'] = 0; $objQuery->update('dtb_pagelayout', $arrPageData[0], 'page_id = 0 AND device_type_id = ?', array(DEVICE_TYPE_PC)); @@ -249,7 +245,7 @@ public function savePreviewData($page_id, &$objLayout) /** * ブロックを配置する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param boolean $is_preview プレビュー時の場合 true * @return void */ @@ -258,7 +254,7 @@ public function placingBlocs(&$objFormParam, $is_preview = false) $page_id = $is_preview ? 0 : $objFormParam->getValue('page_id'); $device_type_id = $objFormParam->getValue('device_type_id'); $bloc_cnt = $objFormParam->getValue('bloc_cnt'); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $objQuery->delete('dtb_blocposition', 'page_id = ? AND device_type_id = ?', array($page_id, $device_type_id)); @@ -266,7 +262,7 @@ public function placingBlocs(&$objFormParam, $is_preview = false) for ($i = 1; $i <= $bloc_cnt; $i++) { // bloc_id が取得できない場合は INSERT しない $id = $objFormParam->getValue('id_' . $i); - if (SC_Utils_Ex::isBlank($id)) { + if (Utils::isBlank($id)) { continue; } // 未使用は INSERT しない diff --git a/data/class/pages/admin/design/LC_Page_Admin_Design_MainEdit.php b/data/Eccube/Page/Admin/Design/MainEdit.php similarity index 82% rename from data/class/pages/admin/design/LC_Page_Admin_Design_MainEdit.php rename to data/Eccube/Page/Admin/Design/MainEdit.php index ea647f93694..29a28f51e5d 100644 --- a/data/class/pages/admin/design/LC_Page_Admin_Design_MainEdit.php +++ b/data/Eccube/Page/Admin/Design/MainEdit.php @@ -1,36 +1,35 @@ tpl_mainno = 'design'; $this->tpl_maintitle = 'デザイン管理'; $this->tpl_subtitle = 'ページ詳細設定'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); } @@ -68,13 +67,13 @@ public function process() */ public function action() { - $objLayout = new SC_Helper_PageLayout_Ex(); - $objFormParam = new SC_FormParam_Ex(); + $objLayout = new PageLayoutHelper(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); $this->arrErr = $objFormParam->checkError(); - $is_error = (!SC_Utils_Ex::isBlank($this->arrErr)); + $is_error = (!Utils::isBlank($this->arrErr)); $this->device_type_id = $objFormParam->getValue('device_type_id', DEVICE_TYPE_PC); $this->page_id = $objFormParam->getValue('page_id'); @@ -86,9 +85,9 @@ public function action() if ($objLayout->isEditablePage($this->device_type_id, $this->page_id)) { $objLayout->lfDelPageData($this->page_id, $this->device_type_id); - SC_Response_Ex::reload(array('device_type_id' => $this->device_type_id, + Response::reload(array('device_type_id' => $this->device_type_id, 'msg' => 'on'), true); - SC_Response_Ex::actionExit(); + Response::actionExit(); } } break; @@ -97,7 +96,7 @@ public function action() case 'confirm': if (!$is_error) { $this->arrErr = $this->lfCheckError($objFormParam, $this->arrErr); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $result = $this->doRegister($objFormParam, $objLayout); if ($result !== false) { $arrQueryString = array( @@ -105,8 +104,8 @@ public function action() 'page_id' => $result, 'msg' => 'on', ); - SC_Response_Ex::reload($arrQueryString, true); - SC_Response_Ex::actionExit(); + Response::reload($arrQueryString, true); + Response::actionExit(); } } } @@ -122,13 +121,13 @@ public function action() if (!$is_error) { $this->arrPageList = $objLayout->getPageProperties($this->device_type_id, null); // page_id が指定されている場合にはテンプレートデータの取得 - if (!SC_Utils_Ex::isBlank($this->page_id)) { + if (!Utils::isBlank($this->page_id)) { $arrPageData = $this->getTplMainpage($this->device_type_id, $this->page_id, $objLayout); $objFormParam->setParam($arrPageData); } } else { // 画面にエラー表示しないため, ログ出力 - GC_Utils_Ex::gfPrintLog('Error: ' . print_r($this->arrErr, true)); + GcUtils::gfPrintLog('Error: ' . print_r($this->arrErr, true)); } $this->tpl_subtitle = $this->arrDeviceType[$this->device_type_id] . '>' . $this->tpl_subtitle; $this->arrForm = $objFormParam->getFormParamList(); @@ -139,7 +138,7 @@ public function action() * * XXX URL のフィールドは, 実際は filename なので注意 * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -163,7 +162,7 @@ public function lfInitParam(&$objFormParam) * * @param integer $device_type_id 端末種別ID * @param integer $page_id ページID - * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス + * @param PageLayoutHelper $objLayout PageLayoutHelper インスタンス * @return array ページデータの配列 */ public function getTplMainpage($device_type_id, $page_id, &$objLayout) @@ -187,8 +186,8 @@ public function getTplMainpage($device_type_id, $page_id, &$objLayout) * ファイルの作成に失敗した場合は, エラーメッセージを出力し, * データベースをロールバックする. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス + * @param FormParam $objFormParam FormParam インスタンス + * @param PageLayoutHelper $objLayout PageLayoutHelper インスタンス * @return integer|boolean 登録が成功した場合, 登録したページID; * 失敗した場合 false */ @@ -208,7 +207,7 @@ public function doRegister(&$objFormParam, &$objLayout) $arrParams['keyword'] = $objFormParam->getValue('keyword'); $arrParams['meta_robots'] = $objFormParam->getValue('meta_robots'); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $page_id = $this->registerPage($arrParams, $objLayout); @@ -218,7 +217,7 @@ public function doRegister(&$objFormParam, &$objLayout) * or 編集可能な既存ページ編集時かつ, PHP ファイルが存在しない場合に, * PHP ファイルを作成する. */ - if (SC_Utils_Ex::isBlank($arrParams['page_id']) + if (Utils::isBlank($arrParams['page_id']) || $objLayout->isEditablePage($arrParams['device_type_id'], $arrParams['page_id'])) { if (!$this->createPHPFile($filename)) { $this->arrErr['err'] = '※ PHPファイルの作成に失敗しました
'; @@ -236,7 +235,7 @@ public function doRegister(&$objFormParam, &$objLayout) $tpl_path = $objLayout->getTemplatePath($arrParams['device_type_id']) . $filename . '.tpl'; } - if (!SC_Helper_FileManager_Ex::sfWriteFile($tpl_path, $arrParams['tpl_data'])) { + if (!FileManagerHelper::sfWriteFile($tpl_path, $arrParams['tpl_data'])) { $this->arrErr['err'] = '※ TPLファイルの書き込みに失敗しました
'; $objQuery->rollback(); @@ -252,15 +251,15 @@ public function doRegister(&$objFormParam, &$objLayout) * 入力内容をデータベースに登録する. * * @param array $arrParams フォームパラメーターの配列 - * @param SC_Helper_PageLayout $objLayout SC_Helper_PageLayout インスタンス + * @param PageLayoutHelper $objLayout PageLayoutHelper インスタンス * @return integer ページID */ public function registerPage($arrParams, &$objLayout) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // ページIDが空の場合は新規登録 - $is_new = SC_Utils_Ex::isBlank($arrParams['page_id']); + $is_new = Utils::isBlank($arrParams['page_id']); // 既存ページの存在チェック if (!$is_new) { $arrExists = $objLayout->getPageProperties($arrParams['device_type_id'], $arrParams['page_id']); @@ -272,7 +271,7 @@ public function registerPage($arrParams, &$objLayout) $arrValues['update_date'] = 'CURRENT_TIMESTAMP'; // 新規登録 - if ($is_new || SC_Utils_Ex::isBlank($arrExists)) { + if ($is_new || Utils::isBlank($arrExists)) { $objQuery->setOrder(''); $arrValues['page_id'] = 1 + $objQuery->max('page_id', $table, 'device_type_id = ?', array($arrValues['device_type_id'])); @@ -297,20 +296,20 @@ public function registerPage($arrParams, &$objLayout) /** * エラーチェックを行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array エラーメッセージの配列 */ public function lfCheckError(&$objFormParam, &$arrErr) { $arrParams = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrParams); + $objErr = new CheckError($arrParams); $objErr->arrErr =& $arrErr; $objErr->doFunc(array('名称', 'page_name', STEXT_LEN), array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); $objErr->doFunc(array('URL', 'filename', STEXT_LEN), array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); /* * URL チェック - * ここでチェックするのは, パスのみなので SC_CheckError::URL_CHECK() + * ここでチェックするのは, パスのみなので CheckError::URL_CHECK() * は使用しない */ $valid_url = true; @@ -329,12 +328,12 @@ public function lfCheckError(&$objFormParam, &$arrErr) $where = 'page_id <> 0 AND device_type_id = ? AND filename = ?'; $arrValues = array($arrParams['device_type_id'], USER_DIR . $arrParams['filename']); // 変更の場合は自 URL を除外 - if (!SC_Utils_Ex::isBlank($arrParams['page_id'])) { + if (!Utils::isBlank($arrParams['page_id'])) { $where .= ' AND page_id <> ?'; $arrValues[] = $arrParams['page_id']; } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists('dtb_pagelayout', $where, $arrValues); if ($exists) { $objErr->arrErr['filename'] = '※ 同じURLのデータが存在しています。別のURLを入力してください。
'; @@ -370,6 +369,6 @@ public function createPHPFile($filename) $replaceStrings = "require_once '" . str_repeat('../', substr_count($filename, '/')) . "../require.php';"; $php_contents = str_replace($defaultStrings, $replaceStrings, $php_contents); - return SC_Helper_FileManager_Ex::sfWriteFile($path, $php_contents); + return FileManagerHelper::sfWriteFile($path, $php_contents); } } diff --git a/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php b/data/Eccube/Page/Admin/Design/Template.php similarity index 82% rename from data/class/pages/admin/design/LC_Page_Admin_Design_Template.php rename to data/Eccube/Page/Admin/Design/Template.php index 30c7d62e313..65c7c99fd83 100644 --- a/data/class/pages/admin/design/LC_Page_Admin_Design_Template.php +++ b/data/Eccube/Page/Admin/Design/Template.php @@ -1,36 +1,33 @@ arrErr = array(); $this->arrForm = array(); ini_set('max_execution_time', 300); - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); } @@ -70,7 +67,7 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); @@ -83,7 +80,7 @@ public function action() // 登録ボタン押下時 case 'register': $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { if ($this->doRegister($template_code, $this->device_type_id)) { $this->tpl_select = $template_code; $this->tpl_onload = "alert('登録が完了しました。');"; @@ -94,10 +91,10 @@ public function action() // 削除ボタン押下時 case 'delete': if ($objFormParam->checkError()) { - SC_Utils_Ex::sfDispError(''); + Utils::sfDispError(''); } $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { if ($this->doDelete($template_code, $this->device_type_id)) { $this->tpl_onload = "alert('削除が完了しました。');"; } @@ -107,10 +104,10 @@ public function action() // downloadボタン押下時 case 'download': $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { if ($this->doDownload($template_code) !== false) { // ブラウザに出力し, 終了する - SC_Response_Ex::actionExit(); + Response::actionExit(); } } break; @@ -126,7 +123,7 @@ public function action() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -146,7 +143,7 @@ public function lfInitParam(&$objFormParam) */ public function doUpdateMasterData($template_code, $device_type_id) { - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $defineName = 'TEMPLATE_NAME'; switch ($device_type_id) { @@ -187,7 +184,7 @@ public function updateBloc($filepath) // 改行、タブを1スペースに変換 $sql = preg_replace("/[\r\n\t]/", ' ', $sql); $sql_split = explode(';', $sql); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); foreach ($sql_split as $val) { if (trim($val) != '') { $objQuery->query($val); @@ -211,7 +208,7 @@ public function doDelete($template_code, $device_type_id) return false; } else { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $objQuery->delete('dtb_templates', 'template_code = ? AND device_type_id = ?', array($template_code, $device_type_id)); @@ -219,7 +216,7 @@ public function doDelete($template_code, $device_type_id) $error = '※ テンプレートの削除ができませんでした
'; // テンプレート削除 $templates_dir = SMARTY_TEMPLATES_REALDIR . $template_code. '/'; - if (SC_Helper_FileManager_Ex::deleteFile($templates_dir) === false) { + if (FileManagerHelper::deleteFile($templates_dir) === false) { $this->arrErr['err'] = $error; $objQuery->rollback(); @@ -227,7 +224,7 @@ public function doDelete($template_code, $device_type_id) } // ユーザーデータ削除 $user_dir = USER_TEMPLATE_REALDIR. $template_code. '/'; - if (SC_Helper_FileManager_Ex::deleteFile($user_dir) === false) { + if (FileManagerHelper::deleteFile($user_dir) === false) { $this->arrErr['err'] = $error; $objQuery->rollback(); @@ -236,7 +233,7 @@ public function doDelete($template_code, $device_type_id) // コンパイル削除 $templates_c_dir = DATA_REALDIR. 'Smarty/templates_c/'. $template_code. '/'; - if (SC_Helper_FileManager_Ex::deleteFile($templates_c_dir) === false) { + if (FileManagerHelper::deleteFile($templates_c_dir) === false) { $this->arrErr['err'] = $error; $objQuery->rollback(); @@ -274,7 +271,7 @@ public function doRegister($template_code, $device_type_id) $this->doUpdateMasterData($template_code, $device_type_id); // コンパイルファイルのクリア処理 - $objView = new SC_AdminView_Ex(); + $objView = new AdminView(); $objView->_smarty->clear_compiled_tpl(); return true; @@ -293,13 +290,13 @@ public function doDownload($template_code) { $from_dir = USER_TEMPLATE_REALDIR . $template_code . '/'; $to_dir = SMARTY_TEMPLATES_REALDIR . $template_code . '/_packages/'; - if (SC_Utils_Ex::recursiveMkdir($to_dir) === false) { + if (Utils::recursiveMkdir($to_dir) === false) { $this->arrErr['err'] = '※ ディレクトリの作成に失敗しました
'; return false; } - SC_Utils_Ex::sfCopyDir($from_dir, $to_dir); - if (SC_Helper_FileManager_Ex::downloadArchiveFiles(SMARTY_TEMPLATES_REALDIR . $template_code, $template_code) === false) { + Utils::sfCopyDir($from_dir, $to_dir); + if (FileManagerHelper::downloadArchiveFiles(SMARTY_TEMPLATES_REALDIR . $template_code, $template_code) === false) { $this->arrErr['err'] = '※ アーカイブファイルの作成に失敗しました
'; return false; @@ -316,7 +313,7 @@ public function doDownload($template_code) */ public function getAllTemplates($device_type_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->select('*', 'dtb_templates', 'device_type_id = ?', array($device_type_id)); } diff --git a/data/class/pages/admin/design/LC_Page_Admin_Design_UpDown.php b/data/Eccube/Page/Admin/Design/UpDown.php similarity index 78% rename from data/class/pages/admin/design/LC_Page_Admin_Design_UpDown.php rename to data/Eccube/Page/Admin/Design/UpDown.php index c95dfb1cb06..d659775f17c 100644 --- a/data/class/pages/admin/design/LC_Page_Admin_Design_UpDown.php +++ b/data/Eccube/Page/Admin/Design/UpDown.php @@ -1,36 +1,32 @@ arrErr = array(); $this->arrForm = array(); ini_set('max_execution_time', 300); - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); } @@ -72,7 +68,7 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); $objFormParam->convParam(); @@ -84,7 +80,7 @@ public function action() case 'upload': $objUpFile = $this->lfInitUploadFile($objFormParam); $this->arrErr = $this->lfCheckError($objFormParam, $objUpFile); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { if ($this->doUpload($objFormParam, $objUpFile)) { $this->tpl_onload = "alert('テンプレートファイルをアップロードしました。');"; $objFormParam->setValue('template_name', ''); @@ -102,24 +98,24 @@ public function action() } /** - * SC_UploadFileクラスの初期化. + * UploadFileクラスの初期化. * - * @param SC_FormParam $objForm SC_FormParamのインスタンス - * @return SC_UploadFile_Ex SC_UploadFileのインスタンス + * @param FormParam $objForm FormParamのインスタンス + * @return UploadFile UploadFileのインスタンス */ public function lfInitUploadFile($objForm) { $pkg_dir = SMARTY_TEMPLATES_REALDIR . $objForm->getValue('template_code'); - $objUpFile = new SC_UploadFile_Ex(TEMPLATE_TEMP_REALDIR, $pkg_dir); + $objUpFile = new UploadFile(TEMPLATE_TEMP_REALDIR, $pkg_dir); $objUpFile->addFile('テンプレートファイル', 'template_file', array(), TEMPLATE_SIZE, true, 0, 0, false); return $objUpFile; } /** - * SC_FormParamクラスの初期化. + * FormParamクラスの初期化. * - * @param SC_FormParam $objFormParam SC_FormParamのインスタンス + * @param FormParam $objFormParam FormParamのインスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -132,8 +128,8 @@ public function lfInitParam(&$objFormParam) /** * uploadモードのパラメーター検証を行う. * - * @param SC_FormParam $objFormParam SC_FormParamのインスタンス - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileのインスタンス + * @param FormParam $objFormParam FormParamのインスタンス + * @param UploadFile $objUpFile UploadFileのインスタンス * @return array エラー情報を格納した連想配列, エラーが無ければ(多分)nullを返す */ public function lfCheckError(&$objFormParam, &$objUpFile) @@ -156,7 +152,7 @@ public function lfCheckError(&$objFormParam, &$objUpFile) } // DBにすでに登録されていないかチェック - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists('dtb_templates', 'template_code = ?', array($template_code)); if ($exists) { $arrErr['template_code'] = '※ すでに登録されているテンプレートコードです。
'; @@ -172,7 +168,7 @@ public function lfCheckError(&$objFormParam, &$objUpFile) $arrErr['template_file'] = '※ テンプレートファイルが解凍できません。許可されている形式は、tar/tar.gzです。
'; } else { $make_temp_error = $objUpFile->makeTempFile('template_file', false); - if (!SC_Utils_Ex::isBlank($make_temp_error)) { + if (!Utils::isBlank($make_temp_error)) { $arrErr['template_file'] = $make_temp_error; } } @@ -185,8 +181,8 @@ public function lfCheckError(&$objFormParam, &$objUpFile) * * エラーが発生した場合は, エラーを出力し, false を返す. * - * @param SC_FormParam $objFormParam SC_FormParamのインスタンス - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileのインスタンス + * @param FormParam $objFormParam FormParamのインスタンス + * @param UploadFile $objUpFile UploadFileのインスタンス * @return boolean 成功した場合 true; 失敗した場合 false */ public function doUpload($objFormParam, $objUpFile) @@ -198,7 +194,7 @@ public function doUpload($objFormParam, $objUpFile) $template_dir = SMARTY_TEMPLATES_REALDIR . $template_code; $compile_dir = DATA_REALDIR . 'Smarty/templates_c/' . $template_code; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $arrValues = array( @@ -232,7 +228,7 @@ public function doUpload($objFormParam, $objUpFile) $objUpFile->moveTempFile(); // 解凍 - if (!SC_Helper_FileManager_Ex::unpackFile($template_dir . '/' . $_FILES['template_file']['name'])) { + if (!FileManagerHelper::unpackFile($template_dir . '/' . $_FILES['template_file']['name'])) { $this->arrErr['err'] = '※ テンプレートファイルの解凍に失敗しました。
'; $objQuery->rollback(); @@ -241,13 +237,13 @@ public function doUpload($objFormParam, $objUpFile) // ユーザデータの下のファイルをコピーする $from_dir = SMARTY_TEMPLATES_REALDIR . $template_code . '/_packages/'; $to_dir = USER_REALDIR . 'packages/' . $template_code . '/'; - if (!SC_Utils_Ex::recursiveMkdir($to_dir)) { + if (!Utils::recursiveMkdir($to_dir)) { $this->arrErr['err'] = '※ ' . $to_dir . ' の作成に失敗しました。
'; $objQuery->rollback(); return false; } - SC_Utils_Ex::sfCopyDir($from_dir, $to_dir); + Utils::sfCopyDir($from_dir, $to_dir); $objQuery->commit(); diff --git a/data/class/pages/admin/LC_Page_Admin_Home.php b/data/Eccube/Page/Admin/Home.php similarity index 82% rename from data/class/pages/admin/LC_Page_Admin_Home.php rename to data/Eccube/Page/Admin/Home.php index 2ffd38f2954..b43b38c6cd2 100644 --- a/data/class/pages/admin/LC_Page_Admin_Home.php +++ b/data/Eccube/Page/Admin/Home.php @@ -1,37 +1,29 @@ - sfGetDBVersion(); } @@ -132,7 +124,7 @@ public function lfGetDBVersion() */ public function lfGetCustomerCnt() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'COUNT(customer_id)'; $table = 'dtb_customer'; $where = 'del_flg = 0 AND status = 2'; @@ -148,10 +140,10 @@ public function lfGetCustomerCnt() */ public function lfGetOrderYesterday($method) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // TODO: DBFactory使わないでも共通化できそうな気もしますが - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); $sql = $dbFactory->getOrderYesterdaySql($method); return $objQuery->getOne($sql); @@ -165,11 +157,11 @@ public function lfGetOrderYesterday($method) */ public function lfGetOrderMonth($method) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $month = date('Y/m', mktime()); // TODO: DBFactory使わないでも共通化できそうな気もしますが - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); $sql = $dbFactory->getOrderMonthSql($method); return $objQuery->getOne($sql, array($month)); @@ -182,7 +174,7 @@ public function lfGetOrderMonth($method) */ public function lfGetTotalCustomerPoint() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'SUM(point)'; $where = 'del_flg = 0'; @@ -198,10 +190,10 @@ public function lfGetTotalCustomerPoint() */ public function lfGetReviewYesterday() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // TODO: DBFactory使わないでも共通化できそうな気もしますが - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); $sql = $dbFactory->getReviewYesterdaySql(); return $objQuery->getOne($sql); @@ -214,7 +206,7 @@ public function lfGetReviewYesterday() */ public function lfGetReviewNonDisp() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_review AS A LEFT JOIN dtb_products AS B ON A.product_id = B.product_id'; $where = 'A.del_flg = 0 AND A.status = 2 AND B.del_flg = 0'; @@ -229,7 +221,7 @@ public function lfGetReviewNonDisp() */ public function lfGetSoldOut() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $cols = 'product_id, name'; $table = 'dtb_products'; @@ -248,7 +240,7 @@ public function lfGetSoldOut() */ public function lfGetNewOrder() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('order_detail_id'); $sql_product_name = $objQuery->getSql('product_name', 'dtb_order_detail', 'order_id = dtb_order.order_id'); @@ -312,10 +304,10 @@ public function lfGetInfo() $jsonStr = @file_get_contents($url, false, stream_context_create($context)); - $arrTmpData = is_string($jsonStr) ? SC_Utils_Ex::jsonDecode($jsonStr) : null; + $arrTmpData = is_string($jsonStr) ? Utils::jsonDecode($jsonStr) : null; if (empty($arrTmpData)) { - SC_Utils_Ex::sfErrorHeader('>> 更新情報の取得に失敗しました。'); + Utils::sfErrorHeader('>> 更新情報の取得に失敗しました。'); return array(); } diff --git a/data/class/pages/admin/LC_Page_Admin_Index.php b/data/Eccube/Page/Admin/Index.php similarity index 77% rename from data/class/pages/admin/LC_Page_Admin_Index.php rename to data/Eccube/Page/Admin/Index.php index 9ac52465b73..121584def20 100644 --- a/data/class/pages/admin/LC_Page_Admin_Index.php +++ b/data/Eccube/Page/Admin/Index.php @@ -1,36 +1,33 @@ getMode()) { case 'login': @@ -71,16 +68,16 @@ public function action() $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->lfDoLogin($objFormParam->getValue('login_id')); - SC_Response_Ex::sendRedirect(ADMIN_HOME_URLPATH); + Response::sendRedirect(ADMIN_HOME_URLPATH); } else { // ブルートフォースアタック対策 // ログイン失敗時に遅延させる sleep(LOGIN_RETRY_INTERVAL); - SC_Utils_Ex::sfDispError(LOGIN_ERROR); + Utils::sfDispError(LOGIN_ERROR); } break; default: @@ -94,7 +91,7 @@ public function action() /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ public function lfInitParam(&$objFormParam) @@ -108,14 +105,14 @@ public function lfInitParam(&$objFormParam) * * TODO: ブルートフォースアタック対策チェックの実装 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array $arrErr エラー配列 */ public function lfCheckError(&$objFormParam) { // 書式チェック $arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($arrErr)) { + if (Utils::isBlank($arrErr)) { $arrForm = $objFormParam->getHashArray(); // ログインチェック if (!$this->lfIsLoginMember($arrForm['login_id'], $arrForm['password'])) { @@ -136,17 +133,17 @@ public function lfCheckError(&$objFormParam) */ public function lfIsLoginMember($login_id, $pass) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); //パスワード、saltの取得 $cols = 'password, salt'; $table = 'dtb_member'; $where = 'login_id = ? AND del_flg <> 1 AND work = 1'; $arrData = $objQuery->getRow($cols, $table, $where, array($login_id)); - if (SC_Utils_Ex::isBlank($arrData)) { + if (Utils::isBlank($arrData)) { return false; } // ユーザー入力パスワードの判定 - if (SC_Utils_Ex::sfIsMatchHashPassword($pass, $arrData['password'], $arrData['salt'])) { + if (Utils::sfIsMatchHashPassword($pass, $arrData['password'], $arrData['salt'])) { return true; } @@ -161,7 +158,7 @@ public function lfIsLoginMember($login_id, $pass) */ public function lfDoLogin($login_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); //メンバー情報取得 $cols = 'member_id, authority, login_date, name'; $table = 'dtb_member'; @@ -186,9 +183,9 @@ public function lfDoLogin($login_id) public function lfSetLoginSession($member_id, $login_id, $authority, $login_name, $last_login) { // Session Fixation対策 - SC_Helper_Session_Ex::regenerateSID(); + SessionHelper::regenerateSID(); - $objSess = new SC_Session_Ex(); + $objSess = new Session(); // 認証済みの設定 $objSess->SetSession('cert', CERT_STRING); $objSess->SetSession('member_id', $member_id); @@ -196,7 +193,7 @@ public function lfSetLoginSession($member_id, $login_id, $authority, $login_name $objSess->SetSession('authority', $authority); $objSess->SetSession('login_name', $login_name); $objSess->SetSession('uniqid', $objSess->getUniqId()); - if (SC_Utils_Ex::isBlank($last_login)) { + if (Utils::isBlank($last_login)) { $objSess->SetSession('last_login', date('Y-m-d H:i:s')); } else { $objSess->SetSession('last_login', $last_login); @@ -220,10 +217,10 @@ public function lfSetLoginData($sid, $member_id, $login_id, $authority, $last_lo // ログイン記録ログ出力 $str_log = "login: user=$login_id($member_id) auth=$authority " . "lastlogin=$last_login sid=$sid"; - GC_Utils_Ex::gfPrintLog($str_log); + GcUtils::gfPrintLog($str_log); // 最終ログイン日時更新 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqlval = array(); $sqlval['login_date'] = date('Y-m-d H:i:s'); $table = 'dtb_member'; @@ -241,6 +238,6 @@ public function lfSetLoginData($sid, $member_id, $login_id, $authority, $last_lo */ public function lfSetIncorrectData($error_login_id) { - GC_Utils_Ex::gfPrintLog($error_login_id . ' password incorrect.'); + GcUtils::gfPrintLog($error_login_id . ' password incorrect.'); } } diff --git a/data/Eccube/Page/Admin/Logout.php b/data/Eccube/Page/Admin/Logout.php new file mode 100644 index 00000000000..fc95cc09102 --- /dev/null +++ b/data/Eccube/Page/Admin/Logout.php @@ -0,0 +1,70 @@ +action(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + $this->lfDoLogout(); + + // ログイン画面に遷移 + Response::sendRedirectFromUrlPath(ADMIN_DIR . DIR_INDEX_PATH); + } + + /** + * ログアウト処理 + * + * @return void + */ + public function lfDoLogout() + { + $objSess = new Session(); + $objSess->logout(); + } +} diff --git a/data/class/pages/admin/mail/LC_Page_Admin_Mail_History.php b/data/Eccube/Page/Admin/Mail/History.php similarity index 70% rename from data/class/pages/admin/mail/LC_Page_Admin_Mail_History.php rename to data/Eccube/Page/Admin/Mail/History.php index 0bd1e7c2aa1..bac2490454e 100644 --- a/data/class/pages/admin/mail/LC_Page_Admin_Mail_History.php +++ b/data/Eccube/Page/Admin/Mail/History.php @@ -1,36 +1,29 @@ getMode()) { case 'delete': - if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) { + if (Utils::sfIsInt($_GET['send_id'])) { // 削除時 $this->lfDeleteHistory($_GET['send_id']); @@ -86,17 +79,17 @@ public function action() * 実行履歴の取得 * * @param integer $search_pageno 表示したいページ番号 - * @return array( integer 全体件数, mixed メール配信データ一覧配列, mixed SC_PageNaviオブジェクト) + * @return array( integer 全体件数, mixed メール配信データ一覧配列, mixed PageNaviオブジェクト) */ public function lfDoSearch($search_pageno = 1) { // 引数の初期化 - if (SC_Utils_Ex::sfIsInt($search_pageno)===false) { + if (Utils::sfIsInt($search_pageno)===false) { $search_pageno = 1; } // - $objSelect =& SC_Query_Ex::getSingletonInstance(); // 一覧データ取得用 - $objQuery =& SC_Query_Ex::getSingletonInstance(); // 件数取得用 + $objSelect = Query::getSingletonInstance(); // 一覧データ取得用 + $objQuery = Query::getSingletonInstance(); // 件数取得用 // 該当全体件数の取得 $linemax = $objQuery->count('dtb_send_history', 'del_flg = 0'); @@ -115,7 +108,7 @@ public function lfDoSearch($search_pageno = 1) $objSelect->setLimitOffset(SEARCH_PMAX, $offset); $arrResult = $objSelect->select($col, 'dtb_send_history', ' del_flg = 0'); - $objNavi = new SC_PageNavi_Ex($search_pageno, + $objNavi = new PageNavi($search_pageno, $linemax, SEARCH_PMAX); @@ -128,7 +121,7 @@ public function lfDoSearch($search_pageno = 1) */ public function lfDeleteHistory($send_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->update('dtb_send_history', array('del_flg' =>1), 'send_id = ?', diff --git a/data/class/pages/admin/mail/LC_Page_Admin_Mail.php b/data/Eccube/Page/Admin/Mail/Index.php similarity index 76% rename from data/class/pages/admin/mail/LC_Page_Admin_Mail.php rename to data/Eccube/Page/Admin/Mail/Index.php index b7a07348727..67b888b64fb 100644 --- a/data/class/pages/admin/mail/LC_Page_Admin_Mail.php +++ b/data/Eccube/Page/Admin/Mail/Index.php @@ -1,36 +1,35 @@ tpl_maintitle = 'メルマガ管理'; $this->tpl_subtitle = '配信内容設定'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrJob = $masterData->getMasterData('mtb_job'); $this->arrJob['不明'] = '不明'; @@ -57,7 +56,7 @@ public function init() $this->arrMailType = $masterData->getMasterData('mtb_mail_type'); // 日付プルダウン設定 - $objDate = new SC_Date_Ex(BIRTH_YEAR); + $objDate = new Date(BIRTH_YEAR); $this->arrBirthYear = $objDate->getYear(); $this->arrRegistYear = $objDate->getYear(); $this->arrMonth = $objDate->getMonth(); @@ -65,11 +64,11 @@ public function init() $this->objDate = $objDate; // カテゴリ一覧設定 - $objDb = new SC_Helper_DB_Ex(); - $this->arrCatList = $objDb->sfGetCategoryList(); + $objDb = new DbHelper(); + $this->arrCatList = $objDb->getCategoryList(); // テンプレート一覧設定 - $this->arrTemplate = $this->lfGetMailTemplateList(SC_Helper_Mail_Ex::sfGetMailmagaTemplate()); + $this->arrTemplate = $this->lfGetMailTemplateList(MailHelper::sfGetMailmagaTemplate()); $this->httpCacheControl('nocache'); } @@ -93,7 +92,7 @@ public function process() public function action() { // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParamSearchCustomer($objFormParam); $objFormParam->setParam($_POST); @@ -101,16 +100,16 @@ public function action() $this->arrHidden = $objFormParam->getSearchArray(); // 入力パラメーターチェック - $this->arrErr = SC_Helper_Customer_Ex::sfCheckErrorSearchParam($objFormParam); + $this->arrErr = CustomerHelper::sfCheckErrorSearchParam($objFormParam); $this->arrForm = $objFormParam->getFormParamList(); - if (!SC_Utils_Ex::isBlank($this->arrErr)) return; + if (!Utils::isBlank($this->arrErr)) return; // モードによる処理切り替え switch ($this->getMode()) { // 配信先検索 case 'search': case 'back': - list($this->tpl_linemax, $this->arrResults, $this->objNavi) = SC_Helper_Customer_Ex::sfGetSearchData($objFormParam->getHashArray()); + list($this->tpl_linemax, $this->arrResults, $this->objNavi) = CustomerHelper::sfGetSearchData($objFormParam->getHashArray()); $this->arrPagenavi = $this->objNavi->arrPagenavi; break; // input:検索結果画面「配信内容を設定する」押下後 @@ -121,7 +120,7 @@ public function action() case 'template': case 'regist_back': $this->tpl_mainpage = 'mail/input.tpl'; - if (SC_Utils_Ex::sfIsInt($_POST['template_id']) === true) { + if (Utils::sfIsInt($_POST['template_id']) === true) { $this->lfAddParamSelectTemplate($objFormParam); $this->lfGetTemplateData($objFormParam, $_POST['template_id']); // regist_back時、subject,bodyにはテンプレートを読み込むのではなく、入力内容で上書き @@ -135,33 +134,33 @@ public function action() $this->lfAddParamSelectTemplate($objFormParam); $objFormParam->setParam($_POST); $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) $this->tpl_mainpage = 'mail/input_confirm.tpl'; + if (Utils::isBlank($this->arrErr)) $this->tpl_mainpage = 'mail/input_confirm.tpl'; break; case 'regist_complete': $this->tpl_mainpage = 'mail/input.tpl'; $this->lfAddParamSelectTemplate($objFormParam); $objFormParam->setParam($_POST); $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->tpl_mainpage = 'mail/index.tpl'; - SC_Helper_Mail_Ex::sfSendMailmagazine($this->lfRegisterData($objFormParam)); // DB登録・送信 + MailHelper::sfSendMailmagazine($this->lfRegisterData($objFormParam)); // DB登録・送信 - SC_Response_Ex::sendRedirect('./history.php'); + Response::sendRedirect('./history.php'); } break; // query:配信履歴から「確認」 case 'query': - if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) { + if (Utils::sfIsInt($_GET['send_id'])) { $this->arrSearchData = $this->lfGetMailQuery($_GET['send_id']); } $this->setTemplate('mail/query.tpl'); break; // query:配信履歴から「再送信」 case 'retry': - if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) { - SC_Helper_Mail_Ex::sfSendMailmagazine($_GET['send_id']); // DB登録・送信 + if (Utils::sfIsInt($_GET['send_id'])) { + MailHelper::sfSendMailmagazine($_GET['send_id']); // DB登録・送信 - SC_Response_Ex::sendRedirect('./history.php'); + Response::sendRedirect('./history.php'); } else { $this->tpl_onload = "window.alert('メール送信IDが正しくありません');"; } @@ -175,12 +174,12 @@ public function action() /** * パラメーター情報の初期化(初期会員検索時) * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ public function lfInitParamSearchCustomer(&$objFormParam) { - SC_Helper_Customer_Ex::sfSetSearchParam($objFormParam); + CustomerHelper::sfSetSearchParam($objFormParam); $objFormParam->addParam('配信形式', 'search_htmlmail', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); $objFormParam->addParam('配信メールアドレス種別', 'search_mail_type', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); } @@ -188,7 +187,7 @@ public function lfInitParamSearchCustomer(&$objFormParam) /** * パラメーター情報の追加(テンプレート選択) * - * @param SC_FormParam $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ public function lfAddParamSelectTemplate(&$objFormParam) @@ -202,7 +201,7 @@ public function lfAddParamSelectTemplate(&$objFormParam) /** * メルマガテンプレート一覧情報の取得 * - * @param array $arrTemplate SC_Helper_Mail_Ex::sfGetMailmagaTemplate()の戻り値 + * @param array $arrTemplate MailHelper::sfGetMailmagaTemplate()の戻り値 * @return array key:template_id value:サブジェクト【配信形式】 */ public function lfGetMailTemplateList($arrTemplate) @@ -219,13 +218,13 @@ public function lfGetMailTemplateList($arrTemplate) /** * テンプレートIDから情報の取得して$objFormParamにset_paramする * - * @param SC_FormParam $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @param array $template_id テンプレートID * @return void */ public function lfGetTemplateData(&$objFormParam, $template_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('template_id DESC'); $where = 'template_id = ?'; $arrResults = $objQuery->getRow('*', 'dtb_mailmaga_template', $where, array($template_id)); @@ -235,14 +234,14 @@ public function lfGetTemplateData(&$objFormParam, $template_id) /** * 配信内容と配信リストを書き込む * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return integer 登録した行の dtb_send_history.send_id の値 */ public function lfRegisterData(&$objFormParam) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); - list($linemax, $arrSendCustomer, $objNavi) = SC_Helper_Customer_Ex::sfGetSearchData($objFormParam->getHashArray(), 'All'); + list($linemax, $arrSendCustomer, $objNavi) = CustomerHelper::sfGetSearchData($objFormParam->getHashArray(), 'All'); $send_customer_cnt = count($arrSendCustomer); $send_id = $objQuery->nextVal('dtb_send_history_send_id'); @@ -285,7 +284,7 @@ public function lfRegisterData(&$objFormParam) */ public function lfGetMailQuery($send_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 送信履歴より、送信条件確認画面 $sql = 'SELECT search_data FROM dtb_send_history WHERE send_id = ?'; diff --git a/data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php b/data/Eccube/Page/Admin/Mail/Preview.php similarity index 57% rename from data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php rename to data/Eccube/Page/Admin/Mail/Preview.php index e6f43ea4be7..11f450a3778 100644 --- a/data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php +++ b/data/Eccube/Page/Admin/Mail/Preview.php @@ -1,36 +1,28 @@ getMode()) { case 'template': - if (SC_Utils_Ex::sfIsInt($_GET['template_id'])) { + if (Utils::sfIsInt($_GET['template_id'])) { $arrMail = $objMailHelper->sfGetMailmagaTemplate($_GET['template_id']); $this->mail = $arrMail[0]; } break; case 'history'; - if (SC_Utils_Ex::sfIsInt($_GET['send_id'])) { + if (Utils::sfIsInt($_GET['send_id'])) { $arrMail = $objMailHelper->sfGetSendHistory($_GET['send_id']); $this->mail = $arrMail[0]; } diff --git a/data/class/pages/admin/mail/LC_Page_Admin_Mail_Template.php b/data/Eccube/Page/Admin/Mail/Template.php similarity index 61% rename from data/class/pages/admin/mail/LC_Page_Admin_Mail_Template.php rename to data/Eccube/Page/Admin/Mail/Template.php index ee4654af1ef..3ae8a960961 100644 --- a/data/class/pages/admin/mail/LC_Page_Admin_Mail_Template.php +++ b/data/Eccube/Page/Admin/Mail/Template.php @@ -1,36 +1,30 @@ tpl_maintitle = 'メルマガ管理'; $this->tpl_subtitle = 'テンプレート設定'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrMagazineType = $masterData->getMasterData('mtb_magazine_type'); } @@ -68,11 +62,11 @@ public function process() */ public function action() { - $objMailHelper = new SC_Helper_Mail_Ex(); + $objMailHelper = new MailHelper(); switch ($this->getMode()) { case 'delete': - if (SC_Utils_Ex::sfIsInt($_GET['id'])===true) { + if (Utils::sfIsInt($_GET['id'])===true) { $this->lfDeleteMailTemplate($_GET['id']); $this->objDisplay->reload(null, true); @@ -91,7 +85,7 @@ public function action() */ public function lfDeleteMailTemplate($template_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->update('dtb_mailmaga_template', array('del_flg' =>1), 'template_id = ?', diff --git a/data/class/pages/admin/mail/LC_Page_Admin_Mail_TemplateInput.php b/data/Eccube/Page/Admin/Mail/TemplateInput.php similarity index 73% rename from data/class/pages/admin/mail/LC_Page_Admin_Mail_TemplateInput.php rename to data/Eccube/Page/Admin/Mail/TemplateInput.php index 68100dac961..a1e15442695 100644 --- a/data/class/pages/admin/mail/LC_Page_Admin_Mail_TemplateInput.php +++ b/data/Eccube/Page/Admin/Mail/TemplateInput.php @@ -1,36 +1,31 @@ tpl_subtitle = 'テンプレート設定'; $this->tpl_subno = 'template'; $this->mode = 'regist'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrMagazineType = $masterData->getMasterData('mtb_magazine_type'); } @@ -68,26 +63,26 @@ public function process() */ public function action() { - $objMailHelper = new SC_Helper_Mail_Ex(); + $objMailHelper = new MailHelper(); switch ($this->getMode()) { case 'edit': // 編集 - if (SC_Utils_Ex::sfIsInt($_GET['template_id'])===true) { + if (Utils::sfIsInt($_GET['template_id'])===true) { $arrMail = $objMailHelper->sfGetMailmagaTemplate($_GET['template_id']); $this->arrForm = $arrMail[0]; } break; case 'regist': // 新規登録 - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $this->arrErr = $objFormParam->checkError(); $this->arrForm = $objFormParam->getHashArray(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { // エラーが無いときは登録・編集 $this->lfRegistData($objFormParam, $objFormParam->getValue('template_id')); @@ -110,19 +105,19 @@ public function action() /** * メルマガテンプレートデータの登録・更新を行う * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param integer template_id 更新時は指定 * @return void */ public function lfRegistData(&$objFormParam, $template_id = null) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqlval = $objFormParam->getDbArray(); $sqlval['creator_id'] = $_SESSION['member_id']; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; - if (SC_Utils_Ex::sfIsInt($template_id)) { + if (Utils::sfIsInt($template_id)) { // 更新時 $objQuery->update('dtb_mailmaga_template', $sqlval, @@ -139,7 +134,7 @@ public function lfRegistData(&$objFormParam, $template_id = null) /** * お問い合わせ入力時のパラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_Disp.php b/data/Eccube/Page/Admin/Order/Disp.php similarity index 88% rename from data/class/pages/admin/order/LC_Page_Admin_Order_Disp.php rename to data/Eccube/Page/Admin/Order/Disp.php index b532e8fcf73..3893f5980ed 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_Disp.php +++ b/data/Eccube/Page/Admin/Order/Disp.php @@ -1,36 +1,33 @@ tpl_subno = ''; $this->tpl_subtitle = '受注情報表示'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status'); $this->arrDeviceType = $masterData->getMasterData('mtb_device_type'); @@ -91,10 +88,10 @@ public function init() $this->arrJob = $masterData->getMasterData('mtb_job'); // 支払い方法の取得 - $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); + $this->arrPayment = PaymentHelper::getIDValueList(); // 配送業者の取得 - $this->arrDeliv = SC_Helper_Delivery_Ex::getIDValueList(); + $this->arrDeliv = DeliveryHelper::getIDValueList(); } /** @@ -115,8 +112,8 @@ public function process() */ public function action() { - $objPurchase = new SC_Helper_Purchase_Ex(); - $objFormParam = new SC_FormParam_Ex(); + $objPurchase = new PurchaseHelper(); + $objFormParam = new FormParam(); // パラメータ情報の初期化 $this->lfInitParam($objFormParam); @@ -129,9 +126,9 @@ public function action() $this->arrForm = $objFormParam->getFormParamList(); $this->arrAllShipping = $objFormParam->getSwapArray(array_merge($this->arrShippingKeys, $this->arrShipmentItemKeys)); - $this->tpl_shipping_quantity = count($this->arrAllShipping); - $this->arrDelivTime = SC_Helper_Delivery_Ex::getDelivTime($objFormParam->getValue('deliv_id')); - $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $this->tpl_shipping_quantity = count($this->arrAllShipping); + $this->arrDelivTime = DeliveryHelper::getDelivTime($objFormParam->getValue('deliv_id')); + $this->arrInfo = DbHelper::getBasisData(); $this->setTemplate($this->tpl_mainpage); } @@ -139,7 +136,7 @@ public function action() /** * パラメータ情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -166,11 +163,11 @@ public function lfInitParam(&$objFormParam) $objFormParam->addParam('電話番号1', 'order_tel01', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); $objFormParam->addParam('電話番号2', 'order_tel02', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); $objFormParam->addParam('電話番号3', 'order_tel03', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); - $objFormParam->addParam('性別', 'order_sex', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); + $objFormParam->addParam('性別', 'order_sex', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); $objFormParam->addParam('職業', 'order_job', TEL_ITEM_LEN, 'n', array('MAX_LENGTH_CHECK' ,'NUM_CHECK')); - $objFormParam->addParam('生年月日(年)', 'order_birth_year', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); - $objFormParam->addParam('生年月日(月)', 'order_birth_month', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); - $objFormParam->addParam('生年月日(日)', 'order_birth_day', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); + $objFormParam->addParam('生年月日(年)', 'order_birth_year', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); + $objFormParam->addParam('生年月日(月)', 'order_birth_month', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); + $objFormParam->addParam('生年月日(日)', 'order_birth_day', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); // 受注商品情報 $objFormParam->addParam('値引き', 'discount', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), '0'); @@ -263,25 +260,25 @@ public function lfInitParam(&$objFormParam) } /** - * 受注データを取得して, SC_FormParam へ設定する. + * 受注データを取得して, FormParam へ設定する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param integer $order_id 取得元の受注ID * @return void */ public function setOrderToFormParam(&$objFormParam, $order_id) { - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); // 受注詳細を設定 $arrOrderDetail = $objPurchase->getOrderDetail($order_id, false); - $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrOrderDetail)); + $objFormParam->setParam(Utils::sfSwapArray($arrOrderDetail)); $arrShippingsTmp = $objPurchase->getShippings($order_id); $arrShippings = array(); foreach ($arrShippingsTmp as $row) { // お届け日の処理 - if (!SC_Utils_Ex::isBlank($row['shipping_date'])) { + if (!Utils::isBlank($row['shipping_date'])) { $ts = strtotime($row['shipping_date']); $row['shipping_date_year'] = date('Y', $ts); $row['shipping_date_month'] = date('n', $ts); @@ -289,7 +286,7 @@ public function setOrderToFormParam(&$objFormParam, $order_id) } $arrShippings[$row['shipping_id']] = $row; } - $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrShippings)); + $objFormParam->setParam(Utils::sfSwapArray($arrShippings)); /* * 配送商品を設定 @@ -317,26 +314,26 @@ public function setOrderToFormParam(&$objFormParam, $order_id) */ $arrOrder = $objPurchase->getOrder($order_id); - // 生年月日の処理 - if (!SC_Utils_Ex::isBlank($arrOrder['order_birth'])) { - $order_birth = substr($arrOrder['order_birth'], 0, 10); - $arrOrderBirth = explode("-", $order_birth); - $arrOrder['order_birth_year'] = intval($arrOrderBirth[0]); - $arrOrder['order_birth_month'] = intval($arrOrderBirth[1]); - $arrOrder['order_birth_day'] = intval($arrOrderBirth[2]); + // 生年月日の処理 + if (!Utils::isBlank($arrOrder['order_birth'])) { + $order_birth = substr($arrOrder['order_birth'], 0, 10); + $arrOrderBirth = explode("-", $order_birth); + $arrOrder['order_birth_year'] = intval($arrOrderBirth[0]); + $arrOrder['order_birth_month'] = intval($arrOrderBirth[1]); + $arrOrder['order_birth_day'] = intval($arrOrderBirth[2]); } $objFormParam->setParam($arrOrder); // ポイントを設定 - list($db_point, $rollback_point) = SC_Helper_DB_Ex::sfGetRollbackPoint( + list($db_point, $rollback_point) = DbHelper::getRollbackPoint( $order_id, $arrOrder['use_point'], $arrOrder['add_point'], $arrOrder['status'] ); $objFormParam->setValue('total_point', $db_point); $objFormParam->setValue('point', $rollback_point); - if (!SC_Utils_Ex::isBlank($objFormParam->getValue('customer_id'))) { - $arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($objFormParam->getValue('customer_id')); + if (!Utils::isBlank($objFormParam->getValue('customer_id'))) { + $arrCustomer = CustomerHelper::sfGetCustomerDataFromId($objFormParam->getValue('customer_id')); $objFormParam->setValue('customer_point', $arrCustomer['point']); } } diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php b/data/Eccube/Page/Admin/Order/Edit.php similarity index 90% rename from data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php rename to data/Eccube/Page/Admin/Order/Edit.php index 71b2012bd8d..5c83b2da2a6 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php +++ b/data/Eccube/Page/Admin/Order/Edit.php @@ -1,36 +1,38 @@ tpl_maintitle = '受注管理'; $this->tpl_subtitle = '受注登録'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status'); @@ -104,21 +106,21 @@ public function init() $this->arrSex = $masterData->getMasterData('mtb_sex'); $this->arrJob = $masterData->getMasterData('mtb_job'); - $objShippingDate = new SC_Date_Ex(RELEASE_YEAR); + $objShippingDate = new Date(RELEASE_YEAR); $this->arrYearShippingDate = $objShippingDate->getYear('', date('Y'), ''); $this->arrMonthShippingDate = $objShippingDate->getMonth(true); $this->arrDayShippingDate = $objShippingDate->getDay(true); - $objBirthDate = new SC_Date_Ex(BIRTH_YEAR, date('Y')); + $objBirthDate = new Date(BIRTH_YEAR, date('Y')); $this->arrBirthYear = $objBirthDate->getYear('', START_BIRTH_YEAR, ''); $this->arrBirthMonth = $objBirthDate->getMonth(true); $this->arrBirthDay = $objBirthDate->getDay(true); // 支払い方法の取得 - $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); + $this->arrPayment = PaymentHelper::getIDValueList(); // 配送業者の取得 - $this->arrDeliv = SC_Helper_Delivery_Ex::getIDValueList(); + $this->arrDeliv = DeliveryHelper::getIDValueList(); $this->httpCacheControl('nocache'); } @@ -141,8 +143,8 @@ public function process() */ public function action() { - $objPurchase = new SC_Helper_Purchase_Ex(); - $objFormParam = new SC_FormParam_Ex(); + $objPurchase = new PurchaseHelper(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); @@ -152,7 +154,7 @@ public function action() $arrValuesBefore = array(); // DBから受注情報を読み込む - if (!SC_Utils_Ex::isBlank($order_id)) { + if (!Utils::isBlank($order_id)) { $this->setOrderToFormParam($objFormParam, $order_id); $this->tpl_subno = 'index'; $arrValuesBefore['deliv_id'] = $objFormParam->getValue('deliv_id'); @@ -169,9 +171,9 @@ public function action() $objFormParam->setValue('shipping_id', $arrShippingIds); // 新規受注登録で入力エラーがあった場合の画面表示用に、会員の現在ポイントを取得 - if (!SC_Utils_Ex::isBlank($objFormParam->getValue('customer_id'))) { + if (!Utils::isBlank($objFormParam->getValue('customer_id'))) { $customer_id = $objFormParam->getValue('customer_id'); - $arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id); + $arrCustomer = CustomerHelper::sfGetCustomerDataFromId($customer_id); $objFormParam->setValue('customer_point', $arrCustomer['point']); // 新規受注登録で、ポイント利用できるように現在ポイントを設定 @@ -192,7 +194,7 @@ public function action() //複数配送時に各商品の総量を設定 $this->setProductsQuantity($objFormParam); $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $message = '受注を編集しました。'; $order_id = $this->doRegister($order_id, $objPurchase, $objFormParam, $message, $arrValuesBefore); if ($order_id >= 0) { @@ -209,7 +211,7 @@ public function action() //複数配送時に各商品の総量を設定 $this->setProductsQuantity($objFormParam); $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $message = '受注を登録しました。'; $order_id = $this->doRegister(null, $objPurchase, $objFormParam, $message, $arrValuesBefore); if ($order_id >= 0) { @@ -315,12 +317,12 @@ public function action() $this->arrAllShipping = $objFormParam->getSwapArray(array_merge($this->arrShippingKeys, $this->arrShipmentItemKeys)); $this->tpl_shipping_quantity = count($this->arrAllShipping); $this->top_shipping_id = array_shift((array_keys($this->arrAllShipping))); - $this->arrDelivTime = SC_Helper_Delivery_Ex::getDelivTime($objFormParam->getValue('deliv_id')); + $this->arrDelivTime = DeliveryHelper::getDelivTime($objFormParam->getValue('deliv_id')); $this->tpl_onload .= $this->getAnchorKey($objFormParam); if ($arrValuesBefore['deliv_id']) { // 受注当時の配送業者名はdtb_orderにないので、 // 削除済みの配送業者も含めて情報を取得。 - $objDelivery = new SC_Helper_Delivery_Ex(); + $objDelivery = new DeliveryHelper(); $arrDelivery = $objDelivery->get($arrValuesBefore['deliv_id'], true); $this->arrDeliv[$arrValuesBefore['deliv_id']] = $arrDelivery['name']; } @@ -331,7 +333,7 @@ public function action() /** * パラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -462,7 +464,7 @@ public function lfInitParam(&$objFormParam) /** * 複数配送用フォームの初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitMultipleParam(&$objFormParam) @@ -478,9 +480,9 @@ public function lfInitMultipleParam(&$objFormParam) } /** - * 複数配送入力フォームで入力された値を SC_FormParam へ設定する. + * 複数配送入力フォームで入力された値を FormParam へ設定する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function setMultipleItemTo(&$objFormParam) @@ -552,19 +554,19 @@ public function setMultipleItemTo(&$objFormParam) } /** - * 受注データを取得して, SC_FormParam へ設定する. + * 受注データを取得して, FormParam へ設定する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param integer $order_id 取得元の受注ID * @return void */ public function setOrderToFormParam(&$objFormParam, $order_id) { - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); // 受注詳細を設定 $arrOrderDetail = $objPurchase->getOrderDetail($order_id, false); - $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrOrderDetail)); + $objFormParam->setParam(Utils::sfSwapArray($arrOrderDetail)); $arrShippingsTmp = $objPurchase->getShippings($order_id); $arrShippings = array(); @@ -572,7 +574,7 @@ public function setOrderToFormParam(&$objFormParam, $order_id) if ($arrShippingsTmp) { foreach ($arrShippingsTmp as $row) { // お届け日の処理 - if (!SC_Utils_Ex::isBlank($row['shipping_date'])) { + if (!Utils::isBlank($row['shipping_date'])) { $ts = strtotime($row['shipping_date']); $row['shipping_date_year'] = date('Y', $ts); $row['shipping_date_month'] = date('n', $ts); @@ -591,7 +593,7 @@ public function setOrderToFormParam(&$objFormParam, $order_id) $arrShippings[0]['shipment_item'][$key]['quantity'] = $value['quantity']; } } - $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrShippings)); + $objFormParam->setParam(Utils::sfSwapArray($arrShippings)); /* * 配送商品を設定 @@ -617,7 +619,7 @@ public function setOrderToFormParam(&$objFormParam, $order_id) $arrOrder = $objPurchase->getOrder($order_id); // 生年月日の処理 - if (!SC_Utils_Ex::isBlank($arrOrder['order_birth'])) { + if (!Utils::isBlank($arrOrder['order_birth'])) { $order_birth = substr($arrOrder['order_birth'], 0, 10); $arrOrderBirth = explode("-", $order_birth); @@ -630,7 +632,7 @@ public function setOrderToFormParam(&$objFormParam, $order_id) // ポイントを設定 if (USE_POINT !== false) { - list($db_point, $rollback_point) = SC_Helper_DB_Ex::sfGetRollbackPoint( + list($db_point, $rollback_point) = DbHelper::getRollbackPoint( $order_id, $arrOrder['use_point'], $arrOrder['add_point'], $arrOrder['status'] ); @@ -641,8 +643,8 @@ public function setOrderToFormParam(&$objFormParam, $order_id) $objFormParam->setValue('point', 0); } - if (!SC_Utils_Ex::isBlank($objFormParam->getValue('customer_id'))) { - $arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($objFormParam->getValue('customer_id')); + if (!Utils::isBlank($objFormParam->getValue('customer_id'))) { + $arrCustomer = CustomerHelper::sfGetCustomerDataFromId($objFormParam->getValue('customer_id')); $objFormParam->setValue('customer_point', $arrCustomer['point']); } } @@ -650,12 +652,12 @@ public function setOrderToFormParam(&$objFormParam, $order_id) /** * 入力内容のチェックを行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array エラーメッセージの配列 */ public function lfCheckError(&$objFormParam) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $arrValues = $objFormParam->getHashArray(); $arrErr = array(); $arrErrTemp = $objFormParam->checkError(); @@ -663,7 +665,7 @@ public function lfCheckError(&$objFormParam) foreach ($arrValues['shipping_date_year'] as $key_index => $year) { $month = $arrValues['shipping_date_month'][$key_index]; $day = $arrValues['shipping_date_day'][$key_index]; - $objError = new SC_CheckError_Ex(array('shipping_date_year' => $year, + $objError = new CheckError(array('shipping_date_year' => $year, 'shipping_date_month' => $month, 'shipping_date_day' => $day)); $objError->doFunc(array('お届け日', 'shipping_date_year', 'shipping_date_month', 'shipping_date_day'), array('CHECK_DATE')); @@ -675,7 +677,7 @@ public function lfCheckError(&$objFormParam) $year = $arrValues['order_birth_year']; $month = $arrValues['order_birth_month']; $day = $arrValues['order_birth_day']; - $objError = new SC_CheckError_Ex(array('order_birth_year' => $year, + $objError = new CheckError(array('order_birth_year' => $year, 'order_birth_month' => $month, 'order_birth_day' => $day)); $objError->doFunc(array('生年月日', 'order_birth_year', 'order_birth_month', 'order_birth_day'), @@ -689,25 +691,25 @@ public function lfCheckError(&$objFormParam) $totaltax = 0; for ($i = 0; $i < $max; $i++) { // 小計の計算 - $subtotal += SC_Helper_DB_Ex::sfCalcIncTax($arrValues['price'][$i], $arrValues['tax_rate'][$i], $arrValues['tax_rule'][$i]) * $arrValues['quantity'][$i]; + $subtotal += DbHelper::calcIncTax($arrValues['price'][$i], $arrValues['tax_rate'][$i], $arrValues['tax_rule'][$i]) * $arrValues['quantity'][$i]; // 小計の計算 - $totaltax += SC_Utils_Ex::sfTax($arrValues['price'][$i], $arrValues['tax_rate'][$i], $arrValues['tax_rule'][$i]) * $arrValues['quantity'][$i]; + $totaltax += Utils::sfTax($arrValues['price'][$i], $arrValues['tax_rate'][$i], $arrValues['tax_rule'][$i]) * $arrValues['quantity'][$i]; // 加算ポイントの計算 - $totalpoint += SC_Utils_Ex::sfPrePoint($arrValues['price'][$i], $arrValues['point_rate'][$i]) * $arrValues['quantity'][$i]; + $totalpoint += Utils::sfPrePoint($arrValues['price'][$i], $arrValues['point_rate'][$i]) * $arrValues['quantity'][$i]; // 在庫数のチェック $arrProduct = $objProduct->getDetailAndProductsClass($arrValues['product_class_id'][$i]); // 編集前の値と比較するため受注詳細を取得 - $objPurchase = new SC_Helper_Purchase_Ex(); - $arrOrderDetail = SC_Utils_Ex::sfSwapArray($objPurchase->getOrderDetail($objFormParam->getValue('order_id'), false)); + $objPurchase = new PurchaseHelper(); + $arrOrderDetail = Utils::sfSwapArray($objPurchase->getOrderDetail($objFormParam->getValue('order_id'), false)); if ($arrProduct['stock_unlimited'] != '1' && $arrProduct['stock'] < $arrValues['quantity'][$i] - $arrOrderDetail['quantity'][$i]) { $class_name1 = $arrValues['classcategory_name1'][$i]; - $class_name1 = SC_Utils_Ex::isBlank($class_name1) ? 'なし' : $class_name1; + $class_name1 = Utils::isBlank($class_name1) ? 'なし' : $class_name1; $class_name2 = $arrValues['classcategory_name2'][$i]; - $class_name2 = SC_Utils_Ex::isBlank($class_name2) ? 'なし' : $class_name2; + $class_name2 = Utils::isBlank($class_name2) ? 'なし' : $class_name2; $arrErr['quantity'][$i] .= $arrValues['product_name'][$i] . '/(' . $class_name1 . ')/(' . $class_name2 . ') の在庫が不足しています。 設定できる数量は「' . ($arrOrderDetail['quantity'][$i] + $arrProduct['stock']) . '」までです。
'; @@ -724,7 +726,7 @@ public function lfCheckError(&$objFormParam) $arrValues['payment_total'] = $arrValues['total'] - ($arrValues['use_point'] * POINT_VALUE); // 加算ポイント - $arrValues['add_point'] = SC_Helper_DB_Ex::sfGetAddPoint($totalpoint, $arrValues['use_point']) + $arrValues['birth_point']; + $arrValues['add_point'] = DbHelper::getAddPoint($totalpoint, $arrValues['use_point']) + $arrValues['birth_point']; // 最終保持ポイント $arrValues['total_point'] = $objFormParam->getValue('point') - $arrValues['use_point']; @@ -751,17 +753,17 @@ public function lfCheckError(&$objFormParam) * DB更新処理 * * @param integer $order_id 受注ID - * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param PurchaseHelper $objPurchase PurchaseHelper インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param string $message 通知メッセージ * @param array $arrValuesBefore 更新前の受注情報 * @return integer $order_id 受注ID * * エラー発生時は負数を返す。 */ - public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message, &$arrValuesBefore) + public function doRegister($order_id, PurchaseHelper &$objPurchase, &$objFormParam, &$message, &$arrValuesBefore) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrValues = $objFormParam->getDbArray(); $where = 'order_id = ?'; @@ -775,7 +777,7 @@ public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message, } // 生年月日の調整 - $arrValues['order_birth'] = SC_Utils_Ex::sfGetTimestamp($arrValues['order_birth_year'], $arrValues['order_birth_month'], $arrValues['order_birth_day']); + $arrValues['order_birth'] = Utils::sfGetTimestamp($arrValues['order_birth_year'], $arrValues['order_birth_month'], $arrValues['order_birth_day']); // 受注テーブルの更新 $order_id = $objPurchase->registerOrder($order_id, $arrValues); @@ -841,7 +843,7 @@ public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message, $arrAllShipping = $objFormParam->getSwapArray($this->arrShippingKeys); $arrAllShipmentItem = $objFormParam->getSwapArray($this->arrShipmentItemKeys); - $arrDelivTime = SC_Helper_Delivery_Ex::getDelivTime($objFormParam->getValue('deliv_id')); + $arrDelivTime = DeliveryHelper::getDelivTime($objFormParam->getValue('deliv_id')); //商品単価を複数配送にも適応 $arrShippingValues = array(); $arrIsNotQuantityUp = array(); @@ -850,7 +852,7 @@ public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message, $arrShippingValues[$shipping_index] = $arrShipping; $arrShippingValues[$shipping_index]['shipping_date'] - = SC_Utils_Ex::sfGetTimestamp($arrShipping['shipping_date_year'], + = Utils::sfGetTimestamp($arrShipping['shipping_date_year'], $arrShipping['shipping_date_month'], $arrShipping['shipping_date_day']); @@ -869,7 +871,7 @@ public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message, $arrShippingValues[$shipping_index]['shipping_time'] = $arrDelivTime[$arrShipping['time_id']]; // 複数配送の場合は配送商品を登録 - if (!SC_Utils_Ex::isBlank($arrAllShipmentItem)) { + if (!Utils::isBlank($arrAllShipmentItem)) { $arrShipmentValues = array(); foreach ($arrAllShipmentItem[$shipping_index] as $key => $arrItem) { @@ -898,13 +900,13 @@ public function doRegister($order_id, &$objPurchase, &$objFormParam, &$message, * * 小画面で選択した受注商品をフォームに反映させる. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function doRegisterProduct(&$objFormParam) { $product_class_id = $objFormParam->getValue('add_product_class_id'); - if (SC_Utils_Ex::isBlank($product_class_id)) { + if (Utils::isBlank($product_class_id)) { $product_class_id = $objFormParam->getValue('edit_product_class_id'); $changed_no = $objFormParam->getValue('no'); $this->shipmentEditProduct($objFormParam, $product_class_id, $changed_no); @@ -917,7 +919,7 @@ public function doRegisterProduct(&$objFormParam) * 受注商品を削除する. * * @param integer $delete_no 削除する受注商品の項番 - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function doDeleteProduct($delete_no, &$objFormParam) @@ -952,7 +954,7 @@ public function doDeleteProduct($delete_no, &$objFormParam) /** * お届け先を追加する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function addShipping(&$objFormParam) @@ -966,18 +968,18 @@ public function addShipping(&$objFormParam) * 会員情報をフォームに設定する. * * @param integer $customer_id 会員ID - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function setCustomerTo($customer_id, &$objFormParam) { - $arrCustomer = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id); + $arrCustomer = CustomerHelper::sfGetCustomerDataFromId($customer_id); foreach ($arrCustomer as $key => $val) { $objFormParam->setValue('order_' . $key, $val); } // 誕生日の処理 - if (!SC_Utils_Ex::isBlank($objFormParam->getValue('order_birth'))) { + if (!Utils::isBlank($objFormParam->getValue('order_birth'))) { $order_birth = substr($objFormParam->getValue('order_birth'), 0, 10); $arrOrderBirth = explode("-", $order_birth); @@ -993,13 +995,13 @@ public function setCustomerTo($customer_id, &$objFormParam) /** * アンカーキーを取得する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return string アンカーキーの文字列 */ public function getAnchorKey(&$objFormParam) { $ancor_key = $objFormParam->getValue('anchor_key'); - if (!SC_Utils_Ex::isBlank($ancor_key)) { + if (!Utils::isBlank($ancor_key)) { return "location.hash='#" . htmlentities(urlencode($ancor_key), ENT_QUOTES) . "'"; } @@ -1009,7 +1011,7 @@ public function getAnchorKey(&$objFormParam) /** * 商品を追加 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param integer $add_product_class_id 追加商品規格ID * @return void */ @@ -1030,7 +1032,7 @@ public function shipmentAddProduct(&$objFormParam, $add_product_class_id) } } else { //届け先に選択商品がない場合 - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $arrAddProductInfo = $objProduct->getDetailAndProductsClass($add_product_class_id); $arrShipmentProducts['shipment_product_class_id'][$select_shipping_id][] = $add_product_class_id; @@ -1050,7 +1052,7 @@ public function shipmentAddProduct(&$objFormParam, $add_product_class_id) /** * 商品を変更 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param integer $edit_product_class_id 変更商品規格ID * @param integer $change_no 変更対象 * @return void @@ -1075,7 +1077,7 @@ public function shipmentEditProduct(&$objFormParam, $edit_product_class_id, $cha } } } else { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $arrAddProductInfo = $objProduct->getDetailAndProductsClass($edit_product_class_id); //上書き @@ -1106,7 +1108,7 @@ public function shipmentEditProduct(&$objFormParam, $edit_product_class_id, $cha /** * 複数配送のパラメータを取り出す * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array 配送データ */ public function getShipmentProducts(&$objFormParam) @@ -1151,7 +1153,7 @@ public function changeShipmentProducts(&$arrShipmentProducts, $arrProductInfo, $ /** * 商品側の総量計算&セット * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function setProductsQuantity(&$objFormParam) @@ -1159,7 +1161,7 @@ public function setProductsQuantity(&$objFormParam) $arrShipmentsItems = $objFormParam->getSwapArray(array('shipment_product_class_id', 'shipment_quantity')); // 配送先が存在する時のみ、商品個数の再設定を行います - if (!SC_Utils_Ex::isBlank($arrShipmentsItems)) { + if (!Utils::isBlank($arrShipmentsItems)) { $arrUpdateQuantity = array(); foreach ($arrShipmentsItems as $arritems) { foreach ($arritems['shipment_product_class_id'] as $relation_index => $shipment_product_class_id) { @@ -1179,7 +1181,7 @@ public function setProductsQuantity(&$objFormParam) /** * 削除対象の確認、削除をする * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param array $arrProductClassIds  削除対象配列の商品規格ID * @param integer $delete_product_class_id 削除商品規? ?ID * @param array $arrDeleteKeys 削除項目 @@ -1208,7 +1210,7 @@ public function checkDeleteProducts(&$objFormParam, $arrProductClassIds, $delete /** * 配送先商品の削除の削除 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param array $arrShipmentDeleteKeys 削除項目 * @param int $delete_shipping_id  削除配送ID * @param int $delete_no 削除対象 @@ -1235,7 +1237,7 @@ public function deleteShipment(&$objFormParam, $arrShipmentDeleteKeys, $delete_s /** * 受注商品一覧側に商品を追加 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param array $arrProductClassIds   対象配列の商品規格ID * @param int $insert_product_class_id 追加商品規格ID * @param array $arrAddProductInfo 追加データ @@ -1245,7 +1247,7 @@ public function checkInsertOrderProducts(&$objFormParam, $arrProductClassIds, $i { if (!$arrProductClassIds || !in_array($insert_product_class_id, $arrProductClassIds)) { $arrAddProducts = array(); - $arrTax = SC_Helper_TaxRule_Ex::getTaxRule(0, $insert_product_class_id); + $arrTax = TaxRuleHelper::getTaxRule(0, $insert_product_class_id); $arrAddProductInfo['product_name'] = ($arrAddProductInfo['product_name']) ? $arrAddProductInfo['product_name'] diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order.php b/data/Eccube/Page/Admin/Order/Index.php similarity index 87% rename from data/class/pages/admin/order/LC_Page_Admin_Order.php rename to data/Eccube/Page/Admin/Order/Index.php index a873ce0710d..55e1e17a938 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order.php +++ b/data/Eccube/Page/Admin/Order/Index.php @@ -1,36 +1,39 @@ tpl_maintitle = '受注管理'; $this->tpl_subtitle = '受注管理'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status'); $this->arrORDERSTATUS_COLOR = $masterData->getMasterData('mtb_order_status_color'); $this->arrSex = $masterData->getMasterData('mtb_sex'); $this->arrPageMax = $masterData->getMasterData('mtb_page_max'); - $objDate = new SC_Date_Ex(); + $objDate = new Date(); // 登録・更新日検索用 $objDate->setStartYear(RELEASE_YEAR); $objDate->setEndYear(DATE('Y')); @@ -67,7 +70,7 @@ public function init() $this->arrDay = $objDate->getDay(); // 支払い方法の取得 - $this->arrPayments = SC_Helper_Payment_Ex::getIDValueList(); + $this->arrPayments = PaymentHelper::getIDValueList(); $this->httpCacheControl('nocache'); } @@ -90,13 +93,13 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $this->arrHidden = $objFormParam->getSearchArray(); $this->arrForm = $objFormParam->getFormParamList(); - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); switch ($this->getMode()) { // 削除 @@ -136,7 +139,7 @@ public function action() case 'csv': $this->doOutputCSV($where, $arrWhereVal, $order); - SC_Response_Ex::actionExit(); + Response::actionExit(); break; // 全件削除(ADMIN_MODE) @@ -154,9 +157,9 @@ public function action() // 行数の取得 $this->tpl_linemax = $this->getNumberOfLines($where, $arrWhereVal); // ページ送りの処理 - $page_max = SC_Utils_Ex::sfGetSearchPageMax($objFormParam->getValue('search_page_max')); + $page_max = Utils::sfGetSearchPageMax($objFormParam->getValue('search_page_max')); // ページ送りの取得 - $objNavi = new SC_PageNavi_Ex($this->arrHidden['search_pageno'], + $objNavi = new PageNavi($this->arrHidden['search_pageno'], $this->tpl_linemax, $page_max, 'eccube.moveNaviPage', NAVI_PMAX); $this->arrPagenavi = $objNavi->arrPagenavi; @@ -177,7 +180,7 @@ public function action() /** * パラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -225,12 +228,12 @@ public function lfInitParam(&$objFormParam) /** * 入力内容のチェックを行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfCheckError(&$objFormParam) { - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->arrErr = $objFormParam->checkError(); // 相関チェック @@ -257,19 +260,19 @@ public function lfCheckError(&$objFormParam) * クエリを構築する. * * 検索条件のキーに応じた WHERE 句と, クエリパラメーターを構築する. - * クエリパラメーターは, SC_FormParam の入力値から取得する. + * クエリパラメーターは, FormParam の入力値から取得する. * * 構築内容は, 引数の $where 及び $arrValues にそれぞれ追加される. * * @param string $key 検索条件のキー * @param string $where 構築する WHERE 句 * @param array $arrValues 構築するクエリパラメーター - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function buildQuery($key, &$where, &$arrValues, &$objFormParam) { - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); switch ($key) { case 'search_product_name': $where .= ' AND EXISTS (SELECT 1 FROM dtb_order_detail od WHERE od.order_id = dtb_order.order_id AND od.product_name LIKE ?)'; @@ -295,7 +298,7 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam) $tmp_where = ''; foreach ($objFormParam->getValue($key) as $element) { if ($element != '') { - if (SC_Utils_Ex::isBlank($tmp_where)) { + if (Utils::isBlank($tmp_where)) { $tmp_where .= ' AND (order_sex = ?'; } else { $tmp_where .= ' OR order_sex = ?'; @@ -304,14 +307,14 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam) } } - if (!SC_Utils_Ex::isBlank($tmp_where)) { + if (!Utils::isBlank($tmp_where)) { $tmp_where .= ')'; $where .= " $tmp_where "; } break; case 'search_order_tel': $where .= ' AND (' . $dbFactory->concatColumn(array('order_tel01', 'order_tel02', 'order_tel03')) . ' LIKE ?)'; - $arrValues[] = SC_SelectSql_Ex::addSearchStr(preg_replace('/[()-]+/', '', $objFormParam->getValue($key))); + $arrValues[] = SelectSql::addSearchStr(preg_replace('/[()-]+/', '', $objFormParam->getValue($key))); break; case 'search_order_email': $where .= ' AND order_email LIKE ?'; @@ -330,7 +333,7 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam) } } - if (!SC_Utils_Ex::isBlank($tmp_where)) { + if (!Utils::isBlank($tmp_where)) { $tmp_where .= ')'; $where .= " $tmp_where "; } @@ -344,42 +347,42 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam) $arrValues[] = sprintf('%d', $objFormParam->getValue($key)); break; case 'search_sorderyear': - $date = SC_Utils_Ex::sfGetTimestamp($objFormParam->getValue('search_sorderyear'), + $date = Utils::sfGetTimestamp($objFormParam->getValue('search_sorderyear'), $objFormParam->getValue('search_sordermonth'), $objFormParam->getValue('search_sorderday')); $where.= ' AND create_date >= ?'; $arrValues[] = $date; break; case 'search_eorderyear': - $date = SC_Utils_Ex::sfGetTimestamp($objFormParam->getValue('search_eorderyear'), + $date = Utils::sfGetTimestamp($objFormParam->getValue('search_eorderyear'), $objFormParam->getValue('search_eordermonth'), $objFormParam->getValue('search_eorderday'), true); $where.= ' AND create_date <= ?'; $arrValues[] = $date; break; case 'search_supdateyear': - $date = SC_Utils_Ex::sfGetTimestamp($objFormParam->getValue('search_supdateyear'), + $date = Utils::sfGetTimestamp($objFormParam->getValue('search_supdateyear'), $objFormParam->getValue('search_supdatemonth'), $objFormParam->getValue('search_supdateday')); $where.= ' AND update_date >= ?'; $arrValues[] = $date; break; case 'search_eupdateyear': - $date = SC_Utils_Ex::sfGetTimestamp($objFormParam->getValue('search_eupdateyear'), + $date = Utils::sfGetTimestamp($objFormParam->getValue('search_eupdateyear'), $objFormParam->getValue('search_eupdatemonth'), $objFormParam->getValue('search_eupdateday'), true); $where.= ' AND update_date <= ?'; $arrValues[] = $date; break; case 'search_sbirthyear': - $date = SC_Utils_Ex::sfGetTimestamp($objFormParam->getValue('search_sbirthyear'), + $date = Utils::sfGetTimestamp($objFormParam->getValue('search_sbirthyear'), $objFormParam->getValue('search_sbirthmonth'), $objFormParam->getValue('search_sbirthday')); $where.= ' AND order_birth >= ?'; $arrValues[] = $date; break; case 'search_ebirthyear': - $date = SC_Utils_Ex::sfGetTimestamp($objFormParam->getValue('search_ebirthyear'), + $date = Utils::sfGetTimestamp($objFormParam->getValue('search_ebirthyear'), $objFormParam->getValue('search_ebirthmonth'), $objFormParam->getValue('search_ebirthday'), true); $where.= ' AND order_birth <= ?'; @@ -403,7 +406,7 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam) */ public function doDelete($where, $arrParam = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqlval['del_flg'] = 1; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; $objQuery->update('dtb_order', $sqlval, $where, $arrParam); @@ -422,7 +425,7 @@ public function doDelete($where, $arrParam = array()) */ public function doOutputCSV($where, $arrVal, $order) { - $objCSV = new SC_Helper_CSV_Ex(); + $objCSV = new CsvHelper(); $objCSV->sfDownloadCsv('3', $where, $arrVal, $order, true); } @@ -435,7 +438,7 @@ public function doOutputCSV($where, $arrVal, $order) */ public function getNumberOfLines($where, $arrValues) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->count('dtb_order', $where, $arrValues); } @@ -452,7 +455,7 @@ public function getNumberOfLines($where, $arrValues) */ public function findOrders($where, $arrValues, $limit, $offset, $order) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); if ($limit != 0) { $objQuery->setLimitOffset($limit, $offset); } diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php b/data/Eccube/Page/Admin/Order/Mail.php similarity index 79% rename from data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php rename to data/Eccube/Page/Admin/Order/Mail.php index 1bacfea8c7a..4bb589492f0 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_Mail.php +++ b/data/Eccube/Page/Admin/Order/Mail.php @@ -1,36 +1,32 @@ tpl_maintitle = '受注管理'; $this->tpl_subtitle = '受注管理'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrMAILTEMPLATE = $masterData->getMasterData('mtb_mail_template'); $this->httpCacheControl('nocache'); } @@ -82,19 +78,19 @@ public function action() $this->order_id_array = $post['order_id_array']; } else { //エラーで元に戻す - SC_Response_Ex::sendRedirect(ADMIN_ORDER_URLPATH); - SC_Response_Ex::actionExit(); + Response::sendRedirect(ADMIN_ORDER_URLPATH); + Response::actionExit(); } //メール本文の確認例は初めの1受注とする - if (!SC_Utils_Ex::isBlank($this->order_id_array)) { + if (!Utils::isBlank($this->order_id_array)) { $order_id_array = split(',', $this->order_id_array); $post['order_id'] = intval($order_id_array[0]); $this->order_id_count = count($order_id_array); } // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); @@ -107,7 +103,7 @@ public function action() $this->arrSearchHidden = $objFormParam->getSearchArray(); // 履歴を読み込むか - $load_history = SC_Utils_Ex::sfIsInt($this->tpl_order_id); + $load_history = Utils::sfIsInt($this->tpl_order_id); switch ($this->getMode()) { case 'confirm': @@ -122,8 +118,8 @@ public function action() case 'send': $sendStatus = $this->doSend($objFormParam); if ($sendStatus === true) { - SC_Response_Ex::sendRedirect(ADMIN_ORDER_URLPATH); - SC_Response_Ex::actionExit(); + Response::sendRedirect(ADMIN_ORDER_URLPATH); + Response::actionExit(); } $this->arrErr = $sendStatus; break; @@ -153,7 +149,7 @@ public function action() */ public function getMailHistory($order_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'send_date, subject, template_id, send_id'; $where = 'order_id = ?'; $objQuery->setOrder('send_date DESC'); @@ -164,7 +160,7 @@ public function getMailHistory($order_id) /** * * メールを送る。 - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam */ public function doSend(&$objFormParam) { @@ -175,14 +171,14 @@ public function doSend(&$objFormParam) // 注文受付メール(複数受注ID対応) $order_id_array = explode(',', $this->order_id_array); foreach ($order_id_array as $order_id) { - $objMail = new SC_Helper_Mail_Ex(); + $objMail = new MailHelper(); $objSendMail = $objMail->sfSendOrderMail($order_id, $objFormParam->getValue('template_id'), $objFormParam->getValue('subject'), $objFormParam->getValue('header'), $objFormParam->getValue('footer')); } - // TODO $SC_SendMail から送信がちゃんと出来たか確認できたら素敵。 + // TODO $SendMail から送信がちゃんと出来たか確認できたら素敵。 return true; } @@ -191,7 +187,7 @@ public function doSend(&$objFormParam) /** * 確認画面を表示する為の準備 - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam */ public function confirm(&$objFormParam) { @@ -199,7 +195,7 @@ public function confirm(&$objFormParam) // メールの送信 if (count($arrErr) == 0) { // 注文受付メール(送信なし) - $objMail = new SC_Helper_Mail_Ex(); + $objMail = new MailHelper(); $objSendMail = $objMail->sfSendOrderMail( $objFormParam->getValue('order_id'), $objFormParam->getValue('template_id'), @@ -221,7 +217,7 @@ public function confirm(&$objFormParam) /** * * テンプレートの文言をフォームに入れる。 - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam */ public function changeData(&$objFormParam) { @@ -231,8 +227,8 @@ public function changeData(&$objFormParam) if (strlen($template_id) === 0) { $mailTemplates = null; // 有効選択時 - } elseif (SC_Utils_Ex::sfIsInt($template_id)) { - $objMailtemplate = new SC_Helper_Mailtemplate_Ex(); + } elseif (Utils::sfIsInt($template_id)) { + $objMailtemplate = new MailtemplateHelper(); $mailTemplates = $objMailtemplate->get($template_id); // 不正選択時 } else { @@ -252,7 +248,7 @@ public function changeData(&$objFormParam) /** * パラメーター情報の初期化 - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_MailView.php b/data/Eccube/Page/Admin/Order/MailView.php similarity index 60% rename from data/class/pages/admin/order/LC_Page_Admin_Order_MailView.php rename to data/Eccube/Page/Admin/Order/MailView.php index 447aaf2a469..efe94b79685 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_MailView.php +++ b/data/Eccube/Page/Admin/Order/MailView.php @@ -1,36 +1,28 @@ getMailHistory($send_id); $this->tpl_subject = $mailHistory[0]['subject']; $this->tpl_body = $mailHistory[0]['mail_body']; @@ -79,7 +71,7 @@ public function action() */ public function getMailHistory($send_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'subject, mail_body'; $where = 'send_id = ?'; $mailHistory = $objQuery->select($col, 'dtb_mail_history', $where, array($send_id)); diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_Multiple.php b/data/Eccube/Page/Admin/Order/Multiple.php similarity index 52% rename from data/class/pages/admin/order/LC_Page_Admin_Order_Multiple.php rename to data/Eccube/Page/Admin/Order/Multiple.php index e96f9602a97..44c954ba65b 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_Multiple.php +++ b/data/Eccube/Page/Admin/Order/Multiple.php @@ -1,37 +1,26 @@ - setStartYear(RELEASE_YEAR); $this->arrYear = $objDate->getYear(); $this->arrMonth = $objDate->getMonth(); $this->arrDay = $objDate->getDay(); // パラメーター管理クラス - $this->objFormParam = new SC_FormParam_Ex(); + $this->objFormParam = new FormParam(); // パラメーター情報の初期化 $this->lfInitParam($this->objFormParam); $this->objFormParam->setParam($_POST); @@ -96,7 +93,7 @@ public function action() $status = $this->createPdf($this->objFormParam); if ($status === true) { - SC_Response_Ex::actionExit(); + Response::actionExit(); } else { $this->arrErr = $status; } @@ -130,7 +127,7 @@ public function createFromValues($order_id, $pdf_order_id) $arrForm['msg3'] = 'ご確認くださいますよう、お願いいたします。'; // 注文番号があったら、セットする - if (SC_Utils_Ex::sfIsInt($order_id)) { + if (Utils::sfIsInt($order_id)) { $arrForm['order_id'][0] = $order_id; } elseif (is_array($pdf_order_id)) { sort($pdf_order_id); @@ -145,7 +142,7 @@ public function createFromValues($order_id, $pdf_order_id) /** * * PDFの作成 - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam */ public function createPdf(&$objFormParam) { @@ -158,7 +155,7 @@ public function createPdf(&$objFormParam) $this->arrForm = $arrRet; // エラー入力なし if (count($arrErr) == 0) { - $objFpdf = new SC_Fpdf_Ex($arrRet['download'], $arrRet['title']); + $objFpdf = new Fpdf($arrRet['download'], $arrRet['title']); foreach ($arrRet['order_id'] AS $key => $val) { $arrPdfData = $arrRet; $arrPdfData['order_id'] = $val; @@ -174,8 +171,8 @@ public function createPdf(&$objFormParam) /** * パラメーター情報の初期化 - * @param SC_FormParam - * @param SC_FormParam_Ex $objFormParam + * @param FormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -198,8 +195,8 @@ public function lfInitParam(&$objFormParam) /** * 入力内容のチェック - * @var SC_FormParam - * @param SC_FormParam $objFormParam + * @var FormParam + * @param FormParam $objFormParam */ public function lfCheckError(&$objFormParam) @@ -207,7 +204,7 @@ public function lfCheckError(&$objFormParam) // 入力データを渡す。 $arrParams = $objFormParam->getHashArray(); $arrErr = $objFormParam->checkError(); - $objError = new SC_CheckError_Ex($arrParams); + $objError = new CheckError($arrParams); $year = $objFormParam->getValue('year'); if (!is_numeric($year)) { diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php b/data/Eccube/Page/Admin/Order/ProductSelect.php similarity index 80% rename from data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php rename to data/Eccube/Page/Admin/Order/ProductSelect.php index 4b8c6c21163..9748c28732c 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php +++ b/data/Eccube/Page/Admin/Order/ProductSelect.php @@ -1,36 +1,33 @@ tpl_maintitle = '受注管理'; $this->tpl_subtitle = '商品選択'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPRODUCTSTATUS_COLOR = $masterData->getMasterData('mtb_product_status_color'); } @@ -68,8 +65,8 @@ public function process() */ public function action() { - $objDb = new SC_Helper_DB_Ex(); - $objFormParam = new SC_FormParam_Ex(); + $objDb = new DbHelper(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); @@ -79,17 +76,17 @@ public function action() switch ($this->getMode()) { case 'search': - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $this->arrForm = $objFormParam->getHashArray(); $wheres = $this->createWhere($objFormParam, $objDb); $this->tpl_linemax = $this->getLineCount($wheres, $objProduct); //ぶった斬りポイント================================================================== // ページ送りの処理 - $page_max = SC_Utils_Ex::sfGetSearchPageMax($_POST['search_page_max']); + $page_max = Utils::sfGetSearchPageMax($_POST['search_page_max']); // ページ送りの取得 - $objNavi = new SC_PageNavi_Ex($_POST['search_pageno'], $this->tpl_linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX); + $objNavi = new PageNavi($_POST['search_pageno'], $this->tpl_linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX); $this->tpl_strnavi = $objNavi->strnavi; // 表示文字列 $startno = $objNavi->start_row; $arrProduct_id = $this->getProducts($wheres, $objProduct, $page_max, $startno); @@ -120,7 +117,7 @@ public function action() } // カテゴリ取得 - $this->arrCatList = $objDb->sfGetCategoryList(); + $this->arrCatList = $objDb->getCategoryList(); $this->setTemplate($this->tpl_mainpage); } @@ -128,11 +125,11 @@ public function action() * 商品取得 * * @param array $arrProductId - * @param SC_Product $objProduct + * @param Product $objProduct */ - public function getProductList($arrProductId, &$objProduct) + public function getProductList($arrProductId, Product &$objProduct) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 表示順序 $order = 'update_date DESC, product_id DESC'; @@ -156,24 +153,24 @@ public function getFnOnload($arrProducts) /** * 規格クラス用JavaScript生成 - * @param SC_Product $objProduct + * @param Product $objProduct */ - public function getTplJavascript(&$objProduct) + public function getTplJavascript(Product &$objProduct) { - return 'eccube.productsClassCategories = ' . SC_Utils_Ex::jsonEncode($objProduct->classCategories) . '; '; + return 'eccube.productsClassCategories = ' . Utils::jsonEncode($objProduct->classCategories) . '; '; } /** * 検索結果の取得 * @param array $whereAndBind string whereと array bindの連想配列 - * @param SC_Product $objProduct + * @param Product $objProduct * @param integer $page_max */ - public function getProducts($whereAndBind, &$objProduct, $page_max, $startno) + public function getProducts($whereAndBind, Product &$objProduct, $page_max, $startno) { $where = $whereAndBind['where']; $bind = $whereAndBind['bind']; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setWhere($where); // 取得範囲の指定(開始行番号、行数のセット) $objQuery->setLimitOffset($page_max, $startno); @@ -188,14 +185,14 @@ public function getProducts($whereAndBind, &$objProduct, $page_max, $startno) * * 検索結果対象となる商品の数を返す。 * @param array $whereAndBind - * @param SC_Product $objProduct + * @param Product $objProduct */ public function getLineCount($whereAndBind, &$objProduct) { $where = $whereAndBind['where']; $bind = $whereAndBind['bind']; // 検索結果対象となる商品の数を取得 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setWhere($where); $linemax = $objProduct->findProductCount($objQuery, $bind); @@ -206,8 +203,8 @@ public function getLineCount($whereAndBind, &$objProduct) * * POSTされた値からSQLのWHEREとBINDを配列で返す。 * @return array ('where' => where string, 'bind' => databind array) - * @param SC_FormParam $objFormParam - * @param SC_Helper_DB_Ex $objDb + * @param FormParam $objFormParam + * @param DbHelper $objDb */ public function createWhere(&$objFormParam, &$objDb) { @@ -225,7 +222,7 @@ public function createWhere(&$objFormParam, &$objDb) $bind[] = '%'.$val.'%'; break; case 'search_category_id': - list($tmp_where, $tmp_bind) = $objDb->sfGetCatWhere($val); + list($tmp_where, $tmp_bind) = $objDb->getCatWhere($val); if ($tmp_where != '') { $where.= ' AND alldtl.product_id IN (SELECT product_id FROM dtb_product_categories WHERE ' . $tmp_where . ')'; $bind = array_merge((array) $bind, (array) $tmp_bind); @@ -298,7 +295,7 @@ public function sortProducts($arrProduct_id, $productList) /** * パラメーター情報の初期化 - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { diff --git a/data/class/pages/admin/order/LC_Page_Admin_Order_Status.php b/data/Eccube/Page/Admin/Order/Status.php similarity index 77% rename from data/class/pages/admin/order/LC_Page_Admin_Order_Status.php rename to data/Eccube/Page/Admin/Order/Status.php index 89cb78a85dd..be78c2c4c77 100644 --- a/data/class/pages/admin/order/LC_Page_Admin_Order_Status.php +++ b/data/Eccube/Page/Admin/Order/Status.php @@ -1,36 +1,33 @@ tpl_maintitle = '受注管理'; $this->tpl_subtitle = '対応状況管理'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrORDERSTATUS = $masterData->getMasterData('mtb_order_status'); $this->arrORDERSTATUS_COLOR = $masterData->getMasterData('mtb_order_status_color'); } @@ -69,10 +66,10 @@ public function process() */ public function action() { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); @@ -82,7 +79,7 @@ public function action() $this->arrForm = $objFormParam->getHashArray(); //支払方法の取得 - $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); + $this->arrPayment = PaymentHelper::getIDValueList(); switch ($this->getMode()) { case 'update': @@ -116,8 +113,8 @@ public function action() /** * パラメーター情報の初期化 - * @param SC_FormParam - * @param SC_FormParam_Ex $objFormParam + * @param FormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -132,7 +129,7 @@ public function lfInitParam(&$objFormParam) /** * 入力内容のチェック - * @param SC_FormParam + * @param FormParam */ public function lfCheckError(&$objFormParam) { @@ -147,7 +144,7 @@ public function lfCheckError(&$objFormParam) // 対応状況一覧の表示 public function lfStatusDisp($status,$pageno) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $select ='*'; $from = 'dtb_order'; @@ -162,7 +159,7 @@ public function lfStatusDisp($status,$pageno) $page_max = ORDER_STATUS_MAX; // ページ送りの取得 - $objNavi = new SC_PageNavi_Ex($pageno, $linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX); + $objNavi = new PageNavi($pageno, $linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX); $this->tpl_strnavi = $objNavi->strnavi; // 表示文字列 $startno = $objNavi->start_row; @@ -183,13 +180,13 @@ public function lfStatusDisp($status,$pageno) */ public function lfStatusMove($statusId, $arrOrderId) { - $objPurchase = new SC_Helper_Purchase_Ex(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objPurchase = new PurchaseHelper(); + $objQuery = Query::getSingletonInstance(); if (!isset($arrOrderId) || !is_array($arrOrderId)) { return false; } - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $arrORDERSTATUS = $masterData->getMasterData('mtb_order_status'); $objQuery->begin(); @@ -210,13 +207,13 @@ public function lfStatusMove($statusId, $arrOrderId) */ public function lfDelete($arrOrderId) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); if (!isset($arrOrderId) || !is_array($arrOrderId)) { return false; } - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); foreach ($arrOrderId as $orderId) { $objPurchase->cancelOrder($orderId, ORDER_CANCEL, true); } diff --git a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore.php b/data/Eccube/Page/Admin/Ownersstore/Index.php similarity index 90% rename from data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore.php rename to data/Eccube/Page/Admin/Ownersstore/Index.php index 8c9336e1a9e..c9f23799839 100644 --- a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore.php +++ b/data/Eccube/Page/Admin/Ownersstore/Index.php @@ -1,36 +1,35 @@ getMode(); // パラメーター情報の初期化 $this->initParam($objFormParam, $mode); @@ -83,7 +82,7 @@ public function action() $this->arrErr = $this->installPlugin($archive_file_name, 'plugin_file'); if ($this->isError($this->arrErr) === false) { // コンパイルファイルのクリア処理 - SC_Utils_Ex::clearCompliedTemplate(); + Utils::clearCompliedTemplate(); $this->tpl_onload = "alert('プラグインをインストールしました。');"; } } @@ -94,13 +93,13 @@ public function action() $this->arrErr = $objFormParam->checkError(); if ($this->isError($this->arrErr) === false) { $plugin_id = $objFormParam->getValue('plugin_id'); - $plugin = SC_Plugin_Util_Ex::getPluginByPluginId($plugin_id); + $plugin = PluginUtil::getPluginByPluginId($plugin_id); $this->arrErr = $this->uninstallPlugin($plugin); if ($this->isError($this->arrErr) === false) { // TODO 全プラグインのインスタンスを保持したまま後続処理が実行されるので、全てのインスタンスを解放する。 - unset($GLOBALS['_SC_Helper_Plugin_instance']); + unset($GLOBALS['_PluginHelper_instance']); // コンパイルファイルのクリア処理 - SC_Utils_Ex::clearCompliedTemplate(); + Utils::clearCompliedTemplate(); $this->tpl_onload = "alert('" . $plugin['plugin_name'] ."を削除しました。');"; } } @@ -112,13 +111,13 @@ public function action() if ($this->isError($this->arrErr) === false) { $plugin_id = $objFormParam->getValue('plugin_id'); // プラグイン取得. - $plugin = SC_Plugin_Util_Ex::getPluginByPluginId($plugin_id); + $plugin = PluginUtil::getPluginByPluginId($plugin_id); $this->arrErr = $this->enablePlugin($plugin); if ($this->isError($this->arrErr) === false) { // TODO 全プラグインのインスタンスを保持したまま後続処理が実行されるので、全てのインスタンスを解放する。 - unset($GLOBALS['_SC_Helper_Plugin_instance']); + unset($GLOBALS['_PluginHelper_instance']); // コンパイルファイルのクリア処理 - SC_Utils_Ex::clearCompliedTemplate(); + Utils::clearCompliedTemplate(); $this->tpl_onload = "alert('" . $plugin['plugin_name'] . "を有効にしました。');"; } } @@ -130,13 +129,13 @@ public function action() if ($this->isError($this->arrErr) === false) { $plugin_id = $objFormParam->getValue('plugin_id'); // プラグイン取得. - $plugin = SC_Plugin_Util_Ex::getPluginByPluginId($plugin_id); + $plugin = PluginUtil::getPluginByPluginId($plugin_id); $this->arrErr = $this->disablePlugin($plugin); if ($this->isError($this->arrErr) === false) { // TODO 全プラグインのインスタンスを保持したまま後続処理が実行されるので、全てのインスタンスを解放する。 - unset($GLOBALS['_SC_Helper_Plugin_instance']); + unset($GLOBALS['_PluginHelper_instance']); // コンパイルファイルのクリア処理 - SC_Utils_Ex::clearCompliedTemplate(); + Utils::clearCompliedTemplate(); $this->tpl_onload = "alert('" . $plugin['plugin_name'] . "を無効にしました。');"; } } @@ -147,7 +146,7 @@ public function action() $this->arrErr = $objFormParam->checkError(); if ($this->isError($this->arrErr) === false) { $plugin_id = $objFormParam->getValue('plugin_id'); - $plugin = SC_Plugin_Util_Ex::getPluginByPluginId($plugin_id); + $plugin = PluginUtil::getPluginByPluginId($plugin_id); $target_plugin_code = $plugin['plugin_code']; // アップデート対象のプラグインコード $this->arrErr = $this->checkUploadFile($target_plugin_code); @@ -155,11 +154,11 @@ public function action() $update_plugin_file = $_FILES[$target_plugin_code]; $update_plugin_file_name = $update_plugin_file['name']; // アップデートファイルのファイル名. // インストール処理. - $target_plugin = SC_Plugin_Util_Ex::getPluginByPluginCode($target_plugin_code); + $target_plugin = PluginUtil::getPluginByPluginCode($target_plugin_code); $this->arrErr = $this->updatePlugin($target_plugin, $update_plugin_file_name, $target_plugin_code); if ($this->isError($this->arrErr) === false) { // コンパイルファイルのクリア処理 - SC_Utils_Ex::clearCompliedTemplate(); + Utils::clearCompliedTemplate(); $this->tpl_onload = "alert('プラグインをアップデートしました。');"; } } @@ -175,7 +174,7 @@ public function action() $priority = $objFormParam->getValue('priority'); $this->updatePriority($plugin_id, $priority); // コンパイルファイルのクリア処理 - SC_Utils_Ex::clearCompliedTemplate(); + Utils::clearCompliedTemplate(); } else { // エラーメッセージを詰め直す. $this->arrErr['priority'][$plugin_id] = $arrErr['priority']; @@ -186,7 +185,7 @@ public function action() break; } // DBからプラグイン情報を取得 - $plugins = SC_Plugin_Util_Ex::getAllPlugin(); + $plugins = PluginUtil::getAllPlugin(); foreach ($plugins as $key => $plugin) { // ロゴファイルへのパスを生成(ロゴが無い場合はNO_IMAGEを表示) @@ -201,7 +200,7 @@ public function action() if ($plugins[$key]['enable'] === PLUGIN_ENABLE_TRUE) { // 競合するプラグインがあるかを判定. //$plugins[$key]['conflict_message']= $this->checkConflictPlugin($plugin['plugin_id']); - $plugins[$key]['conflict_message'] = SC_Plugin_Util_Ex::checkConflictPlugin($plugin['plugin_id']); + $plugins[$key]['conflict_message'] = PluginUtil::checkConflictPlugin($plugin['plugin_id']); } } $this->plugins = $plugins; @@ -210,7 +209,7 @@ public function action() /** * パラメーター初期化. * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @param string $mode モード * @return void */ @@ -226,7 +225,7 @@ public function initParam(&$objFormParam, $mode) /** * ファイルパラメーター初期化. * - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileのインスタンス. + * @param UploadFile $objUpFile UploadFileのインスタンス. * @param string $key 登録するキー. * @return void */ @@ -243,7 +242,7 @@ public function initUploadFile(&$objUpFile, $key) */ public function checkUploadFile($file_key) { - $objErr = new SC_CheckError_Ex(); + $objErr = new CheckError(); // 拡張子チェック $objErr->doFunc(array('プラグインファイル', $file_key, explode(',', PLUGIN_EXTENSION)), array('FILE_EXT_CHECK')); // ファイルサイズチェック @@ -262,7 +261,7 @@ public function checkUploadFile($file_key) */ public function isInstalledPlugin($plugin_code) { - $plugin = SC_Plugin_Util_Ex::getPluginByPluginCode($plugin_code); + $plugin = PluginUtil::getPluginByPluginCode($plugin_code); if (!empty($plugin)) { return true; } @@ -339,13 +338,13 @@ public function getPluginFilePath($plugin_code , $plugin_class) */ public function installPlugin($archive_file_name, $key) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); // 一時展開ディレクトリにファイルがある場合は事前に削除. - $arrFileHash = SC_Helper_FileManager_Ex::sfGetFileList(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR); + $arrFileHash = FileManagerHelper::sfGetFileList(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR); if (count($arrFileHash) > 0) { - SC_Helper_FileManager_Ex::deleteFile(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR, false); + FileManagerHelper::deleteFile(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR, false); } //シンタックスエラーがあるtar.gzをアップ後、削除するとたまにディレクトリが消えるので追加 @@ -353,7 +352,7 @@ public function installPlugin($archive_file_name, $key) $arrErr = array(); // 必須拡張モジュールのチェック - $arrErr = SC_Plugin_Util_Ex::checkExtension($key); + $arrErr = PluginUtil::checkExtension($key); if ($this->isError($arrErr) === true) { return $arrErr; } @@ -400,10 +399,10 @@ public function installPlugin($archive_file_name, $key) // プラグイン保存ディレクトリを作成し、一時展開用ディレクトリから移動します. $plugin_dir_path = $this->getPluginDir($arrPluginInfo['PLUGIN_CODE']); $this->makeDir($plugin_dir_path); - SC_Utils_Ex::copyDirectory(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR, $plugin_dir_path); + Utils::copyDirectory(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR, $plugin_dir_path); // プラグイン情報を取得 - $plugin = SC_Plugin_Util_Ex::getPluginByPluginCode($arrPluginInfo['PLUGIN_CODE']); + $plugin = PluginUtil::getPluginByPluginCode($arrPluginInfo['PLUGIN_CODE']); // クラスファイルを読み込み. $plugin_class_file_path = $this->getPluginFilePath($plugin['plugin_code'], $plugin['class_name']); @@ -429,7 +428,7 @@ public function installPlugin($archive_file_name, $key) $objQuery->commit(); // 不要なファイルの削除 - SC_Helper_FileManager_Ex::deleteFile(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR, false); + FileManagerHelper::deleteFile(DOWNLOADS_TEMP_PLUGIN_INSTALL_DIR, false); return $arrErr; } @@ -445,14 +444,14 @@ public function installPlugin($archive_file_name, $key) public function rollBack($temp_dir, $plugin_id = '', $plugin_html_dir_path ='') { // 一時ディレクトリを削除. - SC_Helper_FileManager_Ex::deleteFile($temp_dir, false); + FileManagerHelper::deleteFile($temp_dir, false); // DBからプラグイン情報を削除 if (empty($plugin_id) === false) { - SC_Plugin_Util_Ex::deletePluginByPluginId($plugin_id); + PluginUtil::deletePluginByPluginId($plugin_id); } // htmlディレクトリを削除 if (empty($plugin_html_dir_path) === false) { - SC_Helper_FileManager_Ex::deleteFile($plugin_html_dir_path, true); + FileManagerHelper::deleteFile($plugin_html_dir_path, true); } } @@ -549,7 +548,7 @@ public function checkPluginConstants(ReflectionClass $objReflection, $dir_path) return $arrErr; } - $objErr = new SC_CheckError_Ex($arrPluginInfo); + $objErr = new CheckError($arrPluginInfo); $objErr->doFunc(array('PLUGIN_CODE', 'PLUGIN_CODE', STEXT_LEN), array('MAX_LENGTH_CHECK','GRAPH_CHECK')); $objErr->doFunc(array('PLUGIN_NAME', 'PLUGIN_NAME', STEXT_LEN), array('MAX_LENGTH_CHECK')); $objErr->doFunc(array('CLASS_NAME', 'CLASS_NAME', STEXT_LEN), array('MAX_LENGTH_CHECK','GRAPH_CHECK')); @@ -584,7 +583,7 @@ public function checkPluginConstants(ReflectionClass $objReflection, $dir_path) public function updatePlugin($target_plugin, $upload_file_name) { // アップデート前に不要なファイルを消しておきます. - SC_Helper_FileManager_Ex::deleteFile(DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR, false); + FileManagerHelper::deleteFile(DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR, false); $arrErr = array(); @@ -628,7 +627,7 @@ public function updatePlugin($target_plugin, $upload_file_name) } // 保存ディレクトリの削除. - SC_Helper_FileManager_Ex::deleteFile(DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR, false); + FileManagerHelper::deleteFile(DOWNLOADS_TEMP_PLUGIN_UPDATE_DIR, false); return $arrErr; } @@ -645,7 +644,7 @@ public function unpackPluginFile($unpack_file_name, $unpack_dir_path, $file_key) { $arrErr = array(); // 解凍ディレクトリディレクトリを作成し、一時ディレクトリからファイルを移動 - $objUpFile = new SC_UploadFile_Ex(PLUGIN_TEMP_REALDIR, $unpack_dir_path); + $objUpFile = new UploadFile(PLUGIN_TEMP_REALDIR, $unpack_dir_path); $this->initUploadFile($objUpFile, $file_key); $arrErr = $objUpFile->makeTempFile($file_key, false); if ($this->isError($arrErr) === true) { @@ -766,7 +765,7 @@ public function disablePlugin($plugin) */ public function updatePriority($plugin_id, $priority) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // UPDATEする値を作成する。 $sqlval['priority'] = $priority; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; @@ -787,7 +786,7 @@ public function updatePriority($plugin_id, $priority) public function registerData($arrPluginInfo, $mode = 'install') { // プラグイン情報をDB登録. - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arr_sqlval_plugin = array(); $arr_sqlval_plugin['plugin_name'] = $arrPluginInfo['PLUGIN_NAME']; $arr_sqlval_plugin['plugin_code'] = $arrPluginInfo['PLUGIN_CODE']; @@ -825,7 +824,7 @@ public function registerData($arrPluginInfo, $mode = 'install') // 該当プラグインのフックポイントを一旦削除 $objQuery->delete('dtb_plugin_hookpoint', 'plugin_id = ? ', array($plugin_id)); } else { - GC_Utils_Ex::gfPrintLog("モードの指定が不正($mode)", ERROR_LOG_REALFILE); + GcUtils::gfPrintLog("モードの指定が不正($mode)", ERROR_LOG_REALFILE); return false; } @@ -896,7 +895,7 @@ public function requirePluginFile($file_path, $key) */ public function execPlugin($obj, $class_name, $exec_func) { - $objPluginInstaller = new SC_Plugin_Installer($exec_func, $obj); + $objPluginInstaller = new PluginInstaller($exec_func, $obj); $arrErr = array(); if (method_exists($class_name, $exec_func) === true) { @@ -933,7 +932,7 @@ public function unpackPluginArchive($path) // 指定されたフォルダ内に解凍する $result = $tar->extractModify($dir . '/', ''); - GC_Utils_Ex::gfPrintLog("解凍: $path -> $dir"); + GcUtils::gfPrintLog("解凍: $path -> $dir"); // 解凍元のファイルを削除する. unlink($path); @@ -949,7 +948,7 @@ public function unpackPluginArchive($path) */ public function updatePluginEnable($plugin_id, $enable_flg) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // UPDATEする値を作成する。 $sqlval['enable'] = $enable_flg; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; @@ -970,16 +969,16 @@ public function updatePluginEnable($plugin_id, $enable_flg) public function deletePlugin($plugin_id, $plugin_code) { $arrErr = array(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); - SC_Plugin_Util_Ex::deletePluginByPluginId($plugin_id); + PluginUtil::deletePluginByPluginId($plugin_id); - if (SC_Helper_FileManager_Ex::deleteFile($this->getPluginDir($plugin_code)) === false) { + if (FileManagerHelper::deleteFile($this->getPluginDir($plugin_code)) === false) { // TODO エラー処理 } - if (SC_Helper_FileManager_Ex::deleteFile($this->getHtmlPluginDir($plugin_code)) === false) { + if (FileManagerHelper::deleteFile($this->getHtmlPluginDir($plugin_code)) === false) { // TODO エラー処理 } @@ -1054,7 +1053,7 @@ public function checkConflictPlugin($plugin_id) $conflict_alert_message = ''; $arrConflictPluginName = array(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); foreach ($hookPoints as $hookPoint) { // 競合するプラグインを取得する, $table = 'dtb_plugin_hookpoint AS T1 LEFT JOIN dtb_plugin AS T2 ON T1.plugin_id = T2.plugin_id'; @@ -1100,7 +1099,7 @@ public function isError($error) */ public function getHookPoint($plugin_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_plugin_hookpoint'; $where = 'plugin_id = ?'; diff --git a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Log.php b/data/Eccube/Page/Admin/Ownersstore/Log.php similarity index 69% rename from data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Log.php rename to data/Eccube/Page/Admin/Ownersstore/Log.php index e3e507fbfb9..e663c3497bb 100644 --- a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Log.php +++ b/data/Eccube/Page/Admin/Ownersstore/Log.php @@ -1,36 +1,29 @@ initParam(); if ($objForm->checkError()) { - SC_Utils_Ex::sfDispError(''); + Utils::sfDispError(''); } $this->arrLogDetail = $this->getLogDetail($objForm->getValue('log_id')); if (count($this->arrLogDetail) == 0) { - SC_Utils_Ex::sfDispError(''); + Utils::sfDispError(''); } $this->tpl_mainpage = 'ownersstore/log_detail.tpl'; break; @@ -99,7 +92,7 @@ public function getLogs() ) AS modules ON dtb_module_update_logs.module_id = modules.module_id ORDER BY update_date DESC END; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->getAll($sql); return isset($arrRet) ? $arrRet : array(); @@ -107,7 +100,7 @@ public function getLogs() public function initParam() { - $objForm = new SC_FormParam_Ex(); + $objForm = new FormParam(); $objForm->addParam('log_id', 'log_id', INT_LEN, '', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK')); $objForm->setParam($_GET); @@ -130,7 +123,7 @@ public function getLogDetail($log_id) WHERE log_id = ? END; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->getAll($sql, array($log_id)); return isset($arrRet[0]) ? $arrRet[0] : array(); diff --git a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Module.php b/data/Eccube/Page/Admin/Ownersstore/Module.php similarity index 53% rename from data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Module.php rename to data/Eccube/Page/Admin/Ownersstore/Module.php index da1f3ca06e5..479d2888dda 100644 --- a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Module.php +++ b/data/Eccube/Page/Admin/Ownersstore/Module.php @@ -1,36 +1,26 @@ initParam($objFormParam); $objFormParam->setParam($_POST); @@ -89,18 +78,18 @@ public function action() $arrPluginHookpointUse = $objFormParam->getValue('plugin_hookpoint_use'); $plugin_hookpoint_id = $objFormParam->getValue('plugin_hookpoint_id'); $use_flg = ($arrPluginHookpointUse[$plugin_hookpoint_id] == 1) ? 1 : 0; - SC_Plugin_Util_Ex::setPluginHookPointChangeUse($plugin_hookpoint_id, $use_flg); + PluginUtil::setPluginHookPointChangeUse($plugin_hookpoint_id, $use_flg); // Smartyコンパイルファイルをクリア - SC_Utils_Ex::clearCompliedTemplate(); + Utils::clearCompliedTemplate(); } break; default: break; } // DBからプラグイン情報を取得 - $arrRet = SC_Plugin_Util_Ex::getPluginHookPointList(); + $arrRet = PluginUtil::getPluginHookPointList(); // 競合チェック - $this->arrConflict = SC_Plugin_Util_Ex::checkConflictPlugin(); + $this->arrConflict = PluginUtil::checkConflictPlugin(); $arrHookPoint = array(); foreach ($arrRet AS $key => $val) { $arrHookPoint[$val['hook_point']][$val['plugin_id']] = $val; @@ -111,7 +100,7 @@ public function action() /** * パラメーター初期化. * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return void */ public function initParam(&$objFormParam) diff --git a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Settings.php b/data/Eccube/Page/Admin/Ownersstore/Settings.php similarity index 78% rename from data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Settings.php rename to data/Eccube/Page/Admin/Ownersstore/Settings.php index 147162e9f6a..2c50e10ff12 100644 --- a/data/class/pages/admin/ownersstore/LC_Page_Admin_OwnersStore_Settings.php +++ b/data/Eccube/Page/Admin/Ownersstore/Settings.php @@ -1,38 +1,30 @@ addParam('認証キー', 'public_key', LTEXT_LEN, '', array('EXIST_CHECK', 'ALNUM_CHECK', 'MAX_LENGTH_CHECK')); $objForm->setParam($_POST); @@ -171,7 +163,7 @@ public function execDefaultMode() public function registerOwnersStoreSettings($arrSettingsData) { $table = 'dtb_ownersstore_settings'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists($table); if ($exists) { @@ -192,7 +184,7 @@ public function getOwnersStoreSettings() $table = 'dtb_ownersstore_settings'; $colmuns = '*'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->select($colmuns, $table); if (isset($arrRet[0])) return $arrRet[0]; diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php b/data/Eccube/Page/Admin/Products/Category.php similarity index 84% rename from data/class/pages/admin/products/LC_Page_Admin_Products_Category.php rename to data/Eccube/Page/Admin/Products/Category.php index 41d0d1a644a..3132f37dc3b 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_Category.php +++ b/data/Eccube/Page/Admin/Products/Category.php @@ -1,36 +1,33 @@ initParam($objFormParam); @@ -100,7 +97,7 @@ public function action() // DnDしたカテゴリと移動先のセットを分解する $keys = explode('-', $_POST['keySet']); if ($keys[0] && $keys[1]) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); // 移動したデータのrank、level、parent_category_idを取得 @@ -155,10 +152,10 @@ public function action() // CSVダウンロード case 'csv': // CSVを送信する - $objCSV = new SC_Helper_CSV_Ex(); + $objCSV = new CsvHelper(); $objCSV->sfDownloadCsv('5', '', array(), '', true); - SC_Response_Ex::actionExit(); + Response::actionExit(); break; default: break; @@ -178,7 +175,7 @@ public function action() $this->arrList = $objCategory->getTreeBranch($parent_category_id); // ぱんくずの生成 $arrBread = $objCategory->getTreeTrail($this->arrForm['parent_category_id'], FALSE); - $this->tpl_bread_crumbs = SC_Utils_Ex::jsonEncode(array_reverse($arrBread)); + $this->tpl_bread_crumbs = Utils::jsonEncode(array_reverse($arrBread)); } /** @@ -191,12 +188,12 @@ public function action() * * カテゴリの削除は、物理削除で行う. * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return void */ public function doDelete(&$objFormParam) { - $objCategory = new SC_Helper_Category_Ex(false); + $objCategory = new CategoryHelper(false); $category_id = $objFormParam->getValue('category_id'); // 子カテゴリのチェック @@ -219,14 +216,14 @@ public function doDelete(&$objFormParam) /** * 編集対象のカテゴリ名を, 入力ボックスへ表示する. * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return void */ public function doPreEdit(&$objFormParam) { $category_id = $objFormParam->getValue('category_id'); - $objCategory = new SC_Helper_Category_Ex(); + $objCategory = new CategoryHelper(); $arrRes = $objCategory->get($category_id); $objFormParam->setParam($arrRes); @@ -243,7 +240,7 @@ public function doPreEdit(&$objFormParam) * - 階層登録数の上限を超える場合 (登録時のみ評価) * - カテゴリ名がすでに使用されている場合 (登録時のみ評価) * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return void */ public function doEdit(&$objFormParam) @@ -254,7 +251,7 @@ public function doEdit(&$objFormParam) // エラーがない場合、追加・更新処理 if (empty($this->arrErr)) { $arrCategory = $objFormParam->getDbArray(); - $objCategory = new SC_Helper_Category_Ex(); + $objCategory = new CategoryHelper(); $objCategory->save($arrCategory); // エラーがある場合、入力値の再表示 } else { @@ -265,12 +262,12 @@ public function doEdit(&$objFormParam) /** * エラーチェック * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return array */ public function checkError(&$objFormParam) { - $objCategory = new SC_Helper_Category_Ex(); + $objCategory = new CategoryHelper(); // 入力項目チェック $arrErr = $objFormParam->checkError(); @@ -321,12 +318,12 @@ public function checkError(&$objFormParam) /** * カテゴリの表示順序を上へ移動する. * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return void */ public function doUp(&$objFormParam) { - $objCategory = new SC_Helper_Category_Ex(false); + $objCategory = new CategoryHelper(false); $category_id = $objFormParam->getValue('category_id'); $objCategory->rankUp($category_id); } @@ -334,12 +331,12 @@ public function doUp(&$objFormParam) /** * カテゴリの表示順序を下へ移動する. * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return void */ public function doDown(&$objFormParam) { - $objCategory = new SC_Helper_Category_Ex(false); + $objCategory = new CategoryHelper(false); $category_id = $objFormParam->getValue('category_id'); $objCategory->rankDown($category_id); } @@ -347,7 +344,7 @@ public function doDown(&$objFormParam) /** * パラメーターの初期化を行う * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return void */ public function initParam(&$objFormParam) @@ -358,32 +355,32 @@ public function initParam(&$objFormParam) } /** - * @param SC_Query $objQuery + * @param Query $objQuery * @param string $table * @param string $pid_name * @param string $id_name */ public function lfCountChilds($objQuery, $table, $pid_name, $id_name, $id) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // 子ID一覧を取得 - $arrRet = $objDb->sfGetChildrenArray($table, $pid_name, $id_name, $id); + $arrRet = $objDb->getChildrenArray($table, $pid_name, $id_name, $id); return count($arrRet); } /** - * @param SC_Query $objQuery + * @param Query $objQuery * @param string $table * @param string $pid_name * @param string $id_name */ public function lfUpRankChilds($objQuery, $table, $pid_name, $id_name, $id, $count) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // 子ID一覧を取得 - $arrRet = $objDb->sfGetChildrenArray($table, $pid_name, $id_name, $id); - $line = SC_Utils_Ex::sfGetCommaList($arrRet); + $arrRet = $objDb->getChildrenArray($table, $pid_name, $id_name, $id); + $line = Utils::sfGetCommaList($arrRet); $where = "$id_name IN ($line) AND del_flg = 0"; $arrRawVal = array( 'rank' => "(rank + $count)", @@ -393,7 +390,7 @@ public function lfUpRankChilds($objQuery, $table, $pid_name, $id_name, $id, $cou } /** - * @param SC_Query $objQuery + * @param Query $objQuery * @param string $table * @param string $pid_name * @param string $id_name @@ -401,10 +398,10 @@ public function lfUpRankChilds($objQuery, $table, $pid_name, $id_name, $id, $cou */ public function lfDownRankChilds($objQuery, $table, $pid_name, $id_name, $id, $count) { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // 子ID一覧を取得 - $arrRet = $objDb->sfGetChildrenArray($table, $pid_name, $id_name, $id); - $line = SC_Utils_Ex::sfGetCommaList($arrRet); + $arrRet = $objDb->getChildrenArray($table, $pid_name, $id_name, $id); + $line = Utils::sfGetCommaList($arrRet); $where = "$id_name IN ($line) AND del_flg = 0"; $arrRawVal = array( 'rank' => "(rank - $count)", diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_ClassCategory.php b/data/Eccube/Page/Admin/Products/ClassCategory.php similarity index 78% rename from data/class/pages/admin/products/LC_Page_Admin_Products_ClassCategory.php rename to data/Eccube/Page/Admin/Products/ClassCategory.php index 04cb1d758d2..823c7487569 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_ClassCategory.php +++ b/data/Eccube/Page/Admin/Products/ClassCategory.php @@ -1,36 +1,31 @@ lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); @@ -81,7 +76,7 @@ public function action() $this->arrForm = $objFormParam->getHashArray(); // 入力パラメーターチェック $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { //新規規格追加かどうかを判定する $is_insert = $this->lfCheckInsert($classcategory_id); if ($is_insert) { @@ -93,7 +88,7 @@ public function action() } // 再表示 - SC_Response_Ex::reload(); + Response::reload(); } break; // 削除 @@ -101,7 +96,7 @@ public function action() // ランク付きレコードの削除 $this->lfDeleteClassCat($class_id, $classcategory_id); - SC_Response_Ex::reload(); + Response::reload(); break; // 編集前処理 case 'pre_edit': @@ -114,13 +109,13 @@ public function action() //並び順を下げる $this->lfDownRank($class_id, $classcategory_id); - SC_Response_Ex::reload(); + Response::reload(); break; case 'up': //並び順を上げる $this->lfUpRank($class_id, $classcategory_id); - SC_Response_Ex::reload(); + Response::reload(); break; default: break; @@ -136,7 +131,7 @@ public function action() /** * パラメーターの初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -154,7 +149,7 @@ public function lfInitParam(&$objFormParam) */ public function lfGetClassCat($class_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'del_flg <> 1 AND class_id = ?'; $objQuery->setOrder('rank DESC'); // XXX 降順 @@ -171,7 +166,7 @@ public function lfGetClassCat($class_id) */ public function lfGetClassName($class_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'class_id = ?'; $name = $objQuery->get('name', 'dtb_class', $where, array($class_id)); @@ -187,7 +182,7 @@ public function lfGetClassName($class_id) */ public function lfGetClassCatName($classcategory_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'classcategory_id = ?'; $name = $objQuery->get('name', 'dtb_classcategory', $where, array($classcategory_id)); @@ -202,12 +197,12 @@ public function lfGetClassCatName($classcategory_id) */ public function lfInsertClass($arrForm) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); // 親規格IDの存在チェック $where = 'del_flg <> 1 AND class_id = ?'; $class_id = $objQuery->get('class_id', 'dtb_class', $where, array($arrForm['class_id'])); - if (!SC_Utils_Ex::isBlank($class_id)) { + if (!Utils::isBlank($class_id)) { // INSERTする値を作成する。 $sqlval['name'] = $arrForm['name']; $sqlval['class_id'] = $arrForm['class_id']; @@ -232,7 +227,7 @@ public function lfInsertClass($arrForm) */ public function lfUpdateClass($arrForm) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // UPDATEする値を作成する。 $sqlval['name'] = $arrForm['name']; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; @@ -246,16 +241,16 @@ public function lfUpdateClass($arrForm) /** * エラーチェック * - * @param SC_FormParam $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckError(&$objFormParam) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrForm = $objFormParam->getHashArray(); // パラメーターの基本チェック $arrErr = $objFormParam->checkError(); - if (!SC_Utils_Ex::isBlank($arrErr)) { + if (!Utils::isBlank($arrErr)) { return $arrErr; } else { $arrForm = $objFormParam->getHashArray(); @@ -296,9 +291,9 @@ public function lfCheckInsert($classcategory_id) */ public function lfDeleteClassCat($class_id, $classcategory_id) { - $objDb = new SC_Helper_DB_Ex(); - $where = 'class_id = ' . SC_Utils_Ex::sfQuoteSmart($class_id); - $objDb->sfDeleteRankRecord('dtb_classcategory', 'classcategory_id', $classcategory_id, $where, true); + $objDb = new DbHelper(); + $where = 'class_id = ' . Utils::sfQuoteSmart($class_id); + $objDb->deleteRankRecord('dtb_classcategory', 'classcategory_id', $classcategory_id, $where, true); } /** * 並び順を上げる @@ -309,9 +304,9 @@ public function lfDeleteClassCat($class_id, $classcategory_id) */ public function lfUpRank($class_id, $classcategory_id) { - $objDb = new SC_Helper_DB_Ex(); - $where = 'class_id = ' . SC_Utils_Ex::sfQuoteSmart($class_id); - $objDb->sfRankUp('dtb_classcategory', 'classcategory_id', $classcategory_id, $where); + $objDb = new DbHelper(); + $where = 'class_id = ' . Utils::sfQuoteSmart($class_id); + $objDb->rankUp('dtb_classcategory', 'classcategory_id', $classcategory_id, $where); } /** * 並び順を下げる @@ -322,8 +317,8 @@ public function lfUpRank($class_id, $classcategory_id) */ public function lfDownRank($class_id, $classcategory_id) { - $objDb = new SC_Helper_DB_Ex(); - $where = 'class_id = ' . SC_Utils_Ex::sfQuoteSmart($class_id); - $objDb->sfRankDown('dtb_classcategory', 'classcategory_id', $classcategory_id, $where); + $objDb = new DbHelper(); + $where = 'class_id = ' . Utils::sfQuoteSmart($class_id); + $objDb->rankDown('dtb_classcategory', 'classcategory_id', $classcategory_id, $where); } } diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_Class.php b/data/Eccube/Page/Admin/Products/ClassList.php similarity index 76% rename from data/class/pages/admin/products/LC_Page_Admin_Products_Class.php rename to data/Eccube/Page/Admin/Products/ClassList.php index d19a643dc35..a014870de63 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_Class.php +++ b/data/Eccube/Page/Admin/Products/ClassList.php @@ -1,36 +1,31 @@ lfInitParam($objFormParam); $objFormParam->setParam($_POST); @@ -80,7 +75,7 @@ public function action() $this->arrForm = $objFormParam->getHashArray(); // 入力パラメーターチェック $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { //新規規格追加かどうかを判定する $is_insert = $this->lfCheckInsert($this->arrForm); if ($is_insert) { @@ -90,7 +85,7 @@ public function action() } // 再表示 - SC_Response_Ex::reload(); + Response::reload(); } break; // 削除 @@ -99,7 +94,7 @@ public function action() $this->lfDeleteClass($class_id); // 再表示 - SC_Response_Ex::reload(); + Response::reload(); break; // 編集前処理 case 'pre_edit': @@ -112,20 +107,20 @@ public function action() $this->lfDownRank($class_id); // 再表示 - SC_Response_Ex::reload(); + Response::reload(); break; case 'up': $this->lfUpRank($class_id); // 再表示 - SC_Response_Ex::reload(); + Response::reload(); break; default: break; } // 規格の読込 $this->arrClass = $this->lfGetClass(); - $this->arrClassCatCount = SC_Utils_Ex::sfGetClassCatCount(); + $this->arrClassCatCount = Utils::sfGetClassCatCount(); // POSTデータを引き継ぐ $this->tpl_class_id = $class_id; } @@ -133,7 +128,7 @@ public function action() /** * パラメーターの初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -149,7 +144,7 @@ public function lfInitParam(&$objFormParam) */ public function lfGetClass() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'del_flg <> 1'; $objQuery->setOrder('rank DESC'); @@ -166,7 +161,7 @@ public function lfGetClass() */ public function lfGetClassName($class_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = 'class_id = ?'; $class_name = $objQuery->get('name', 'dtb_class', $where, array($class_id)); @@ -181,7 +176,7 @@ public function lfGetClassName($class_id) */ public function lfInsertClass($arrForm) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // INSERTする値を作成する。 $sqlval['name'] = $arrForm['name']; $sqlval['creator_id'] = $_SESSION['member_id']; @@ -203,7 +198,7 @@ public function lfInsertClass($arrForm) */ public function lfUpdateClass($arrForm) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // UPDATEする値を作成する。 $sqlval['name'] = $arrForm['name']; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; @@ -222,10 +217,10 @@ public function lfUpdateClass($arrForm) */ public function lfDeleteClass($class_id) { - $objDb = new SC_Helper_DB_Ex(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objDb = new DbHelper(); + $objQuery = Query::getSingletonInstance(); - $ret = $objDb->sfDeleteRankRecord('dtb_class', 'class_id', $class_id, '', true); + $ret = $objDb->deleteRankRecord('dtb_class', 'class_id', $class_id, '', true); $where= 'class_id = ?'; $objQuery->delete('dtb_classcategory', $where, array($class_id)); @@ -235,16 +230,16 @@ public function lfDeleteClass($class_id) /** * エラーチェック * - * @param SC_FormParam $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return array エラー配列 */ public function lfCheckError(&$objFormParam) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrForm = $objFormParam->getHashArray(); // パラメーターの基本チェック $arrErr = $objFormParam->checkError(); - if (!SC_Utils_Ex::isBlank($arrErr)) { + if (!Utils::isBlank($arrErr)) { return $arrErr; } else { $arrForm = $objFormParam->getHashArray(); @@ -283,8 +278,8 @@ public function lfCheckInsert($arrForm) */ public function lfUpRank($class_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankUp('dtb_class', 'class_id', $class_id); + $objDb = new DbHelper(); + $objDb->rankUp('dtb_class', 'class_id', $class_id); } /** * 並び順を下げる @@ -294,7 +289,7 @@ public function lfUpRank($class_id) */ public function lfDownRank($class_id) { - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfRankDown('dtb_class', 'class_id', $class_id); + $objDb = new DbHelper(); + $objDb->rankDown('dtb_class', 'class_id', $class_id); } } diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products.php b/data/Eccube/Page/Admin/Products/Index.php similarity index 82% rename from data/class/pages/admin/products/LC_Page_Admin_Products.php rename to data/Eccube/Page/Admin/Products/Index.php index 6e9ce4bdd0d..d609e8205b3 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products.php +++ b/data/Eccube/Page/Admin/Products/Index.php @@ -1,36 +1,39 @@ tpl_maintitle = '商品管理'; $this->tpl_subtitle = '商品マスター'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPageMax = $masterData->getMasterData('mtb_page_max'); $this->arrDISP = $masterData->getMasterData('mtb_disp'); $this->arrSTATUS = $masterData->getMasterData('mtb_status'); $this->arrPRODUCTSTATUS_COLOR = $masterData->getMasterData('mtb_product_status_color'); - $objDate = new SC_Date_Ex(); + $objDate = new Date(); // 登録・更新検索開始年 $objDate->setStartYear(RELEASE_YEAR); $objDate->setEndYear(DATE('Y')); @@ -86,10 +89,10 @@ public function process() */ public function action() { - $objDb = new SC_Helper_DB_Ex(); - $objFormParam = new SC_FormParam_Ex(); - $objProduct = new SC_Product_Ex(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objDb = new DbHelper(); + $objFormParam = new FormParam(); + $objProduct = new Product(); + $objQuery = Query::getSingletonInstance(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); @@ -102,8 +105,8 @@ public function action() // 商品、子テーブル(商品規格)、会員お気に入り商品の削除 $this->doDelete('product_id = ?', array($objFormParam->getValue('product_id'))); // 件数カウントバッチ実行 - $objDb->sfCountCategory($objQuery); - $objDb->sfCountMaker($objQuery); + $objDb->countCategory($objQuery); + $objDb->countMaker($objQuery); // 削除後に検索結果を表示するため breakしない // 検索パラメーター生成後に処理実行するため breakしない @@ -134,10 +137,10 @@ public function action() switch ($this->getMode()) { // CSVを送信する。 case 'csv': - $objCSV = new SC_Helper_CSV_Ex(); + $objCSV = new CsvHelper(); // CSVを送信する。正常終了の場合、終了。 $objCSV->sfDownloadCsv(1, $where, $arrWhereVal, $order, true); - SC_Response_Ex::actionExit(); + Response::actionExit(); // 全件削除(ADMIN_MODE) case 'delete_all': @@ -149,9 +152,9 @@ public function action() // 行数の取得 $this->tpl_linemax = $this->getNumberOfLines($where, $arrWhereVal); // ページ送りの処理 - $page_max = SC_Utils_Ex::sfGetSearchPageMax($objFormParam->getValue('search_page_max')); + $page_max = Utils::sfGetSearchPageMax($objFormParam->getValue('search_page_max')); // ページ送りの取得 - $objNavi = new SC_PageNavi_Ex($this->arrHidden['search_pageno'], + $objNavi = new PageNavi($this->arrHidden['search_pageno'], $this->tpl_linemax, $page_max, 'eccube.moveNaviPage', NAVI_PMAX); $this->arrPagenavi = $objNavi->arrPagenavi; @@ -173,14 +176,14 @@ public function action() } // カテゴリの読込 - list($this->arrCatKey, $this->arrCatVal) = $objDb->sfGetLevelCatList(false); + list($this->arrCatKey, $this->arrCatVal) = $objDb->getLevelCatList(false); $this->arrCatList = $this->lfGetIDName($this->arrCatKey, $this->arrCatVal); } /** * パラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -211,12 +214,12 @@ public function lfInitParam(&$objFormParam) /** * 入力内容のチェックを行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfCheckError(&$objFormParam) { - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->arrErr = $objFormParam->checkError(); $objErr->doFunc(array('開始日', '終了日', 'search_startyear', 'search_startmonth', 'search_startday', 'search_endyear', 'search_endmonth', 'search_endday'), array('CHECK_SET_TERM')); @@ -246,7 +249,7 @@ public function lfGetIDName($arrCatKey, $arrCatVal) */ public function doDelete($where, $arrParam = array()) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $product_ids = $objQuery->getCol('product_id', "dtb_products", $where, $arrParam); $sqlval['del_flg'] = 1; @@ -255,7 +258,7 @@ public function doDelete($where, $arrParam = array()) $objQuery->update('dtb_products_class', $sqlval, "product_id IN (SELECT product_id FROM dtb_products WHERE $where)", $arrParam); $objQuery->delete('dtb_customer_favorite_products', "product_id IN (SELECT product_id FROM dtb_products WHERE $where)", $arrParam); - $objRecommend = new SC_Helper_BestProducts_Ex(); + $objRecommend = new BestProductsHelper(); $objRecommend->deleteByProductIDs($product_ids); $objQuery->update('dtb_products', $sqlval, $where, $arrParam); @@ -266,20 +269,20 @@ public function doDelete($where, $arrParam = array()) * クエリを構築する. * * 検索条件のキーに応じた WHERE 句と, クエリパラメーターを構築する. - * クエリパラメーターは, SC_FormParam の入力値から取得する. + * クエリパラメーターは, FormParam の入力値から取得する. * * 構築内容は, 引数の $where 及び $arrValues にそれぞれ追加される. * * @param string $key 検索条件のキー * @param string $where 構築する WHERE 句 * @param array $arrValues 構築するクエリパラメーター - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @param SC_FormParam $objDb SC_Helper_DB_Ex インスタンス + * @param FormParam $objFormParam FormParam インスタンス + * @param FormParam $objDb DbHelper インスタンス * @return void */ public function buildQuery($key, &$where, &$arrValues, &$objFormParam, &$objDb) { - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); switch ($key) { // 商品ID case 'search_product_id': @@ -298,7 +301,7 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam, &$objDb) break; // カテゴリ case 'search_category_id': - list($tmp_where, $tmp_Values) = $objDb->sfGetCatWhere($objFormParam->getValue($key)); + list($tmp_where, $tmp_Values) = $objDb->getCatWhere($objFormParam->getValue($key)); if ($tmp_where != '') { $where.= ' AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE ' . $tmp_where . ')'; $arrValues = array_merge((array) $arrValues, (array) $tmp_Values); @@ -309,7 +312,7 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam, &$objDb) $tmp_where = ''; foreach ($objFormParam->getValue($key) as $element) { if ($element != '') { - if (SC_Utils_Ex::isBlank($tmp_where)) { + if (Utils::isBlank($tmp_where)) { $tmp_where .= ' AND (status = ?'; } else { $tmp_where .= ' OR status = ?'; @@ -318,14 +321,14 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam, &$objDb) } } - if (!SC_Utils_Ex::isBlank($tmp_where)) { + if (!Utils::isBlank($tmp_where)) { $tmp_where .= ')'; $where .= " $tmp_where "; } break; // 登録・更新日(開始) case 'search_startyear': - $date = SC_Utils_Ex::sfGetTimestamp($objFormParam->getValue('search_startyear'), + $date = Utils::sfGetTimestamp($objFormParam->getValue('search_startyear'), $objFormParam->getValue('search_startmonth'), $objFormParam->getValue('search_startday')); $where.= ' AND update_date >= ?'; @@ -333,7 +336,7 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam, &$objDb) break; // 登録・更新日(終了) case 'search_endyear': - $date = SC_Utils_Ex::sfGetTimestamp($objFormParam->getValue('search_endyear'), + $date = Utils::sfGetTimestamp($objFormParam->getValue('search_endyear'), $objFormParam->getValue('search_endmonth'), $objFormParam->getValue('search_endday'), true); $where.= ' AND update_date <= ?'; @@ -346,7 +349,7 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam, &$objDb) if ($count >= 1) { $where .= ' ' . 'AND product_id IN (' - . ' SELECT product_id FROM dtb_product_status WHERE product_status_id IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', $count) . ')' + . ' SELECT product_id FROM dtb_product_status WHERE product_status_id IN (' . Utils::repeatStrWithSeparator('?', $count) . ')' . ')'; $arrValues = array_merge($arrValues, $arrPartVal); } @@ -365,7 +368,7 @@ public function buildQuery($key, &$where, &$arrValues, &$objFormParam, &$objDb) */ public function getNumberOfLines($where, $arrValues) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->count('dtb_products', $where, $arrValues); } @@ -378,12 +381,12 @@ public function getNumberOfLines($where, $arrValues) * @param integer $limit 表示件数 * @param integer $offset 開始件数 * @param string $order 検索結果の並び順 - * @param SC_Product $objProduct SC_Product インスタンス + * @param Product $objProduct Product インスタンス * @return array 商品の検索結果 */ - public function findProducts($where, $arrValues, $limit, $offset, $order, &$objProduct) + public function findProducts($where, $arrValues, $limit, $offset, $order, Product &$objProduct) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 読み込む列とテーブルの指定 $col = 'product_id, name, main_list_image, status, product_code_min, product_code_max, price02_min, price02_max, stock_min, stock_max, stock_unlimited_min, stock_unlimited_max, update_date'; diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_Maker.php b/data/Eccube/Page/Admin/Products/Maker.php similarity index 74% rename from data/class/pages/admin/products/LC_Page_Admin_Products_Maker.php rename to data/Eccube/Page/Admin/Products/Maker.php index 061b32be9b4..713110e1783 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_Maker.php +++ b/data/Eccube/Page/Admin/Products/Maker.php @@ -1,36 +1,30 @@ lfInitParam($objFormParam); @@ -86,7 +80,7 @@ public function action() case 'edit': // エラーチェック $this->arrErr = $this->lfCheckError($objFormParam, $objMaker); - if (!SC_Utils_Ex::isBlank($this->arrErr['maker_id'])) { + if (!Utils::isBlank($this->arrErr['maker_id'])) { trigger_error('', E_USER_ERROR); return; @@ -100,7 +94,7 @@ public function action() if ($res_maker_id !== FALSE) { // 完了メッセージ $this->tpl_onload = "alert('登録が完了しました。');"; - SC_Response_Ex::reload(); + Response::reload(); } else { $this->arrErr['maker_id'] = '登録に失敗しました。'; } @@ -121,14 +115,14 @@ public function action() $objMaker->rankUp($maker_id); // リロード - SC_Response_Ex::reload(); + Response::reload(); break; case 'down': $objMaker->rankDown($maker_id); // リロード - SC_Response_Ex::reload(); + Response::reload(); break; // 削除 @@ -136,7 +130,7 @@ public function action() $objMaker->delete($maker_id); // リロード - SC_Response_Ex::reload(); + Response::reload(); break; default: @@ -152,7 +146,7 @@ public function action() /** * パラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -166,10 +160,10 @@ public function lfInitParam(&$objFormParam) * * @param integer $maker_id * @param array $sqlval - * @param SC_Helper_Maker_Ex $objMaker + * @param MakerHelper $objMaker * @return multiple */ - public function doRegist($maker_id, $sqlval, SC_Helper_Maker_Ex $objMaker) + public function doRegist($maker_id, $sqlval, MakerHelper $objMaker) { $sqlval['maker_id'] = $maker_id; $sqlval['creator_id'] = $_SESSION['member_id']; @@ -180,18 +174,18 @@ public function doRegist($maker_id, $sqlval, SC_Helper_Maker_Ex $objMaker) /** * 入力エラーチェック. * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return array $objErr->arrErr エラー内容 */ - public function lfCheckError(&$objFormParam, SC_Helper_Maker_Ex &$objMaker) + public function lfCheckError(&$objFormParam, MakerHelper &$objMaker) { $arrErr = $objFormParam->checkError(); $arrForm = $objFormParam->getHashArray(); // maker_id の正当性チェック if (!empty($arrForm['maker_id'])) { - if (!SC_Utils_Ex::sfIsInt($arrForm['maker_id']) - || SC_Utils_Ex::sfIsZeroFilling($arrForm['maker_id']) + if (!Utils::sfIsInt($arrForm['maker_id']) + || Utils::sfIsZeroFilling($arrForm['maker_id']) || !$objMaker->getMaker($arrForm['maker_id']) ) { // maker_idが指定されていて、且つその値が不正と思われる場合はエラー @@ -203,7 +197,7 @@ public function lfCheckError(&$objFormParam, SC_Helper_Maker_Ex &$objMaker) // 編集中のレコード以外に同じ名称が存在する場合 if ( - !SC_Utils_Ex::isBlank($arrMaker) + !Utils::isBlank($arrMaker) && $arrMaker['maker_id'] != $arrForm['maker_id'] && $arrMaker['name'] == $arrForm['name'] ) { diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php b/data/Eccube/Page/Admin/Products/ProductClass.php similarity index 84% rename from data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php rename to data/Eccube/Page/Admin/Products/ProductClass.php index b7875dc02e4..e96c26fc3cc 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php +++ b/data/Eccube/Page/Admin/Products/ProductClass.php @@ -1,36 +1,36 @@ tpl_subno = 'product'; $this->tpl_maintitle = '商品管理'; $this->tpl_subtitle = '商品登録(商品規格)'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrProductType = $masterData->getMasterData('mtb_product_type'); // 規格プルダウンのリスト $this->arrClass = $this->getAllClass(); @@ -70,7 +70,7 @@ public function process() public function action() { // 商品マスターの検索条件パラメーターを初期化 - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->initParam($objFormParam); $objFormParam->setParam($_POST); @@ -84,7 +84,7 @@ public function action() $this->arrErr = $this->lfCheckProductsClass($objFormParam); // エラーの無い場合は確認画面を表示 - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->tpl_mainpage = 'products/product_class_confirm.tpl'; $this->doDisp($objFormParam); $this->fillCheckboxesValue('stock_unlimited', $_POST['total']); @@ -113,7 +113,7 @@ public function action() // 「表示する」ボタン押下時 case 'disp': $this->arrErr = $this->lfCheckSelectClass(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->doDisp($objFormParam); $this->initDispParam($objFormParam); } @@ -157,7 +157,7 @@ public function action() /** * パラメーター初期化 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function initParam(&$objFormParam) @@ -216,8 +216,8 @@ public function initParam(&$objFormParam) */ public function registerProductClass($arrList, $product_id, $total) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $objDb = new SC_Helper_DB_Ex(); + $objQuery = Query::getSingletonInstance(); + $objDb = new DbHelper(); $objQuery->begin(); @@ -233,8 +233,8 @@ public function registerProductClass($arrList, $product_id, $total) $objQuery->delete('dtb_products_class', 'product_id = ? AND (classcategory_id1 <> 0 OR classcategory_id2 <> 0)', array($product_id)); for ($i = 0; $i < $total; $i++) { - $del_flg = SC_Utils_Ex::isBlank($arrList['check'][$i]) ? 1 : 0; - $price02 = SC_Utils_Ex::isBlank($arrList['price02'][$i]) ? 0 : $arrList['price02'][$i]; + $del_flg = Utils::isBlank($arrList['check'][$i]) ? 1 : 0; + $price02 = Utils::isBlank($arrList['price02'][$i]) ? 0 : $arrList['price02'][$i]; // dtb_products_class 登録/更新用 $registerKeys = array( 'classcategory_id1', 'classcategory_id2', @@ -265,7 +265,7 @@ public function registerProductClass($arrList, $product_id, $total) $arrPC['create_date'] = 'CURRENT_TIMESTAMP'; // 更新の場合は, product_class_id を使い回す - if (!SC_Utils_Ex::isBlank($arrList['product_class_id'][$i])) { + if (!Utils::isBlank($arrList['product_class_id'][$i])) { $arrPC['product_class_id'] = $arrList['product_class_id'][$i]; } else { $arrPC['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id'); @@ -274,13 +274,13 @@ public function registerProductClass($arrList, $product_id, $total) /* * チェックを入れない商品は product_type_id が NULL になるので, 0 を入れる */ - $arrPC['product_type_id'] = SC_Utils_Ex::isBlank($arrPC['product_type_id']) ? 0 : $arrPC['product_type_id']; + $arrPC['product_type_id'] = Utils::isBlank($arrPC['product_type_id']) ? 0 : $arrPC['product_type_id']; $objQuery->insert('dtb_products_class', $arrPC); // 税情報登録/更新 if (OPTION_PRODUCT_TAX_RULE) { - SC_Helper_TaxRule_Ex::setTaxRuleForProduct($arrList['tax_rate'][$i], $arrPC['product_id'], $arrPC['product_class_id']); + TaxRuleHelper::setTaxRuleForProduct($arrList['tax_rate'][$i], $arrPC['product_id'], $arrPC['product_class_id']); } } @@ -292,20 +292,20 @@ public function registerProductClass($arrList, $product_id, $total) array($product_id)); // 件数カウントバッチ実行 - $objDb->sfCountCategory($objQuery); + $objDb->countCategory($objQuery); $objQuery->commit(); } /** * 規格選択エラーチェックを行う * - * ※SC_FormParamで対応していないエラーチェックのため, SC_CheckErrorを使用している. + * ※FormParamで対応していないエラーチェックのため, CheckErrorを使用している. * * @return array エラーの配列 */ public function lfCheckSelectClass() { - $objErr = new SC_CheckError_Ex(); + $objErr = new CheckError(); $objErr->doFunc(array('規格1', 'class_id1'), array('EXIST_CHECK')); $objErr->doFunc(array('規格', 'class_id1', 'select_class_id2'), array('TOP_EXIST_CHECK')); $objErr->doFunc(array('規格1', '規格2', 'class_id1', 'class_id2'), array('DIFFERENT_CHECK')); @@ -316,7 +316,7 @@ public function lfCheckSelectClass() /** * 商品規格エラーチェック. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array エラー結果の配列 */ public function lfCheckProductsClass(&$objFormParam) @@ -325,60 +325,60 @@ public function lfCheckProductsClass(&$objFormParam) $arrErr = $objFormParam->checkError(); $total = $objFormParam->getValue('total'); - if (SC_Utils_Ex::isBlank($arrValues['check'])) { + if (Utils::isBlank($arrValues['check'])) { $arrErr['check_empty'] = '※ 規格が選択されていません。
'; } for ($i = 0; $i < $total; $i++) { /* * チェックボックスの入っている項目のみ, 必須チェックを行う. - * エラーを配列で返す必要があるため, SC_CheckError を使用しない. + * エラーを配列で返す必要があるため, CheckError を使用しない. */ - if (!SC_Utils_Ex::isBlank($arrValues['check'][$i])) { + if (!Utils::isBlank($arrValues['check'][$i])) { /* * 販売価格の必須チェック */ - if (SC_Utils_Ex::isBlank($arrValues['price02'][$i])) { + if (Utils::isBlank($arrValues['price02'][$i])) { $arrErr['price02'][$i] = '※ ' . SALE_PRICE_TITLE . 'が入力されていません。
'; } /* * 在庫数の必須チェック */ - if ((SC_Utils_Ex::isBlank($arrValues['stock_unlimited'][$i]) || $arrValues['stock_unlimited'][$i] != 1) - && SC_Utils_Ex::isBlank($arrValues['stock'][$i]) + if ((Utils::isBlank($arrValues['stock_unlimited'][$i]) || $arrValues['stock_unlimited'][$i] != 1) + && Utils::isBlank($arrValues['stock'][$i]) ) { $arrErr['stock'][$i] = '※ 在庫数が入力されていません。
'; } /* * 消費税率の必須チェック */ - if (OPTION_PRODUCT_TAX_RULE && SC_Utils_Ex::isBlank($arrValues['tax_rate'][$i])) { + if (OPTION_PRODUCT_TAX_RULE && Utils::isBlank($arrValues['tax_rate'][$i])) { $arrErr['tax_rate'][$i] = '※ 消費税率が入力されていません。
'; } /* * 商品種別の必須チェック */ - if (SC_Utils_Ex::isBlank($arrValues['product_type_id'][$i])) { + if (Utils::isBlank($arrValues['product_type_id'][$i])) { $arrErr['product_type_id'][$i] = '※ 商品種別は、いずれかを選択してください。
'; } /* * ダウンロード商品の必須チェック */ if ($arrValues['product_type_id'][$i] == PRODUCT_TYPE_DOWNLOAD) { - if (SC_Utils_Ex::isBlank($arrValues['down_filename'][$i])) { + if (Utils::isBlank($arrValues['down_filename'][$i])) { $arrErr['down_filename'][$i] = '※ ダウンロード商品の場合はダウンロードファイル名を入力してください。
'; } - if (SC_Utils_Ex::isBlank($arrValues['down_realfilename'][$i])) { + if (Utils::isBlank($arrValues['down_realfilename'][$i])) { $arrErr['down_realfilename'][$i] = '※ ダウンロード商品の場合はダウンロード商品用ファイルをアップロードしてください。
'; } /* * 通常商品チェック */ } elseif ($arrValues['product_type_id'][$i] != PRODUCT_TYPE_DOWNLOAD) { - if (!SC_Utils_Ex::isBlank($arrValues['down_filename'][$i])) { + if (!Utils::isBlank($arrValues['down_filename'][$i])) { $arrErr['down_filename'][$i] = '※ ダウンロード商品ではない場合、ダウンロードファイル名を設定できません。
'; } - if (!SC_Utils_Ex::isBlank($arrValues['down_realfilename'][$i])) { + if (!Utils::isBlank($arrValues['down_realfilename'][$i])) { $arrErr['down_realfilename'][$i] = '※ ダウンロード商品ではない場合、ダウンロード商品用ファイルをアップロードできません。
ファイルを取り消してください。
'; } } @@ -394,7 +394,7 @@ public function lfCheckProductsClass(&$objFormParam) * 規格1, 規格2における規格分類の全ての組み合わせを取得し, * 該当商品の商品規格の内容を取得後, フォームに設定する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function doDisp(&$objFormParam) @@ -407,7 +407,7 @@ public function doDisp(&$objFormParam) $arrClassCat = $this->getAllClassCategory($class_id1, $class_id2); $total = count($arrClassCat); $objFormParam->setValue('total', $total); - $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrClassCat)); + $objFormParam->setParam(Utils::sfSwapArray($arrClassCat)); // class_id1, class_id2 を, 入力値で上書き $objFormParam->setValue('class_id1', $class_id1); @@ -431,7 +431,7 @@ public function doDisp(&$objFormParam) /** * 「表示する」ボタンをクリックされたときのパラメーター初期化処理 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function initDispParam(&$objFormParam) @@ -441,7 +441,7 @@ public function initDispParam(&$objFormParam) // 規格2が選択されていない場合、規格2名称初期化 $class_id2 = $objFormParam->getValue('class_id2'); - if (SC_Utils_Ex::isBlank($class_id2) == true) { + if (Utils::isBlank($class_id2) == true) { $objFormParam->setValue('classcategory_name2', ''); } } @@ -449,12 +449,12 @@ public function initDispParam(&$objFormParam) /** * 規格編集画面を表示する * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam */ public function doPreEdit(&$objFormParam) { $product_id = $objFormParam->getValue('product_id'); - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $existsProductsClass = $objProduct->getProductsClassFullByProductId($product_id); // 規格のデフォルト値(全ての組み合わせ)を取得し, フォームに反映 @@ -491,7 +491,7 @@ public function doPreEdit(&$objFormParam) foreach ($arrClassCatKey as $arrC1) { foreach ($arrC1 as $arrValues) { $arrValues['del_flg'] = (string) $arrValues['del_flg']; - if (SC_Utils_Ex::isBlank($arrValues['del_flg']) + if (Utils::isBlank($arrValues['del_flg']) || $arrValues['del_flg'] === '1') { $arrValues['del_flg'] = '1'; } else { @@ -500,7 +500,7 @@ public function doPreEdit(&$objFormParam) // 消費税率を設定 if (OPTION_PRODUCT_TAX_RULE) { - $arrRet = SC_Helper_TaxRule_Ex::getTaxRule($arrValues['product_id'], $arrValues['product_class_id']); + $arrRet = TaxRuleHelper::getTaxRule($arrValues['product_id'], $arrValues['product_class_id']); $arrValues['tax_rate'] = $arrRet['tax_rate']; } @@ -509,7 +509,7 @@ public function doPreEdit(&$objFormParam) } // 登録済みのデータで上書き - $objFormParam->setParam(SC_Utils_Ex::sfSwapArray($arrMergeProductsClass)); + $objFormParam->setParam(Utils::sfSwapArray($arrMergeProductsClass)); // $arrMergeProductsClass で product_id が配列になってしまうため数値で上書き $objFormParam->setValue('product_id', $product_id); @@ -538,7 +538,7 @@ public function doPreEdit(&$objFormParam) */ public function doDelete($product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); @@ -555,8 +555,8 @@ public function doDelete($product_id) // 在庫無し商品の非表示対応 if (NOSTOCK_HIDDEN) { // 件数カウントバッチ実行 - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfCountCategory($objQuery); + $objDb = new DbHelper(); + $objDb->countCategory($objQuery); } } @@ -568,10 +568,10 @@ public function doDelete($product_id) * 2. 拡張子チェック * * TODO - * SC_CheckError クラスや, SC_UploadFile クラスが多次元配列に対応して + * CheckError クラスや, UploadFile クラスが多次元配列に対応して * いないため, 独自のロジックを使用している. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function doFileUpload(&$objFormParam) @@ -590,13 +590,13 @@ public function doFileUpload(&$objFormParam) } $this->arrErr['down_realfilename'][$index] = '※ ダウンロード販売用ファイル名のファイルサイズは' . $size . $byte . '以下のものを使用してください。
'; } else { - // SC_CheckError::FILE_EXT_CHECK とのソース互換を強めるための配列 + // CheckError::FILE_EXT_CHECK とのソース互換を強めるための配列 $value = array( 0 => 'ダウンロード販売用ファイル名', 1 => 'down_realfilename', 2 => explode(',', DOWNLOAD_EXTENSION), ); - // ▼SC_CheckError::FILE_EXT_CHECK から移植 + // ▼CheckError::FILE_EXT_CHECK から移植 $match = false; if (strlen($_FILES[$value[1]]['name'][$index]) >= 1) { $filename = $_FILES[$value[1]]['name'][$index]; @@ -612,7 +612,7 @@ public function doFileUpload(&$objFormParam) if ($match === false) { $str_ext = implode('・', $value[2]); $this->arrErr[$value[1]][$index] = '※ ' . $value[0] . 'で許可されている形式は、' . $str_ext . 'です。
'; - // ▲SC_CheckError::FILE_EXT_CHECK から移植 + // ▲CheckError::FILE_EXT_CHECK から移植 } else { $uniqname = date('mdHi') . '_' . uniqid('').'.'; $temp_file = preg_replace("/^.*\./", $uniqname, $_FILES['down_realfilename']['name'][$index]); @@ -620,10 +620,10 @@ public function doFileUpload(&$objFormParam) if (move_uploaded_file($_FILES['down_realfilename']['tmp_name'][$index], DOWN_TEMP_REALDIR . $temp_file)) { $arrDownRealFiles[$index] = $temp_file; $objFormParam->setValue('down_realfilename', $arrDownRealFiles); - GC_Utils_Ex::gfPrintLog($_FILES['down_realfilename']['name'][$index] .' -> '. realpath(DOWN_TEMP_REALDIR . $temp_file)); + GcUtils::gfPrintLog($_FILES['down_realfilename']['name'][$index] .' -> '. realpath(DOWN_TEMP_REALDIR . $temp_file)); } else { $objErr->arrErr[$keyname] = '※ ファイルのアップロードに失敗しました。
'; - GC_Utils_Ex::gfPrintLog('File Upload Error!: ' . $_FILES['down_realfilename']['name'][$index] . ' -> ' . DOWN_TEMP_REALDIR . $temp_file); + GcUtils::gfPrintLog('File Upload Error!: ' . $_FILES['down_realfilename']['name'][$index] . ' -> ' . DOWN_TEMP_REALDIR . $temp_file); } } } @@ -634,12 +634,12 @@ public function doFileUpload(&$objFormParam) * * TODO 一時ファイルの削除 * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function doFileDelete(&$objFormParam) { - $objImage = new SC_Image_Ex(DOWN_TEMP_REALDIR); + $objImage = new Image(DOWN_TEMP_REALDIR); $arrRealFileName = $objFormParam->getValue('down_realfilename'); $index = $objFormParam->getValue('upload_index'); $objImage->deleteImage($arrRealFileName[$index], DOWN_SAVE_REALDIR); @@ -650,12 +650,12 @@ public function doFileDelete(&$objFormParam) /** * アップロードした一時ファイルを保存する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function doUploadComplete(&$objFormParam) { - $objImage = new SC_Image_Ex(DOWN_TEMP_REALDIR); + $objImage = new Image(DOWN_TEMP_REALDIR); $arrRealFileName = $objFormParam->getValue('down_realfilename'); if (is_array($arrRealFileName)) { foreach ($arrRealFileName as $real_file_name) { @@ -673,7 +673,7 @@ public function doUploadComplete(&$objFormParam) */ public function getAllClassCategory($class_id1, $class_id2 = null) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = <<< __EOF__ T1.class_id AS class_id1, @@ -683,7 +683,7 @@ public function getAllClassCategory($class_id1, $class_id2 = null) __EOF__; $table = ''; $arrParams = array(); - if (SC_Utils_Ex::isBlank($class_id2)) { + if (Utils::isBlank($class_id2)) { $col .= ',0 AS classcategory_id2'; $table = 'dtb_classcategory T1 '; $objQuery->setWhere('T1.class_id = ?'); @@ -715,7 +715,7 @@ public function getAllClassCategory($class_id1, $class_id2 = null) */ public function getProductName($product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->get('name', 'dtb_products', 'product_id = ?', array($product_id)); } @@ -728,13 +728,13 @@ public function getProductName($product_id) */ public function getAllClass() { - $arrClass = SC_Helper_DB_Ex::sfGetIDValueList('dtb_class', 'class_id', 'name'); + $arrClass = DbHelper::getIDValueList('dtb_class', 'class_id', 'name'); // 規格分類が登録されていない規格は表示しないようにする。 - $arrClassCatCount = SC_Utils_Ex::sfGetClassCatCount(); + $arrClassCatCount = Utils::sfGetClassCatCount(); $results = array(); - if (!SC_Utils_Ex::isBlank($arrClass)) { + if (!Utils::isBlank($arrClass)) { foreach ($arrClass as $key => $val) { if ($arrClassCatCount[$key] > 0) { $results[$key] = $arrClass[$key]; @@ -755,7 +755,7 @@ public function getAllClass() */ public function getProductsClass($product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'product_code, price01, price02, stock, stock_unlimited, sale_limit, deliv_fee, point_rate'; $where = 'product_id = ? AND classcategory_id1 = 0 AND classcategory_id2 = 0'; @@ -766,7 +766,7 @@ public function getProductsClass($product_id) * チェックボックスの値を埋める. * * チェックボックスが, 全て空で submit されると, $_POST の値が全く渡らない - * ため, SC_FormParam::getValue() で取得できない. + * ため, FormParam::getValue() で取得できない. * これを防ぐため, $_POST[$key] を直接操作し, 指定の長さで空白の配列を作成する * * @param string $key $_POST のキー diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php b/data/Eccube/Page/Admin/Products/ProductEdit.php similarity index 88% rename from data/class/pages/admin/products/LC_Page_Admin_Products_Product.php rename to data/Eccube/Page/Admin/Products/ProductEdit.php index ca15f2554c3..3f37df49007 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php +++ b/data/Eccube/Page/Admin/Products/ProductEdit.php @@ -1,36 +1,37 @@ tpl_maintitle = '商品管理'; $this->tpl_subtitle = '商品登録'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrProductType = $masterData->getMasterData('mtb_product_type'); $this->arrDISP = $masterData->getMasterData('mtb_disp'); $this->arrSTATUS = $masterData->getMasterData('mtb_status'); $this->arrSTATUS_IMAGE = $masterData->getMasterData('mtb_status_image'); $this->arrDELIVERYDATE = $masterData->getMasterData('mtb_delivery_date'); - $this->arrMaker = SC_Helper_Maker_Ex::getIDValueList(); + $this->arrMaker = MakerHelper::getIDValueList(); $this->arrAllowedTag = $masterData->getMasterData('mtb_allowed_tag'); } @@ -74,15 +75,15 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // アップロードファイル情報の初期化 - $objUpFile = new SC_UploadFile_Ex(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR); + $objUpFile = new UploadFile(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR); $this->lfInitFile($objUpFile); $objUpFile->setHiddenFileList($_POST); // ダウンロード販売ファイル情報の初期化 - $objDownFile = new SC_UploadFile_Ex(DOWN_TEMP_REALDIR, DOWN_SAVE_REALDIR); + $objDownFile = new UploadFile(DOWN_TEMP_REALDIR, DOWN_SAVE_REALDIR); $this->lfInitDownFile($objDownFile); $objDownFile->setHiddenFileList($_POST); @@ -160,10 +161,10 @@ public function action() $product_id = $this->lfRegistProduct($objUpFile, $objDownFile, $arrForm); // 件数カウントバッチ実行 - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfCountCategory($objQuery); - $objDb->sfCountMaker($objQuery); + $objQuery = Query::getSingletonInstance(); + $objDb = new DbHelper(); + $objDb->countCategory($objQuery); + $objDb->countMaker($objQuery); // ダウンロード商品の複製時に、ダウンロード商品用ファイルを // 変更すると、複製元のファイルが削除されるのを回避。 @@ -289,7 +290,7 @@ public function action() * パラメーター情報の初期化 * - 編集/複製モード * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @param array $arrPost $_POSTデータ * @return void */ @@ -303,7 +304,7 @@ public function lfInitFormParam_PreEdit(&$objFormParam, $arrPost) /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @param array $arrPost $_POSTデータ * @return void */ @@ -376,7 +377,7 @@ public function lfInitFormParam(&$objFormParam, $arrPost) * パラメーター情報の初期化 * - 画像ファイルアップロードモード * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitFormParam_UploadImage(&$objFormParam) @@ -388,7 +389,7 @@ public function lfInitFormParam_UploadImage(&$objFormParam) * パラメーター情報の初期化 * - ダウンロード商品ファイルアップロードモード * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitFormParam_UploadDown(&$objFormParam) @@ -400,7 +401,7 @@ public function lfInitFormParam_UploadDown(&$objFormParam) * パラメーター情報の初期化 * - 関連商品追加モード * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return void */ public function lfInitFormParam_RecommendSelect(&$objFormParam) @@ -413,7 +414,7 @@ public function lfInitFormParam_RecommendSelect(&$objFormParam) * アップロードファイルパラメーター情報の初期化 * - 画像ファイル用 * - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileインスタンス + * @param UploadFile $objUpFile UploadFileインスタンス * @return void */ public function lfInitFile(&$objUpFile) @@ -431,7 +432,7 @@ public function lfInitFile(&$objUpFile) * アップロードファイルパラメーター情報の初期化 * - ダウンロード商品ファイル用 * - * @param SC_UploadFile_Ex $objDownFile SC_UploadFileインスタンス + * @param UploadFile $objDownFile UploadFileインスタンス * @return void */ public function lfInitDownFile(&$objDownFile) @@ -442,15 +443,15 @@ public function lfInitDownFile(&$objDownFile) /** * フォーム入力パラメーターのエラーチェック * - * @param object $objFormParam SC_FormParamインスタンス - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileインスタンス - * @param SC_UploadFile_Ex $objDownFile SC_UploadFileインスタンス + * @param object $objFormParam FormParamインスタンス + * @param UploadFile $objUpFile UploadFileインスタンス + * @param UploadFile $objDownFile UploadFileインスタンス * @param array $arrForm フォーム入力パラメーター配列 * @return array エラー情報を格納した連想配列 */ public function lfCheckError_Edit(&$objFormParam, &$objUpFile, &$objDownFile, $arrForm) { - $objErr = new SC_CheckError_Ex($arrForm); + $objErr = new CheckError($arrForm); $arrErr = array(); // 入力パラメーターチェック @@ -522,7 +523,7 @@ public function lfCheckError_RecommendSelect(&$arrForm, &$arrErr) public function lfGetSearchParam($arrPost) { $arrSearchParam = array(); - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); parent::lfInitParam($objFormParam); $objFormParam->setParam($arrPost); @@ -535,8 +536,8 @@ public function lfGetSearchParam($arrPost) * フォームパラメーター取得 * - 編集/複製モード * - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileインスタンス - * @param SC_UploadFile_Ex $objDownFile SC_UploadFileインスタンス + * @param UploadFile $objUpFile UploadFileインスタンス + * @param UploadFile $objDownFile UploadFileインスタンス * @param integer $product_id 商品ID * @return array フォームパラメーター配列 */ @@ -558,13 +559,13 @@ public function lfGetFormParam_PreEdit(&$objUpFile, &$objDownFile, $product_id) * フォームパラメーター取得 * - 登録モード * - * @param SC_FormParam_Ex $objFormParam SC_FormParamインスタンス + * @param FormParam $objFormParam FormParamインスタンス * @return array フォームパラメーター配列 */ public function lfGetFormParam_Complete(&$objFormParam) { $arrForm = $objFormParam->getHashArray(); - $arrForm['category_id'] = SC_Utils_Ex::jsonDecode($arrForm['category_id']); + $arrForm['category_id'] = Utils::jsonDecode($arrForm['category_id']); $objFormParam->setValue('category_id', $arrForm['category_id']); return $arrForm; @@ -574,21 +575,21 @@ public function lfGetFormParam_Complete(&$objFormParam) * 表示用フォームパラメーター取得 * - 入力画面 * - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileインスタンス - * @param SC_UploadFile_Ex $objDownFile SC_UploadFileインスタンス + * @param UploadFile $objUpFile UploadFileインスタンス + * @param UploadFile $objDownFile UploadFileインスタンス * @param array $arrForm フォーム入力パラメーター配列 * @return array 表示用フォームパラメーター配列 */ public function lfSetViewParam_InputPage(&$objUpFile, &$objDownFile, &$arrForm) { // カテゴリマスターデータ取得 - $objDb = new SC_Helper_DB_Ex(); - list($this->arrCatVal, $this->arrCatOut) = $objDb->sfGetLevelCatList(false); + $objDb = new DbHelper(); + list($this->arrCatVal, $this->arrCatOut) = $objDb->getLevelCatList(false); if (isset($arrForm['category_id']) && !is_array($arrForm['category_id'])) { - $arrForm['category_id'] = SC_Utils_Ex::jsonDecode($arrForm['category_id']); + $arrForm['category_id'] = Utils::jsonDecode($arrForm['category_id']); } - $this->tpl_json_category_id = !empty($arrForm['category_id']) ? SC_Utils_Ex::jsonEncode($arrForm['category_id']) : SC_Utils_Ex::jsonEncode(array()); + $this->tpl_json_category_id = !empty($arrForm['category_id']) ? Utils::jsonEncode($arrForm['category_id']) : Utils::jsonEncode(array()); if ($arrForm['status'] == '') { $arrForm['status'] = DEFAULT_PRODUCT_DISP; } @@ -598,9 +599,9 @@ public function lfSetViewParam_InputPage(&$objUpFile, &$objDownFile, &$arrForm) if (OPTION_PRODUCT_TAX_RULE) { // 編集の場合は設定された税率、新規の場合はデフォルトの税率を取得 if ($arrForm['product_id'] == '') { - $arrRet = SC_Helper_TaxRule_Ex::getTaxRule(); + $arrRet = TaxRuleHelper::getTaxRule(); } else { - $arrRet = SC_Helper_TaxRule_Ex::getTaxRule($arrForm['product_id'], $arrForm['product_class_id']); + $arrRet = TaxRuleHelper::getTaxRule($arrForm['product_id'], $arrForm['product_class_id']); } $arrForm['tax_rate'] = $arrRet['tax_rate']; } @@ -615,7 +616,7 @@ public function lfSetViewParam_InputPage(&$objUpFile, &$objDownFile, &$arrForm) $arrForm['down_realfilename'] = $objDownFile->getFormDownFile(); // 基本情報(デフォルトポイントレート用) - $arrForm['arrInfo'] = SC_Helper_DB_Ex::sfGetBasisData(); + $arrForm['arrInfo'] = DbHelper::getBasisData(); // サブ情報ありなしフラグ $arrForm['sub_find'] = $this->hasSubProductData($arrForm); @@ -627,8 +628,8 @@ public function lfSetViewParam_InputPage(&$objUpFile, &$objDownFile, &$arrForm) * 表示用フォームパラメーター取得 * - 確認画面 * - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileインスタンス - * @param SC_UploadFile_Ex $objDownFile SC_UploadFileインスタンス + * @param UploadFile $objUpFile UploadFileインスタンス + * @param UploadFile $objDownFile UploadFileインスタンス * @param array $arrForm フォーム入力パラメーター配列 * @return array 表示用フォームパラメーター配列 */ @@ -637,7 +638,7 @@ public function lfSetViewParam_ConfirmPage(&$objUpFile, &$objDownFile, &$arrForm // カテゴリ表示用 $arrForm['arrCategoryId'] = $arrForm['category_id']; // hidden に渡す値は serialize する - $arrForm['category_id'] = SC_Utils_Ex::jsonEncode($arrForm['category_id']); + $arrForm['category_id'] = Utils::jsonEncode($arrForm['category_id']); // 画像ファイル用データ取得 $arrForm['arrFile'] = $objUpFile->getFormFileList(IMAGE_TEMP_URLPATH, IMAGE_SAVE_URLPATH); // ダウンロード商品実ファイル名取得 @@ -649,7 +650,7 @@ public function lfSetViewParam_ConfirmPage(&$objUpFile, &$objDownFile, &$arrForm /** * 縮小した画像をセットする * - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileインスタンス + * @param UploadFile $objUpFile UploadFileインスタンス * @param string $image_key 画像ファイルキー * @return void */ @@ -676,7 +677,7 @@ public function lfSetScaleImage(&$objUpFile, $image_key) /** * 画像ファイルのコピー * - * @param object $objUpFile SC_UploadFileインスタンス + * @param object $objUpFile UploadFileインスタンス * @return void */ public function lfCopyProductImageFiles(&$objUpFile) @@ -692,7 +693,7 @@ public function lfCopyProductImageFiles(&$objUpFile) /** * 縮小画像生成 * - * @param object $objUpFile SC_UploadFileインスタンス + * @param object $objUpFile UploadFileインスタンス * @param string $from_key 元画像ファイルキー * @param string $to_key 縮小画像ファイルキー * @param boolean $forced @@ -733,13 +734,13 @@ public function lfMakeScaleImage(&$objUpFile, $from_key, $to_key, $forced = fals * アップロードファイルパラメーター情報から削除 * 一時ディレクトリに保存されている実ファイルも削除する * - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileインスタンス + * @param UploadFile $objUpFile UploadFileインスタンス * @param string $image_key 画像ファイルキー * @return void */ public function lfDeleteTempFile(&$objUpFile, $image_key) { - // TODO: SC_UploadFile::deleteFileの画像削除条件見直し要 + // TODO: UploadFile::deleteFileの画像削除条件見直し要 $arrTempFile = $objUpFile->temp_file; $arrKeyName = $objUpFile->keyname; @@ -766,15 +767,15 @@ public function lfDeleteTempFile(&$objUpFile, $image_key) /** * アップロードファイルを保存する * - * @param object $objUpFile SC_UploadFileインスタンス - * @param object $objDownFile SC_UploadFileインスタンス + * @param object $objUpFile UploadFileインスタンス + * @param object $objDownFile UploadFileインスタンス * @param integer $product_id 商品ID * @return void */ public function lfSaveUploadFiles(&$objUpFile, &$objDownFile, $product_id) { - // TODO: SC_UploadFile::moveTempFileの画像削除条件見直し要 - $objImage = new SC_Image_Ex($objUpFile->temp_dir); + // TODO: UploadFile::moveTempFileの画像削除条件見直し要 + $objImage = new Image($objUpFile->temp_dir); $arrKeyName = $objUpFile->keyname; $arrTempFile = $objUpFile->temp_file; $arrSaveFile = $objUpFile->save_file; @@ -808,7 +809,7 @@ public function lfSaveUploadFiles(&$objUpFile, &$objDownFile, $product_id) */ public function lfHasSameProductImage($product_id, $arrImageKey, $image_file_name) { - if (!SC_Utils_Ex::sfIsInt($product_id)) return false; + if (!Utils::sfIsInt($product_id)) return false; if (!$arrImageKey) return false; if (!$image_file_name) return false; @@ -829,7 +830,7 @@ public function lfHasSameProductImage($product_id, $arrImageKey, $image_file_nam } $where .= ')'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists('dtb_products', $where, $sqlval); return $exists; @@ -843,7 +844,7 @@ public function lfHasSameProductImage($product_id, $arrImageKey, $image_file_nam */ public function lfGetProductData_FromDB($product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrProduct = array(); // 商品データ取得 @@ -879,16 +880,16 @@ public function lfGetProductData_FromDB($product_id) $arrProduct[0]['category_id'] = $objQuery->getCol($col, $table, $where, array($product_id)); // 規格情報ありなしフラグ取得 - $objDb = new SC_Helper_DB_Ex(); - $arrProduct[0]['has_product_class'] = $objDb->sfHasProductClass($product_id); + $objDb = new DbHelper(); + $arrProduct[0]['has_product_class'] = $objDb->hasProductClass($product_id); // 規格が登録されていなければ規格ID取得 if ($arrProduct[0]['has_product_class'] == false) { - $arrProduct[0]['product_class_id'] = SC_Utils_Ex::sfGetProductClassId($product_id, '0', '0'); + $arrProduct[0]['product_class_id'] = Utils::sfGetProductClassId($product_id, '0', '0'); } // 商品ステータス取得 - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $productStatus = $objProduct->getProductStatus(array($product_id)); $arrProduct[0]['product_status'] = $productStatus[$product_id]; @@ -907,7 +908,7 @@ public function lfGetProductData_FromDB($product_id) */ public function lfGetRecommendProductsData_FromDB($product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRecommendProducts = array(); $col = 'recommend_product_id,'; @@ -945,7 +946,7 @@ public function lfGetRecommendProducts(&$arrForm) if (!isset($arrForm[$delkey])) $arrForm[$delkey] = null; if ((isset($arrForm[$keyname]) && !empty($arrForm[$keyname])) && $arrForm[$delkey] != 1) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $arrRecommend[$i] = $objProduct->getDetail($arrForm[$keyname]); $arrRecommend[$i]['product_id'] = $arrForm[$keyname]; $arrRecommend[$i]['comment'] = $arrForm[$commentkey]; @@ -964,10 +965,10 @@ public function lfGetRecommendProducts(&$arrForm) */ public function lfGetCategoryList_Edit() { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); $arrCategoryList = array(); - list($arrCatVal, $arrCatOut) = $objDb->sfGetLevelCatList(false); + list($arrCatVal, $arrCatOut) = $objDb->getLevelCatList(false); for ($i = 0; $i < count($arrCatVal); $i++) { $arrCategoryList[$arrCatVal[$i]] = $arrCatOut[$i]; } @@ -990,15 +991,15 @@ public function lfSetOnloadJavaScript_InputPage($anchor_hash = '') /** * DBに商品データを登録する * - * @param SC_UploadFile_Ex $objUpFile SC_UploadFileインスタンス - * @param SC_UploadFile_Ex $objDownFile SC_UploadFileインスタンス + * @param UploadFile $objUpFile UploadFileインスタンス + * @param UploadFile $objDownFile UploadFileインスタンス * @param array $arrList フォーム入力パラメーター配列 * @return integer 登録商品ID */ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $objDb = new SC_Helper_DB_Ex(); + $objQuery = Query::getSingletonInstance(); + $objDb = new DbHelper(); // 配列の添字を定義 $checkArray = array('name', 'status', @@ -1006,7 +1007,7 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList) 'deliv_fee', 'comment1', 'comment2', 'comment3', 'comment4', 'comment5', 'comment6', 'sale_limit', 'deliv_date_id', 'maker_id', 'note'); - $arrList = SC_Utils_Ex::arrayDefineIndexes($arrList, $checkArray); + $arrList = Utils::arrayDefineIndexes($arrList, $checkArray); // INSERTする値を作成する。 $sqlval['name'] = $arrList['name']; @@ -1049,14 +1050,14 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList) $objDb->updateProductCategories($arrList['category_id'], $product_id); // 複製商品の場合には規格も複製する - if ($arrList['copy_product_id'] != '' && SC_Utils_Ex::sfIsInt($arrList['copy_product_id'])) { + if ($arrList['copy_product_id'] != '' && Utils::sfIsInt($arrList['copy_product_id'])) { if (!$arrList['has_product_class']) { //規格なしの場合、複製は価格等の入力が発生しているため、その内容で追加登録を行う $this->lfCopyProductClass($arrList, $objQuery); } else { //規格がある場合の複製は複製元の内容で追加登録を行う // dtb_products_class のカラムを取得 - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); $arrColList = $objQuery->listTableFields('dtb_products_class'); $arrColList_tmp = array_flip($arrColList); @@ -1066,14 +1067,14 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList) unset($arrColList[$arrColList_tmp['create_date']]); // 複製元商品の規格データ取得 - $col = SC_Utils_Ex::sfGetCommaList($arrColList); + $col = Utils::sfGetCommaList($arrColList); $table = 'dtb_products_class'; $where = 'product_id = ?'; $objQuery->setOrder('product_class_id'); $arrProductsClass = $objQuery->select($col, $table, $where, array($arrList['copy_product_id'])); // 規格データ登録 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); foreach ($arrProductsClass as $arrData) { $sqlval = $arrData; $sqlval['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id'); @@ -1092,8 +1093,8 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList) $product_id = $arrList['product_id']; // 削除要求のあった既存ファイルの削除 $arrRet = $this->lfGetProductData_FromDB($arrList['product_id']); - // TODO: SC_UploadFile::deleteDBFileの画像削除条件見直し要 - $objImage = new SC_Image_Ex($objUpFile->temp_dir); + // TODO: UploadFile::deleteDBFileの画像削除条件見直し要 + $objImage = new Image($objUpFile->temp_dir); $arrKeyName = $objUpFile->keyname; $arrSaveFile = $objUpFile->save_file; $arrImageKey = array(); @@ -1118,7 +1119,7 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList) // 商品登録の時は規格を生成する。複製の場合は規格も複製されるのでこの処理は不要。 if ($arrList['copy_product_id'] == '') { // 規格登録 - if ($objDb->sfHasProductClass($product_id)) { + if ($objDb->hasProductClass($product_id)) { // 規格あり商品(商品規格テーブルのうち、商品登録フォームで設定するパラメーターのみ更新) $this->lfUpdateProductClass($arrList); } else { @@ -1128,12 +1129,12 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList) } // 商品ステータス設定 - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $objProduct->setProductStatus($product_id, $arrList['product_status']); // 税情報設定 - if (OPTION_PRODUCT_TAX_RULE && !$objDb->sfHasProductClass($product_id)) { - SC_Helper_TaxRule_Ex::setTaxRuleForProduct($arrList['tax_rate'], $arrList['product_id'], $arrList['product_class_id']); + if (OPTION_PRODUCT_TAX_RULE && !$objDb->hasProductClass($product_id)) { + TaxRuleHelper::setTaxRuleForProduct($arrList['tax_rate'], $arrList['product_id'], $arrList['product_class_id']); } // 関連商品登録 @@ -1152,13 +1153,13 @@ public function lfRegistProduct(&$objUpFile, &$objDownFile, $arrList) */ public function lfInsertDummyProductClass($arrList) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $objDb = new SC_Helper_DB_Ex(); + $objQuery = Query::getSingletonInstance(); + $objDb = new DbHelper(); // 配列の添字を定義 $checkArray = array('product_class_id', 'product_id', 'product_code', 'stock', 'stock_unlimited', 'price01', 'price02', 'sale_limit', 'deliv_fee', 'point_rate', 'product_type_id', 'down_filename', 'down_realfilename'); - $sqlval = SC_Utils_Ex::sfArrayIntersectKeys($arrList, $checkArray); - $sqlval = SC_Utils_Ex::arrayDefineIndexes($sqlval, $checkArray); + $sqlval = Utils::sfArrayIntersectKeys($arrList, $checkArray); + $sqlval = Utils::arrayDefineIndexes($sqlval, $checkArray); $sqlval['stock_unlimited'] = $sqlval['stock_unlimited'] ? UNLIMITED_FLG_UNLIMITED : UNLIMITED_FLG_LIMITED; $sqlval['creator_id'] = strlen($_SESSION['member_id']) >= 1 ? $_SESSION['member_id'] : '0'; @@ -1186,7 +1187,7 @@ public function lfInsertDummyProductClass($arrList) */ public function lfUpdateProductClass($arrList) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sqlval = array(); $sqlval['deliv_fee'] = $arrList['deliv_fee']; @@ -1199,7 +1200,7 @@ public function lfUpdateProductClass($arrList) /** * DBに関連商品データを登録する * - * @param SC_Query $objQuery SC_Queryインスタンス + * @param Query $objQuery Queryインスタンス * @param string $arrList フォーム入力パラメーター配列 * @param integer $product_id 登録する商品ID * @return void @@ -1234,7 +1235,7 @@ public function lfInsertRecommendProducts(&$objQuery, $arrList, $product_id) * 規格データをコピーする * * @param array $arrList フォーム入力パラメーター配列 - * @param SC_Query $objQuery SC_Queryインスタンス + * @param Query $objQuery Queryインスタンス * @return boolean エラーフラグ */ public function lfCopyProductClass($arrList, &$objQuery) @@ -1323,12 +1324,12 @@ public function hasSubProductData($arrSubProductData) $has_subproduct_data = false; for ($i = 1; $i <= PRODUCTSUB_MAX; $i++) { - if (SC_Utils_Ex::isBlank($arrSubProductData['sub_title'.$i]) == false - || SC_Utils_Ex::isBlank($arrSubProductData['sub_comment'.$i]) == false - || SC_Utils_Ex::isBlank($arrSubProductData['sub_image'.$i]) == false - || SC_Utils_Ex::isBlank($arrSubProductData['sub_large_image'.$i]) == false - || SC_Utils_Ex::isBlank($arrSubProductData['temp_sub_image'.$i]) == false - || SC_Utils_Ex::isBlank($arrSubProductData['temp_sub_large_image'.$i]) == false + if (Utils::isBlank($arrSubProductData['sub_title'.$i]) == false + || Utils::isBlank($arrSubProductData['sub_comment'.$i]) == false + || Utils::isBlank($arrSubProductData['sub_image'.$i]) == false + || Utils::isBlank($arrSubProductData['sub_large_image'.$i]) == false + || Utils::isBlank($arrSubProductData['temp_sub_image'.$i]) == false + || Utils::isBlank($arrSubProductData['temp_sub_large_image'.$i]) == false ) { $has_subproduct_data = true; break; diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php b/data/Eccube/Page/Admin/Products/ProductRank.php similarity index 71% rename from data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php rename to data/Eccube/Page/Admin/Products/ProductRank.php index 139164e6665..35143aff412 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php +++ b/data/Eccube/Page/Admin/Products/ProductRank.php @@ -1,36 +1,32 @@ tpl_pageno = isset($_POST['pageno']) ? $_POST['pageno'] : ''; @@ -101,16 +97,16 @@ public function action() $this->arrParentID = $objCategory->getTreeTrail($this->arrForm['parent_category_id']); $this->arrProductsList = $this->lfGetProduct($this->arrForm['parent_category_id']); $arrBread = $objCategory->getTreeTrail($this->arrForm['parent_category_id'], FALSE); - $this->tpl_bread_crumbs = SC_Utils_Ex::jsonEncode(array_reverse($arrBread)); + $this->tpl_bread_crumbs = Utils::jsonEncode(array_reverse($arrBread)); } /* 商品読み込み */ public function lfGetProduct($category_id) { - // FIXME SC_Product クラスを使用した実装 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + // FIXME Product クラスを使用した実装 + $objQuery = Query::getSingletonInstance(); $col = 'alldtl.product_id, name, main_list_image, product_code_min, product_code_max, status'; - $objProduct = new SC_Product(); + $objProduct = new Product(); $table = $objProduct->alldtlSQL(); $table.= ' LEFT JOIN dtb_product_categories AS T5 ON alldtl.product_id = T5.product_id'; $where = 'del_flg = 0 AND category_id = ?'; @@ -120,7 +116,7 @@ public function lfGetProduct($category_id) // 該当件数表示用 $this->tpl_linemax = $linemax; - $objNavi = new SC_PageNavi_Ex($this->tpl_pageno, $linemax, SEARCH_PMAX, 'eccube.movePage', NAVI_PMAX); + $objNavi = new PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, 'eccube.movePage', NAVI_PMAX); $startno = $objNavi->start_row; $this->tpl_start_row = $objNavi->start_row; $this->tpl_strnavi = $objNavi->strnavi; // Navi表示文字列 @@ -142,7 +138,7 @@ public function lfGetProduct($category_id) */ public function lfRenumber($parent_category_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sql = <<< __EOS__ UPDATE dtb_product_categories @@ -168,33 +164,33 @@ public function lfRenumber($parent_category_id) } /** - * @param SC_Helper_DB_Ex $objDb + * @param DbHelper $objDb */ public function lfRankUp(&$objDb, $parent_category_id, $product_id) { - $where = 'category_id = ' . SC_Utils_Ex::sfQuoteSmart($parent_category_id); - $objDb->sfRankUp('dtb_product_categories', 'product_id', $product_id, $where); + $where = 'category_id = ' . Utils::sfQuoteSmart($parent_category_id); + $objDb->rankUp('dtb_product_categories', 'product_id', $product_id, $where); } /** - * @param SC_Helper_DB_Ex $objDb + * @param DbHelper $objDb */ public function lfRankDown(&$objDb, $parent_category_id, $product_id) { - $where = 'category_id = ' . SC_Utils_Ex::sfQuoteSmart($parent_category_id); - $objDb->sfRankDown('dtb_product_categories', 'product_id', $product_id, $where); + $where = 'category_id = ' . Utils::sfQuoteSmart($parent_category_id); + $objDb->rankDown('dtb_product_categories', 'product_id', $product_id, $where); } /** - * @param SC_Helper_DB_Ex $objDb + * @param DbHelper $objDb */ public function lfRankMove(&$objDb, $parent_category_id, $product_id) { $key = 'pos-'.$product_id; $input_pos = mb_convert_kana($_POST[$key], 'n'); - if (SC_Utils_Ex::sfIsInt($input_pos)) { - $where = 'category_id = ' . SC_Utils_Ex::sfQuoteSmart($parent_category_id); - $objDb->sfMoveRank('dtb_product_categories', 'product_id', $product_id, $input_pos, $where); + if (Utils::sfIsInt($input_pos)) { + $where = 'category_id = ' . Utils::sfQuoteSmart($parent_category_id); + $objDb->moveRank('dtb_product_categories', 'product_id', $product_id, $input_pos, $where); } } } diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php b/data/Eccube/Page/Admin/Products/ProductSelect.php similarity index 70% rename from data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php rename to data/Eccube/Page/Admin/Products/ProductSelect.php index 73272b0237e..80a7151fd90 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php +++ b/data/Eccube/Page/Admin/Products/ProductSelect.php @@ -1,36 +1,33 @@ tpl_maintitle = '商品管理'; $this->tpl_subtitle = '商品選択'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPRODUCTSTATUS_COLOR = $masterData->getMasterData('mtb_product_status_color'); } @@ -68,9 +65,9 @@ public function process() */ public function action() { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); @@ -85,14 +82,14 @@ public function action() } // カテゴリ取得 - $this->arrCatList = $objDb->sfGetCategoryList(); + $this->arrCatList = $objDb->getCategoryList(); $this->setTemplate($this->tpl_mainpage); } /** * パラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -105,7 +102,7 @@ public function lfInitParam(&$objFormParam) /* 商品検索結果取得 */ /** - * @param SC_Helper_DB_Ex $objDb + * @param DbHelper $objDb */ public function lfGetProducts(&$objDb) { @@ -122,7 +119,7 @@ public function lfGetProducts(&$objDb) $arrWhereVal[] = "%$val%"; break; case 'search_category_id': - list($tmp_where, $arrTmp) = $objDb->sfGetCatWhere($val); + list($tmp_where, $arrTmp) = $objDb->getCatWhere($val); if ($tmp_where != '') { $where.= ' AND product_id IN (SELECT product_id FROM dtb_product_categories WHERE ' . $tmp_where . ')'; $arrWhereVal = array_merge((array) $arrWhereVal, (array) $arrTmp); @@ -139,16 +136,16 @@ public function lfGetProducts(&$objDb) $order = 'update_date DESC, product_id DESC '; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 行数の取得 $linemax = $objQuery->count('dtb_products', $where, $arrWhereVal); $this->tpl_linemax = $linemax; // 何件が該当しました。表示用 // ページ送りの処理 - $page_max = SC_Utils_Ex::sfGetSearchPageMax($_POST['search_page_max']); + $page_max = Utils::sfGetSearchPageMax($_POST['search_page_max']); // ページ送りの取得 - $objNavi = new SC_PageNavi_Ex($_POST['search_pageno'], $linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX); + $objNavi = new PageNavi($_POST['search_pageno'], $linemax, $page_max, 'eccube.moveSearchPage', NAVI_PMAX); $this->tpl_strnavi = $objNavi->strnavi; // 表示文字列 $startno = $objNavi->start_row; @@ -159,7 +156,7 @@ public function lfGetProducts(&$objDb) // 検索結果の取得 // FIXME 商品コードの表示 - $arrProducts = $objQuery->select('*', SC_Product_Ex::alldtlSQL(), $where, $arrWhereVal); + $arrProducts = $objQuery->select('*', Product::alldtlSQL(), $where, $arrWhereVal); return $arrProducts; } diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php b/data/Eccube/Page/Admin/Products/UploadCSV.php similarity index 91% rename from data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php rename to data/Eccube/Page/Admin/Products/UploadCSV.php index 69db97cc840..b17f195d099 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSV.php +++ b/data/Eccube/Page/Admin/Products/UploadCSV.php @@ -1,38 +1,39 @@ tpl_subtitle = '商品登録CSV'; $this->csv_id = '1'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrDISP = $masterData->getMasterData('mtb_disp'); $this->arrSTATUS = $masterData->getMasterData('mtb_status'); $this->arrDELIVERYDATE = $masterData->getMasterData('mtb_delivery_date'); $this->arrProductType = $masterData->getMasterData('mtb_product_type'); - $this->arrMaker = SC_Helper_Maker_Ex::getIDValueList(); - $this->arrPayments = SC_Helper_Payment_Ex::getIDValueList(); - $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $this->arrMaker = MakerHelper::getIDValueList(); + $this->arrPayments = PaymentHelper::getIDValueList(); + $this->arrInfo = DbHelper::getBasisData(); $this->arrAllowedTag = $masterData->getMasterData('mtb_allowed_tag'); $this->arrTagCheckItem = array(); } @@ -95,10 +96,10 @@ public function process() */ public function action() { - $this->objDb = new SC_Helper_DB_Ex(); + $this->objDb = new DbHelper(); // CSV管理ヘルパー - $objCSV = new SC_Helper_CSV_Ex(); + $objCSV = new CsvHelper(); // CSV構造読み込み $arrCSVFrame = $objCSV->sfGetCsvOutput($this->csv_id); @@ -112,14 +113,14 @@ public function action() $this->tpl_is_update = $objCSV->sfIsUpdateCSVFrame($arrCSVFrame); // CSVファイルアップロード情報の初期化 - $objUpFile = new SC_UploadFile_Ex(CSV_TEMP_REALDIR, CSV_TEMP_REALDIR); + $objUpFile = new UploadFile(CSV_TEMP_REALDIR, CSV_TEMP_REALDIR); $this->lfInitFile($objUpFile); // パラメーター情報の初期化 - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam, $arrCSVFrame); - $this->max_upload_csv_size = SC_Utils_Ex::getUnitDataSize(CSV_SIZE); + $this->max_upload_csv_size = Utils::getUnitDataSize(CSV_SIZE); $objFormParam->setHtmlDispNameArray(); $this->arrTitle = $objFormParam->getHtmlDispNameArray(); @@ -211,7 +212,7 @@ public function lfReadCSVFile(&$objFormParam, &$fp, $objQuery = null) $product_id = $objFormParam->getValue('product_id'); $product_class_id = $objFormParam->getValue('product_class_id'); if ($product_class_id == '' && $product_id != '') { - $product_class_id = SC_Utils_Ex::sfGetProductClassId($product_id, $objFormParam->getValue('classcategory_id1'), $objFormParam->getValue('classcategory_id2')); + $product_class_id = Utils::sfGetProductClassId($product_id, $objFormParam->getValue('classcategory_id1'), $objFormParam->getValue('classcategory_id2')); $objFormParam->setValue('product_class_id', $product_class_id); } @@ -231,7 +232,7 @@ public function lfReadCSVFile(&$objFormParam, &$fp, $objQuery = null) $this->addRowResult($line_count, '商品ID:'.$arrParam['product_id'] . ' / 商品名:' . $arrParam['name']); } - SC_Utils_Ex::extendTimeOut(); + Utils::extendTimeOut(); } return $errFlag; @@ -258,12 +259,12 @@ public function doUploadCsv(&$objFormParam, &$objUpFile) // 一時ファイル名の取得 $filepath = $objUpFile->getTempFilePath('csv_file'); // CSVファイルの文字コード変換 - $enc_filepath = SC_Utils_Ex::sfEncodeFile($filepath, CHAR_CODE, CSV_TEMP_REALDIR); + $enc_filepath = Utils::sfEncodeFile($filepath, CHAR_CODE, CSV_TEMP_REALDIR); // CSVファイルのオープン $fp = fopen($enc_filepath, 'r'); // 失敗した場合はエラー表示 if (!$fp) { - SC_Utils_Ex::sfDispError(''); + Utils::sfDispError(''); } // 登録先テーブル カラム情報の初期化 @@ -272,7 +273,7 @@ public function doUploadCsv(&$objFormParam, &$objUpFile) // 登録フォーム カラム情報 $this->arrFormKeyList = $objFormParam->getKeyList(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); // CSVからの読み込み、入力エラーチェック @@ -297,8 +298,8 @@ public function doUploadCsv(&$objFormParam, &$objUpFile) $objQuery->commit(); // 商品件数カウント関数の実行 - $this->objDb->sfCountCategory($objQuery); - $this->objDb->sfCountMaker($objQuery); + $this->objDb->countCategory($objQuery); + $this->objDb->countMaker($objQuery); } /** @@ -367,7 +368,7 @@ public function lfCheckError(&$objFormParam) { // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrRet); + $objErr = new CheckError($arrRet); $objErr->arrErr = $objFormParam->checkError(false); // HTMLタグチェックの実行 foreach ($this->arrTagCheckItem as $item) { @@ -388,7 +389,7 @@ public function lfCheckError(&$objFormParam) */ public function lfInitTableInfo() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $this->arrProductColumn = $objQuery->listTableFields('dtb_products'); $this->arrProductClassColumn = $objQuery->listTableFields('dtb_products_class'); } @@ -398,13 +399,13 @@ public function lfInitTableInfo() * * FIXME: 商品登録の実処理自体は、LC_Page_Admin_Products_Productと共通化して欲しい。 * - * @param SC_Query $objQuery SC_Queryインスタンス + * @param Query $objQuery Queryインスタンス * @param string|integer $line 処理中の行数 * @return void */ public function lfRegistProduct($objQuery, $line = '', &$objFormParam) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); // 登録データ対象取得 $arrList = $objFormParam->getDbArray(); @@ -413,7 +414,7 @@ public function lfRegistProduct($objQuery, $line = '', &$objFormParam) // 商品登録情報を生成する。 // 商品テーブルのカラムに存在しているもののうち、Form投入設定されていないデータは上書きしない。 - $sqlval = SC_Utils_Ex::sfArrayIntersectKeys($arrList, $this->arrProductColumn); + $sqlval = Utils::sfArrayIntersectKeys($arrList, $this->arrProductColumn); // 必須入力では無い項目だが、空文字では問題のある特殊なカラム値の初期値設定 $sqlval = $this->lfSetProductDefaultData($sqlval); @@ -467,7 +468,7 @@ public function lfRegistProduct($objQuery, $line = '', &$objFormParam) * * FIXME: 商品規格登録の実処理自体は、LC_Page_Admin_Products_Productと共通化して欲しい。 * - * @param SC_Query $objQuery SC_Queryインスタンス + * @param Query $objQuery Queryインスタンス * @param array $arrList 商品規格情報配列 * @param integer $product_id 商品ID * @param integer $product_class_id 商品規格ID @@ -475,7 +476,7 @@ public function lfRegistProduct($objQuery, $line = '', &$objFormParam) */ public function lfRegistProductClass($objQuery, $arrList, $product_id, $product_class_id) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); // FIXME: dtb_csvテーブルの中で古いカラム名(右辺)が設定されている。sfArrayIntersectKeysでフィルタされてしまうので、名称を変更する必要がある if (array_key_exists('classcategory_id', $arrList) && $arrList['classcategory_id'] != '') { @@ -487,7 +488,7 @@ public function lfRegistProductClass($objQuery, $arrList, $product_id, $product_ // 商品規格登録情報を生成する。 // 商品規格テーブルのカラムに存在しているもののうち、Form投入設定されていないデータは上書きしない。 - $sqlval = SC_Utils_Ex::sfArrayIntersectKeys($arrList, $this->arrProductClassColumn); + $sqlval = Utils::sfArrayIntersectKeys($arrList, $this->arrProductClassColumn); if ($product_class_id == '') { // 新規登録 @@ -514,7 +515,7 @@ public function lfRegistProductClass($objQuery, $arrList, $product_id, $product_ * FIXME: 商品規格登録の実処理自体は、LC_Page_Admin_Products_Productと共通化して欲しい。 * DELETE/INSERT ではなく UPDATEへの変更も・・・ * - * @param SC_Query $objQuery SC_Queryインスタンス + * @param Query $objQuery Queryインスタンス * @param array $arrList 商品規格情報配列 * @param integer $product_id 商品ID * @return void @@ -679,7 +680,7 @@ public function lfCheckErrorDetail($item, $arrErr) if ($item['product_id'] == '') { $arrErr['product_class_id'] = '※ 商品規格ID指定時には商品IDの指定が必須です。'; } else { - if (!$this->objDb->sfIsRecord('dtb_products_class', 'product_id, product_class_id', + if (!$this->objDb->isRecord('dtb_products_class', 'product_id, product_class_id', array($item['product_id'], $item['product_class_id'])) ) { $arrErr['product_class_id'] = '※ 指定の商品IDと商品規格IDの組合せは正しくありません。'; @@ -688,7 +689,7 @@ public function lfCheckErrorDetail($item, $arrErr) // product_class_idは(product_id, classcategory_id1, classcategory_id2)に対して一意。既に異なるproduct_class_idが存在した場合はエラー $classcategory_id1 = $item['classcategory_id'] ? $item['classcategory_id'] : 0; $classcategory_id2 = $item['parent_classcategory_id'] ? $item['parent_classcategory_id'] : 0; - $product_class_id = SC_Utils_Ex::sfGetProductClassId($item['product_id'], $classcategory_id1, $classcategory_id2); + $product_class_id = Utils::sfGetProductClassId($item['product_id'], $classcategory_id1, $classcategory_id2); if ($product_class_id && $product_class_id != $item['product_class_id']) { $arrErr['product_class_id'] = '※ 指定の商品ID/規格分類と、商品規格IDの組合せは正しくありません。'; } @@ -717,7 +718,7 @@ public function lfCheckErrorDetail($item, $arrErr) if ((array_search($recommend_product_id_key, $this->arrFormKeyList) !== FALSE) && ($item[$recommend_product_id_key] != '')) { // 商品IDの存在チェック - if (!$this->objDb->sfIsRecord('dtb_products', 'product_id', (array) $item[$recommend_product_id_key])) { + if (!$this->objDb->isRecord('dtb_products', 'product_id', (array) $item[$recommend_product_id_key])) { $arrErr[$recommend_product_id_key] = "※ 指定の関連商品ID($i)は、登録されていません。"; continue; } @@ -860,9 +861,9 @@ public function lfIsDbRecordMulti($table, $tblkey, $keyname, $item, $delimiter = return false; } $count = count($arrItems); - $where = $tblkey .' IN (' . SC_Utils_Ex::repeatStrWithSeparator('?', $count) . ')'; + $where = $tblkey .' IN (' . Utils::repeatStrWithSeparator('?', $count) . ')'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $db_count = $objQuery->count($table, $where, $arrItems); if ($count != $db_count) { return false; @@ -883,7 +884,7 @@ public function lfIsDbRecord($table, $keyname, $item) { if (array_search($keyname, $this->arrFormKeyList) !== FALSE //入力対象である && $item[$keyname] != '' // 空ではない - && !$this->objDb->sfIsRecord($table, $keyname, (array) $item[$keyname]) //DBに存在するか + && !$this->objDb->isRecord($table, $keyname, (array) $item[$keyname]) //DBに存在するか ) { return false; } diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php b/data/Eccube/Page/Admin/Products/UploadCSVCategory.php similarity index 87% rename from data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php rename to data/Eccube/Page/Admin/Products/UploadCSVCategory.php index ae38a4f2416..ca30ffaa7f1 100644 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_UploadCSVCategory.php +++ b/data/Eccube/Page/Admin/Products/UploadCSVCategory.php @@ -1,27 +1,27 @@ tpl_subtitle = 'カテゴリ登録CSV'; $this->csv_id = '5'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrAllowedTag = $masterData->getMasterData('mtb_allowed_tag'); $this->arrTagCheckItem = array(); } @@ -111,7 +110,7 @@ public function process() public function action() { // CSV管理ヘルパー - $objCSV = new SC_Helper_CSV_Ex(); + $objCSV = new CsvHelper(); // CSV構造読み込み $arrCSVFrame = $objCSV->sfGetCsvOutput($this->csv_id); @@ -125,14 +124,14 @@ public function action() $this->tpl_is_update = $objCSV->sfIsUpdateCSVFrame($arrCSVFrame); // CSVファイルアップロード情報の初期化 - $objUpFile = new SC_UploadFile_Ex(CSV_TEMP_REALDIR, CSV_TEMP_REALDIR); + $objUpFile = new UploadFile(CSV_TEMP_REALDIR, CSV_TEMP_REALDIR); $this->lfInitFile($objUpFile); // パラメーター情報の初期化 - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam, $arrCSVFrame); - $this->max_upload_csv_size = SC_Utils_Ex::getUnitDataSize(CSV_SIZE); + $this->max_upload_csv_size = Utils::getUnitDataSize(CSV_SIZE); $objFormParam->setHtmlDispNameArray(); $this->arrTitle = $objFormParam->getHtmlDispNameArray(); @@ -174,8 +173,8 @@ public function addRowErr($line_count, $message) /** * CSVアップロードを実行する * - * @param SC_FormParam $objFormParam - * @param SC_UploadFile $objUpFile + * @param FormParam $objFormParam + * @param UploadFile $objUpFile * @return void */ public function doUploadCsv(&$objFormParam, &$objUpFile) @@ -191,12 +190,12 @@ public function doUploadCsv(&$objFormParam, &$objUpFile) // 一時ファイル名の取得 $filepath = $objUpFile->getTempFilePath('csv_file'); // CSVファイルの文字コード変換 - $enc_filepath = SC_Utils_Ex::sfEncodeFile($filepath, CHAR_CODE, CSV_TEMP_REALDIR); + $enc_filepath = Utils::sfEncodeFile($filepath, CHAR_CODE, CSV_TEMP_REALDIR); // CSVファイルのオープン $fp = fopen($enc_filepath, 'r'); // 失敗した場合はエラー表示 if (!$fp) { - SC_Utils_Ex::sfDispError(''); + Utils::sfDispError(''); } // 登録先テーブル カラム情報の初期化 @@ -210,7 +209,7 @@ public function doUploadCsv(&$objFormParam, &$objUpFile) // 行数 $line_count = 0; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $errFlag = false; @@ -268,8 +267,8 @@ public function doUploadCsv(&$objFormParam, &$objUpFile) $objQuery->commit(); // カテゴリ件数を更新 - $objDb = new SC_Helper_DB_Ex(); - $objDb->sfCountCategory($objQuery); + $objDb = new DbHelper(); + $objDb->countCategory($objQuery); return; } @@ -277,10 +276,10 @@ public function doUploadCsv(&$objFormParam, &$objUpFile) /** * ファイル情報の初期化を行う. * - * @param SC_UploadFile $objUpFile + * @param UploadFile $objUpFile * @return void */ - public function lfInitFile(SC_UploadFile &$objUpFile) + public function lfInitFile(UploadFile &$objUpFile) { $objUpFile->addFile('CSVファイル', 'csv_file', array('csv'), CSV_SIZE, true, 0, 0, false); } @@ -288,11 +287,11 @@ public function lfInitFile(SC_UploadFile &$objUpFile) /** * 入力情報の初期化を行う. * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @param array $arrCSVFrame CSV構造設定配列 * @return void */ - public function lfInitParam(SC_FormParam &$objFormParam, &$arrCSVFrame) + public function lfInitParam(FormParam &$objFormParam, &$arrCSVFrame) { // 固有の初期値調整 $arrCSVFrame = $this->lfSetParamDefaultValue($arrCSVFrame); @@ -336,14 +335,14 @@ public function lfInitParam(SC_FormParam &$objFormParam, &$arrCSVFrame) /** * 入力チェックを行う. * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return array */ - public function lfCheckError(SC_FormParam &$objFormParam) + public function lfCheckError(FormParam &$objFormParam) { // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrRet); + $objErr = new CheckError($arrRet); $objErr->arrErr = $objFormParam->checkError(false); // HTMLタグチェックの実行 foreach ($this->arrTagCheckItem as $item) { @@ -364,7 +363,7 @@ public function lfCheckError(SC_FormParam &$objFormParam) */ public function lfInitTableInfo() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $this->arrRegistColumn = $objQuery->listTableFields('dtb_category'); } @@ -374,22 +373,22 @@ public function lfInitTableInfo() * FIXME: 登録の実処理自体は、LC_Page_Admin_Products_Categoryと共通化して欲しい。 * * @param integer $line 処理中の行数 - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @return integer カテゴリID */ - public function lfRegisterCategory($line, SC_FormParam &$objFormParam) + public function lfRegisterCategory($line, FormParam &$objFormParam) { // 登録データ対象取得 $arrList = $objFormParam->getDbArray(); // 登録情報を生成する。 // テーブルのカラムに存在しているもののうち、Form投入設定されていないデータは上書きしない。 - $sqlval = SC_Utils_Ex::sfArrayIntersectKeys($arrList, $this->arrRegistColumn); + $sqlval = Utils::sfArrayIntersectKeys($arrList, $this->arrRegistColumn); // 必須入力では無い項目だが、空文字では問題のある特殊なカラム値の初期値設定 $sqlval = $this->lfSetCategoryDefaultData($sqlval); - $objCategory = new SC_Helper_Category_Ex(); + $objCategory = new CategoryHelper(); $category_id = $objCategory->save($sqlval); return $category_id; @@ -449,7 +448,7 @@ public function lfSetCategoryDefaultData(&$sqlval) */ public function lfCheckErrorDetail($item, $arrErr) { - $objCategory = new SC_Helper_Category_Ex(); + $objCategory = new CategoryHelper(); // スタティック変数を初期化 $objCategory->getTree(true); /* diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_AdminArea.php b/data/Eccube/Page/Admin/System/AdminArea.php similarity index 86% rename from data/class/pages/admin/system/LC_Page_Admin_System_AdminArea.php rename to data/Eccube/Page/Admin/System/AdminArea.php index 5e43a830d40..c726633c49a 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_AdminArea.php +++ b/data/Eccube/Page/Admin/System/AdminArea.php @@ -1,27 +1,20 @@ tpl_enable_ssl = TRUE; } - $objFormParam = new SC_FormParam_Ex; + $objFormParam = new FormParam; // パラメーターの初期化 $this->initParam($objFormParam, $_POST); @@ -89,7 +82,7 @@ public function action() //管理画面ディレクトリのチェック $this->lfCheckAdminArea($this->arrForm, $arrErr); - if (SC_Utils_Ex::isBlank($arrErr) && $this->lfUpdateAdminData($this->arrForm)) { + if (Utils::isBlank($arrErr) && $this->lfUpdateAdminData($this->arrForm)) { $this->tpl_onload = "window.alert('管理機能の設定を変更しました。URLを変更した場合は、新しいURLにアクセスしてください。');"; } else { $this->tpl_onload = "window.alert('設定内容に誤りがあります。設定内容を確認してください。');"; @@ -110,7 +103,7 @@ public function action() /** * パラメーター初期化. * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @param array $arrParams $_POST値 * @return void */ diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Bkup.php b/data/Eccube/Page/Admin/System/Bkup.php similarity index 87% rename from data/class/pages/admin/system/LC_Page_Admin_System_Bkup.php rename to data/Eccube/Page/Admin/System/Bkup.php index e361c99c5c6..588b489657c 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Bkup.php +++ b/data/Eccube/Page/Admin/System/Bkup.php @@ -1,36 +1,32 @@ initParam($objFormParam, $_POST); @@ -97,22 +93,22 @@ public function action() $arrErrTmp[1] = $objFormParam->checkError(); // データ型に問題がない場合 - if (SC_Utils_Ex::isBlank($arrErrTmp[1])) { + if (Utils::isBlank($arrErrTmp[1])) { // データ型以外のエラーチェック $arrErrTmp[2] = $this->lfCheckError($objFormParam->getHashArray(), $this->mode); } // エラーがなければバックアップ処理を行う - if (SC_Utils_Ex::isBlank($arrErrTmp[1]) && SC_Utils_Ex::isBlank($arrErrTmp[2])) { + if (Utils::isBlank($arrErrTmp[1]) && Utils::isBlank($arrErrTmp[2])) { $arrData = $objFormParam->getHashArray(); $work_dir = $this->bkup_dir . $arrData['bkup_name'] . '/'; // バックアップデータの事前削除 - SC_Helper_FileManager_Ex::deleteFile($work_dir); + FileManagerHelper::deleteFile($work_dir); // バックアップファイル作成 $res = $this->lfCreateBkupData($arrData['bkup_name'], $work_dir); // バックアップデータの事後削除 - SC_Helper_FileManager_Ex::deleteFile($work_dir); + FileManagerHelper::deleteFile($work_dir); $arrErrTmp[3] = array(); if ($res !== true) { @@ -120,7 +116,7 @@ public function action() } // DBにデータ更新 - if (SC_Utils_Ex::isBlank($arrErrTmp[3])) { + if (Utils::isBlank($arrErrTmp[3])) { $this->lfUpdBkupData($arrData); } else { $arrForm = $arrData; @@ -141,11 +137,11 @@ public function action() $arrErr = $this->lfCheckError($objFormParam->getHashArray(), $this->mode); // エラーがなければリストア処理を行う - if (SC_Utils_Ex::isBlank($arrErr)) { + if (Utils::isBlank($arrErr)) { $arrData = $objFormParam->getHashArray(); $msg = '「' . $arrData['list_name'] . '」のリストアを開始します。'; - GC_Utils_Ex::gfPrintLog($msg); + GcUtils::gfPrintLog($msg); $success = $this->lfRestore($arrData['list_name'], $this->bkup_dir, $this->bkup_ext, $this->mode); @@ -153,7 +149,7 @@ public function action() $msg .= $success ? 'リストアを終了しました。' : 'リストアに失敗しました。'; $this->tpl_restore_msg .= $msg . "\n"; - GC_Utils_Ex::gfPrintLog($msg); + GcUtils::gfPrintLog($msg); } break; @@ -164,7 +160,7 @@ public function action() $arrErr = $this->lfCheckError($objFormParam->getHashArray(), $this->mode); // エラーがなければリストア処理を行う - if (SC_Utils_Ex::isBlank($arrErr)) { + if (Utils::isBlank($arrErr)) { $arrData = $objFormParam->getHashArray(); // DBとファイルを削除 @@ -180,17 +176,17 @@ public function action() $arrErr = $this->lfCheckError($objFormParam->getHashArray(), $this->mode); // エラーがなければダウンロード処理を行う - if (SC_Utils_Ex::isBlank($arrErr)) { + if (Utils::isBlank($arrErr)) { $arrData = $objFormParam->getHashArray(); $filename = $arrData['list_name'] . $this->bkup_ext; $dl_file = $this->bkup_dir.$arrData['list_name'] . $this->bkup_ext; // ダウンロード開始 - SC_Response_Ex::headerForDownload($filename); + Response::headerForDownload($filename); header('Content-Length: ' . filesize($dl_file)); readfile($dl_file); - SC_Response_Ex::actionExit(); + Response::actionExit(); break; } @@ -212,7 +208,7 @@ public function action() /** * パラメーター初期化. * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @param array $arrParams $_POST値 * @return void */ @@ -271,7 +267,7 @@ public function lfCheckError(&$arrForm, $mode) */ public function lfCreateBkupData($bkup_name, $work_dir) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $csv_autoinc = ''; $arrData = array(); @@ -309,7 +305,7 @@ public function lfCreateBkupData($bkup_name, $work_dir) } // タイムアウトを防ぐ - SC_Utils_Ex::sfFlush(); + Utils::sfFlush(); } // 自動採番型の構成を取得する @@ -357,7 +353,7 @@ public function cbOutputCSV($data) $this->output_header = false; } fputcsv($this->fpOutput, $data); - SC_Utils_Ex::extendTimeOut(); + Utils::extendTimeOut(); return true; } @@ -372,7 +368,7 @@ public function cbOutputCSV($data) */ public function lfGetAutoIncrement() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrSequences = $objQuery->listSequences(); foreach ($arrSequences as $name) { @@ -380,7 +376,7 @@ public function lfGetAutoIncrement() continue 1; } - // XXX SC_Query::currVal は、PostgreSQL で nextval と等しい値を戻すケースがある。欠番を生じうるが、さして問題無いと推測している。 + // XXX Query::currVal は、PostgreSQL で nextval と等しい値を戻すケースがある。欠番を生じうるが、さして問題無いと推測している。 $seq = $objQuery->currVal($name); // TODO CSV 生成の共通処理を使う @@ -395,7 +391,7 @@ public function lfGetAutoIncrement() // バックアップテーブルにデータを更新する public function lfUpdBkupData($data) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrVal = array(); $arrVal['bkup_name'] = $data['bkup_name']; @@ -410,7 +406,7 @@ public function lfUpdBkupData($data) */ public function lfGetBkupData($sql_option = '', $filter_bkup_name = '') { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // テーブルから取得 $arrVal = array(); @@ -464,7 +460,7 @@ public function lfGetBkupData($sql_option = '', $filter_bkup_name = '') */ public function lfRestore($bkup_name, $bkup_dir, $bkup_ext, $mode) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $bkup_filepath = $bkup_dir . $bkup_name . $bkup_ext; $work_dir = $bkup_dir . $bkup_name . '/'; @@ -502,7 +498,7 @@ public function lfRestore($bkup_name, $bkup_dir, $bkup_ext, $mode) // FIXME この辺りで、バックアップ時と同等の一時ファイルの削除を実行すべきでは? - SC_Utils_Ex::extendTimeOut(); + Utils::extendTimeOut(); return $success; } @@ -510,7 +506,7 @@ public function lfRestore($bkup_name, $bkup_dir, $bkup_ext, $mode) /** * CSVファイルからインサート実行. * - * @param SC_Query $objQuery + * @param Query $objQuery * @param string $dir * @param string $mode * @return boolean @@ -548,7 +544,7 @@ public function lfExeInsertSQL(&$objQuery, $dir, $mode) trigger_error($file_name . ' のファイルオープンに失敗しました。', E_USER_ERROR); } - GC_Utils_Ex::gfPrintLog('リストア実行: ' . $table); + GcUtils::gfPrintLog('リストア実行: ' . $table); $objQuery->delete($table); $line = 0; @@ -573,7 +569,7 @@ public function lfExeInsertSQL(&$objQuery, $dir, $mode) $arrVal = array_combine($arrColName, $arrCsvLine); $objQuery->insert($table, $arrVal); - SC_Utils_Ex::extendTimeOut(); + Utils::extendTimeOut(); } fclose($fp); @@ -585,7 +581,7 @@ public function lfExeInsertSQL(&$objQuery, $dir, $mode) /** * シーケンス生成器を復元する * @param string $csv - * @param SC_Query $objQuery + * @param Query $objQuery */ public function restoreSequence(&$objQuery, $csv) { @@ -609,7 +605,7 @@ public function restoreSequence(&$objQuery, $csv) // 選択したバックアップをDBから削除 public function lfDeleteBackUp(&$arrForm, $bkup_dir, $bkup_ext) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $del_file = $bkup_dir.$arrForm['list_name'] . $bkup_ext; // ファイルの削除 diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Delete.php b/data/Eccube/Page/Admin/System/Delete.php similarity index 70% rename from data/class/pages/admin/system/LC_Page_Admin_System_Delete.php rename to data/Eccube/Page/Admin/System/Delete.php index 95c5b49dbcf..b8362f30c26 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Delete.php +++ b/data/Eccube/Page/Admin/System/Delete.php @@ -1,36 +1,31 @@ initParam($objFormParam, $_GET); // パラメーターの検証 if ($objFormParam->checkError() - || !SC_Utils_ex::sfIsInt($id = $objFormParam->getValue('id'))) { - GC_Utils_Ex::gfPrintLog("error id=$id"); - SC_Utils_Ex::sfDispError(INVALID_MOVE_ERRORR); + || !Utils::sfIsInt($id = $objFormParam->getValue('id'))) { + GcUtils::gfPrintLog("error id=$id"); + Utils::sfDispError(INVALID_MOVE_ERRORR); } $id = $objFormParam->getValue('id'); @@ -81,13 +76,13 @@ public function action() $url = $this->getLocation(ADMIN_SYSTEM_URLPATH) . '?pageno=' . $objFormParam->getValue('pageno'); - SC_Response_Ex::sendRedirect($url); + Response::sendRedirect($url); } /** * パラメーター初期化. * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @param array $arrParams $_GET値 * @return void */ @@ -106,7 +101,7 @@ public function initParam(&$objFormParam, &$arrParams) */ public function deleteMember($id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->begin(); $this->renumberRank($objQuery, $id); @@ -118,7 +113,7 @@ public function deleteMember($id) /** * ランキングの振り直し. * - * @param SC_Query $objQuery + * @param Query $objQuery * @param integer $id 削除対象のmember_id * @return void|UPDATE の結果フラグ */ @@ -138,7 +133,7 @@ public function renumberRank(&$objQuery, $id) /** * レコードの削除(削除フラグをONにする). * - * @param SC_Query $objQuery + * @param Query $objQuery * @param integer $id 削除対象のmember_id * @return void|UPDATE の結果フラグ */ diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php b/data/Eccube/Page/Admin/System/Editdb.php similarity index 83% rename from data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php rename to data/Eccube/Page/Admin/System/Editdb.php index 8455fc48456..e83f5a7ffde 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Editdb.php +++ b/data/Eccube/Page/Admin/System/Editdb.php @@ -1,36 +1,29 @@ initForm($objFormParam, $_POST); @@ -88,7 +81,7 @@ public function action() /** * フォームパラメーター初期化 * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @param array $arrParams $_POST値 * @return void */ @@ -103,11 +96,11 @@ public function initForm(&$objFormParam, &$arrParams) } /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfDoChange(&$objFormParam) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrTarget = $this->lfGetTargetData($objFormParam); $message = ''; if (is_array($arrTarget) && count($arrTarget) == 0) { @@ -134,11 +127,11 @@ public function lfDoChange(&$objFormParam) } /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfGetTargetData(&$objFormParam) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrIndexFlag = $objFormParam->getValue('indexflag'); $arrIndexFlagNew = $objFormParam->getValue('indexflag_new'); $arrTableName = $objFormParam->getValue('table_name'); @@ -153,7 +146,7 @@ public function lfGetTargetData(&$objFormParam) 'indexflag_new' => $arrIndexFlagNew[$i], 'table_name' => $arrTableName[$i], 'column_name' => $arrColumnName[$i]); - $objErr = new SC_CheckError_Ex($param); + $objErr = new CheckError($param); $objErr->doFunc(array('インデックス(' . $i . ')', 'indexflag', INT_LEN), array('NUM_CHECK')); $objErr->doFunc(array('インデックス変更後(' . $i . ')', 'indexflag_new', INT_LEN), array('NUM_CHECK')); $objErr->doFunc(array('インデックス変更後(' . $i . ')', 'indexflag_new', INT_LEN), array('NUM_CHECK')); @@ -185,7 +178,7 @@ public function lfGetTargetData(&$objFormParam) public function lfGetIndexList() { // データベースからインデックス設定一覧を取得する - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('table_name, column_name'); $arrIndexList = $objQuery->select('table_name , column_name , recommend_flg, recommend_comment', 'dtb_index_list'); diff --git a/data/class/pages/admin/system/LC_Page_Admin_System.php b/data/Eccube/Page/Admin/System/Index.php similarity index 78% rename from data/class/pages/admin/system/LC_Page_Admin_System.php rename to data/Eccube/Page/Admin/System/Index.php index 7717776d026..1a2ed4c2a01 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System.php +++ b/data/Eccube/Page/Admin/System/Index.php @@ -1,36 +1,30 @@ tpl_maintitle = 'システム設定'; $this->tpl_subtitle = 'メンバー管理'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrAUTHORITY = $masterData->getMasterData('mtb_authority'); $this->arrWORK = $masterData->getMasterData('mtb_work'); } @@ -84,7 +78,7 @@ public function action() // ページ送りの処理 $_GET['pageno']が信頼しうる値かどうかチェックする。 $pageno = $this->lfCheckPageNo($_GET['pageno']); - $objNavi = new SC_PageNavi_Ex($pageno, $linemax, MEMBER_PMAX, 'eccube.moveMemberPage', NAVI_PMAX); + $objNavi = new PageNavi($pageno, $linemax, MEMBER_PMAX, 'eccube.moveMemberPage', NAVI_PMAX); $this->tpl_strnavi = $objNavi->strnavi; $this->tpl_disppage = $objNavi->now_page; $this->tpl_pagemax = $objNavi->max_page; @@ -104,7 +98,7 @@ public function action() */ public function getMemberCount($where) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_member'; return $objQuery->count($table, $where); @@ -122,7 +116,7 @@ public function getMemberData($startno) $col = 'member_id,name,department,login_id,authority,rank,work'; $from = 'dtb_member'; $where = 'del_flg <> 1 AND member_id <> ?'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('rank DESC'); $objQuery->setLimitOffset(MEMBER_PMAX, $startno); $arrMemberData = $objQuery->select($col, $from, $where, array(ADMIN_ID)); @@ -164,7 +158,7 @@ public function lfCheckPageNo($pageno) $clean_pageno = ''; // $pagenoが0以上の整数かチェック - if (SC_Utils_Ex::sfIsInt($pageno) && $pageno > 0) { + if (Utils::sfIsInt($pageno) && $pageno > 0) { $clean_pageno = $pageno; // 例外は全て1とする } else { diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Input.php b/data/Eccube/Page/Admin/System/Input.php similarity index 87% rename from data/class/pages/admin/system/LC_Page_Admin_System_Input.php rename to data/Eccube/Page/Admin/System/Input.php index c406ae1cdd2..ed07f55fe51 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Input.php +++ b/data/Eccube/Page/Admin/System/Input.php @@ -1,36 +1,31 @@ tpl_mainpage = 'system/input.tpl'; // マスターデータから権限配列を取得 - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrAUTHORITY = $masterData->getMasterData('mtb_authority'); $this->arrWORK = $masterData->getMasterData('mtb_work'); @@ -70,7 +65,7 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // ページ送りの処理 $_REQUEST['pageno']が信頼しうる値かどうかチェックする。 $this->tpl_pageno = $this->lfCheckPageNo($_REQUEST['pageno']); @@ -87,7 +82,7 @@ public function action() $arrErr = $this->validateData($objFormParam, $_POST, $this->getMode()); $this->arrForm = $objFormParam->getHashArray(); - if (SC_Utils_Ex::isBlank($arrErr)) { + if (Utils::isBlank($arrErr)) { $this->insertMemberData($this->arrForm); // 親ウィンドウを更新後、自ウィンドウを閉じる。 $url = ADMIN_SYSTEM_URLPATH . '?pageno=' . $this->arrForm['pageno']; @@ -114,7 +109,7 @@ public function action() $arrErr = $this->validateData($objFormParam, $_POST, $this->getMode()); $this->arrForm = $objFormParam->getHashArray(); - if (SC_Utils_Ex::isBlank($arrErr)) { + if (Utils::isBlank($arrErr)) { $this->updateMemberData($this->arrForm['member_id'], $this->arrForm); // 親ウィンドウを更新後、自ウィンドウを閉じる。 $url = ADMIN_SYSTEM_URLPATH . '?pageno=' . $this->arrForm['pageno']; @@ -141,7 +136,7 @@ public function action() $clean_mode_flg = 'new'; // idが0より大きい数字で整数の場合 - if (isset($_GET['id']) && SC_Utils_Ex::sfIsInt($_GET['id']) && $_GET['id'] > 0) { + if (isset($_GET['id']) && Utils::sfIsInt($_GET['id']) && $_GET['id'] > 0) { if ($this->memberDataExists('member_id = ? AND del_flg = 0', $_GET['id'])) { $clean_id = $_GET['id']; $clean_mode_flg = 'edit'; @@ -173,7 +168,7 @@ public function action() /** * フォームパラメーター初期化 * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @param array $arrParams $_POST値 * @param string $mode editの時は指定 * @return void @@ -205,7 +200,7 @@ public function initForm(&$objFormParam, &$arrParams, $mode = '') * * @param void * @param string|null $mode - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return array エラー情報の連想配列 */ public function validateData(&$objFormParam, &$arrParams, $mode) @@ -214,7 +209,7 @@ public function validateData(&$objFormParam, &$arrParams, $mode) if (isset($arrErr) && count($arrErr) > 0) return $arrErr; // ログインID・パスワードの文字数チェック - $objErr = new SC_CheckError_Ex(); + $objErr = new CheckError(); if ($mode == 'new') { $objErr->doFunc(array('パスワード', 'password', ID_MIN_LEN, ID_MAX_LEN), array('NUM_RANGE_CHECK')); $objErr->doFunc(array('ログインID', 'login_id', ID_MIN_LEN, ID_MAX_LEN), array('NUM_RANGE_CHECK')); @@ -263,7 +258,7 @@ public function getMemberData($id) $columns = 'name,department,login_id,authority, work'; $where = 'member_id = ?'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); return $objQuery->getRow($columns, $table, $where, array($id)); } @@ -277,7 +272,7 @@ public function getMemberData($id) */ public function memberDataExists($where, $val) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_member'; @@ -298,7 +293,7 @@ public function lfCheckPageNo($pageno) $clean_pageno = ''; // $pagenoが0以上の整数かチェック - if (SC_Utils_Ex::sfIsInt($pageno) && $pageno > 0) { + if (Utils::sfIsInt($pageno) && $pageno > 0) { $clean_pageno = $pageno; // 例外は全て1とする } else { @@ -316,15 +311,15 @@ public function lfCheckPageNo($pageno) */ public function insertMemberData($arrMemberData) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // INSERTする値を作成する. - $salt = SC_Utils_Ex::sfGetRandomString(10); + $salt = Utils::sfGetRandomString(10); $sqlVal = array(); $sqlVal['name'] = $arrMemberData['name']; $sqlVal['department'] = $arrMemberData['department']; $sqlVal['login_id'] = $arrMemberData['login_id']; - $sqlVal['password'] = SC_Utils_Ex::sfGetHashString($arrMemberData['password'], $salt); + $sqlVal['password'] = Utils::sfGetHashString($arrMemberData['password'], $salt); $sqlVal['salt'] = $salt; $sqlVal['authority'] = $arrMemberData['authority']; $sqlVal['rank'] = $objQuery->max('rank', 'dtb_member') + 1; @@ -347,7 +342,7 @@ public function insertMemberData($arrMemberData) */ public function updateMemberData($member_id, $arrMemberData) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // Updateする値を作成する. $sqlVal = array(); @@ -358,9 +353,9 @@ public function updateMemberData($member_id, $arrMemberData) $sqlVal['work'] = $arrMemberData['work']; $sqlVal['update_date'] = 'CURRENT_TIMESTAMP'; if ($arrMemberData['password'] != DEFAULT_PASSWORD) { - $salt = SC_Utils_Ex::sfGetRandomString(10); + $salt = Utils::sfGetRandomString(10); $sqlVal['salt'] = $salt; - $sqlVal['password'] = SC_Utils_Ex::sfGetHashString($arrMemberData['password'], $salt); + $sqlVal['password'] = Utils::sfGetHashString($arrMemberData['password'], $salt); } $where = 'member_id = ?'; diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Log.php b/data/Eccube/Page/Admin/System/Log.php similarity index 83% rename from data/class/pages/admin/system/LC_Page_Admin_System_Log.php rename to data/Eccube/Page/Admin/System/Log.php index 495c0536d38..10ab5d62244 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Log.php +++ b/data/Eccube/Page/Admin/System/Log.php @@ -1,36 +1,27 @@ lfInitParam($objFormParam); @@ -92,7 +83,7 @@ public function action() /** * パラメーターの初期化. * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return void */ public function lfInitParam(&$objFormParam) diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Masterdata.php b/data/Eccube/Page/Admin/System/Masterdata.php similarity index 81% rename from data/class/pages/admin/system/LC_Page_Admin_System_Masterdata.php rename to data/Eccube/Page/Admin/System/Masterdata.php index 52ee4b4968c..34c86e5db9c 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Masterdata.php +++ b/data/Eccube/Page/Admin/System/Masterdata.php @@ -1,36 +1,30 @@ arrMasterDataName = $this->getMasterDataNames(array('mtb_pref', 'mtb_zip', 'mtb_constants')); - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); switch ($this->getMode()) { case 'edit': @@ -110,7 +104,7 @@ public function checkMasterDataName(&$arrParams, &$arrMasterDataName) return $master_data_name; } else { - SC_Utils_Ex::sfDispError(''); + Utils::sfDispError(''); } } @@ -124,7 +118,7 @@ public function checkMasterDataName(&$arrParams, &$arrMasterDataName) */ public function getMasterDataNames($ignores = array()) { - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); $arrMasterDataName = $dbFactory->findTableNames('mtb_'); $i = 0; @@ -169,7 +163,7 @@ public function checkUniqueID(&$arrParams) * * @access private{ * @param array $arrParams $_POST値 - * @param SC_DB_MasterData_Ex $masterData SC_DB_MasterData_Ex() + * @param MasterData $masterData MasterData() * @param string $master_data_name 登録対象のマスターデータのテーブル名 * @return void */ @@ -184,7 +178,7 @@ public function registMasterData($arrParams, &$masterData, $master_data_name) } // マスターデータを更新 - $masterData->objQuery =& SC_Query_Ex::getSingletonInstance(); + $masterData->objQuery = Query::getSingletonInstance(); $masterData->objQuery->begin(); $masterData->deleteMasterData($master_data_name, false); // TODO カラム名はメタデータから取得した方が良い diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Parameter.php b/data/Eccube/Page/Admin/System/Parameter.php similarity index 73% rename from data/class/pages/admin/system/LC_Page_Admin_System_Parameter.php rename to data/Eccube/Page/Admin/System/Parameter.php index 18b54d80e1d..aac815f88d4 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Parameter.php +++ b/data/Eccube/Page/Admin/System/Parameter.php @@ -1,36 +1,29 @@ arrKeys = $this->getParamKeys($masterData); @@ -91,7 +84,7 @@ public function action() $this->update($this->arrKeys, $this->arrForm); $this->tpl_onload = "window.alert('パラメーターの設定が完了しました。');"; } else { - $this->arrValues = SC_Utils_Ex::getHash2Array($this->arrForm, $this->arrKeys); + $this->arrValues = Utils::getHash2Array($this->arrForm, $this->arrKeys); $this->tpl_onload = "window.alert('エラーが発生しました。入力内容をご確認下さい。');"; } break; @@ -100,11 +93,11 @@ public function action() } if (empty($this->arrErr)) { - $this->arrValues = SC_Utils_Ex::getHash2Array($masterData->getDBMasterData('mtb_constants')); + $this->arrValues = Utils::getHash2Array($masterData->getDBMasterData('mtb_constants')); } // コメント, 値の配列を生成 - $this->arrComments = SC_Utils_Ex::getHash2Array($masterData->getDBMasterData('mtb_constants', + $this->arrComments = Utils::getHash2Array($masterData->getDBMasterData('mtb_constants', array('id', 'remarks', 'rank'))); } @@ -119,7 +112,7 @@ public function action() public function update(&$arrKeys, &$arrForm) { $data = array(); - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); foreach ($arrKeys as $key) { $data[$key] = $arrForm[$key]; } @@ -140,7 +133,7 @@ public function update(&$arrKeys, &$arrForm) */ public function errorCheck(&$arrKeys, &$arrForm) { - $objErr = new SC_CheckError_Ex($arrForm); + $objErr = new CheckError($arrForm); for ($i = 0; $i < count($arrKeys); $i++) { $objErr->doFunc(array($arrKeys[$i], $arrForm[$arrKeys[$i]]), @@ -154,7 +147,7 @@ public function errorCheck(&$arrKeys, &$arrForm) * パラメーターのキーを配列で返す. * * @access private - * @param SC_DB_MasterData_Ex $masterData + * @param MasterData $masterData * @return array パラメーターのキーの配列 */ public function getParamKeys(&$masterData) diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_Rank.php b/data/Eccube/Page/Admin/System/Rank.php similarity index 77% rename from data/class/pages/admin/system/LC_Page_Admin_System_Rank.php rename to data/Eccube/Page/Admin/System/Rank.php index 1d03c083089..a8db1a20071 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_Rank.php +++ b/data/Eccube/Page/Admin/System/Rank.php @@ -1,36 +1,30 @@ getOne('SELECT rank FROM dtb_member WHERE member_id = ?', array($id)); @@ -133,7 +127,7 @@ public function lfRunkUp($id) // ランキングを下げる。 public function lfRunkDown($id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); // 自身のランクを取得する。 $rank = $objQuery->getOne('SELECT rank FROM dtb_member WHERE member_id = ?', array($id)); diff --git a/data/class/pages/admin/system/LC_Page_Admin_System_System.php b/data/Eccube/Page/Admin/System/System.php similarity index 72% rename from data/class/pages/admin/system/LC_Page_Admin_System_System.php rename to data/Eccube/Page/Admin/System/System.php index c9193cbc579..64ca277ed0c 100644 --- a/data/class/pages/admin/system/LC_Page_Admin_System_System.php +++ b/data/Eccube/Page/Admin/System/System.php @@ -1,36 +1,29 @@ initForm($objFormParam, $_GET); switch ($this->getMode()) { // PHP INFOを表示 case 'info': phpinfo(); - SC_Response_Ex::actionExit(); + Response::actionExit(); break; default: @@ -85,7 +78,7 @@ public function action() /** * フォームパラメーター初期化. * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @param array $arrParams $_GET値 * @return void */ @@ -102,7 +95,7 @@ public function initForm(&$objFormParam, &$arrParams) */ public function getSystemInfo() { - $objDB = SC_DB_DBFactory_Ex::getInstance(); + $objDB = DBFactory::getInstance(); $arrSystemInfo = array( array('title' => 'EC-CUBE', 'value' => ECCUBE_VERSION), diff --git a/data/class/pages/admin/total/LC_Page_Admin_Total.php b/data/Eccube/Page/Admin/Total/Index.php similarity index 92% rename from data/class/pages/admin/total/LC_Page_Admin_Total.php rename to data/Eccube/Page/Admin/Total/Index.php index 66cf51dc9d3..b415dbadd87 100644 --- a/data/class/pages/admin/total/LC_Page_Admin_Total.php +++ b/data/Eccube/Page/Admin/Total/Index.php @@ -1,35 +1,37 @@ tpl_maintitle = '売上集計'; $this->tpl_mainno = 'total'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrWDAY = $masterData->getMasterData('mtb_wday'); $this->arrSex = $masterData->getMasterData('mtb_sex'); $this->arrJob = $masterData->getMasterData('mtb_job'); // 登録・更新日検索用 - $objDate = new SC_Date_Ex(); + $objDate = new Date(); $objDate->setStartYear(RELEASE_YEAR); $objDate->setEndYear(DATE('Y')); $this->arrYear = $objDate->getYear(); @@ -107,7 +109,7 @@ public function action() } // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); $objFormParam->setParam($_REQUEST); @@ -137,14 +139,14 @@ public function action() if ($this->getMode() == 'csv') { // CSV出力タイトル行の取得 list($arrTitleCol, $arrDataCol) = $this->lfGetCSVColum($page); - $head = SC_Utils_Ex::sfGetCSVList($arrTitleCol); + $head = Utils::sfGetCSVList($arrTitleCol); $data = $this->lfGetDataColCSV($this->arrResults, $arrDataCol); // CSVを送信する。 - list($fime_name, $data) = SC_Utils_Ex::sfGetCSVData($head.$data); + list($fime_name, $data) = Utils::sfGetCSVData($head.$data); $this->sendResponseCSV($fime_name, $data); - SC_Response_Ex::actionExit(); + Response::actionExit(); } } break; @@ -191,7 +193,7 @@ public function lfGetDateDefault() /* パラメーター情報の初期化 */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -219,12 +221,12 @@ public function lfInitParam(&$objFormParam) /* 入力内容のチェック */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfCheckError(&$objFormParam) { $objFormParam->convParam(); - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->arrErr = $objFormParam->checkError(); // 特殊項目チェック @@ -274,7 +276,7 @@ public function lfGetDateInit() /* フォームで入力された日付を適切な形にする */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfSetStartEndDate(&$objFormParam) { @@ -282,7 +284,7 @@ public function lfSetStartEndDate(&$objFormParam) // 月度集計 if ($arrRet['search_form'] == 1) { - list($sdate, $edate) = SC_Utils_Ex::sfTermMonth($arrRet['search_startyear_m'], + list($sdate, $edate) = Utils::sfTermMonth($arrRet['search_startyear_m'], $arrRet['search_startmonth_m'], CLOSE_DAY); // 期間集計 @@ -310,7 +312,7 @@ public function lfGetGraphLine($arrResults, $keyname, $type, $xtitle, $ytitle, $ // 結果が0行以上ある場合のみグラフを生成する。 if (count($arrResults) > 0 && $this->install_GD) { // グラフの生成 - $arrList = SC_Utils_Ex::sfArrKeyValue($arrResults, $keyname, 'total'); + $arrList = Utils::sfArrKeyValue($arrResults, $keyname, 'total'); // 一時ファイル名の取得 $pngname = $this->lfGetGraphPng($type); @@ -322,7 +324,7 @@ public function lfGetGraphLine($arrResults, $keyname, $type, $xtitle, $ytitle, $ if ($interval < 1) { $interval = 1; } - $objGraphLine = new SC_Graph_Line(); + $objGraphLine = new LineGraph(); // 値のセット $objGraphLine->setData($arrList); @@ -350,7 +352,7 @@ public function lfGetGraphLine($arrResults, $keyname, $type, $xtitle, $ytitle, $ // グラフの出力 if (DRAW_IMAGE) { $objGraphLine->outputGraph(); - SC_Response_Ex::actionExit(); + Response::actionExit(); } // ファイルパスを返す @@ -372,7 +374,7 @@ public function lfGetGraphPie($arrResults, $keyname, $type, $title = '', $sdate // 結果が0行以上ある場合のみグラフを生成する。 if (count($arrResults) > 0 && $this->install_GD) { // グラフの生成 - $arrList = SC_Utils_Ex::sfArrKeyValue($arrResults, $keyname, + $arrList = Utils::sfArrKeyValue($arrResults, $keyname, 'total', GRAPH_PIE_MAX, GRAPH_LABEL_MAX); @@ -380,7 +382,7 @@ public function lfGetGraphPie($arrResults, $keyname, $type, $title = '', $sdate $pngname = $this->lfGetGraphPng($type); $path = GRAPH_REALDIR . $pngname; - $objGraphPie = new SC_Graph_Pie(); + $objGraphPie = new PieGraph(); // データをセットする $objGraphPie->setData($arrList); @@ -400,7 +402,7 @@ public function lfGetGraphPie($arrResults, $keyname, $type, $title = '', $sdate // グラフの出力 if (DRAW_IMAGE) { $objGraphPie->outputGraph(); - SC_Response_Ex::actionExit(); + Response::actionExit(); } // ファイルパスを返す @@ -425,13 +427,13 @@ public function lfGetGraphBar($arrResults, $keyname, $type, $xtitle, $ytitle, $s // 結果が0行以上ある場合のみグラフを生成する。 if (count($arrResults) > 0 && $this->install_GD) { // グラフの生成 - $arrList = SC_Utils_Ex::sfArrKeyValue($arrResults, $keyname, 'total', GRAPH_PIE_MAX, GRAPH_LABEL_MAX); + $arrList = Utils::sfArrKeyValue($arrResults, $keyname, 'total', GRAPH_PIE_MAX, GRAPH_LABEL_MAX); // 一時ファイル名の取得 $pngname = $this->lfGetGraphPng($type); $path = GRAPH_REALDIR . $pngname; - $objGraphBar = new SC_Graph_Bar(); + $objGraphBar = new BarGraph(); foreach ($arrList as $key => $value) { $arrKey[] = preg_replace('/~/u', '-', $key); @@ -455,7 +457,7 @@ public function lfGetGraphBar($arrResults, $keyname, $type, $xtitle, $ytitle, $s if (DRAW_IMAGE) { $objGraphBar->outputGraph(); - SC_Response_Ex::actionExit(); + Response::actionExit(); } // ファイルパスを返す @@ -532,7 +534,7 @@ public function lfGetWhereMember($col_date, $sdate, $edate, $type, $col_member = /** 会員別集計 **/ public function lfGetOrderMember($type, $sdate, $edate) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); list($where, $arrWhereVal) = $this->lfGetWhereMember('create_date', $sdate, $edate, $type); $where .= ' AND del_flg = 0 AND status <> ?'; @@ -574,7 +576,7 @@ public function lfGetOrderMember($type, $sdate, $edate) /** 商品別集計 **/ public function lfGetOrderProducts($type, $sdate, $edate) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); list($where, $arrWhereVal) = $this->lfGetWhereMember('create_date', $sdate, $edate, $type); @@ -606,7 +608,7 @@ public function lfGetOrderProducts($type, $sdate, $edate) /** 職業別集計 **/ public function lfGetOrderJob($type, $sdate, $edate) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); list($where, $arrWhereVal) = $this->lfGetWhereMember('dtb_order.create_date', $sdate, $edate, $type); $col = <<< __EOS__ @@ -643,11 +645,11 @@ public function lfGetOrderJob($type, $sdate, $edate) /** 年代別集計 **/ public function lfGetOrderAge($type, $sdate, $edate) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); list($where, $arrWhereVal) = $this->lfGetWhereMember('create_date', $sdate, $edate, $type); - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); $col = $dbFactory->getOrderTotalAgeColSql() . ' AS age'; $col .= ',COUNT(order_id) AS order_count'; $col .= ',SUM(total) AS total'; @@ -681,7 +683,7 @@ public function lfGetOrderAge($type, $sdate, $edate) // todo あいだの日付埋める public function lfGetOrderTerm($type, $sdate, $edate) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); list($where, $arrWhereVal) = $this->lfGetWhereMember('create_date', $sdate, $edate); $where .= ' AND del_flg = 0 AND status <> ?'; @@ -716,7 +718,7 @@ public function lfGetOrderTerm($type, $sdate, $edate) break; } - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); // todo postgres $col = $dbFactory->getOrderTotalDaysWhereSql($type); @@ -837,7 +839,7 @@ public function lfGetDataColCSV($arrData, $arrDataCol) if (($i === $max -1) && isset($arrRet[$i]['str_date'])) { $arrRet[$i]['str_date'] = '合計'; } - $csv_data.= SC_Utils_Ex::sfGetCSVList($arrRet[$i]); + $csv_data.= Utils::sfGetCSVList($arrRet[$i]); } return $csv_data; diff --git a/data/Eccube/Page/Api/Index.php b/data/Eccube/Page/Api/Index.php new file mode 100644 index 00000000000..1e1ff991fbc --- /dev/null +++ b/data/Eccube/Page/Api/Index.php @@ -0,0 +1,61 @@ +action(); +// $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + $arrParam = $_REQUEST; + + list($response_outer, $arrResponse) = Operation::doApiAction($arrParam); + Operation::sendApiResponse('xml', $response_outer, $arrResponse); + Response::actionExit(); + } +} diff --git a/data/Eccube/Page/Api/Json.php b/data/Eccube/Page/Api/Json.php new file mode 100644 index 00000000000..2b610c2cf91 --- /dev/null +++ b/data/Eccube/Page/Api/Json.php @@ -0,0 +1,66 @@ +action(); +// $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + $arrParam = $_REQUEST; + + list($response_outer, $arrResponse) = Operation::doApiAction($arrParam); + + if (isset($arrParam["callback"])) { + $arrResponse["callback"] = $arrParam["callback"]; + } + + Operation::sendApiResponse('json', $response_outer, $arrResponse); + Response::actionExit(); + } +} diff --git a/data/Eccube/Page/Api/Php.php b/data/Eccube/Page/Api/Php.php new file mode 100644 index 00000000000..e4e21842af9 --- /dev/null +++ b/data/Eccube/Page/Api/Php.php @@ -0,0 +1,61 @@ +action(); +// $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + $arrParam = $_REQUEST; + + list($response_outer, $arrResponse) = Operation::doApiAction($arrParam); + Operation::sendApiResponse('php', $response_outer, $arrResponse); + Response::actionExit(); + } +} diff --git a/data/Eccube/Page/Api/Xml.php b/data/Eccube/Page/Api/Xml.php new file mode 100644 index 00000000000..cf877d17b54 --- /dev/null +++ b/data/Eccube/Page/Api/Xml.php @@ -0,0 +1,61 @@ +action(); +// $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + $arrParam = $_REQUEST; + + list($response_outer, $arrResponse) = Operation::doApiAction($arrParam); + Operation::sendApiResponse('xml', $response_outer, $arrResponse); + Response::actionExit(); + } +} diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc.php b/data/Eccube/Page/Bloc/AbstractBloc.php similarity index 53% rename from data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc.php rename to data/Eccube/Page/Bloc/AbstractBloc.php index 3ec61883888..58ceb092545 100644 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc.php +++ b/data/Eccube/Page/Bloc/AbstractBloc.php @@ -1,37 +1,36 @@ tpl_authority = $_SESSION['authority']; // ディスプレイクラス生成 - $this->objDisplay = new SC_Display_Ex(); + $this->objDisplay = new Display(); $this->setTplMainpage($this->blocItems['tpl_path']); @@ -53,7 +52,7 @@ public function init() $this->setTokenTo(); // ローカルフックポイントを実行. - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); $this->doLocalHookpointBefore($objPlugin); } @@ -65,10 +64,10 @@ public function init() */ public function setTplMainpage($bloc_file) { - if (SC_Utils_Ex::isAbsoluteRealPath($bloc_file)) { + if (Utils::isAbsoluteRealPath($bloc_file)) { $this->tpl_mainpage = $bloc_file; } else { - $this->tpl_mainpage = SC_Helper_PageLayout_Ex::getTemplatePath($this->objDisplay->detectDevice()) . BLOC_DIR . $bloc_file; + $this->tpl_mainpage = PageLayoutHelper::getTemplatePath($this->objDisplay->detectDevice()) . BLOC_DIR . $bloc_file; } $this->setTemplate($this->tpl_mainpage); diff --git a/data/Eccube/Page/Bloc/Calendar.php b/data/Eccube/Page/Bloc/Calendar.php new file mode 100644 index 00000000000..ed4ba8ef746 --- /dev/null +++ b/data/Eccube/Page/Bloc/Calendar.php @@ -0,0 +1,94 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + // カレンダーデータ取得 + $this->arrCalendar = $this->lfGetCalendar(2); + } + + /** + * カレンダー情報取得. + * + * @param integer $disp_month 表示する月数 + * @return array カレンダー情報の配列を返す + */ + public function lfGetCalendar($disp_month = 1) + { + $objDate = new Date(); + $arrCalendar = array(); + $today = date('Y/m/d'); + + for ($j = 0; $j <= $disp_month - 1; $j++) { + $time = mktime(0, 0, 0, date('n') + $j, 1); + $year = date('Y', $time); + $month = date('n', $time); + + $objMonth = new \Calendar_Month_Weekdays($year, $month, 0); + $objMonth->build(); + $i = 0; + while ($objDay = $objMonth->fetch()) { + $arrCalendar[$j][$i]['in_month'] = $month == $objDay->month; + $arrCalendar[$j][$i]['first'] = $objDay->first; + $arrCalendar[$j][$i]['last'] = $objDay->last; + $arrCalendar[$j][$i]['empty'] = $objDay->empty; + $arrCalendar[$j][$i]['year'] = $year; + $arrCalendar[$j][$i]['month'] = $month; + $arrCalendar[$j][$i]['day'] = $objDay->day; + $arrCalendar[$j][$i]['holiday'] = $objDate->isHoliday($year, $month, $objDay->day); + $arrCalendar[$j][$i]['today'] = $today === sprintf('%04d/%02d/%02d', $year, $month, $objDay->day); + + $i++; + } + } + + return $arrCalendar; + } +} diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Cart.php b/data/Eccube/Page/Bloc/Cart.php similarity index 64% rename from data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Cart.php rename to data/Eccube/Page/Bloc/Cart.php index b164e2d55d0..02f9d0e431d 100644 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Cart.php +++ b/data/Eccube/Page/Bloc/Cart.php @@ -1,36 +1,28 @@ arrProductType = $masterData->getMasterData('mtb_product_type'); //商品種類を取得 } @@ -62,7 +54,7 @@ public function process() */ public function action() { - $objCart = new SC_CartSession_Ex(); + $objCart = new CartSession(); $this->isMultiple = $objCart->isMultiple(); $this->hasDownload = $objCart->hasProductType(PRODUCT_TYPE_DOWNLOAD); // 旧仕様との互換のため、不自然なセットとなっている @@ -72,10 +64,10 @@ public function action() /** * カートの情報を取得する * - * @param SC_CartSession $objCart カートセッション管理クラス + * @param Eccube\CartSession $objCart カートセッション管理クラス * @return array カートデータ配列 */ - public function lfGetCartData(&$objCart) + public function lfGetCartData(CartSession &$objCart) { $arrCartKeys = $objCart->getKeys(); foreach ($arrCartKeys as $cart_key) { @@ -96,7 +88,7 @@ public function lfGetCartData(&$objCart) $arrCartList['TotalQuantity'] = $total_quantity; // 店舗情報の取得 - $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $arrInfo = DbHelper::getBasisData(); $arrCartList['free_rule'] = $arrInfo['free_rule']; // 送料無料までの金額 diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php b/data/Eccube/Page/Bloc/Category.php similarity index 77% rename from data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php rename to data/Eccube/Page/Bloc/Category.php index a673f2646f1..78428d6fc49 100644 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Category.php +++ b/data/Eccube/Page/Bloc/Category.php @@ -1,36 +1,30 @@ arrCat = $this->lfGetMainCat(true); @@ -97,8 +91,8 @@ public function lfGetSelectedCategoryId($arrRequest) $category_id = $arrRequest['category_id']; } // 選択中のカテゴリIDを判定する - $objDb = new SC_Helper_DB_Ex(); - $arrCategoryId = $objDb->sfGetCategoryId($product_id, $category_id); + $objDb = new DbHelper(); + $arrCategoryId = $objDb->getCategoryId($product_id, $category_id); if (empty($arrCategoryId)) { $arrCategoryId = array(0); } @@ -115,7 +109,7 @@ public function lfGetSelectedCategoryId($arrRequest) */ public function lfGetCatTree($arrParentCategoryId, $count_check = false) { - $objCategory = new SC_Helper_Category_Ex($count_check); + $objCategory = new CategoryHelper($count_check); $arrTree = $objCategory->getTree(); $this->arrParentID = array(); @@ -136,7 +130,7 @@ public function lfGetCatTree($arrParentCategoryId, $count_check = false) */ public function lfGetMainCat($count_check = false) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = '*'; $from = 'dtb_category left join dtb_category_total_count ON dtb_category.category_id = dtb_category_total_count.category_id'; // メインカテゴリとその直下のカテゴリを取得する。 @@ -154,7 +148,7 @@ public function lfGetMainCat($count_check = false) continue; } // 子カテゴリを持つかどうかを調べる。 - $arrChildrenID = SC_Utils_Ex::sfGetUnderChildrenArray( + $arrChildrenID = Utils::sfGetUnderChildrenArray( $arrRet, 'parent_category_id', 'category_id', diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Login.php b/data/Eccube/Page/Bloc/Login.php similarity index 65% rename from data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Login.php rename to data/Eccube/Page/Bloc/Login.php index ccd2b59c817..cdc73830151 100644 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Login.php +++ b/data/Eccube/Page/Bloc/Login.php @@ -1,36 +1,29 @@ isLoginSuccess()) { @@ -87,7 +80,7 @@ public function action() $this->tpl_disable_logout = $this->lfCheckDisableLogout(); //スマートフォン版ログアウト処理で不正なページ移動エラーを防ぐ為、トークンをセット - $this->transactionid = SC_Helper_Session_Ex::getToken(); + $this->transactionid = SessionHelper::getToken(); } /** @@ -97,7 +90,7 @@ public function action() */ public function lfCheckDisableLogout() { - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $arrDisableLogout = $masterData->getMasterData('mtb_disable_logout'); $current_page = $_SERVER['SCRIPT_NAME']; diff --git a/data/Eccube/Page/Bloc/LoginFooter.php b/data/Eccube/Page/Bloc/LoginFooter.php new file mode 100644 index 00000000000..a562c677767 --- /dev/null +++ b/data/Eccube/Page/Bloc/LoginFooter.php @@ -0,0 +1,53 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + parent::action(); + } +} diff --git a/data/Eccube/Page/Bloc/LoginHeader.php b/data/Eccube/Page/Bloc/LoginHeader.php new file mode 100644 index 00000000000..ac088efc26c --- /dev/null +++ b/data/Eccube/Page/Bloc/LoginHeader.php @@ -0,0 +1,53 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + parent::action(); + } +} diff --git a/data/Eccube/Page/Bloc/NaviFooter.php b/data/Eccube/Page/Bloc/NaviFooter.php new file mode 100644 index 00000000000..244a949c8e0 --- /dev/null +++ b/data/Eccube/Page/Bloc/NaviFooter.php @@ -0,0 +1,53 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + parent::action(); + } +} diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_NaviHeader.php b/data/Eccube/Page/Bloc/NaviHeader.php similarity index 62% rename from data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_NaviHeader.php rename to data/Eccube/Page/Bloc/NaviHeader.php index 0685ed48b3c..e191ce5d959 100644 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_NaviHeader.php +++ b/data/Eccube/Page/Bloc/NaviHeader.php @@ -1,36 +1,28 @@ arrProductType = $masterData->getMasterData('mtb_product_type'); //商品種類を取得 } @@ -65,9 +57,9 @@ public function action() parent::action(); //ヘッダーナビのカート情報を取得 - $objCart = new SC_CartSession_Ex(); + $objCart = new CartSession(); $cartKeys = $objCart->getKeys(); - $arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $arrInfo = DbHelper::getBasisData(); $this->freeRule = $arrInfo['free_rule']; $this->arrCartList = $this->lfGetCartData($objCart, $arrInfo, $cartKeys); } @@ -75,12 +67,12 @@ public function action() /** * カートの情報を取得する * - * @param SC_CartSession $objCart カートセッション管理クラス + * @param CartSession $objCart カートセッション管理クラス * @param Array $arrInfo 基本情報配列 * @param Array $cartKeys 商品種類配列 * @return array $arrCartList カートデータ配列 */ - public function lfGetCartData($objCart, $arrInfo, $cartKeys) + public function lfGetCartData(CartSession $objCart, $arrInfo, $cartKeys) { $cartList = array(); foreach ($cartKeys as $key) { diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_News.php b/data/Eccube/Page/Bloc/News.php similarity index 68% rename from data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_News.php rename to data/Eccube/Page/Bloc/News.php index 3cc3143d00b..fe965c065d3 100644 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_News.php +++ b/data/Eccube/Page/Bloc/News.php @@ -1,36 +1,30 @@ getMode()) { case 'getList': $this->lfInitNewsParam($objFormParam); @@ -72,10 +66,10 @@ public function action() $arrData = $objFormParam->getHashArray(); $json = $this->lfGetNewsForJson($arrData, $objNews); echo $json; - SC_Response_Ex::actionExit(); + Response::actionExit(); } else { echo $this->lfGetErrors($this->arrErr); - SC_Response_Ex::actionExit(); + Response::actionExit(); } break; case 'getDetail': @@ -87,10 +81,10 @@ public function action() $arrData = $objFormParam->getHashArray(); $json = $this->lfGetNewsDetailForJson($arrData); echo $json; - SC_Response_Ex::actionExit(); + Response::actionExit(); } else { echo $this->lfGetErrors($this->arrErr); - SC_Response_Ex::actionExit(); + Response::actionExit(); } break; default: @@ -104,10 +98,10 @@ public function action() /** * 新着情報パラメーター初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ - public function lfInitNewsParam(&$objFormParam) + public function lfInitNewsParam(FormParam &$objFormParam) { $objFormParam->addParam('現在ページ', 'pageno', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'), '', false); $objFormParam->addParam('表示件数', 'disp_number', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK'), '', false); @@ -119,16 +113,16 @@ public function lfInitNewsParam(&$objFormParam) * * @return array $arrNewsList 新着情報の配列を返す */ - public function lfGetNews($dispNumber, $pageNo, SC_Helper_News_Ex $objNews) + public function lfGetNews($dispNumber, $pageNo, NewsHelper $objNews) { $arrNewsList = $objNews->getList($dispNumber, $pageNo); // モバイルサイトのセッション保持 (#797) - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { foreach ($arrNewsList as $key => $value) { $arrRow =& $arrNewsList[$key]; - if (SC_Utils_Ex::isAppInnerUrl($arrRow['news_url'])) { - $netUrl = new Net_URL($arrRow['news_url']); + if (Utils::isAppInnerUrl($arrRow['news_url'])) { + $netUrl = new \Net_URL($arrRow['news_url']); $netUrl->addQueryString(session_name(), session_id()); $arrRow['news_url'] = $netUrl->getURL(); } @@ -143,10 +137,10 @@ public function lfGetNews($dispNumber, $pageNo, SC_Helper_News_Ex $objNews) * (ページと表示件数を指定) * * @param array $arrData フォーム入力値 - * @param SC_Helper_News_Ex $objNews + * @param NewsHelper $objNews * @return String $json 新着情報のJSONを返す */ - public function lfGetNewsForJson($arrData, SC_Helper_News_Ex $objNews) + public function lfGetNewsForJson($arrData, NewsHelper $objNews) { $dispNumber = $arrData['disp_number']; $pageNo = $arrData['pageno']; @@ -156,7 +150,7 @@ public function lfGetNewsForJson($arrData, SC_Helper_News_Ex $objNews) $newsCount = $objNews->getCount(); $arrNewsList['news_page_count'] = ceil($newsCount / 3); - $json = SC_Utils_Ex::jsonEncode($arrNewsList); //JSON形式 + $json = Utils::jsonEncode($arrNewsList); //JSON形式 return $json; } @@ -170,8 +164,8 @@ public function lfGetNewsForJson($arrData, SC_Helper_News_Ex $objNews) */ public function lfGetNewsDetailForJson($arrData) { - $arrNewsList = SC_Helper_News_Ex::getNews($arrData['news_id']); - $json = SC_Utils_Ex::jsonEncode($arrNewsList); //JSON形式 + $arrNewsList = NewsHelper::getNews($arrData['news_id']); + $json = Utils::jsonEncode($arrNewsList); //JSON形式 return $json; } @@ -189,6 +183,6 @@ public function lfGetErrors($arrErr) $messages .= $val . "\n"; } - return SC_Utils_Ex::jsonEncode(array('error' => $messages)); + return Utils::jsonEncode(array('error' => $messages)); } } diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend.php b/data/Eccube/Page/Bloc/Recommend.php similarity index 61% rename from data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend.php rename to data/Eccube/Page/Bloc/Recommend.php index 7fbcaa5d493..eda0613b167 100644 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend.php +++ b/data/Eccube/Page/Bloc/Recommend.php @@ -1,36 +1,29 @@ arrInfo = $objSiteInfo->data; //おすすめ商品表示 - $this->arrBestProducts = $this->lfGetRanking(); + $this->arrBestProductsHelper = $this->lfGetRanking(); } /** * おすすめ商品検索. * - * @return array $arrBestProducts 検索結果配列 + * @return array $arrBestProductsHelper 検索結果配列 */ public function lfGetRanking() { - $objRecommend = new SC_Helper_BestProducts_Ex(); + $objRecommend = new BestProductsHelper(); // おすすめ商品取得 $arrRecommends = $objRecommend->getList(RECOMMEND_NUM); @@ -83,8 +76,8 @@ public function lfGetRanking() $response = array(); if (count($arrRecommends) > 0) { // 商品一覧を取得 - $objQuery =& SC_Query_Ex::getSingletonInstance(); - $objProduct = new SC_Product_Ex(); + $objQuery = Query::getSingletonInstance(); + $objProduct = new Product(); // where条件生成&セット $arrProductId = array(); foreach ($arrRecommends as $key => $val) { @@ -93,7 +86,7 @@ public function lfGetRanking() $arrProducts = $objProduct->getListByProductIds($objQuery, $arrProductId); // 税込金額を設定する - SC_Product_Ex::setIncTaxToProducts($arrProducts); + Product::setIncTaxToProducts($arrProducts); // おすすめ商品情報にマージ foreach ($arrRecommends as $key => $value) { diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_SearchProducts.php b/data/Eccube/Page/Bloc/SearchProducts.php similarity index 72% rename from data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_SearchProducts.php rename to data/Eccube/Page/Bloc/SearchProducts.php index bde452ba72b..d55626e9e44 100644 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_SearchProducts.php +++ b/data/Eccube/Page/Bloc/SearchProducts.php @@ -1,36 +1,27 @@ sfGetCategoryId($product_id, $category_id); + $objDb = new DbHelper(); + $arrCategoryId = $objDb->getCategoryId($product_id, $category_id); return $arrCategoryId; } @@ -147,8 +138,8 @@ public function lfGetSelectedCategoryId($product_id, $category_id) public function lfGetSelectedMakerId($product_id, $maker_id) { // 選択中のメーカーIDを判定する - $objDb = new SC_Helper_DB_Ex(); - $arrMakerId = $objDb->sfGetMakerId($product_id, $maker_id); + $objDb = new DbHelper(); + $arrMakerId = $objDb->getMakerId($product_id, $maker_id); return $arrMakerId; } @@ -160,13 +151,13 @@ public function lfGetSelectedMakerId($product_id, $maker_id) */ public function lfGetCategoryList() { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // カテゴリ検索用選択リスト - $arrCategoryList = $objDb->sfGetCategoryList('', true, ' '); + $arrCategoryList = $objDb->getCategoryList('', true, ' '); if (is_array($arrCategoryList)) { // 文字サイズを制限する foreach ($arrCategoryList as $key => $val) { - $truncate_str = SC_Utils_Ex::sfCutString($val, SEARCH_CATEGORY_LEN, false); + $truncate_str = Utils::sfCutString($val, SEARCH_CATEGORY_LEN, false); $arrCategoryList[$key] = preg_replace('/ /u', '  ', $truncate_str); } } @@ -181,13 +172,13 @@ public function lfGetCategoryList() */ public function lfGetMakerList() { - $objDb = new SC_Helper_DB_Ex(); + $objDb = new DbHelper(); // メーカー検索用選択リスト - $arrMakerList = $objDb->sfGetMakerList('', true); + $arrMakerList = $objDb->getMakerList('', true); if (is_array($arrMakerList)) { // 文字サイズを制限する foreach ($arrMakerList as $key => $val) { - $arrMakerList[$key] = SC_Utils_Ex::sfCutString($val, SEARCH_CATEGORY_LEN, false); + $arrMakerList[$key] = Utils::sfCutString($val, SEARCH_CATEGORY_LEN, false); } } diff --git a/data/class/pages/cart/LC_Page_Cart.php b/data/Eccube/Page/Cart/Index.php similarity index 79% rename from data/class/pages/cart/LC_Page_Cart.php rename to data/Eccube/Page/Cart/Index.php index 854ee8aa41c..f2be1aa7097 100644 --- a/data/class/pages/cart/LC_Page_Cart.php +++ b/data/Eccube/Page/Cart/Index.php @@ -1,37 +1,39 @@ tpl_title = '現在のカゴの中'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrProductType = $masterData->getMasterData('mtb_product_type'); } @@ -74,18 +76,18 @@ public function process() public function action() { //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - $objCartSess = new SC_CartSession_Ex(); - $objSiteSess = new SC_SiteSession_Ex(); - $objCustomer = new SC_Customer_Ex(); + $objCartSess = new CartSession(); + $objSiteSess = new SiteSession(); + $objCustomer = new Customer(); $objFormParam = $this->lfInitParam($_POST); $this->mode = $this->getMode(); // モバイル対応 - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { if (isset($_GET['cart_no'])) { $objFormParam->setValue('cart_no', $_GET['cart_no']); } @@ -108,8 +110,8 @@ public function action() // エラーチェック $arrError = $objFormParam->checkError(); if (isset($arrError) && !empty($arrError)) { - SC_Utils_Ex::sfDispSiteError(CART_NOT_FOUND); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(CART_NOT_FOUND); + Response::actionExit(); } $objFormParam4OpenCategoryTree = @@ -136,38 +138,38 @@ public function action() $this->lfSetCurrentCart($objSiteSess, $objCartSess, $cartKey); // 購入ページへ - SC_Response_Ex::sendRedirect(SHOPPING_URL); - SC_Response_Ex::actionExit(); + Response::sendRedirect(SHOPPING_URL); + Response::actionExit(); } break; case 'up'://1個追加 $objCartSess->upQuantity($cart_no, $cartKey); - SC_Response_Ex::reload($arrQueryString, true); - SC_Response_Ex::actionExit(); + Response::reload($arrQueryString, true); + Response::actionExit(); break; case 'down'://1個減らす $objCartSess->downQuantity($cart_no, $cartKey); - SC_Response_Ex::reload($arrQueryString, true); - SC_Response_Ex::actionExit(); + Response::reload($arrQueryString, true); + Response::actionExit(); break; case 'setQuantity'://数量変更 $objCartSess->setQuantity($objFormParam->getValue('quantity'), $cart_no, $cartKey); - SC_Response_Ex::reload($arrQueryString, true); - SC_Response_Ex::actionExit(); + Response::reload($arrQueryString, true); + Response::actionExit(); break; case 'delete'://カートから削除 $objCartSess->delProduct($cart_no, $cartKey); - SC_Response_Ex::reload($arrQueryString, true); - SC_Response_Ex::actionExit(); + Response::reload($arrQueryString, true); + Response::actionExit(); break; default: break; } - $this->arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $this->arrInfo = DbHelper::getBasisData(); $totalIncTax = 0; foreach ($this->cartKeys as $key) { // カート集計処理 @@ -203,7 +205,7 @@ public function action() } // 前頁のURLを取得 - // TODO: SC_CartSession::setPrevURL()利用不可。 + // TODO: CartSession::setPrevURL()利用不可。 $this->lfGetCartPrevUrl($_SESSION, $_SERVER['HTTP_REFERER']); $this->tpl_prev_url = (isset($_SESSION['cart_prev_url'])) ? $_SESSION['cart_prev_url'] : ''; @@ -214,11 +216,11 @@ public function action() /** * ユーザ入力値の処理 * - * @return SC_FormParam_Ex + * @return FormParam */ public function lfInitParam($arrRequest) { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $objFormParam->addParam('カートキー', 'cartKey', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); $objFormParam->addParam('カートナンバー', 'cart_no', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); // スマートフォン版での数量変更用 @@ -234,11 +236,11 @@ public function lfInitParam($arrRequest) /** * PC版での開いているカテゴリーツリーの維持用の入力値 * - * @return SC_FormParam_Ex + * @return FormParam */ public function lfInitParam4OpenCategoryTree($arrRequest) { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $objFormParam->addParam('カテゴリID', 'category_id', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); @@ -262,7 +264,7 @@ public function lfUpdateOrderTempid($pre_uniqid, $uniqid) { $sqlval['order_temp_id'] = $uniqid; $where = 'order_temp_id = ?'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $res = $objQuery->update('dtb_order_temp', $sqlval, $where, array($pre_uniqid)); if ($res != 1) { return false; @@ -291,7 +293,7 @@ public function lfGetCartPrevUrl(&$session, $referer) } } // 妥当性チェック - if (!SC_Utils_Ex::sfIsInternalDomain($session['cart_prev_url'])) { + if (!Utils::sfIsInternalDomain($session['cart_prev_url'])) { $session['cart_prev_url'] = ''; } } @@ -299,8 +301,8 @@ public function lfGetCartPrevUrl(&$session, $referer) /** * カートを購入モードに設定 * - * @param SC_SiteSession_Ex $objSiteSess - * @param SC_CartSession_Ex $objCartSess + * @param SiteSession $objSiteSess + * @param CartSession $objCartSess * @return void */ public function lfSetCurrentCart(&$objSiteSess, &$objCartSess, $cartKey) diff --git a/data/class/pages/contact/LC_Page_Contact_Complete.php b/data/Eccube/Page/Contact/Complete.php similarity index 50% rename from data/class/pages/contact/LC_Page_Contact_Complete.php rename to data/Eccube/Page/Contact/Complete.php index 5138c28bf84..3f5c585baef 100644 --- a/data/class/pages/contact/LC_Page_Contact_Complete.php +++ b/data/Eccube/Page/Contact/Complete.php @@ -1,36 +1,26 @@ tpl_title = 'お問い合わせ'; } else { $this->tpl_title = 'お問い合わせ(入力ページ)'; } $this->httpCacheControl('nocache'); - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { // @deprecated EC-CUBE 2.11 テンプレート互換用 - $this->CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $this->CONF = DbHelper::getBasisData(); } } @@ -75,7 +73,7 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->arrData = isset($_SESSION['customer']) ? $_SESSION['customer'] : ''; @@ -91,7 +89,7 @@ public function action() // 入力値の取得 $this->arrForm = $objFormParam->getFormParamList(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { // エラー無しで完了画面 $this->tpl_mainpage = 'contact/confirm.tpl'; $this->tpl_title = 'お問い合わせ(確認ページ)'; @@ -111,15 +109,15 @@ public function action() $objFormParam->setParam($_POST); $this->arrErr = $objFormParam->checkError(); $this->arrForm = $objFormParam->getFormParamList(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->lfSendMail($this); // 完了ページへ移動する - SC_Response_Ex::sendRedirect('complete.php'); - SC_Response_Ex::actionExit(); + Response::sendRedirect('complete.php'); + Response::actionExit(); } else { - SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(CUSTOMER_ERROR); + Response::actionExit(); } break; @@ -132,7 +130,7 @@ public function action() /** * お問い合わせ入力時のパラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -157,14 +155,14 @@ public function lfInitParam(&$objFormParam) /** * 入力内容のチェックを行なう. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array 入力チェック結果の配列 */ public function lfCheckError(&$objFormParam) { // 入力データを渡す。 $arrForm = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrForm); + $objErr = new CheckError($arrForm); $objErr->arrErr = $objFormParam->checkError(); $objErr->doFunc(array('メールアドレス', 'メールアドレス(確認)', 'email', 'email02'), array('EQUAL_CHECK')); @@ -179,10 +177,10 @@ public function lfCheckError(&$objFormParam) */ public function lfSendMail(&$objPage) { - $CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $CONF = DbHelper::getBasisData(); $objPage->tpl_shopname = $CONF['shop_name']; $objPage->tpl_infoemail = $CONF['email02']; - $helperMail = new SC_Helper_Mail_Ex(); + $helperMail = new MailHelper(); $helperMail->setPage($this); $helperMail->sfSendTemplateMail( $objPage->arrForm['email']['value'], // to diff --git a/data/class/pages/entry/LC_Page_Entry_Complete.php b/data/Eccube/Page/Entry/Complete.php similarity index 58% rename from data/class/pages/entry/LC_Page_Entry_Complete.php rename to data/Eccube/Page/Entry/Complete.php index 0d406485ca7..705bb4a86f4 100644 --- a/data/class/pages/entry/LC_Page_Entry_Complete.php +++ b/data/Eccube/Page/Entry/Complete.php @@ -1,36 +1,28 @@ getKeys(); $this->tpl_cart_empty = true; foreach ($arrCartKeys as $cart_key) { @@ -79,7 +71,7 @@ public function action() $this->tpl_mainpage = 'entry/complete.tpl'; } else { // 本会員登録完了 - SC_Response_Ex::sendRedirectFromUrlPath('regist/complete.php'); + Response::sendRedirectFromUrlPath('regist/complete.php'); } } diff --git a/data/class/pages/entry/LC_Page_Entry_EmailMobile.php b/data/Eccube/Page/Entry/EmailMobile.php similarity index 72% rename from data/class/pages/entry/LC_Page_Entry_EmailMobile.php rename to data/Eccube/Page/Entry/EmailMobile.php index 1fc7a027a75..b99eb961bbd 100644 --- a/data/class/pages/entry/LC_Page_Entry_EmailMobile.php +++ b/data/Eccube/Page/Entry/EmailMobile.php @@ -1,36 +1,30 @@ lfInitParam($objFormParam); $objFormParam->setParam($_POST); @@ -88,7 +82,7 @@ public function action() * lfInitParam * * @access public - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @return void */ public function lfInitParam(&$objFormParam) @@ -100,14 +94,14 @@ public function lfInitParam(&$objFormParam) /** * エラーチェックする * - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam * @access private * @return array エラー情報の配列 */ public function lfCheckError(&$objFormParam) { $objFormParam->convParam(); - $objErr = new SC_CheckError_Ex(); + $objErr = new CheckError(); $objErr->arrErr = $objFormParam->checkError(); // FIXME: lfInitParam() で設定すれば良いように感じる @@ -128,7 +122,7 @@ public function lfCheckError(&$objFormParam) */ public function lfRegistEmailMobile($email_mobile, $customer_id) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->update('dtb_customer', array('email_mobile' => $email_mobile), 'customer_id = ?', array($customer_id)); diff --git a/data/class/pages/entry/LC_Page_Entry.php b/data/Eccube/Page/Entry/Index.php similarity index 77% rename from data/class/pages/entry/LC_Page_Entry.php rename to data/Eccube/Page/Entry/Index.php index c0d30565abc..5600224e8a2 100644 --- a/data/class/pages/entry/LC_Page_Entry.php +++ b/data/Eccube/Page/Entry/Index.php @@ -1,36 +1,40 @@ arrPref = $masterData->getMasterData('mtb_pref'); $this->arrJob = $masterData->getMasterData('mtb_job'); $this->arrReminder = $masterData->getMasterData('mtb_reminder'); @@ -48,7 +52,7 @@ public function init() $this->arrMAILMAGATYPE = $masterData->getMasterData('mtb_mail_magazine_type'); // 生年月日選択肢の取得 - $objDate = new SC_Date_Ex(BIRTH_YEAR, date('Y')); + $objDate = new Date(BIRTH_YEAR, date('Y')); $this->arrYear = $objDate->getYear('', START_BIRTH_YEAR, ''); $this->arrMonth = $objDate->getMonth(true); $this->arrDay = $objDate->getDay(true); @@ -75,17 +79,17 @@ public function process() public function action() { //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // PC時は規約ページからの遷移でなければエラー画面へ遷移する if ($this->lfCheckReferer() === false) { - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); + Utils::sfDispSiteError(PAGE_ERROR, '', true); } - SC_Helper_Customer_Ex::sfCustomerEntryParam($objFormParam); + CustomerHelper::sfCustomerEntryParam($objFormParam); $objFormParam->setParam($_POST); // mobile用(戻るボタンでの遷移かどうかを判定) @@ -104,7 +108,7 @@ public function action() $zipcode = $_POST['zip01'] . $_POST['zip02']; // 郵便番号検索 - $arrAdsList = SC_Utils_Ex::sfGetAddress($zipcode); + $arrAdsList = Utils::sfGetAddress($zipcode); // 郵便番号が発見された場合 if (!empty($arrAdsList)) { @@ -121,11 +125,11 @@ public function action() } //-- 確認 - $this->arrErr = SC_Helper_Customer_Ex::sfCustomerEntryErrorCheck($objFormParam); + $this->arrErr = CustomerHelper::sfCustomerEntryErrorCheck($objFormParam); // 入力エラーなし if (empty($this->arrErr)) { //パスワード表示 - $this->passlen = SC_Utils_Ex::sfPassLen(strlen($objFormParam->getValue('password'))); + $this->passlen = Utils::sfPassLen(strlen($objFormParam->getValue('password'))); $this->tpl_mainpage = 'entry/confirm.tpl'; $this->tpl_title = '会員登録(確認ページ)'; @@ -133,7 +137,7 @@ public function action() break; case 'complete': //-- 会員登録と完了画面 - $this->arrErr = SC_Helper_Customer_Ex::sfCustomerEntryErrorCheck($objFormParam); + $this->arrErr = CustomerHelper::sfCustomerEntryErrorCheck($objFormParam); if (empty($this->arrErr)) { $uniqid = $this->lfRegistCustomerData($this->lfMakeSqlVal($objFormParam)); @@ -142,12 +146,12 @@ public function action() // 仮会員が無効の場合 if (CUSTOMER_CONFIRM_MAIL == false) { // ログイン状態にする - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); $objCustomer->setLogin($objFormParam->getValue('email')); } // 完了ページに移動させる。 - SC_Response_Ex::sendRedirect('complete.php', array('ci' => SC_Helper_Customer_Ex::sfGetCustomerId($uniqid))); + Response::sendRedirect('complete.php', array('ci' => CustomerHelper::sfGetCustomerId($uniqid))); } break; case 'return': @@ -167,7 +171,7 @@ public function action() */ public function lfRegistCustomerData($sqlval) { - SC_Helper_Customer_Ex::sfEditCustomerData($sqlval); + CustomerHelper::sfEditCustomerData($sqlval); return $sqlval['secret_key']; } @@ -179,7 +183,7 @@ public function lfRegistCustomerData($sqlval) * モバイル端末の場合は, email を email_mobile にコピーし, * mobile_phone_id に携帯端末IDを格納する. * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @access private * @return $arrResults */ @@ -189,7 +193,7 @@ public function lfMakeSqlVal(&$objFormParam) $arrResults = $objFormParam->getDbArray(); // 生年月日の作成 - $arrResults['birth'] = SC_Utils_Ex::sfGetTimestamp($arrForm['year'], $arrForm['month'], $arrForm['day']); + $arrResults['birth'] = Utils::sfGetTimestamp($arrForm['year'], $arrForm['month'], $arrForm['day']); // 仮会員 1 本会員 2 $arrResults['status'] = (CUSTOMER_CONFIRM_MAIL == true) ? '1' : '2'; @@ -198,17 +202,17 @@ public function lfMakeSqlVal(&$objFormParam) * secret_keyは、テーブルで重複許可されていない場合があるので、 * 本会員登録では利用されないがセットしておく。 */ - $arrResults['secret_key'] = SC_Helper_Customer_Ex::sfGetUniqSecretKey(); + $arrResults['secret_key'] = CustomerHelper::sfGetUniqSecretKey(); // 入会時ポイント - $CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $CONF = DbHelper::getBasisData(); $arrResults['point'] = $CONF['welcome_point']; - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { // 携帯メールアドレス $arrResults['email_mobile'] = $arrResults['email']; // PHONE_IDを取り出す - $arrResults['mobile_phone_id'] = SC_MobileUserAgent_Ex::getId(); + $arrResults['mobile_phone_id'] = MobileUserAgent::getId(); } return $arrResults; @@ -222,9 +226,9 @@ public function lfMakeSqlVal(&$objFormParam) */ public function lfSendMail($uniqid, $arrForm) { - $CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $CONF = DbHelper::getBasisData(); - $objMailText = new SC_SiteView_Ex(); + $objMailText = new SiteView(); $objMailText->setPage($this); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $arrForm['name01']); @@ -232,7 +236,7 @@ public function lfSendMail($uniqid, $arrForm) $objMailText->assign('uniqid', $uniqid); $objMailText->assignobj($this); - $objHelperMail = new SC_Helper_Mail_Ex(); + $objHelperMail = new MailHelper(); $objHelperMail->setPage($this); // 仮会員が有効の場合 @@ -244,7 +248,7 @@ public function lfSendMail($uniqid, $arrForm) $toCustomerMail = $objMailText->fetch('mail_templates/customer_regist_mail.tpl'); } - $objMail = new SC_SendMail_Ex(); + $objMail = new SendMail(); $objMail->setItem( '', // 宛先 $subject, // サブジェクト @@ -289,7 +293,7 @@ public function lfCheckReferer() $entry_urlpath, ); - if (SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE + if (Display::detectDevice() !== DEVICE_TYPE_MOBILE && !in_array($referer_urlpath, $allowed_urlpath)) { return false; } @@ -306,7 +310,7 @@ public function lfCheckReferer() public function lfCheckError($arrRequest) { // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $objFormParam->addParam('郵便番号1', 'zip01', ZIP01_LEN, 'n', array('EXIST_CHECK', 'NUM_COUNT_CHECK', 'NUM_CHECK')); $objFormParam->addParam('郵便番号2', 'zip02', ZIP02_LEN, 'n', array('EXIST_CHECK', 'NUM_COUNT_CHECK', 'NUM_CHECK')); diff --git a/data/class/pages/entry/LC_Page_Entry_Kiyaku.php b/data/Eccube/Page/Entry/Kiyaku.php similarity index 69% rename from data/class/pages/entry/LC_Page_Entry_Kiyaku.php rename to data/Eccube/Page/Entry/Kiyaku.php index d2369d3f434..7be289ac622 100644 --- a/data/class/pages/entry/LC_Page_Entry_Kiyaku.php +++ b/data/Eccube/Page/Entry/Kiyaku.php @@ -1,36 +1,29 @@ cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); $arrKiyaku = $this->lfGetKiyakuData(); $this->max = count($arrKiyaku); // mobile時はGETでページ指定 - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { $this->offset = $this->lfSetOffset($_GET['offset']); + } else { + $this->offset = null; } $this->tpl_kiyaku_text = $this->lfMakeKiyakuText($arrKiyaku, $this->max, $this->offset); @@ -88,7 +83,7 @@ public function action() */ public function lfMakeKiyakuText($arrKiyaku, $max, $offset) { - $this->tpl_kiyaku_text = ''; + $tpl_kiyaku_text = ''; for ($i = 0; $i < $max; $i++) { if ($offset !== null && ($offset - 1) <> $i) continue; $tpl_kiyaku_text.=$arrKiyaku[$i]['kiyaku_title'] . "\n\n"; @@ -106,7 +101,7 @@ public function lfMakeKiyakuText($arrKiyaku, $max, $offset) */ public function lfGetKiyakuData() { - $objKiyaku = new SC_Helper_Kiyaku_Ex(); + $objKiyaku = new KiyakuHelper(); $arrKiyaku = $objKiyaku->getList(); return $arrKiyaku; diff --git a/data/class/pages/error/LC_Page_Error_DispError.php b/data/Eccube/Page/Error/DispError.php similarity index 67% rename from data/class/pages/error/LC_Page_Error_DispError.php rename to data/Eccube/Page/Error/DispError.php index cb59ac2a2f0..498874466c4 100644 --- a/data/class/pages/error/LC_Page_Error_DispError.php +++ b/data/Eccube/Page/Error/DispError.php @@ -1,36 +1,31 @@ template = LOGIN_FRAME; $this->tpl_mainpage = 'login_error.tpl'; $this->tpl_title = 'ログインエラー'; // ディスプレイクラス生成 - $this->objDisplay = new SC_Display_Ex(); + $this->objDisplay = new Display(); // transformでフックしている場合に, 再度エラーが発生するため, コールバックを無効化. - $objHelperPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objHelperPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); $objHelperPlugin->arrRegistedPluginActions = array(); // キャッシュから店舗情報取得(DBへの接続は行わない) - $this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisDataCache(false); + $this->arrSiteInfo = DbHelper::getBasisDataCache(false); } /** @@ -75,7 +70,7 @@ public function process() */ public function action() { - SC_Response_Ex::sendHttpStatus(500); + Response::sendHttpStatus(500); switch ($this->type) { case LOGIN_ERROR: @@ -86,7 +81,7 @@ public function action() break; case AUTH_ERROR: $this->tpl_error='このページにはアクセスできません'; - SC_Response_Ex::sendHttpStatus(403); + Response::sendHttpStatus(403); break; case INVALID_MOVE_ERRORR: $this->tpl_error='不正なページ移動です。
もう一度ご確認のうえ、再度入力してください。'; diff --git a/data/class/pages/error/LC_Page_Error.php b/data/Eccube/Page/Error/Index.php similarity index 82% rename from data/class/pages/error/LC_Page_Error.php rename to data/Eccube/Page/Error/Index.php index 449527aee52..cbdeb0cbb4d 100644 --- a/data/class/pages/error/LC_Page_Error.php +++ b/data/Eccube/Page/Error/Index.php @@ -1,41 +1,37 @@ tpl_mainpage = 'error.tpl'; $this->tpl_title = 'エラー'; // ディスプレイクラス生成 - $this->objDisplay = new SC_Display_Ex(); + $this->objDisplay = new Display(); - $objHelperPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objHelperPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); if (is_object($objHelperPlugin)) { // transformでフックしている場合に, 再度エラーが発生するため, コールバックを無効化. $objHelperPlugin->arrRegistedPluginActions = array(); } // キャッシュから店舗情報取得(DBへの接続は行わない) - $this->arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisDataCache(false); + $this->arrSiteInfo = DbHelper::getBasisDataCache(false); } /** @@ -92,12 +88,12 @@ public function process() */ public function action() { - SC_Response_Ex::sendHttpStatus(500); + Response::sendHttpStatus(500); switch ($this->type) { case PRODUCT_NOT_FOUND: $this->tpl_error='ご指定のページはございません。'; - SC_Response_Ex::sendHttpStatus(404); + Response::sendHttpStatus(404); break; case PAGE_ERROR: $this->tpl_error='不正なページ移動です。'; @@ -113,7 +109,7 @@ public function action() break; case CATEGORY_NOT_FOUND: $this->tpl_error='ご指定のカテゴリは存在しません。'; - SC_Response_Ex::sendHttpStatus(404); + Response::sendHttpStatus(404); break; case SITE_LOGIN_ERROR: $this->tpl_error='メールアドレスもしくはパスワードが正しくありません。'; diff --git a/data/class/pages/error/LC_Page_Error_SystemError.php b/data/Eccube/Page/Error/SystemError.php similarity index 72% rename from data/class/pages/error/LC_Page_Error_SystemError.php rename to data/Eccube/Page/Error/SystemError.php index acbfc324bb5..487caff7d5f 100644 --- a/data/class/pages/error/LC_Page_Error_SystemError.php +++ b/data/Eccube/Page/Error/SystemError.php @@ -1,27 +1,19 @@ tpl_error = 'システムエラーが発生しました。
大変お手数ですが、サイト管理者までご連絡ください。'; @@ -94,7 +85,7 @@ public function action() */ public function sendResponse() { - $this->adminPage = GC_Utils_Ex::isAdminFunction(); + $this->adminPage = GcUtils::isAdminFunction(); if ($this->adminPage) { $this->tpl_mainpage = 'login_error.tpl'; @@ -141,13 +132,13 @@ public function sfGetErrMsg() if (!is_null($this->pearResult)) { $errmsg .= $this->pearResult->message . "\n\n"; $errmsg .= $this->pearResult->userinfo . "\n\n"; - $errmsg .= GC_Utils_Ex::toStringBacktrace($this->pearResult->backtrace); + $errmsg .= GcUtils::toStringBacktrace($this->pearResult->backtrace); // (上に該当せず)バックトレーススタックが指定されている場合 } else if (is_array($this->backtrace)) { - $errmsg .= GC_Utils_Ex::toStringBacktrace($this->backtrace); + $errmsg .= GcUtils::toStringBacktrace($this->backtrace); } else { - $arrBacktrace = GC_Utils_Ex::getDebugBacktrace(); - $errmsg .= GC_Utils_Ex::toStringBacktrace($arrBacktrace); + $arrBacktrace = GcUtils::getDebugBacktrace(); + $errmsg .= GcUtils::toStringBacktrace($arrBacktrace); } return $errmsg; @@ -161,7 +152,7 @@ public function sfGetErrMsg() public function lfGetErrMsgHead() { $errmsg = ''; - $errmsg .= GC_Utils_Ex::getUrl() . "\n"; + $errmsg .= GcUtils::getUrl() . "\n"; $errmsg .= "\n"; $errmsg .= 'SERVER_ADDR: ' . $_SERVER['SERVER_ADDR'] . "\n"; $errmsg .= 'REMOTE_ADDR: ' . $_SERVER['REMOTE_ADDR'] . "\n"; diff --git a/data/class/pages/forgot/LC_Page_Forgot.php b/data/Eccube/Page/Forgot/Index.php similarity index 83% rename from data/class/pages/forgot/LC_Page_Forgot.php rename to data/Eccube/Page/Forgot/Index.php index a8827607266..f2d9dd15b82 100644 --- a/data/class/pages/forgot/LC_Page_Forgot.php +++ b/data/Eccube/Page/Forgot/Index.php @@ -1,36 +1,38 @@ tpl_title = 'パスワードを忘れた方'; $this->tpl_mainpage = 'forgot/index.tpl'; $this->tpl_mainno = ''; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrReminder = $masterData->getMasterData('mtb_reminder'); - $this->device_type = SC_Display_Ex::detectDevice(); + $this->device_type = Display::detectDevice(); $this->httpCacheControl('nocache'); // デフォルトログインアドレスロード - $objCookie = new SC_Cookie_Ex(); + $objCookie = new Cookie(); $this->tpl_login_email = $objCookie->getCookie('login_email'); } @@ -85,7 +87,7 @@ public function process() public function action() { // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); switch ($this->getMode()) { case 'mail_check': @@ -95,9 +97,9 @@ public function action() $objFormParam->toLower('email'); $this->arrForm = $objFormParam->getHashArray(); $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->errmsg = $this->lfCheckForgotMail($this->arrForm, $this->arrReminder); - if (SC_Utils_Ex::isBlank($this->errmsg)) { + if (Utils::isBlank($this->errmsg)) { $this->tpl_mainpage = 'forgot/secret.tpl'; } } @@ -109,9 +111,9 @@ public function action() $objFormParam->toLower('email'); $this->arrForm = $objFormParam->getHashArray(); $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->errmsg = $this->lfCheckForgotSecret($this->arrForm, $this->arrReminder); - if (SC_Utils_Ex::isBlank($this->errmsg)) { + if (Utils::isBlank($this->errmsg)) { // 完了ページへ移動する $this->tpl_mainpage = 'forgot/complete.tpl'; // transactionidを更新させたいので呼び出し元(ログインフォーム側)をリロード。 @@ -146,7 +148,7 @@ public function action() public function lfCheckForgotMail(&$arrForm, &$arrReminder) { $errmsg = NULL; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = '(email = ? OR email_mobile = ?) AND name01 = ? AND name02 = ? AND del_flg = 0'; $arrVal = array($arrForm['email'], $arrForm['email'], $arrForm['name01'], $arrForm['name02']); $result = $objQuery->select('reminder, status', 'dtb_customer', $where, $arrVal); @@ -169,7 +171,7 @@ public function lfCheckForgotMail(&$arrForm, &$arrReminder) /** * メールアドレス確認におけるパラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @param array $device_type デバイスタイプ * @return void */ @@ -196,7 +198,7 @@ public function lfInitMailCheckParam(&$objFormParam, $device_type) public function lfCheckForgotSecret(&$arrForm, &$arrReminder) { $errmsg = ''; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $cols = 'customer_id, reminder, reminder_answer, salt'; $table = 'dtb_customer'; $where = '(email = ? OR email_mobile = ?)' @@ -213,7 +215,7 @@ public function lfCheckForgotSecret(&$arrForm, &$arrReminder) if ($result[0]['reminder_answer'] == $arrForm['reminder_answer']) { $is_authorized = true; } - } elseif (SC_Utils_Ex::sfIsMatchHashPassword($arrForm['reminder_answer'], + } elseif (Utils::sfIsMatchHashPassword($arrForm['reminder_answer'], $result[0]['reminder_answer'], $result[0]['salt'])) { $is_authorized = true; } @@ -221,16 +223,16 @@ public function lfCheckForgotSecret(&$arrForm, &$arrReminder) if ($is_authorized) { // 秘密の答えが一致 // 新しいパスワードを設定する - $new_password = GC_Utils_Ex::gfMakePassword(8); + $new_password = GcUtils::gfMakePassword(8); if (FORGOT_MAIL == 1) { // メールで変更通知をする - $objDb = new SC_Helper_DB_Ex(); - $CONF = $objDb->sfGetBasisData(); + $objDb = new DbHelper(); + $CONF = $objDb->getBasisData(); $this->lfSendMail($CONF, $arrForm['email'], $arrForm['name01'], $new_password); } $sqlval = array(); $sqlval['password'] = $new_password; - SC_Helper_Customer_Ex::sfEditCustomerData($sqlval, $result[0]['customer_id']); + CustomerHelper::sfEditCustomerData($sqlval, $result[0]['customer_id']); $arrForm['new_password'] = $new_password; } else { // 秘密の答えが一致しなかった @@ -239,7 +241,7 @@ public function lfCheckForgotSecret(&$arrForm, &$arrReminder) } else { //不正なアクセス リマインダー値が前画面と異なる。 // 新リファクタリング基準ではここで遷移は不許可なのでエラー表示 - //SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); + //Utils::sfDispSiteError(PAGE_ERROR, '', true); $errmsg = '秘密の質問が一致しませんでした。'; } @@ -249,7 +251,7 @@ public function lfCheckForgotSecret(&$arrForm, &$arrReminder) /** * 秘密の質問確認におけるパラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @param array $device_type デバイスタイプ * @return void */ @@ -278,17 +280,17 @@ public function lfInitSecretCheckParam(&$objFormParam, $device_type) public function lfSendMail(&$CONF, $email, $customer_name, $new_password) { // パスワード変更お知らせメール送信 - $objMailText = new SC_SiteView_Ex(false); + $objMailText = new SiteView(false); $objMailText->setPage($this); $objMailText->assign('customer_name', $customer_name); $objMailText->assign('new_password', $new_password); $toCustomerMail = $objMailText->fetch('mail_templates/forgot_mail.tpl'); - $objHelperMail = new SC_Helper_Mail_Ex(); + $objHelperMail = new MailHelper(); $objHelperMail->setPage($this); // メール送信オブジェクトによる送信処理 - $objMail = new SC_SendMail_Ex(); + $objMail = new SendMail(); $objMail->setItem( '', //宛先 $objHelperMail->sfMakeSubject('パスワードを変更いたしました。'), diff --git a/data/class/pages/frontparts/LC_Page_FrontParts_LoginCheck.php b/data/Eccube/Page/Frontparts/LoginCheck.php similarity index 68% rename from data/class/pages/frontparts/LC_Page_FrontParts_LoginCheck.php rename to data/Eccube/Page/Frontparts/LoginCheck.php index a02b2f2f1eb..06ced87ce79 100644 --- a/data/class/pages/frontparts/LC_Page_FrontParts_LoginCheck.php +++ b/data/Eccube/Page/Frontparts/LoginCheck.php @@ -1,27 +1,27 @@ cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); // 会員管理クラス - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); // クッキー管理クラス - $objCookie = new SC_Cookie_Ex(); + $objCookie = new Cookie(); // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); @@ -94,12 +93,12 @@ public function action() // エラーの場合はエラー画面に遷移 if (count($arrErr) > 0) { - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { + if (Display::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Response::actionExit(); } else { - SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(TEMP_LOGIN_ERROR); + Response::actionExit(); } } @@ -117,7 +116,7 @@ public function action() if (count($arrErr) == 0) { // ログイン処理 if ($objCustomer->doLogin($arrForm['login_email'], $arrForm['login_pass'])) { - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() === DEVICE_TYPE_MOBILE) { // ログインが成功した場合は携帯端末IDを保存する。 $objCustomer->updateMobilePhoneId(); @@ -125,22 +124,22 @@ public function action() * email がモバイルドメインでは無く, * 携帯メールアドレスが登録されていない場合 */ - $objMobile = new SC_Helper_Mobile_Ex(); + $objMobile = new MobileHelper(); if (!$objMobile->gfIsMobileMailAddress($objCustomer->getValue('email'))) { if (!$objCustomer->hasValue('email_mobile')) { - SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php'); - SC_Response_Ex::actionExit(); + Response::sendRedirectFromUrlPath('entry/email_mobile.php'); + Response::actionExit(); } } } // --- ログインに成功した場合 - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { - echo SC_Utils_Ex::jsonEncode(array('success' => $url)); + if (Display::detectDevice() === DEVICE_TYPE_SMARTPHONE) { + echo Utils::jsonEncode(array('success' => $url)); } else { - SC_Response_Ex::sendRedirect($url); + Response::sendRedirect($url); } - SC_Response_Ex::actionExit(); + Response::actionExit(); } else { // --- ログインに失敗した場合 @@ -149,33 +148,33 @@ public function action() sleep(LOGIN_RETRY_INTERVAL); $arrForm['login_email'] = strtolower($arrForm['login_email']); - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $where = '(email = ? OR email_mobile = ?) AND status = 1 AND del_flg = 0'; $exists = $objQuery->exists('dtb_customer', $where, array($arrForm['login_email'], $arrForm['login_email'])); // ログインエラー表示 TODO リファクタリング if ($exists) { - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { + if (Display::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Response::actionExit(); } else { - SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(TEMP_LOGIN_ERROR); + Response::actionExit(); } } else { - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { + if (Display::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(SITE_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Response::actionExit(); } else { - SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(SITE_LOGIN_ERROR); + Response::actionExit(); } } } } else { // XXX 到達しない? // 入力エラーの場合、元のアドレスに戻す。 - SC_Response_Ex::sendRedirect($url); - SC_Response_Ex::actionExit(); + Response::sendRedirect($url); + Response::actionExit(); } break; @@ -188,12 +187,12 @@ public function action() $mypage_url_search = strpos('.'.$url, 'mypage'); if ($mypage_url_search == 2) { // マイページログイン中はログイン画面へ移行 - SC_Response_Ex::sendRedirectFromUrlPath('mypage/login.php'); + Response::sendRedirectFromUrlPath('mypage/login.php'); } else { // 上記以外の場合、トップへ遷移 - SC_Response_Ex::sendRedirect(TOP_URL); + Response::sendRedirect(TOP_URL); } - SC_Response_Ex::actionExit(); + Response::actionExit(); break; default: @@ -205,7 +204,7 @@ public function action() /** * パラメーター情報の初期化. * - * @param SC_FormParam $objFormParam パラメーター管理クラス + * @param FormParam $objFormParam パラメーター管理クラス * @return void */ public function lfInitParam(&$objFormParam) @@ -236,6 +235,6 @@ public function lfGetErrorMessage($error) $msg = 'メールアドレスもしくはパスワードが正しくありません。'; } - return SC_Utils_Ex::jsonEncode(array('login_error' => $msg)); + return Utils::jsonEncode(array('login_error' => $msg)); } } diff --git a/data/Eccube/Page/Guide/About.php b/data/Eccube/Page/Guide/About.php new file mode 100644 index 00000000000..56af52efa10 --- /dev/null +++ b/data/Eccube/Page/Guide/About.php @@ -0,0 +1,58 @@ +arrPref = $masterData->getMasterData('mtb_pref'); + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + parent::process(); + $this->action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/Eccube/Page/Guide/Charge.php b/data/Eccube/Page/Guide/Charge.php new file mode 100644 index 00000000000..c3307a7c51b --- /dev/null +++ b/data/Eccube/Page/Guide/Charge.php @@ -0,0 +1,55 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/Eccube/Page/Guide/Index.php b/data/Eccube/Page/Guide/Index.php new file mode 100644 index 00000000000..16275a94a15 --- /dev/null +++ b/data/Eccube/Page/Guide/Index.php @@ -0,0 +1,55 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/class/pages/guide/LC_Page_Guide_Kiyaku.php b/data/Eccube/Page/Guide/Kiyaku.php similarity index 66% rename from data/class/pages/guide/LC_Page_Guide_Kiyaku.php rename to data/Eccube/Page/Guide/Kiyaku.php index 5bb3d59597a..f15c9c1487b 100644 --- a/data/class/pages/guide/LC_Page_Guide_Kiyaku.php +++ b/data/Eccube/Page/Guide/Kiyaku.php @@ -1,36 +1,27 @@ getList(); $number = count($arrKiyaku); diff --git a/data/Eccube/Page/Guide/Privacy.php b/data/Eccube/Page/Guide/Privacy.php new file mode 100644 index 00000000000..a919a4fc70b --- /dev/null +++ b/data/Eccube/Page/Guide/Privacy.php @@ -0,0 +1,55 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/Eccube/Page/Guide/Usage.php b/data/Eccube/Page/Guide/Usage.php new file mode 100644 index 00000000000..8238b8d99b4 --- /dev/null +++ b/data/Eccube/Page/Guide/Usage.php @@ -0,0 +1,55 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/Eccube/Page/Index.php b/data/Eccube/Page/Index.php new file mode 100644 index 00000000000..4f01fdc7149 --- /dev/null +++ b/data/Eccube/Page/Index.php @@ -0,0 +1,60 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + //決済処理中ステータスのロールバック + $objPurchase = new \Eccube\Common\Helper\PurchaseHelper(); + $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); + + $this->tpl_title = ''; + $objCustomer = new \Eccube\Common\Customer(); + $this->isLogin = $objCustomer->isLoginSuccess(true); + } +} diff --git a/data/class/pages/LC_Page_InputZip.php b/data/Eccube/Page/InputZip.php similarity index 94% rename from data/class/pages/LC_Page_InputZip.php rename to data/Eccube/Page/InputZip.php index 45b8acbc1fc..1e275d2cf0f 100644 --- a/data/class/pages/LC_Page_InputZip.php +++ b/data/Eccube/Page/InputZip.php @@ -21,16 +21,18 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php'; +namespace Eccube\Page; + +use Eccube\Common\FormParam; +use Eccube\Common\Util\Utils; /** * 郵便番号入力 のページクラス. * * @package Page * @author LOCKON CO.,LTD. - * @version $Id$ */ -class LC_Page_InputZip extends LC_Page_Ex +class InputZip extends AbstractPage { /** * Page を初期化する. @@ -67,7 +69,7 @@ public function process() $zipcode = $_GET['zip1'] . $_GET['zip2']; // 郵便番号検索 - $arrAdsList = SC_Utils_Ex::sfGetAddress($zipcode); + $arrAdsList = Utils::sfGetAddress($zipcode); // 郵便番号が発見された場合 if (!empty($arrAdsList)) { @@ -90,7 +92,7 @@ public function process() public function fnErrorCheck($arrRequest) { // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $objFormParam->addParam('郵便番号1', 'zip1', ZIP01_LEN, 'n', array('NUM_COUNT_CHECK', 'NUM_CHECK')); $objFormParam->addParam('郵便番号2', 'zip2', ZIP02_LEN, 'n', array('NUM_COUNT_CHECK', 'NUM_CHECK')); diff --git a/data/class/pages/mypage/LC_Page_AbstractMypage.php b/data/Eccube/Page/Mypage/AbstractMypage.php old mode 100755 new mode 100644 similarity index 68% rename from data/class/pages/mypage/LC_Page_AbstractMypage.php rename to data/Eccube/Page/Mypage/AbstractMypage.php index d4aa0676e7f..0eb25bb0fbb --- a/data/class/pages/mypage/LC_Page_AbstractMypage.php +++ b/data/Eccube/Page/Mypage/AbstractMypage.php @@ -1,36 +1,29 @@ isLoginSuccess(true) === false) { // クッキー管理クラス - $objCookie = new SC_Cookie_Ex(); + $objCookie = new Cookie(); // クッキー判定(メールアドレスをクッキーに保存しているか) $this->tpl_login_email = $objCookie->getCookie('login_email'); if ($this->tpl_login_email != '') { @@ -75,7 +68,7 @@ public function process() } // 携帯端末IDが一致する会員が存在するかどうかをチェックする。 - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() === DEVICE_TYPE_MOBILE) { $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId(); } $this->tpl_title = 'MYページ(ログイン)'; diff --git a/data/class/pages/mypage/LC_Page_Mypage_Change.php b/data/Eccube/Page/Mypage/Change.php similarity index 72% rename from data/class/pages/mypage/LC_Page_Mypage_Change.php rename to data/Eccube/Page/Mypage/Change.php index fadb7102256..59ef1c892de 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_Change.php +++ b/data/Eccube/Page/Mypage/Change.php @@ -1,36 +1,32 @@ tpl_subtitle = '会員登録内容変更(入力ページ)'; $this->tpl_mypageno = 'change'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrReminder = $masterData->getMasterData('mtb_reminder'); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); @@ -53,7 +49,7 @@ public function init() $this->httpCacheControl('nocache'); // 生年月日選択肢の取得 - $objDate = new SC_Date_Ex(BIRTH_YEAR, date('Y')); + $objDate = new Date(BIRTH_YEAR, date('Y')); $this->arrYear = $objDate->getYear('', START_BIRTH_YEAR, ''); $this->arrMonth = $objDate->getMonth(true); $this->arrDay = $objDate->getDay(true); @@ -75,7 +71,7 @@ public function process() */ public function action() { - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); $customer_id = $objCustomer->getValue('customer_id'); // mobile用(戻るボタンでの遷移かどうかを判定) @@ -84,8 +80,8 @@ public function action() } // パラメーター管理クラス,パラメーター情報の初期化 - $objFormParam = new SC_FormParam_Ex(); - SC_Helper_Customer_Ex::sfCustomerMypageParam($objFormParam); + $objFormParam = new FormParam(); + CustomerHelper::sfCustomerMypageParam($objFormParam); $objFormParam->setParam($_POST); // POST値の取得 switch ($this->getMode()) { @@ -100,7 +96,7 @@ public function action() $zipcode = $_POST['zip01'] . $_POST['zip02']; // 郵便番号検索 - $arrAdsList = SC_Utils_Ex::sfGetAddress($zipcode); + $arrAdsList = Utils::sfGetAddress($zipcode); // 郵便番号が発見された場合 if (!empty($arrAdsList)) { @@ -114,12 +110,12 @@ public function action() } break; } - $this->arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam); + $this->arrErr = CustomerHelper::sfCustomerMypageErrorCheck($objFormParam); // 入力エラーなし if (empty($this->arrErr)) { //パスワード表示 - $this->passlen = SC_Utils_Ex::sfPassLen(strlen($objFormParam->getValue('password'))); + $this->passlen = Utils::sfPassLen(strlen($objFormParam->getValue('password'))); $this->tpl_mainpage = 'mypage/change_confirm.tpl'; $this->tpl_title = '会員登録(確認ページ)'; @@ -128,7 +124,7 @@ public function action() break; // 会員登録と完了画面 case 'complete': - $this->arrErr = SC_Helper_Customer_Ex::sfCustomerMypageErrorCheck($objFormParam); + $this->arrErr = CustomerHelper::sfCustomerMypageErrorCheck($objFormParam); // 入力エラーなし if (empty($this->arrErr)) { @@ -139,7 +135,7 @@ public function action() $objCustomer->updateSession(); // 完了ページに移動させる。 - SC_Response_Ex::sendRedirect('change_complete.php'); + Response::sendRedirect('change_complete.php'); } break; // 確認ページからの戻り @@ -147,7 +143,7 @@ public function action() // quiet. break; default: - $objFormParam->setParam(SC_Helper_Customer_Ex::sfGetCustomerData($customer_id)); + $objFormParam->setParam(CustomerHelper::sfGetCustomerData($customer_id)); break; } $this->arrForm = $objFormParam->getFormParamList(); @@ -156,7 +152,7 @@ public function action() /** * 会員情報を登録する * - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam * @param mixed $customer_id * @access private * @return void @@ -165,9 +161,9 @@ public function lfRegistCustomerData(&$objFormParam, $customer_id) { $arrRet = $objFormParam->getHashArray(); $sqlval = $objFormParam->getDbArray(); - $sqlval['birth'] = SC_Utils_Ex::sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']); + $sqlval['birth'] = Utils::sfGetTimestamp($arrRet['year'], $arrRet['month'], $arrRet['day']); - SC_Helper_Customer_Ex::sfEditCustomerData($sqlval, $customer_id); + CustomerHelper::sfEditCustomerData($sqlval, $customer_id); } /** @@ -179,7 +175,7 @@ public function lfRegistCustomerData(&$objFormParam, $customer_id) public function lfCheckError($arrRequest) { // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $objFormParam->addParam('郵便番号1', 'zip01', ZIP01_LEN, 'n', array('EXIST_CHECK', 'NUM_COUNT_CHECK', 'NUM_CHECK')); $objFormParam->addParam('郵便番号2', 'zip02', ZIP02_LEN, 'n', array('EXIST_CHECK', 'NUM_COUNT_CHECK', 'NUM_CHECK')); diff --git a/data/Eccube/Page/Mypage/ChangeComplete.php b/data/Eccube/Page/Mypage/ChangeComplete.php new file mode 100644 index 00000000000..29b5928d778 --- /dev/null +++ b/data/Eccube/Page/Mypage/ChangeComplete.php @@ -0,0 +1,53 @@ +tpl_subtitle = '会員登録内容変更(完了ページ)'; + $this->tpl_mypageno = 'change'; + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + parent::process(); + } + + /** + * Page のAction. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/class/pages/mypage/LC_Page_Mypage_Delivery.php b/data/Eccube/Page/Mypage/Delivery.php similarity index 67% rename from data/class/pages/mypage/LC_Page_Mypage_Delivery.php rename to data/Eccube/Page/Mypage/Delivery.php index a54ef84467b..4b823bb1824 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_Delivery.php +++ b/data/Eccube/Page/Mypage/Delivery.php @@ -1,36 +1,31 @@ tpl_subtitle = 'お届け先追加・変更'; $this->tpl_mypageno = 'delivery'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->httpCacheControl('nocache'); @@ -65,10 +60,10 @@ public function process() */ public function action() { - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); $customer_id = $objCustomer->getValue('customer_id'); - $objAddress = new SC_Helper_Address_Ex(); - $objFormParam = new SC_FormParam_Ex(); + $objAddress = new AddressHelper(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); @@ -78,13 +73,13 @@ public function action() // お届け先の削除 case 'delete': if ($objFormParam->checkError()) { - SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(CUSTOMER_ERROR); + Response::actionExit(); } if (!$objAddress->deleteAddress($objFormParam->getValue('other_deliv_id'), $customer_id)) { - SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を削除できませんでした。'); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を削除できませんでした。'); + Response::actionExit(); } break; @@ -98,8 +93,8 @@ public function action() $arrOtherDeliv['delivCount'] = count($arrOtherDeliv); $this->arrOtherDeliv = $arrOtherDeliv; - echo SC_Utils_Ex::jsonEncode($this->arrOtherDeliv); - SC_Response_Ex::actionExit(); + echo Utils::jsonEncode($this->arrOtherDeliv); + Response::actionExit(); break; // お届け先の表示 @@ -120,8 +115,8 @@ public function action() /** * フォームパラメータの初期化 * - * @param SC_FormParam_Ex $objFormParam - * @return SC_FormParam + * @param FormParam $objFormParam + * @return FormParam */ public function lfInitParam(&$objFormParam) { diff --git a/data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php b/data/Eccube/Page/Mypage/DeliveryAddr.php similarity index 72% rename from data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php rename to data/Eccube/Page/Mypage/DeliveryAddr.php index adf9488ac50..af813b7cae3 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_DeliveryAddr.php +++ b/data/Eccube/Page/Mypage/DeliveryAddr.php @@ -1,27 +1,25 @@ skip_load_page_layout = true; parent::init(); $this->tpl_title = 'お届け先の追加・変更'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->httpCacheControl('nocache'); @@ -70,8 +68,8 @@ public function process() */ public function action() { - $objCustomer = new SC_Customer_Ex(); - $objAddress = new SC_Helper_Address_Ex(); + $objCustomer = new Customer(); + $objAddress = new AddressHelper(); $ParentPage = MYPAGE_DELIVADDR_URLPATH; // GETでページを指定されている場合には指定ページに戻す @@ -83,7 +81,7 @@ public function action() // 正しい遷移かをチェック $arrParentPageList = array(DELIV_URLPATH, MYPAGE_DELIVADDR_URLPATH, MULTIPLE_URLPATH); - if (!SC_Utils_Ex::isBlank($ParentPage) && !in_array($ParentPage, $arrParentPageList)) { + if (!Utils::isBlank($ParentPage) && !in_array($ParentPage, $arrParentPageList)) { // 遷移が正しくない場合、デフォルトであるマイページの配送先追加の画面を設定する $ParentPage = MYPAGE_DELIVADDR_URLPATH; } @@ -104,7 +102,7 @@ public function action() $_SESSION['other_deliv_id'] = $_REQUEST['other_deliv_id']; // パラメーター管理クラス,パラメーター情報の初期化 - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $objAddress->setFormParam($objFormParam); $objFormParam->setParam($_POST); @@ -118,7 +116,7 @@ public function action() if (in_array($_POST['ParentPage'], $this->validUrl)) { $this->tpl_onload = "eccube.changeParentUrl('". $this->getLocation($_POST['ParentPage']) ."'); window.close();"; } else { - SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); + Utils::sfDispSiteError(CUSTOMER_ERROR); } if ($objCustomer->isLoginSuccess(true)) { @@ -127,10 +125,10 @@ public function action() $this->lfRegistDataNonMember($objFormParam); } - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() === DEVICE_TYPE_MOBILE) { // モバイルの場合、元のページに遷移 - SC_Response_Ex::sendRedirect($this->getLocation($_POST['ParentPage'])); - SC_Response_Ex::actionExit(); + Response::sendRedirect($this->getLocation($_POST['ParentPage'])); + Response::actionExit(); } } break; @@ -144,7 +142,7 @@ public function action() //不正アクセス判定 if (!$objCustomer->isLoginSuccess(true) || !$arrOtherDeliv) { - SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); + Utils::sfDispSiteError(CUSTOMER_ERROR); } //別のお届け先情報取得 @@ -154,7 +152,7 @@ public function action() } $this->arrForm = $objFormParam->getFormParamList(); - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() === DEVICE_TYPE_MOBILE) { $this->tpl_mainpage = 'mypage/delivery_addr.tpl'; } else { $this->setTemplate('mypage/delivery_addr.tpl'); @@ -165,8 +163,8 @@ public function action() /* 登録実行 */ /** - * @param SC_Helper_Address_Ex $objAddress - * @param SC_FormParam $objFormParam + * @param AddressHelper $objAddress + * @param FormParam $objFormParam */ public function lfRegistData($objAddress, $objFormParam, $customer_id) { @@ -177,13 +175,13 @@ public function lfRegistData($objAddress, $objFormParam, $customer_id) $sqlval['customer_id'] = $customer_id; if (!$objAddress->registAddress($sqlval)) { - SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を登録できませんでした。'); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を登録できませんでした。'); + Response::actionExit(); } } /** - * @param SC_FormParam $objFormParam + * @param FormParam $objFormParam */ public function lfRegistDataNonMember($objFormParam) { @@ -192,7 +190,7 @@ public function lfRegistDataNonMember($objFormParam) $arrRegist['shipping_' . $key ] = $val; } if (count($_SESSION['shipping']) >= DELIV_ADDR_MAX) { - SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先最大登録数に達しています。'); + Utils::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先最大登録数に達しています。'); } else { $_SESSION['shipping'][] = $arrRegist; } diff --git a/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php b/data/Eccube/Page/Mypage/Download.php similarity index 82% rename from data/class/pages/mypage/LC_Page_Mypage_DownLoad.php rename to data/Eccube/Page/Mypage/Download.php index f7f337a669f..217a7ed483f 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_DownLoad.php +++ b/data/Eccube/Page/Mypage/Download.php @@ -1,35 +1,37 @@ isLoginSuccess(true)) { - SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); + Utils::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); } // パラメーターチェック - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); // GET、SESSION['customer']値の取得 $objFormParam->setParam($_SESSION['customer']); $objFormParam->setParam($_GET); $this->arrErr = $this->lfCheckError($objFormParam); if (count($this->arrErr)!=0) { - SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); + Utils::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); } } @@ -104,7 +106,7 @@ public function action() public function sendResponse() { // TODO sendResponseをオーバーライドしている為、afterフックポイントが実行されない.直接実行する.(#1790) - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); $objPlugin->doAction('LC_Page_Mypage_DownLoad_action_after', array($this)); $this->objDisplay->noAction(); @@ -119,12 +121,12 @@ public function sendResponse() //ファイル情報が無い場合はNG if ($arrForm['down_realfilename'] == '') { - SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); + Utils::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); } //ファイルそのものが無い場合もとりあえずNG $realpath = DOWN_SAVE_REALDIR . $arrForm['down_realfilename']; if (!file_exists($realpath)) { - SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); + Utils::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); } //ファイル名をエンコードする Safariの対策はUTF-8で様子を見る $encoding = 'Shift_JIS'; @@ -133,13 +135,13 @@ public function sendResponse() } $sdown_filename = mb_convert_encoding($arrForm['down_filename'], $encoding, 'auto'); - // flushなどを利用しているので、現行のSC_Displayは利用できません。 - // SC_DisplayやSC_Responseに大容量ファイルレスポンスが実装されたら移行可能だと思います。 + // flushなどを利用しているので、現行のDisplayは利用できません。 + // DisplayやResponseに大容量ファイルレスポンスが実装されたら移行可能だと思います。 // ダウンロード実行 モバイル端末はダウンロード方法が異なる - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { // キャリアがAUのモバイル端末はさらにダウンロード方法が異なる - if (SC_MobileUserAgent::getCarrier() == 'ezweb') { + if (MobileUserAgent::getCarrier() == 'ezweb') { // AUモバイル $this->lfMobileAuDownload($realpath, $sdown_filename); } else { @@ -162,7 +164,7 @@ public function sendResponse() */ public function lfGetRealFileName($customer_id, $order_id, $product_class_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = <<< __EOS__ pc.down_realfilename AS down_realfilename, pc.down_filename AS down_filename @@ -174,7 +176,7 @@ public function lfGetRealFileName($customer_id, $order_id, $product_class_id) JOIN dtb_products_class AS pc USING(product_id, product_class_id) __EOS__; - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); $where = 'o.customer_id = ? AND o.order_id = ? AND od.product_class_id = ?'; $where .= ' AND ' . $dbFactory->getDownloadableDaysWhereSql('o'); $where .= ' = 1'; @@ -187,7 +189,7 @@ public function lfGetRealFileName($customer_id, $order_id, $product_class_id) /* パラメーター情報の初期化 */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -199,11 +201,11 @@ public function lfInitParam(&$objFormParam) /* 入力内容のチェック */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfCheckError(&$objFormParam) { - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); + $objErr = new CheckError($objFormParam->getHashArray()); $objErr->arrErr = $objFormParam->checkError(); return $objErr->arrErr; @@ -217,7 +219,7 @@ public function lfCheckError(&$objFormParam) */ public function lfMobileHeader($realpath, $sdown_filename) { - $objHelperMobile = new SC_Helper_Mobile_Ex(); + $objHelperMobile = new MobileHelper(); //ファイルの拡張子からコンテンツタイプを取得する $mime_type = $objHelperMobile->getMIMEType($realpath); header('Content-Type: ' . $mime_type); @@ -256,7 +258,7 @@ public function lfMobileAuDownload($realpath, $sdown_filename) header('Content-Length: ' . $content_length); } echo fread($fp, $content_length); - SC_Utils_Ex::sfFlush(); + Utils::sfFlush(); } /** @@ -309,8 +311,8 @@ public function lfMobileDownload($realpath, $sdown_filename) while (!feof($realpath) && (!connection_aborted()) && ($bytes_send<$new_length)) { $buffer = fread($realpath, $chunksize); print($buffer); - SC_Utils_Ex::sfFlush(); - SC_Utils_Ex::extendTimeOut(); + Utils::sfFlush(); + Utils::extendTimeOut(); $bytes_send += strlen($buffer); } fclose($realpath); @@ -350,13 +352,13 @@ public function lfDownload($realpath, $sdown_filename) //ファイル読み込み $handle = fopen($realpath, 'rb'); if ($handle === false) { - SC_Utils_Ex::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(DOWNFILE_NOT_FOUND, '', true); + Response::actionExit(); } while (!feof($handle)) { echo fread($handle, DOWNLOAD_BLOCK*1024); - SC_Utils_Ex::sfFlush(); - SC_Utils_Ex::extendTimeOut(); + Utils::sfFlush(); + Utils::extendTimeOut(); } fclose($handle); } diff --git a/data/class/pages/mypage/LC_Page_Mypage_Favorite.php b/data/Eccube/Page/Mypage/Favorite.php similarity index 75% rename from data/class/pages/mypage/LC_Page_Mypage_Favorite.php rename to data/Eccube/Page/Mypage/Favorite.php index 344533bcbf8..0ada6a11cbf 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_Favorite.php +++ b/data/Eccube/Page/Mypage/Favorite.php @@ -1,36 +1,31 @@ getValue('customer_id'); @@ -81,16 +76,16 @@ public function action() $this->tpl_pageno = intval($_POST['pageno']); } $this->arrFavorite = $this->lfGetFavoriteProduct($customer_id, $this); - SC_Product_Ex::setPriceTaxTo($this->arrFavorite); + Product::setPriceTaxTo($this->arrFavorite); // 一覧メイン画像の指定が無い商品のための処理 foreach ($this->arrFavorite as $key => $val) { - $this->arrFavorite[$key]['main_list_image'] = SC_Utils_Ex::sfNoImageMainList($val['main_list_image']); + $this->arrFavorite[$key]['main_list_image'] = Utils::sfNoImageMainList($val['main_list_image']); } - echo SC_Utils_Ex::jsonEncode($this->arrFavorite); - SC_Response_Ex::actionExit(); + echo Utils::jsonEncode($this->arrFavorite); + Response::actionExit(); break; default: @@ -116,8 +111,8 @@ public function action() */ public function lfGetFavoriteProduct($customer_id, &$objPage) { - $objQuery = SC_Query_Ex::getSingletonInstance(); - $objProduct = new SC_Product_Ex(); + $objQuery = Query::getSingletonInstance(); + $objProduct = new Product(); $objQuery->setOrder('f.create_date DESC'); $where = 'f.customer_id = ? and p.status = 1'; @@ -126,18 +121,18 @@ public function lfGetFavoriteProduct($customer_id, &$objPage) } $arrProductId = $objQuery->getCol('f.product_id', 'dtb_customer_favorite_products f inner join dtb_products p using (product_id)', $where, array($customer_id)); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setWhere($this->lfMakeWhere('alldtl.', $arrProductId)); $linemax = $objProduct->findProductCount($objQuery); $objPage->tpl_linemax = $linemax; // 何件が該当しました。表示用 // ページ送りの取得 - $objNavi = new SC_PageNavi_Ex($objPage->tpl_pageno, $linemax, SEARCH_PMAX, 'eccube.movePage', NAVI_PMAX); + $objNavi = new PageNavi($objPage->tpl_pageno, $linemax, SEARCH_PMAX, 'eccube.movePage', NAVI_PMAX); $this->tpl_strnavi = $objNavi->strnavi; // 表示文字列 $startno = $objNavi->start_row; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); //$objQuery->setLimitOffset(SEARCH_PMAX, $startno); // 取得範囲の指定(開始行番号、行数のセット) $arrProductId = array_slice($arrProductId, $startno, SEARCH_PMAX); @@ -158,7 +153,7 @@ public function lfGetFavoriteProduct($customer_id, &$objPage) } // 税込金額を設定する - SC_Product_Ex::setIncTaxToProducts($arrProductsList); + Product::setIncTaxToProducts($arrProductsList); return $arrProductsList; } @@ -189,7 +184,7 @@ public function lfMakeWhere($tablename, $arrProductId) */ public function lfDeleteFavoriteProduct($customer_id, $product_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($customer_id, $product_id)); diff --git a/data/class/pages/mypage/LC_Page_Mypage_History.php b/data/Eccube/Page/Mypage/History.php similarity index 78% rename from data/class/pages/mypage/LC_Page_Mypage_History.php rename to data/Eccube/Page/Mypage/History.php index 234294c02de..da112f5e060 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_History.php +++ b/data/Eccube/Page/Mypage/History.php @@ -1,36 +1,36 @@ tpl_subtitle = '購入履歴詳細'; $this->httpCacheControl('nocache'); - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrMAILTEMPLATE = $masterData->getMasterData('mtb_mail_template'); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); @@ -71,14 +71,14 @@ public function process() public function action() { //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - $objCustomer = new SC_Customer_Ex(); - $objProduct = new SC_Product(); + $objCustomer = new Customer(); + $objProduct = new Product(); - if (!SC_Utils_Ex::sfIsInt($_GET['order_id'])) { - SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); + if (!Utils::sfIsInt($_GET['order_id'])) { + Utils::sfDispSiteError(CUSTOMER_ERROR); } $order_id = $_GET['order_id']; @@ -88,14 +88,14 @@ public function action() $this->tpl_arrOrderData = $objPurchase->getOrder($order_id, $objCustomer->getValue('customer_id')); if (empty($this->tpl_arrOrderData)) { - SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); + Utils::sfDispSiteError(CUSTOMER_ERROR); } $this->arrShipping = $this->lfGetShippingDate($objPurchase, $order_id, $this->arrWDAY); $this->isMultiple = count($this->arrShipping) > 1; // 支払い方法の取得 - $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); + $this->arrPayment = PaymentHelper::getIDValueList(); // 受注商品明細の取得 $this->tpl_arrOrderDetail = $objPurchase->getOrderDetail($order_id); foreach ($this->tpl_arrOrderDetail as $product_index => $arrOrderProductDetail) { @@ -103,12 +103,12 @@ public function action() $arrTempProductDetail = $objProduct->getProductsClass($arrOrderProductDetail['product_class_id']); // 税計算 $this->tpl_arrOrderDetail[$product_index]['price_inctax'] = $this->tpl_arrOrderDetail[$product_index]['price'] + - SC_Helper_TaxRule_Ex::calcTax( + TaxRuleHelper::calcTax( $this->tpl_arrOrderDetail[$product_index]['price'], $this->tpl_arrOrderDetail[$product_index]['tax_rate'], $this->tpl_arrOrderDetail[$product_index]['tax_rule'] ); - $arrTempProductDetail['price02_inctax'] = SC_Helper_TaxRule_Ex::sfCalcIncTax( + $arrTempProductDetail['price02_inctax'] = TaxRuleHelper::sfCalcIncTax( $arrTempProductDetail['price02'], $arrTempProductDetail['product_id'], $arrTempProductDetail['product_class_id'] @@ -135,7 +135,7 @@ public function action() */ public function lfGetMailHistory($order_id) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'send_date, subject, template_id, send_id'; $where = 'order_id = ?'; $objQuery->setOrder('send_date DESC'); @@ -146,7 +146,7 @@ public function lfGetMailHistory($order_id) /** * 受注お届け先情報の取得 * - * @param SC_Helper_Purchase_Ex $objPurchase object SC_Helper_Purchaseクラス + * @param PurchaseHelper $objPurchase object PurchaseHelperクラス * @param $order_id integer 注文番号 * @param $arrWDAY array 曜日データの配列 * @return array お届け先情報 @@ -157,7 +157,7 @@ public function lfGetShippingDate(&$objPurchase, $order_id, $arrWDAY) foreach ($arrShipping as $shipping_index => $shippingData) { foreach ($shippingData as $key => $val) { - if ($key == 'shipping_date' && SC_Utils_Ex::isBlank($val) == false) { + if ($key == 'shipping_date' && Utils::isBlank($val) == false) { // お届け日を整形 list($y, $m, $d, $w) = explode(' ', date('Y m d w', strtotime($val))); $arrShipping[$shipping_index]['shipping_date'] = sprintf('%04d/%02d/%02d(%s)', $y, $m, $d, $arrWDAY[$w]); @@ -178,7 +178,7 @@ public function setMainListImage($arrOrderDetails) { $i = 0; foreach ($arrOrderDetails as $arrOrderDetail) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrProduct = $objQuery->select('main_list_image', 'dtb_products', 'product_id = ?', array($arrOrderDetail['product_id'])); $arrOrderDetails[$i]['main_list_image'] = $arrProduct[0]['main_list_image']; $i++; @@ -195,10 +195,10 @@ public function setMainListImage($arrOrderDetails) */ public function lfSetMimetype($arrOrderDetails) { - $objHelperMobile = new SC_Helper_Mobile_Ex(); + $objHelperMobile = new MobileHelper(); $i = 0; foreach ($arrOrderDetails as $arrOrderDetail) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrProduct = $objQuery->select('down_realfilename,down_filename', 'dtb_products_class', 'product_id = ? AND product_class_id = ?', array($arrOrderDetail['product_id'],$arrOrderDetail['product_class_id'])); $arrOrderDetails[$i]['mime_type'] = $objHelperMobile->getMimeType($arrProduct[0]['down_realfilename']); $arrOrderDetails[$i]['down_filename'] = $arrProduct[0]['down_filename']; @@ -219,7 +219,7 @@ public function lfSetAU($arrOrderDetails) { $this->isAU = false; // モバイル端末かつ、キャリアがAUの場合に処理を行う - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE && SC_MobileUserAgent::getCarrier() == 'ezweb') { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE && MobileUserAgent::getCarrier() == 'ezweb') { // MIMETYPE、ファイル名のセット $this->tpl_arrOrderDetail = $this->lfSetMimetype($arrOrderDetails); diff --git a/data/class/pages/mypage/LC_Page_Mypage.php b/data/Eccube/Page/Mypage/Index.php similarity index 62% rename from data/class/pages/mypage/LC_Page_Mypage.php rename to data/Eccube/Page/Mypage/Index.php index 43a102edf2e..11f10e17ec4 100644 --- a/data/class/pages/mypage/LC_Page_Mypage.php +++ b/data/Eccube/Page/Mypage/Index.php @@ -1,36 +1,34 @@ tpl_mypageno = 'index'; - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() === DEVICE_TYPE_MOBILE) { $this->tpl_subtitle = 'MYページ'; } else { $this->tpl_subtitle = '購入履歴一覧'; } - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrCustomerOrderStatus = $masterData->getMasterData('mtb_customer_order_status'); $this->httpCacheControl('nocache'); @@ -73,38 +71,38 @@ public function process() public function action() { //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); $customer_id = $objCustomer->getValue('customer_id'); //ページ送り用 - $this->objNavi = new SC_PageNavi_Ex($_REQUEST['pageno'], + $this->objNavi = new PageNavi($_REQUEST['pageno'], $this->lfGetOrderHistory($customer_id), SEARCH_PMAX, 'eccube.movePage', NAVI_PMAX, 'pageno=#page#', - SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE); + Display::detectDevice() !== DEVICE_TYPE_MOBILE); $this->arrOrder = $this->lfGetOrderHistory($customer_id, $this->objNavi->start_row); switch ($this->getMode()) { case 'getList': - echo SC_Utils_Ex::jsonEncode($this->arrOrder); - SC_Response_Ex::actionExit(); + echo Utils::jsonEncode($this->arrOrder); + Response::actionExit(); break; default: break; } // 支払い方法の取得 - $this->arrPayment = SC_Helper_Payment_Ex::getIDValueList(); + $this->arrPayment = PaymentHelper::getIDValueList(); // 1ページあたりの件数 $this->dispNumber = SEARCH_PMAX; - $this->json_payment = SC_Utils::jsonEncode($this->arrPayment); - $this->json_customer_order_status = SC_Utils::jsonEncode($this->arrCustomerOrderStatus); + $this->json_payment = Utils::jsonEncode($this->arrPayment); + $this->json_customer_order_status = Utils::jsonEncode($this->arrCustomerOrderStatus); } /** @@ -117,7 +115,7 @@ public function action() */ public function lfGetOrderHistory($customer_id, $startno = -1) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'order_id, create_date, payment_id, payment_total, status'; $from = 'dtb_order'; diff --git a/data/Eccube/Page/Mypage/Login.php b/data/Eccube/Page/Mypage/Login.php new file mode 100644 index 00000000000..0bf4b05c9ef --- /dev/null +++ b/data/Eccube/Page/Mypage/Login.php @@ -0,0 +1,60 @@ +httpCacheControl('nocache'); + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + parent::process(); + } + + /** + * Page のAction. + * + * @return void + */ + public function action() + { + //決済処理中ステータスのロールバック + $objPurchase = new PurchaseHelper(); + $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); + + Response::sendRedirect(DIR_INDEX_PATH); + } +} diff --git a/data/class/pages/mypage/LC_Page_Mypage_MailView.php b/data/Eccube/Page/Mypage/MailView.php similarity index 59% rename from data/class/pages/mypage/LC_Page_Mypage_MailView.php rename to data/Eccube/Page/Mypage/MailView.php index c45929b8415..8ab5bb7cd0d 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_MailView.php +++ b/data/Eccube/Page/Mypage/MailView.php @@ -1,36 +1,30 @@ lfGetMailView($_GET['send_id'], $objCustomer->getValue('customer_id')); if (empty($arrMailView)) { - SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); + Utils::sfDispSiteError(CUSTOMER_ERROR); } $this->tpl_subject = $arrMailView[0]['subject']; $this->tpl_body = $arrMailView[0]['mail_body']; - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_PC) { + if (Display::detectDevice() === DEVICE_TYPE_PC) { $this->setTemplate('mypage/mail_view.tpl'); } else { $this->tpl_title = 'メール履歴詳細'; @@ -85,8 +79,8 @@ public function action() switch ($this->getMode()) { case 'getDetail': - echo SC_Utils_Ex::jsonEncode($arrMailView); - SC_Response_Ex::actionExit(); + echo Utils::jsonEncode($arrMailView); + Response::actionExit(); break; default: break; @@ -104,7 +98,7 @@ public function action() */ public function lfGetMailView($send_id, $customer_id) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $col = 'subject, mail_body'; $where = 'send_id = ? AND customer_id = ?'; $arrWhereVal = array($send_id, $customer_id); diff --git a/data/class/pages/mypage/LC_Page_Mypage_Order.php b/data/Eccube/Page/Mypage/Order.php similarity index 64% rename from data/class/pages/mypage/LC_Page_Mypage_Order.php rename to data/Eccube/Page/Mypage/Order.php index b9a1dceab2a..aa151af7f36 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_Order.php +++ b/data/Eccube/Page/Mypage/Order.php @@ -1,36 +1,31 @@ cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); //受注詳細データの取得 @@ -69,19 +64,19 @@ public function action() //ログインしていない、またはDBに情報が無い場合 if (empty($arrOrderDetail)) { - SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); + Utils::sfDispSiteError(CUSTOMER_ERROR); } $this->lfAddCartProducts($arrOrderDetail); - SC_Response_Ex::sendRedirect(CART_URL); + Response::sendRedirect(CART_URL); } // 受注詳細データの取得 public function lfGetOrderDetail($order_id) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); //customer_idを検証 $customer_id = $objCustomer->getValue('customer_id'); $order_count = $objQuery->count('dtb_order', 'order_id = ? and customer_id = ?', array($order_id, $customer_id)); @@ -99,7 +94,7 @@ public function lfGetOrderDetail($order_id) // 商品をカートに追加 public function lfAddCartProducts($arrOrderDetail) { - $objCartSess = new SC_CartSession_Ex(); + $objCartSess = new CartSession(); foreach ($arrOrderDetail as $order_row) { $objCartSess->addProduct($order_row['product_class_id'], $order_row['quantity']); } diff --git a/data/class/pages/mypage/LC_Page_Mypage_Refusal.php b/data/Eccube/Page/Mypage/Refusal.php similarity index 70% rename from data/class/pages/mypage/LC_Page_Mypage_Refusal.php rename to data/Eccube/Page/Mypage/Refusal.php index 412eaddf46b..9bb949025fb 100644 --- a/data/class/pages/mypage/LC_Page_Mypage_Refusal.php +++ b/data/Eccube/Page/Mypage/Refusal.php @@ -1,36 +1,35 @@ isValidRefusalToken()) { // エラー画面へ遷移する - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(PAGE_ERROR, '', true); + Response::actionExit(); } - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); $this->lfSendRefusalMail($objCustomer->getValue('customer_id')); $this->lfDeleteCustomer($objCustomer->getValue('customer_id')); $objCustomer->EndSession(); - SC_Response_Ex::sendRedirect('refusal_complete.php'); + Response::sendRedirect('refusal_complete.php'); break; default: - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { $this->refusal_transactionid = $this->getRefusalToken(); } break; @@ -102,7 +101,7 @@ public function action() */ function getRefusalToken() { if (empty($_SESSION['refusal_transactionid'])) { - $_SESSION['refusal_transactionid'] = SC_Helper_Session_Ex::createToken(); + $_SESSION['refusal_transactionid'] = SessionHelper::createToken(); } return $_SESSION['refusal_transactionid']; } @@ -135,7 +134,7 @@ function destroyRefusalToken() { */ public function lfDeleteCustomer($customer_id) { - return SC_Helper_Customer_Ex::delete($customer_id); + return CustomerHelper::delete($customer_id); } /** @@ -148,29 +147,29 @@ public function lfDeleteCustomer($customer_id) public function lfSendRefusalMail($customer_id) { // 会員データの取得 - if (SC_Utils_Ex::sfIsInt($customer_id)) { - $arrCustomerData = SC_Helper_Customer_Ex::sfGetCustomerDataFromId($customer_id); + if (Utils::sfIsInt($customer_id)) { + $arrCustomerData = CustomerHelper::sfGetCustomerDataFromId($customer_id); } - if (SC_Utils_Ex::isBlank($arrCustomerData)) { + if (Utils::isBlank($arrCustomerData)) { return false; } - $CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $CONF = DbHelper::getBasisData(); - $objMailText = new SC_SiteView_Ex(); + $objMailText = new SiteView(); $objMailText->setPage($this); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $arrCustomerData['name01']); $objMailText->assign('name02', $arrCustomerData['name02']); $objMailText->assignobj($this); - $objHelperMail = new SC_Helper_Mail_Ex(); + $objHelperMail = new MailHelper(); $objHelperMail->setPage($this); $subject = $objHelperMail->sfMakeSubject('退会手続きのご完了', $objMailText); $toCustomerMail = $objMailText->fetch('mail_templates/customer_refusal_mail.tpl'); - $objMail = new SC_SendMail_Ex(); + $objMail = new SendMail(); $objMail->setItem( '', // 宛先 $subject, // サブジェクト diff --git a/data/Eccube/Page/Mypage/RefusalComplete.php b/data/Eccube/Page/Mypage/RefusalComplete.php new file mode 100644 index 00000000000..2f1651789e3 --- /dev/null +++ b/data/Eccube/Page/Mypage/RefusalComplete.php @@ -0,0 +1,67 @@ +tpl_title = 'MYページ'; + + if (Display::detectDevice() === DEVICE_TYPE_MOBILE) { + $this->tpl_title .= '/退会手続き(完了ページ)'; + } else { + $this->tpl_subtitle = '退会手続き(完了ページ)'; + } + $this->tpl_navi = PageLayoutHelper::getTemplatePath(Display::detectDevice()) . 'mypage/navi.tpl'; + $this->tpl_mypageno = 'refusal'; + $this->point_disp = false; + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + parent::process(); + $this->action(); + $this->sendResponse(); + } + + /** + * Page のAction. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/Eccube/Page/Order/Index.php b/data/Eccube/Page/Order/Index.php new file mode 100644 index 00000000000..86f9967c0db --- /dev/null +++ b/data/Eccube/Page/Order/Index.php @@ -0,0 +1,62 @@ +tpl_title = '特定商取引に関する法律に基づく表記'; + $masterData = new MasterData(); + $this->arrPref = $masterData->getMasterData('mtb_pref'); + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + parent::process(); + $this->action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + $objDb = new DbHelper(); + $this->arrOrder = $objDb->getBasisData(); + } +} diff --git a/data/Eccube/Page/Preview/Index.php b/data/Eccube/Page/Preview/Index.php new file mode 100644 index 00000000000..296edd28887 --- /dev/null +++ b/data/Eccube/Page/Preview/Index.php @@ -0,0 +1,66 @@ +sfGetPageLayout($this, true); + + // 画面の表示 + $objView->assignobj($this); + $objView->display(SITE_FRAME); + + return; + } + Utils::sfDispSiteError(PAGE_ERROR); + } +} diff --git a/data/class/pages/products/LC_Page_Products_CategoryList.php b/data/Eccube/Page/Products/CategoryList.php similarity index 73% rename from data/class/pages/products/LC_Page_Products_CategoryList.php rename to data/Eccube/Page/Products/CategoryList.php index 242f50de9f1..462b360a6dd 100644 --- a/data/class/pages/products/LC_Page_Products_CategoryList.php +++ b/data/Eccube/Page/Products/CategoryList.php @@ -1,36 +1,29 @@ lfCheckCategoryId($objFormParam->getValue('category_id')); if ($category_id == 0) { - SC_Utils_Ex::sfDispSiteError(CATEGORY_NOT_FOUND); + Utils::sfDispSiteError(CATEGORY_NOT_FOUND); } // カテゴリ情報を取得する。 @@ -82,7 +75,7 @@ public function action() */ public function lfCheckCategoryId($category_id) { - if ($category_id && !SC_Helper_DB_Ex::sfIsRecord('dtb_category', 'category_id', (array) $category_id, 'del_flg = 0')) { + if ($category_id && !DbHelper::isRecord('dtb_category', 'category_id', (array) $category_id, 'del_flg = 0')) { return 0; } @@ -102,7 +95,7 @@ public function lfGetCategories($category_id, $count_check = false) $arrCategory = null; // 選択されたカテゴリ $arrChildren = array(); // 子カテゴリ - $arrAll = SC_Helper_DB_Ex::sfGetCatTree($category_id, $count_check); + $arrAll = DbHelper::getCatTree($category_id, $count_check); foreach ($arrAll as $category) { // 選択されたカテゴリの場合 if ($category['category_id'] == $category_id) { @@ -116,13 +109,13 @@ public function lfGetCategories($category_id, $count_check = false) } // 子カテゴリの場合は、孫カテゴリが存在するかどうかを調べる。 - $arrGrandchildrenID = SC_Utils_Ex::sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']); + $arrGrandchildrenID = Utils::sfGetUnderChildrenArray($arrAll, 'parent_category_id', 'category_id', $category['category_id']); $category['has_children'] = count($arrGrandchildrenID) > 0; $arrChildren[] = $category; } if (!isset($arrCategory)) { - SC_Utils_Ex::sfDispSiteError(CATEGORY_NOT_FOUND); + Utils::sfDispSiteError(CATEGORY_NOT_FOUND); } // 子カテゴリの商品数を合計する。 @@ -144,11 +137,11 @@ public function lfGetCategories($category_id, $count_check = false) /** * ユーザ入力値の処理 * - * @return SC_FormParam_Ex + * @return FormParam */ public function lfInitParam($arrRequest) { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $objFormParam->addParam('カテゴリID', 'category_id', INT_LEN, 'n', array('NUM_CHECK','MAX_LENGTH_CHECK')); // 値の取得 $objFormParam->setParam($arrRequest); diff --git a/data/class/pages/products/LC_Page_Products_Detail.php b/data/Eccube/Page/Products/Detail.php similarity index 81% rename from data/class/pages/products/LC_Page_Products_Detail.php rename to data/Eccube/Page/Products/Detail.php index 1f1c8eccce1..b4a132cecdc 100644 --- a/data/class/pages/products/LC_Page_Products_Detail.php +++ b/data/Eccube/Page/Products/Detail.php @@ -1,39 +1,42 @@ arrSTATUS = $masterData->getMasterData('mtb_status'); $this->arrSTATUS_IMAGE = $masterData->getMasterData('mtb_status_image'); $this->arrDELIVERYDATE = $masterData->getMasterData('mtb_delivery_date'); @@ -168,23 +168,23 @@ public function process() public function action() { //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); // 会員クラス - $objCustomer = new SC_Customer_Ex(); + $objCustomer = new Customer(); // パラメーター管理クラス - $this->objFormParam = new SC_FormParam_Ex(); + $this->objFormParam = new FormParam(); // パラメーター情報の初期化 $this->arrForm = $this->lfInitParam($this->objFormParam); // ファイル管理クラス - $this->objUpFile = new SC_UploadFile_Ex(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR); + $this->objUpFile = new UploadFile(IMAGE_TEMP_REALDIR, IMAGE_SAVE_REALDIR); // ファイル情報の初期化 $this->objUpFile = $this->lfInitFile($this->objUpFile); $this->mode = $this->getMode(); - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); // プロダクトIDの正当性チェック $product_id = $this->lfCheckProductId($this->objFormParam->getValue('admin'), $this->objFormParam->getValue('product_id'), $objProduct); @@ -215,13 +215,13 @@ public function action() $this->js_lnOnload .= $this->lfMakeSelect(); } - $this->tpl_javascript .= 'eccube.classCategories = ' . SC_Utils_Ex::jsonEncode($objProduct->classCategories[$product_id]) . ';'; + $this->tpl_javascript .= 'eccube.classCategories = ' . Utils::jsonEncode($objProduct->classCategories[$product_id]) . ';'; $this->tpl_javascript .= 'function lnOnLoad() {' . $this->js_lnOnload . '}'; $this->tpl_onload .= 'lnOnLoad();'; // モバイル用 規格選択セレクトボックスの作成 - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { $this->lfMakeSelectMobile($this, $product_id, $this->objFormParam->getValue('classcategory_id1')); } @@ -257,7 +257,7 @@ public function action() } // モバイル用 ポストバック処理 - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { switch ($this->mode) { case 'select': $this->doMobileSelect(); @@ -289,7 +289,7 @@ public function action() // 関連カテゴリを取得 $arrCategory_id = $objProduct->getCategoryIds($product_id); - $objCategory = new SC_Helper_Category_Ex(); + $objCategory = new CategoryHelper(); $this->arrRelativeCat = array(); foreach ($arrCategory_id as $category_id) { $this->arrRelativeCat[] = $objCategory->getTreeTrail($category_id, false); @@ -300,12 +300,9 @@ public function action() // 画像ファイル指定がない場合の置換処理 $this->arrProduct['main_image'] - = SC_Utils_Ex::sfNoImageMain($this->arrProduct['main_image']); + = Utils::sfNoImageMain($this->arrProduct['main_image']); $this->subImageFlag = $this->lfSetFile($this->objUpFile, $this->arrProduct, $this->arrFile); - //レビュー情報の取得 - $objReview = new SC_Helper_Review_Ex(); - $this->arrReview = $objReview->getListByProductId($product_id); //関連商品情報表示 $this->arrRecommend = $this->lfPreGetRecommendProducts($product_id); @@ -314,7 +311,7 @@ public function action() if ($objCustomer->isLoginSuccess() === true) { //お気に入りボタン表示 $this->tpl_login = true; - $this->is_favorite = SC_Helper_DB_Ex::sfDataExists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($objCustomer->getValue('customer_id'), $product_id)); + $this->is_favorite = DbHelper::dataExists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($objCustomer->getValue('customer_id'), $product_id)); } } @@ -323,20 +320,20 @@ public function action() * * @param string $admin_mode * @param int $product_id - * @param SC_Product $objProduct + * @param Product $objProduct * @return integer */ - public function lfCheckProductId($admin_mode, $product_id, SC_Product $objProduct) + public function lfCheckProductId($admin_mode, $product_id, Product $objProduct) { // 管理機能からの確認の場合は、非公開の商品も表示する。 - if (isset($admin_mode) && $admin_mode == 'on' && SC_Utils_Ex::sfIsSuccess(new SC_Session_Ex(), false)) { + if (isset($admin_mode) && $admin_mode == 'on' && Utils::sfIsSuccess(new Session(), false)) { $include_hidden = true; } else { $include_hidden = false; } if (!$objProduct->isValidProductId($product_id, $include_hidden)) { - SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); + Utils::sfDispSiteError(PRODUCT_NOT_FOUND); } return $product_id; @@ -345,10 +342,10 @@ public function lfCheckProductId($admin_mode, $product_id, SC_Product $objProduc /** * ファイル情報の初期化 * - * @param SC_UploadFile $objUpFile - * @return SC_UploadFile + * @param Eccube\UploadFile $objUpFile + * @return Eccube\UploadFile */ - public function lfInitFile(SC_UploadFile $objUpFile) + public function lfInitFile(UploadFile $objUpFile) { $objUpFile->addFile('詳細-メイン画像', 'main_image', array('jpg'), IMAGE_SIZE); for ($cnt = 1; $cnt <= PRODUCTSUB_MAX; $cnt++) { @@ -363,7 +360,7 @@ public function lfMakeSelect() { return 'fnSetClassCategories(' . 'document.form1, ' - . SC_Utils_Ex::jsonEncode($this->objFormParam->getValue('classcategory_id2')) + . Utils::jsonEncode($this->objFormParam->getValue('classcategory_id2')) . '); '; } @@ -379,9 +376,9 @@ public function lfMakeSelectMobile(&$objPage, $product_id, $request_classcategor $classcat_find2 = false; // 規格名一覧 - $arrClassName = SC_Helper_DB_Ex::sfGetIDValueList('dtb_class', 'class_id', 'name'); + $arrClassName = DbHelper::getIDValueList('dtb_class', 'class_id', 'name'); // 規格分類名一覧 - $arrClassCatName = SC_Helper_DB_Ex::sfGetIDValueList('dtb_classcategory', 'classcategory_id', 'name'); + $arrClassCatName = DbHelper::getIDValueList('dtb_classcategory', 'classcategory_id', 'name'); // 商品規格情報の取得 $arrProductsClass = $this->lfGetProductsClass($product_id); @@ -439,10 +436,10 @@ public function lfMakeSelectMobile(&$objPage, $product_id, $request_classcategor /** * パラメーター情報の初期化 * - * @param SC_FormParam $objFormParam + * @param Eccube\FormParam $objFormParam * @return array */ - public function lfInitParam(SC_FormParam &$objFormParam) + public function lfInitParam(FormParam &$objFormParam) { $objFormParam->addParam('規格1', 'classcategory_id1', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); $objFormParam->addParam('規格2', 'classcategory_id2', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); @@ -466,7 +463,7 @@ public function lfInitParam(SC_FormParam &$objFormParam) */ public function lfGetProductsClass($product_id) { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); return $objProduct->getProductsClassFullByProductId($product_id); } @@ -478,8 +475,8 @@ public function lfGetProductsClass($product_id) */ public function lfPreGetRecommendProducts($product_id) { - $objProduct = new SC_Product_Ex(); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objProduct = new Product(); + $objQuery = Query::getSingletonInstance(); $objQuery->setOrder('rank DESC'); $arrRecommendData = $objQuery->select('recommend_product_id, comment', 'dtb_recommend_products as t1 left join dtb_products as t2 on t1.recommend_product_id = t2.product_id', 't1.product_id = ? and t2.del_flg = 0 and t2.status = 1', array($product_id)); @@ -489,7 +486,7 @@ public function lfPreGetRecommendProducts($product_id) $recommendProductIds[] = $recommend['recommend_product_id']; } - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrProducts = $objProduct->getListByProductIds($objQuery, $recommendProductIds); foreach ($arrRecommendData as $key => $arrRow) { @@ -506,23 +503,23 @@ public function lfPreGetRecommendProducts($product_id) * @param boolean $tpl_classcat_find1 * @param boolean $tpl_classcat_find2 */ - public function lfCheckError($mode, SC_FormParam &$objFormParam, $tpl_classcat_find1 = null, $tpl_classcat_find2 = null) + public function lfCheckError($mode, FormParam &$objFormParam, $tpl_classcat_find1 = null, $tpl_classcat_find2 = null) { switch ($mode) { case 'add_favorite_sphone': case 'add_favorite': - $objCustomer = new SC_Customer_Ex(); - $objErr = new SC_CheckError_Ex(); + $objCustomer = new Customer(); + $objErr = new CheckError(); $customer_id = $objCustomer->getValue('customer_id'); $favorite_product_id = $objFormParam->getValue('favorite_product_id'); - if (SC_Helper_DB_Ex::sfDataExists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($customer_id, $favorite_product_id))) { + if (DbHelper::dataExists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($customer_id, $favorite_product_id))) { $objErr->arrErr['add_favorite'.$favorite_product_id] = '※ この商品は既にお気に入りに追加されています。
'; } break; default: // 入力データを渡す。 $arrRet = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrRet); + $objErr = new CheckError($arrRet); $objErr->arrErr = $objFormParam->checkError(); // 複数項目チェック @@ -541,12 +538,12 @@ public function lfCheckError($mode, SC_FormParam &$objFormParam, $tpl_classcat_f /** * ファイルの情報をセットする * - * @param SC_UploadFile $objUpFile + * @param UploadFile $objUpFile * @param array $arrProduct * @param array $arrFile * @return bool */ - public function lfSetFile(SC_UploadFile $objUpFile, $arrProduct, &$arrFile) + public function lfSetFile(UploadFile $objUpFile, $arrProduct, &$arrFile) { // DBからのデータを引き継ぐ $objUpFile->setDBFileList($arrProduct); @@ -556,7 +553,7 @@ public function lfSetFile(SC_UploadFile $objUpFile, $arrProduct, &$arrFile) // サブ画像の有無を判定 $subImageFlag = false; for ($i = 1; $i <= PRODUCTSUB_MAX; $i++) { - if ($arrFile['sub_image' . $i]['filepath'] != '') { + if (isset($arrFile['sub_image' . $i]['filepath']) && $arrFile['sub_image' . $i]['filepath'] != '') { $subImageFlag = true; } } @@ -571,12 +568,12 @@ public function lfSetFile(SC_UploadFile $objUpFile, $arrProduct, &$arrFile) public function lfRegistFavoriteProduct($favorite_product_id, $customer_id) { // ログイン中のユーザが商品をお気に入りにいれる処理 - if (!SC_Helper_DB_Ex::sfIsRecord('dtb_products', 'product_id', $favorite_product_id, 'del_flg = 0 AND status = 1')) { - SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); + if (!DbHelper::isRecord('dtb_products', 'product_id', $favorite_product_id, 'del_flg = 0 AND status = 1')) { + Utils::sfDispSiteError(PRODUCT_NOT_FOUND); return false; } else { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists('dtb_customer_favorite_products', 'customer_id = ? AND product_id = ?', array($customer_id, $favorite_product_id)); if (!$exists) { @@ -607,7 +604,7 @@ public function doCart() $this->tpl_classcat_find1, $this->tpl_classcat_find2); if (count($this->arrErr) == 0) { - $objCartSess = new SC_CartSession_Ex(); + $objCartSess = new CartSession(); $product_class_id = $this->objFormParam->getValue('product_class_id'); $objCartSess->addProduct($product_class_id, $this->objFormParam->getValue('quantity')); @@ -617,27 +614,27 @@ public function doCart() 'product_id' => $this->objFormParam->getValue('product_id'), ); - SC_Response_Ex::sendRedirect(CART_URL, $arrQueryString); - SC_Response_Ex::actionExit(); + Response::sendRedirect(CART_URL, $arrQueryString); + Response::actionExit(); } } /** * Add product to authenticated user's favorites. * - * @param SC_Customer $objCustomer + * @param Eccube\Customer $objCustomer * @return void */ - public function doAddFavorite(SC_Customer &$objCustomer) + public function doAddFavorite(Customer &$objCustomer) { // ログイン中のユーザが商品をお気に入りにいれる処理 if ($objCustomer->isLoginSuccess() === true && $this->objFormParam->getValue('favorite_product_id') > 0) { $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam); if (count($this->arrErr) == 0) { if (!$this->lfRegistFavoriteProduct($this->objFormParam->getValue('favorite_product_id'), $objCustomer->getValue('customer_id'))) { - SC_Response_Ex::actionExit(); + Response::actionExit(); } - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); $objPlugin->doAction('LC_Page_Products_Detail_action_add_favorite', array($this)); } } @@ -646,24 +643,24 @@ public function doAddFavorite(SC_Customer &$objCustomer) /** * Add product to authenticated user's favorites. (for Smart phone) * - * @param SC_Customer $objCustomer + * @param Customer $objCustomer * @return void */ - public function doAddFavoriteSphone(SC_Customer $objCustomer) + public function doAddFavoriteSphone(Customer $objCustomer) { // ログイン中のユーザが商品をお気に入りにいれる処理(スマートフォン用) if ($objCustomer->isLoginSuccess() === true && $this->objFormParam->getValue('favorite_product_id') > 0) { $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam); if (count($this->arrErr) == 0) { if ($this->lfRegistFavoriteProduct($this->objFormParam->getValue('favorite_product_id'), $objCustomer->getValue('customer_id'))) { - $objPlugin = SC_Helper_Plugin_Ex::getSingletonInstance($this->plugin_activate_flg); + $objPlugin = PluginHelper::getSingletonInstance($this->plugin_activate_flg); $objPlugin->doAction('LC_Page_Products_Detail_action_add_favorite_sphone', array($this)); print 'true'; - SC_Response_Ex::actionExit(); + Response::actionExit(); } } print 'error'; - SC_Response_Ex::actionExit(); + Response::actionExit(); } } @@ -675,7 +672,7 @@ public function doAddFavoriteSphone(SC_Customer $objCustomer) public function doDefault() { // カート「戻るボタン」用に保持 - $netURL = new Net_URL(); + $netURL = new \Net_URL(); $_SESSION['cart_referer_url'] = $netURL->getURL(); } @@ -731,7 +728,7 @@ public function doMobileSelect2() */ public function doMobileSelectItem() { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $this->arrErr = $this->lfCheckError($this->mode, $this->objFormParam, $this->tpl_classcat_find1, $this->tpl_classcat_find2); @@ -756,7 +753,7 @@ public function doMobileSelectItem() } // 規格2が設定されている場合. - if (SC_Utils_Ex::isBlank($this->objFormParam->getValue('classcategory_id2')) == false) { + if (Utils::isBlank($this->objFormParam->getValue('classcategory_id2')) == false) { $value2 = '#' . $this->objFormParam->getValue('classcategory_id2'); } else { $value2 = '#0'; diff --git a/data/class/pages/products/LC_Page_Products_List.php b/data/Eccube/Page/Products/ProductsList.php similarity index 84% rename from data/class/pages/products/LC_Page_Products_List.php rename to data/Eccube/Page/Products/ProductsList.php index 5c66d66d045..c255b8e49ce 100644 --- a/data/class/pages/products/LC_Page_Products_List.php +++ b/data/Eccube/Page/Products/ProductsList.php @@ -1,36 +1,40 @@ arrSTATUS = $masterData->getMasterData('mtb_status'); $this->arrSTATUS_IMAGE = $masterData->getMasterData('mtb_status_image'); $this->arrDELIVERYDATE = $masterData->getMasterData('mtb_delivery_date'); @@ -92,12 +96,12 @@ public function process() public function action() { //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); // パラメーター情報の初期化 $this->lfInitParam($objFormParam); @@ -137,11 +141,11 @@ public function action() $this->tpl_linemax = $this->lfGetProductAllNum($arrSearchCondition); $urlParam = "category_id={$this->arrSearchData['category_id']}&pageno=#page#"; // モバイルの場合に検索条件をURLの引数に追加 - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() === DEVICE_TYPE_MOBILE) { $searchNameUrl = urlencode(mb_convert_encoding($this->arrSearchData['name'], 'SJIS-win', 'UTF-8')); $urlParam .= "&mode={$this->mode}&name={$searchNameUrl}&orderby={$this->orderby}"; } - $this->objNavi = new SC_PageNavi_Ex($this->tpl_pageno, $this->tpl_linemax, $this->disp_number, 'eccube.movePage', NAVI_PMAX, $urlParam, SC_Display_Ex::detectDevice() !== DEVICE_TYPE_MOBILE); + $this->objNavi = new PageNavi($this->tpl_pageno, $this->tpl_linemax, $this->disp_number, 'eccube.movePage', NAVI_PMAX, $urlParam, Display::detectDevice() !== DEVICE_TYPE_MOBILE); $this->arrProducts = $this->lfGetProductsList($arrSearchCondition, $this->disp_number, $this->objNavi->start_row, $objProduct); switch ($this->getMode()) { @@ -154,13 +158,13 @@ public function action() break; } - $this->tpl_rnd = SC_Utils_Ex::sfGetRandomString(3); + $this->tpl_rnd = Utils::sfGetRandomString(3); } /** * パラメーター情報の初期化 * - * @param SC_FormParam_Ex $objFormParam フォームパラメータークラス + * @param FormParam $objFormParam フォームパラメータークラス * @return void */ public function lfInitParam(&$objFormParam) @@ -193,22 +197,22 @@ public function lfGetCategoryId($category_id) if (empty($category_id)) return 0; // 正当性チェック - $objCategory = new SC_Helper_Category_Ex(); + $objCategory = new CategoryHelper(); if ($objCategory->isValidCategoryId($category_id)) { return $category_id; } else { - SC_Utils_Ex::sfDispSiteError(CATEGORY_NOT_FOUND); + Utils::sfDispSiteError(CATEGORY_NOT_FOUND); } } /* 商品一覧の表示 */ /** - * @param SC_Product_Ex $objProduct + * @param Product $objProduct */ public function lfGetProductsList($searchCondition, $disp_number, $startno, &$objProduct) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrOrderVal = array(); @@ -246,7 +250,7 @@ public function lfGetProductsList($searchCondition, $disp_number, $startno, &$ob // 表示すべきIDとそのIDの並び順を一気に取得 $arrProductId = $objProduct->findProductIdsOrder($objQuery, array_merge($searchCondition['arrval'], $arrOrderVal)); - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrProducts = $objProduct->getListByProductIds($objQuery, $arrProductId); // 規格を設定 @@ -259,13 +263,13 @@ public function lfGetProductsList($searchCondition, $disp_number, $startno, &$ob /* 入力内容のチェック */ /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfCheckError($objFormParam) { // 入力データを渡す。 $arrForm = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrForm); + $objErr = new CheckError($arrForm); $objErr->arrErr = $objFormParam->checkError(); // 動的チェック @@ -287,7 +291,7 @@ public function lfCheckError($objFormParam) public function lfGetDisplayNum($display_number) { // 表示件数 - return (SC_Utils_Ex::sfIsInt($display_number)) + return (Utils::sfIsInt($display_number)) ? $display_number : current(array_keys($this->arrPRODUCTLISTMAX)); } @@ -305,7 +309,7 @@ public function lfGetPageTitle($mode, $category_id = 0) } elseif ($category_id == 0) { return '全商品'; } else { - $objCategory = new SC_Helper_Category_Ex(); + $objCategory = new CategoryHelper(); $arrCat = $objCategory->get($category_id); return $arrCat['category_name']; @@ -319,7 +323,7 @@ public function lfGetPageTitle($mode, $category_id = 0) */ public function lfGetSearchConditionDisp($arrSearchData) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrSearch = array('category' => '指定なし', 'maker' => '指定なし', 'name' => '指定なし'); // カテゴリ検索条件 if ($arrSearchData['category_id'] > 0) { @@ -328,7 +332,7 @@ public function lfGetSearchConditionDisp($arrSearchData) // メーカー検索条件 if (strlen($arrSearchData['maker_id']) > 0) { - $objMaker = new SC_Helper_Maker_Ex(); + $objMaker = new MakerHelper(); $maker = $objMaker->getMaker($arrSearchData['maker_id']); $arrSearch['maker'] = $maker['name']; } @@ -349,9 +353,9 @@ public function lfGetSearchConditionDisp($arrSearchData) public function lfGetProductAllNum($searchCondition) { // 検索結果対象となる商品の数を取得 - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $objQuery->setWhere($searchCondition['where_for_count']); - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); return $objProduct->findProductCount($objQuery, $searchCondition['arrval']); } @@ -372,11 +376,12 @@ public function lfGetSearchCondition($arrSearchData) // カテゴリからのWHERE文字列取得 if ($arrSearchData['category_id'] != 0) { - list($searchCondition['where_category'], $searchCondition['arrvalCategory']) = SC_Helper_DB_Ex::sfGetCatWhere($arrSearchData['category_id']); + $objDb = new DbHelper(); + list($searchCondition['where_category'], $searchCondition['arrvalCategory']) = $objDb->getCatWhere($arrSearchData['category_id']); } // ▼対象商品IDの抽出 // 商品検索条件の作成(未削除、表示) - $searchCondition['where'] = SC_Product_Ex::getProductDispConditions('alldtl'); + $searchCondition['where'] = Product::getProductDispConditions('alldtl'); if (strlen($searchCondition['where_category']) >= 1) { $searchCondition['where'] .= ' AND EXISTS (SELECT * FROM dtb_product_categories WHERE ' . $searchCondition['where_category'] . ' AND product_id = alldtl.product_id)'; @@ -432,7 +437,7 @@ public function lfSetSelectedData(&$arrProducts, $arrForm, $arrErr, $product_id) $arrProducts[$key]['classcategory_id2'] = $arrForm['classcategory_id2']; $arrProducts[$key]['quantity'] = $arrForm['quantity']; $arrProducts[$key]['arrErr'] = $arrErr; - $classcategory_id2 = SC_Utils_Ex::jsonEncode($arrForm['classcategory_id2']); + $classcategory_id2 = Utils::jsonEncode($arrForm['classcategory_id2']); $js_fnOnLoad .= "fnSetClassCategories(document.product_form{$arrProducts[$key]['product_id']}, {$classcategory_id2});"; } } @@ -447,7 +452,7 @@ public function lfSetSelectedData(&$arrProducts, $arrForm, $arrErr, $product_id) */ public function lfAddCart($arrForm) { - $objCartSess = new SC_CartSession_Ex(); + $objCartSess = new CartSession(); $product_class_id = $arrForm['product_class_id']; $objCartSess->addProduct($product_class_id, $arrForm['quantity']); @@ -487,21 +492,21 @@ public function setStatusDataTo($arrProducts, $arrStatus, $arrStatusImage) public function doJson() { $this->arrProducts = $this->setStatusDataTo($this->arrProducts, $this->arrSTATUS, $this->arrSTATUS_IMAGE); - SC_Product_Ex::setPriceTaxTo($this->arrProducts); + Product::setPriceTaxTo($this->arrProducts); // 一覧メイン画像の指定が無い商品のための処理 foreach ($this->arrProducts as $key=>$val) { - $this->arrProducts[$key]['main_list_image'] = SC_Utils_Ex::sfNoImageMainList($val['main_list_image']); + $this->arrProducts[$key]['main_list_image'] = Utils::sfNoImageMainList($val['main_list_image']); } - echo SC_Utils_Ex::jsonEncode($this->arrProducts); - SC_Response_Ex::actionExit(); + echo Utils::jsonEncode($this->arrProducts); + Response::actionExit(); } /** * - * @param SC_Product_Ex $objProduct - * @param SC_FormParam_Ex $objFormParam + * @param Product $objProduct + * @param FormParam $objFormParam * @return void */ public function doDefault(&$objProduct, &$objFormParam) @@ -529,11 +534,13 @@ public function doDefault(&$objProduct, &$objFormParam) $this->tpl_product_class_id = $objProduct->product_class_id; $this->tpl_product_type = $objProduct->product_type; + $js_fnOnLoad = ''; + // 商品ステータスを取得 $this->productStatus = $this->arrProducts['productStatus']; unset($this->arrProducts['productStatus']); - $this->tpl_javascript .= 'eccube.productsClassCategories = ' . SC_Utils_Ex::jsonEncode($objProduct->classCategories) . ';'; - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_PC) { + $this->tpl_javascript .= 'eccube.productsClassCategories = ' . Utils::jsonEncode($objProduct->classCategories) . ';'; + if (Display::detectDevice() === DEVICE_TYPE_PC) { //onloadスクリプトを設定. 在庫ありの商品のみ出力する foreach ($this->arrProducts as $arrProduct) { if ($arrProduct['stock_unlimited_max'] || $arrProduct['stock_max'] > 0) { @@ -546,9 +553,9 @@ public function doDefault(&$objProduct, &$objFormParam) $target_product_id = intval($this->arrForm['product_id']); if ($target_product_id > 0) { // 商品IDの正当性チェック - if (!SC_Utils_Ex::sfIsInt($this->arrForm['product_id']) - || !SC_Helper_DB_Ex::sfIsRecord('dtb_products', 'product_id', $this->arrForm['product_id'], 'del_flg = 0 AND status = 1')) { - SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); + if (!Utils::sfIsInt($this->arrForm['product_id']) + || !DbHelper::isRecord('dtb_products', 'product_id', $this->arrForm['product_id'], 'del_flg = 0 AND status = 1')) { + Utils::sfDispSiteError(PRODUCT_NOT_FOUND); } // 入力内容のチェック @@ -561,13 +568,13 @@ public function doDefault(&$objProduct, &$objFormParam) 'category_id' => $this->arrForm['category_id'], ); - SC_Response_Ex::sendRedirect(CART_URL, $arrQueryString); - SC_Response_Ex::actionExit(); + Response::sendRedirect(CART_URL, $arrQueryString); + Response::actionExit(); } $js_fnOnLoad .= $this->lfSetSelectedData($this->arrProducts, $this->arrForm, $arrErr, $target_product_id); } else { // カート「戻るボタン」用に保持 - $netURL = new Net_URL(); + $netURL = new \Net_URL(); //該当メソッドが無いため、$_SESSIONに直接セット $_SESSION['cart_referer_url'] = $netURL->getURL(); } diff --git a/data/Eccube/Page/Products/Search.php b/data/Eccube/Page/Products/Search.php new file mode 100644 index 00000000000..52fdb9b78c0 --- /dev/null +++ b/data/Eccube/Page/Products/Search.php @@ -0,0 +1,55 @@ +action(); + $this->sendResponse(); + } + + /** + * Page のプロセス. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/Eccube/Page/Regist/Complete.php b/data/Eccube/Page/Regist/Complete.php new file mode 100644 index 00000000000..0e01c8a14b9 --- /dev/null +++ b/data/Eccube/Page/Regist/Complete.php @@ -0,0 +1,56 @@ +tpl_title = '会員登録(完了ページ)'; + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + parent::process(); + $this->action(); + $this->sendResponse(); + } + + /** + * Page のAction. + * + * @return void + */ + public function action() + { + } +} diff --git a/data/class/pages/regist/LC_Page_Regist.php b/data/Eccube/Page/Regist/Index.php similarity index 69% rename from data/class/pages/regist/LC_Page_Regist.php rename to data/Eccube/Page/Regist/Index.php index da3915eb9e7..ebe31f0ba6d 100644 --- a/data/class/pages/regist/LC_Page_Regist.php +++ b/data/Eccube/Page/Regist/Index.php @@ -1,36 +1,36 @@ arrErr = $this->lfCheckError($_GET); - if ($this->arrErr) SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, $this->arrErr['id']); + if ($this->arrErr) Utils::sfDispSiteError(FREE_ERROR_MSG, '', true, $this->arrErr['id']); $registSecretKey = $this->lfRegistData($_GET); //本会員登録(フラグ変更) $this->lfSendRegistMail($registSecretKey); //本会員登録完了メール送信 - SC_Response_Ex::sendRedirect('complete.php', array('ci' => SC_Helper_Customer_Ex::sfGetCustomerId($registSecretKey))); + Response::sendRedirect('complete.php', array('ci' => CustomerHelper::sfGetCustomerId($registSecretKey))); break; //-- それ以外のアクセスは無効とする default: - SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, '無効なアクセスです。'); + Utils::sfDispSiteError(FREE_ERROR_MSG, '', true, '無効なアクセスです。'); break; } @@ -91,8 +91,8 @@ public function action() */ public function lfRegistData($array) { - $objQuery = SC_Query_Ex::getSingletonInstance(); - $arrRegist['secret_key'] = SC_Helper_Customer_Ex::sfGetUniqSecretKey(); //本登録ID発行 + $objQuery = Query::getSingletonInstance(); + $arrRegist['secret_key'] = CustomerHelper::sfGetUniqSecretKey(); //本登録ID発行 $arrRegist['status'] = 2; $arrRegist['update_date'] = 'CURRENT_TIMESTAMP'; @@ -112,10 +112,10 @@ public function lfRegistData($array) */ public function lfCheckError($array) { - $objErr = new SC_CheckError_Ex($array); + $objErr = new CheckError($array); if (preg_match("/^[[:alnum:]]+$/", $array['id'])) { - if (!is_numeric(SC_Helper_Customer_Ex::sfGetCustomerId($array['id'], true))) { + if (!is_numeric(CustomerHelper::sfGetCustomerId($array['id'], true))) { $objErr->arrErr['id'] = '※ 既に会員登録が完了しているか、無効なURLです。
'; } @@ -135,11 +135,11 @@ public function lfCheckError($array) */ public function lfSendRegistMail($registSecretKey) { - $objQuery = SC_Query_Ex::getSingletonInstance(); - $objCustomer = new SC_Customer_Ex(); - $objHelperMail = new SC_Helper_Mail_Ex(); + $objQuery = Query::getSingletonInstance(); + $objCustomer = new Customer(); + $objHelperMail = new MailHelper(); $objHelperMail->setPage($this); - $CONF = SC_Helper_DB_Ex::sfGetBasisData(); + $CONF = DbHelper::getBasisData(); //-- 会員データを取得 $arrCustomer = $objQuery->select('*', 'dtb_customer', 'secret_key = ?', array($registSecretKey)); @@ -147,14 +147,14 @@ public function lfSendRegistMail($registSecretKey) $objCustomer->setLogin($data['email']); //-- メール送信 - $objMailText = new SC_SiteView_Ex(); + $objMailText = new SiteView(); $objMailText->setPage($this); $objMailText->assign('CONF', $CONF); $objMailText->assign('name01', $data['name01']); $objMailText->assign('name02', $data['name02']); $toCustomerMail = $objMailText->fetch('mail_templates/customer_regist_mail.tpl'); $subject = $objHelperMail->sfMakesubject('会員登録が完了しました。'); - $objMail = new SC_SendMail_Ex(); + $objMail = new SendMail(); $objMail->setItem( '', // 宛先 diff --git a/data/class/pages/LC_Page_ResizeImage.php b/data/Eccube/Page/ResizeImage.php similarity index 84% rename from data/class/pages/LC_Page_ResizeImage.php rename to data/Eccube/Page/ResizeImage.php index ad6aae538e7..b0ba3880d63 100644 --- a/data/class/pages/LC_Page_ResizeImage.php +++ b/data/Eccube/Page/ResizeImage.php @@ -21,16 +21,21 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php'; +namespace Eccube\Page; + +use Eccube\Common\FormParam; +use Eccube\Common\Query; +use Eccube\Common\Helper\DbHelper; +use Eccube\Common\Util\Utils; +use Eccube\Common\Util\GcUtils; /** * リサイズイメージ のページクラス. * * @package Page - * @author LOCKON CO.,LTD. - * @version $Id$ + * @author LOCKON CO.,LTD. */ -class LC_Page_ResizeImage extends LC_Page_Ex +class ResizeImage extends AbstractPage { /** * Page を初期化する. @@ -61,11 +66,11 @@ public function process() */ public function action() { - $objFormParam = new SC_FormParam_Ex(); + $objFormParam = new FormParam(); $this->lfInitParam($objFormParam); $objFormParam->setParam($_GET); $arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($arrErr)) { + if (Utils::isBlank($arrErr)) { $arrForm = $objFormParam->getHashArray(); @@ -73,9 +78,9 @@ public function action() // NO_IMAGE_REALFILE以外のファイル名が直接渡された場合、ファイル名のチェックを行う if (strlen($arrForm['image']) >= 1 && $arrForm['image'] !== NO_IMAGE_REALFILE ) { if (!$this->lfCheckFileName($arrForm['image'])) { - GC_Utils_Ex::gfPrintLog('invalid access :resize_image.php image=' . $arrForm['image']); + GcUtils::gfPrintLog('invalid access :resize_image.php image=' . $arrForm['image']); } - $file = SC_Utils_Ex::getSaveImagePath($arrForm['image']); + $file = Utils::getSaveImagePath($arrForm['image']); } else { // 商品画像を取得する $file = $this->lfGetProductImage($arrForm); @@ -87,7 +92,7 @@ public function action() } /** - * @param SC_FormParam_Ex $objFormParam + * @param FormParam $objFormParam */ public function lfInitParam(&$objFormParam) { @@ -123,19 +128,19 @@ public function lfCheckFileName($image) */ public function lfGetProductImage($arrForm) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $table = 'dtb_products'; $col = $arrForm['image_key']; $product_id = $arrForm['product_id']; //指定されたカラムが存在する場合にのみ商品テーブルからファイル名を取得 - if (SC_Helper_DB_Ex::sfColumnExists($table, $col, '', '', false)) { + if (DbHelper::columnExists($table, $col, '', '', false)) { $product_image = $objQuery->get($col, $table, 'product_id = ?', array($product_id)); } else { - GC_Utils_Ex::gfPrintLog('invalid access :resize_image.php image_key=' . $col); + GcUtils::gfPrintLog('invalid access :resize_image.php image_key=' . $col); $product_image = ''; } // ファイル名が正しく、ファイルが存在する場合だけ、$fileを設定 - $file = SC_Utils_Ex::getSaveImagePath($product_image); + $file = Utils::getSaveImagePath($product_image); return $file; } diff --git a/data/class/pages/rss/LC_Page_Rss.php b/data/Eccube/Page/Rss/Index.php similarity index 67% rename from data/class/pages/rss/LC_Page_Rss.php rename to data/Eccube/Page/Rss/Index.php index 66578196399..cbb2da462a6 100644 --- a/data/class/pages/rss/LC_Page_Rss.php +++ b/data/Eccube/Page/Rss/Index.php @@ -1,36 +1,30 @@ lfGetNews(); @@ -87,15 +81,15 @@ public function process() */ public function lfGetNews() { - $objNews = new SC_Helper_News_Ex(); + $objNews = new NewsHelper(); $arrNews = $objNews->getList(); - $objDb = new SC_Helper_DB_Ex(); - $arrInfo = $objDb->sfGetBasisData(); + $objDb = new DbHelper(); + $arrInfo = $objDb->getBasisData(); // RSS用に変換 foreach (array_keys($arrNews) as $key) { - $netUrlHttpUrl = new Net_URL(HTTP_URL); + $netUrlHttpUrl = new \Net_URL(HTTP_URL); $row =& $arrNews[$key]; $row['shop_name'] = $arrInfo['shop_name']; @@ -103,11 +97,11 @@ public function lfGetNews() // 日付 $row['news_date'] = date('r', strtotime($row['news_date'])); // 新着情報URL - if (SC_Utils_Ex::isBlank($row['news_url'])) { + if (Utils::isBlank($row['news_url'])) { $row['news_url'] = HTTP_URL; } elseif ($row['news_url'][0] == '/') { // 変換(絶対パス→URL) - $netUrl = new Net_URL($row['news_url']); + $netUrl = new \Net_URL($row['news_url']); $netUrl->protocol = $netUrlHttpUrl->protocol; $netUrl->user = $netUrlHttpUrl->user; $netUrl->pass = $netUrlHttpUrl->pass; diff --git a/data/class/pages/rss/LC_Page_Rss_Products.php b/data/Eccube/Page/Rss/Products.php similarity index 84% rename from data/class/pages/rss/LC_Page_Rss_Products.php rename to data/Eccube/Page/Rss/Products.php index 368ea22397e..974dc2f26f4 100644 --- a/data/class/pages/rss/LC_Page_Rss_Products.php +++ b/data/Eccube/Page/Rss/Products.php @@ -1,36 +1,31 @@ arrSiteInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $this->arrSiteInfo = DbHelper::getBasisData(); //商品IDを取得 if (isset($_GET['product_id']) && $_GET['product_id'] != '' && is_numeric($_GET['product_id'])) { @@ -125,7 +120,7 @@ public function action() */ public function lfGetProductsDetailData($mode, $product_id) { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); //商品詳細を取得 if ($mode == 'all') { $arrProduct = $this->lfGetProductsDetail($objQuery, $mode); @@ -135,7 +130,7 @@ public function lfGetProductsDetailData($mode, $product_id) // 値の整形 foreach (array_keys($arrProduct) as $key) { //販売価格を税込みに編集 - $arrProduct[$key]['price02'] = SC_Helper_DB_Ex::sfCalcIncTax($arrProduct[$key]['price02']); + $arrProduct[$key]['price02'] = DbHelper::calcIncTax($arrProduct[$key]['price02']); // 画像ファイルのURLセット if (file_exists(IMAGE_SAVE_REALDIR . $arrProduct[$key]['main_list_image'])) { $dir = IMAGE_SAVE_RSS_URL; @@ -156,7 +151,7 @@ public function lfGetProductsDetailData($mode, $product_id) } $arrProduct[$key]['main_large_image'] = $dir . $arrProduct[$key]['main_large_image']; // ポイント計算 - $arrProduct[$key]['point'] = SC_Utils_Ex::sfPrePoint( + $arrProduct[$key]['point'] = Utils::sfPrePoint( $arrProduct[$key]['price02'], $arrProduct[$key]['point_rate'] ); @@ -178,7 +173,7 @@ public function lfGetProductsDetailData($mode, $product_id) */ public function lfGetProductsListData() { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); //商品一覧を取得 $arrProduct = $objQuery->getAll('SELECT product_id, name AS product_name FROM dtb_products'); @@ -192,7 +187,7 @@ public function lfGetProductsListData() */ public function lfGetProductsAllData() { - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); //商品情報を取得 $arrProduct = $this->lfGetProductsAllclass($objQuery); // 値の整形 @@ -217,11 +212,11 @@ public function lfGetProductsAllData() } $arrProduct[$key]['main_large_image'] = $dir . $arrProduct[$key]['main_large_image']; // ポイント計算 - $arrProduct[$key]['point_max'] = SC_Utils_Ex::sfPrePoint( + $arrProduct[$key]['point_max'] = Utils::sfPrePoint( $arrProduct[$key]['price02_max'], $arrProduct[$key]['point_rate'] ); - $arrProduct[$key]['point_min'] = SC_Utils_Ex::sfPrePoint( + $arrProduct[$key]['point_min'] = Utils::sfPrePoint( $arrProduct[$key]['price02_min'], $arrProduct[$key]['point_rate'] ); @@ -233,13 +228,13 @@ public function lfGetProductsAllData() /** * 商品情報を取得する * - * @param SC_Query $objQuery DB操作クラス + * @param Query $objQuery DB操作クラス * @param integer $product_id 商品ID * @return array $arrProduct 取得結果を配列で返す */ public function lfGetProductsDetail(&$objQuery, $product_id = 'all') { - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); // --- 商品詳細の取得 if ($product_id == 'all') { @@ -277,13 +272,13 @@ public function lfGetProductsDetail(&$objQuery, $product_id = 'all') /** * 商品情報を取得する(vw_products_allclass使用) * - * @param SC_Query $objQuery DB操作クラス + * @param Query $objQuery DB操作クラス * @return array $arrProduct 取得結果を配列で返す */ public function lfGetProductsAllclass(&$objQuery) { // --- 商品一覧の取得 - $objProduct = new SC_Product_Ex(); + $objProduct = new Product(); $objQuery->setWhere($objProduct->getProductDispConditions()); $objQuery->setOrder('product_id'); $arrProductLsit = $objProduct->lists($objQuery); @@ -310,7 +305,7 @@ public function lfGetProductsAllclass(&$objQuery) } // 税込金額を設定する - SC_Product_Ex::setIncTaxToProducts($arrProducts); + Product::setIncTaxToProducts($arrProducts); return $arrProducts; } diff --git a/data/class/pages/shopping/LC_Page_Shopping_Complete.php b/data/Eccube/Page/Shopping/Complete.php similarity index 52% rename from data/class/pages/shopping/LC_Page_Shopping_Complete.php rename to data/Eccube/Page/Shopping/Complete.php index 7a4e71e4393..2039749988c 100644 --- a/data/class/pages/shopping/LC_Page_Shopping_Complete.php +++ b/data/Eccube/Page/Shopping/Complete.php @@ -1,36 +1,27 @@ arrInfo = SC_Helper_DB_Ex::sfGetBasisData(); + $this->arrInfo = DbHelper::getBasisData(); } /** diff --git a/data/Eccube/Page/Shopping/Confirm.php b/data/Eccube/Page/Shopping/Confirm.php new file mode 100644 index 00000000000..df5435aa122 --- /dev/null +++ b/data/Eccube/Page/Shopping/Confirm.php @@ -0,0 +1,298 @@ +tpl_title = '入力内容のご確認'; + $masterData = new MasterData(); + $this->arrPref = $masterData->getMasterData('mtb_pref'); + $this->arrCountry = $masterData->getMasterData('mtb_country'); + $this->arrSex = $masterData->getMasterData('mtb_sex'); + $this->arrJob = $masterData->getMasterData('mtb_job'); + $this->arrMAILMAGATYPE = $masterData->getMasterData('mtb_mail_magazine_type'); + $this->arrReminder = $masterData->getMasterData('mtb_reminder'); + $this->httpCacheControl('nocache'); + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + parent::process(); + $this->action(); + $this->sendResponse(); + } + + /** + * Page のアクション. + * + * @return void + */ + public function action() + { + //決済処理中ステータスのロールバック + $objPurchase = new PurchaseHelper(); + $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); + + $objCartSess = new CartSession(); + $objSiteSess = new SiteSession(); + $objCustomer = new Customer(); + + $this->is_multiple = $objPurchase->isMultiple(); + + // 前のページで正しく登録手続きが行われた記録があるか判定 + if (!$objSiteSess->isPrePage()) { + Utils::sfDispSiteError(PAGE_ERROR, $objSiteSess); + } + + // ユーザユニークIDの取得と購入状態の正当性をチェック + $this->tpl_uniqid = $objSiteSess->getUniqId(); + $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); + + $this->cartKey = $objCartSess->getKey(); + + // カート内商品のチェック + $this->tpl_message = $objCartSess->checkProducts($this->cartKey); + if (!Utils::isBlank($this->tpl_message)) { + Response::sendRedirect(CART_URL); + Response::actionExit(); + } + $this->is_download = ($this->cartKey == PRODUCT_TYPE_DOWNLOAD); + + // カートの商品を取得 + $this->arrShipping = $objPurchase->getShippingTemp($this->is_multiple); + $this->arrCartItems = $objCartSess->getCartList($this->cartKey); + // 合計金額 + $this->tpl_total_inctax = $objCartSess->getAllProductsTotal($this->cartKey); + // 税額 + $this->tpl_total_tax = $objCartSess->getAllProductsTax($this->cartKey); + $this->tpl_total_tax = $objCartSess->getAllProductsTax($this->cartKey); + + $objFormParam = new FormParam(); + $this->lfInitParam($objFormParam, $this->arrShipping); + $objFormParam->setParam($_POST); + $objFormParam->convParam(); + $objFormParam->trimParam(); + + // 一時受注テーブルの読込 + $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid); + + // 配送業者を取得 + $objDelivery = new DeliveryHelper(); + $this->arrDeliv = $objDelivery->getList($this->cartKey, false, true); + $this->tpl_is_single_deliv = $objDelivery->isSingleDeliv($this->cartKey); + + // お届け日一覧の取得 + $this->arrDelivDate = $objPurchase->getDelivDate($objCartSess, $this->cartKey); + + if (Utils::sfIsInt($arrOrderTemp['deliv_id'])) { + $this->arrPayment = $objPurchase->getSelectablePayment($objCartSess, $arrOrderTemp['deliv_id'], true); + $this->arrDelivTime = DeliveryHelper::getDelivTime($arrOrderTemp['deliv_id']); + } + + // カート集計を元に最終計算 + $arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer, + $arrOrderTemp['use_point'], + $objPurchase->getShippingPref($this->is_multiple), + $arrOrderTemp['charge'], + $arrOrderTemp['discount'], + $arrOrderTemp['deliv_id'], + $arrOrderTemp['order_pref'], // 税金計算の為に追加 注文者基準 + $arrOrderTemp['order_country_id'] // 税金計算の為に追加 注文者基準 + ); + + $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults); + foreach ($objFormParam->getHashArray() as $key => $param) { + if (!Utils::isBlank($param) && Utils::isBlank($this->arrForm[$key])) { + $this->arrForm[$key] = $param; + } + } + + // 会員ログインチェック + if ($objCustomer->isLoginSuccess(true)) { + $this->tpl_login = '1'; + $this->tpl_user_point = $objCustomer->getValue('point'); + } + + // 決済モジュールを使用するかどうか + $this->use_module = PaymentHelper::useModule($this->arrForm['payment_id']); + + switch ($this->getMode()) { + case 'select_deliv': + $sqlval = $objFormParam->getHashArray(); + if (Utils::isBlank($sqlval['use_point'])) { + $sqlval['use_point'] = '0'; + } + $deliv_id = $objFormParam->getValue('deliv_id'); + $arrPayment = $objPurchase->getSelectablePayment($objCartSess, $deliv_id); + $sqlval['payment_id'] = $arrPayment[0]['payment_id']; + $sqlval['payment_method'] = $arrPayment[0]['payment_method']; + $objPurchase->saveOrderTemp($this->tpl_uniqid, $sqlval); + Response::reload(); + break; + // 前のページに戻る + case 'return': + // 正常な推移であることを記録しておく + $objSiteSess->setRegistFlag(); + + Response::sendRedirect(SHOPPING_PAYMENT_URLPATH); + Response::actionExit(); + break; + case 'confirm': + $this->saveShippings($objFormParam, $this->arrDelivTime); + $deliv_id = $objFormParam->getValue('deliv_id'); + $arrPayment = $objPurchase->getSelectablePayment($objCartSess, $deliv_id); + $this->lfRegistPayment($this->tpl_uniqid, $objFormParam->getHashArray(), $objPurchase, $arrPayment); + /* + * 決済モジュールで必要なため, 受注番号を取得 + */ + $this->arrForm['order_id'] = $objPurchase->getNextOrderID(); + $_SESSION['order_id'] = $this->arrForm['order_id']; + + // 集計結果を受注一時テーブルに反映 + $objPurchase->saveOrderTemp($this->tpl_uniqid, $this->arrForm, + $objCustomer); + + // 正常に登録されたことを記録しておく + $objSiteSess->setRegistFlag(); + + // 決済モジュールを使用する場合 + if ($this->use_module) { + $objPurchase->completeOrder(ORDER_PENDING); + + Response::sendRedirect(SHOPPING_MODULE_URLPATH); + // 購入完了ページ + } else { + $objPurchase->completeOrder(ORDER_NEW); + PurchaseHelper::sendOrderMail($this->arrForm['order_id'], $this); + + Response::sendRedirect(SHOPPING_COMPLETE_URLPATH); + } + Response::actionExit(); + break; + default: + break; + } + + } + + + /** + * パラメーター情報の初期化を行う. + * + * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param array $arrShipping 配送先情報の配列 + * @return void + */ + public function lfInitParam(&$objFormParam, &$arrShipping) + { + $objFormParam->addParam('配送業者', 'deliv_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); + $objFormParam->addParam('ポイント', 'use_point', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK', 'ZERO_START')); + $objFormParam->addParam('その他お問い合わせ', 'message', LTEXT_LEN, 'KVa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); + $objFormParam->addParam('ポイントを使用する', 'point_check', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '2'); + + $objFormParam->addParam('お支払い方法', 'payment_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); + + foreach ($arrShipping as $val) { + $objFormParam->addParam('お届け時間', 'deliv_time_id' . $val['shipping_id'], INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); + $objFormParam->addParam('お届け日', 'deliv_date' . $val['shipping_id'], STEXT_LEN, 'KVa', array('MAX_LENGTH_CHECK')); + } + + $objFormParam->setParam($arrShipping); + $objFormParam->convParam(); + } + + /** + * 配送情報を保存する. + * + * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param array $arrDelivTime 配送時間の配列 + */ + public function saveShippings(&$objFormParam, $arrDelivTime) + { + // ダウンロード商品の場合は配送先が存在しない + if ($this->is_download) return; + + $deliv_id = $objFormParam->getValue('deliv_id'); + /* TODO + * SC_Purchase::getShippingTemp() で取得して, + * リファレンスで代入すると, セッションに添字を追加できない? + */ + foreach (array_keys($_SESSION['shipping']) as $key) { + $shipping_id = $_SESSION['shipping'][$key]['shipping_id']; + $time_id = $objFormParam->getValue('deliv_time_id' . $shipping_id); + $_SESSION['shipping'][$key]['deliv_id'] = $deliv_id; + $_SESSION['shipping'][$key]['time_id'] = $time_id; + $_SESSION['shipping'][$key]['shipping_time'] = $arrDelivTime[$time_id]; + $_SESSION['shipping'][$key]['shipping_date'] = $objFormParam->getValue("deliv_date{$shipping_id}"); + } + } + + /** + * 受注一時テーブルへ登録を行う. + * + * @param integer $uniqid 受注一時テーブルのユニークID + * @param array $arrForm フォームの入力値 + * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス + * @param array $arrPayment お支払い方法の配列 + * @return void + */ + public function lfRegistPayment($uniqid, $arrForm, &$objPurchase, $arrPayment) + { + $arrForm['order_temp_id'] = $uniqid; + $arrForm['update_date'] = 'CURRENT_TIMESTAMP'; + + if ($arrForm['point_check'] != '1') { + $arrForm['use_point'] = 0; + } + + foreach ($arrPayment as $payment) { + if ($arrForm['payment_id'] == $payment['payment_id']) { + $arrForm['charge'] = $payment['charge']; + $arrForm['payment_method'] = $payment['payment_method']; + break; + } + } + $this->arrForm = array_merge($this->arrForm, $arrForm); + } +} diff --git a/data/class/pages/shopping/LC_Page_Shopping_Deliv.php b/data/Eccube/Page/Shopping/Deliv.php similarity index 72% rename from data/class/pages/shopping/LC_Page_Shopping_Deliv.php rename to data/Eccube/Page/Shopping/Deliv.php index e84ed6f31ab..8f65a3f6798 100644 --- a/data/class/pages/shopping/LC_Page_Shopping_Deliv.php +++ b/data/Eccube/Page/Shopping/Deliv.php @@ -1,36 +1,35 @@ arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->tpl_title = 'お届け先の指定'; @@ -67,14 +66,14 @@ public function process() public function action() { //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - $objSiteSess = new SC_SiteSession_Ex(); - $objCartSess = new SC_CartSession_Ex(); - $objCustomer = new SC_Customer_Ex(); - $objFormParam = new SC_FormParam_Ex(); - $objAddress = new SC_Helper_Address_Ex(); + $objSiteSess = new SiteSession(); + $objCartSess = new CartSession(); + $objCustomer = new Customer(); + $objFormParam = new FormParam(); + $objAddress = new AddressHelper(); $this->tpl_uniqid = $objSiteSess->getUniqId(); $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); @@ -83,7 +82,7 @@ public function action() // ログインチェック if (!$objCustomer->isLoginSuccess(true)) { - SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR); + Utils::sfDispSiteError(CUSTOMER_ERROR); } // ダウンロード商品の場合は、支払方法画面に転送 @@ -93,17 +92,17 @@ public function action() $objPurchase->saveOrderTemp($this->tpl_uniqid, $sqlval, $objCustomer); $objSiteSess->setRegistFlag(); - SC_Response_Ex::sendRedirect('payment.php'); - SC_Response_Ex::actionExit(); + Response::sendRedirect('confirm.php'); + Response::actionExit(); } $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $objFormParam->convParam(); $arrErr = $objFormParam->checkError(); - if (!SC_Utils_Ex::isBlank($arrErr)) { - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); - SC_Response_Ex::actionExit(); + if (!Utils::isBlank($arrErr)) { + Utils::sfDispSiteError(PAGE_ERROR, '', true); + Response::actionExit(); } $arrForm = $objFormParam->getHashArray(); @@ -112,8 +111,8 @@ public function action() // 削除 case 'delete': if (!$objAddress->deleteAddress($arrForm['other_deliv_id'], $objCustomer->getValue('customer_id'))) { - SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を削除できませんでした。'); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(FREE_ERROR_MSG, '', false, '別のお届け先を削除できませんでした。'); + Response::actionExit(); } break; @@ -124,40 +123,40 @@ public function action() $shipping_id = $arrForm['deliv_check'] == -1 ? 0 : $arrForm['deliv_check']; $success = $this->registerDeliv($shipping_id, $this->tpl_uniqid, $objPurchase, $objCustomer, $objAddress); if (!$success) { - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); + Utils::sfDispSiteError(PAGE_ERROR, '', true); } $objPurchase->setShipmentItemTempForSole($objCartSess, $shipping_id); $objSiteSess->setRegistFlag(); - SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); - SC_Response_Ex::actionExit(); + Response::sendRedirect(SHOPPING_CONFIRM_URLPATH); + Response::actionExit(); break; // 前のページに戻る case 'return': // 確認ページへ移動 - SC_Response_Ex::sendRedirect(CART_URL); - SC_Response_Ex::actionExit(); + Response::sendRedirect('confirm.php'); + Response::actionExit(); break; // お届け先複数指定 case 'multiple': // 複数配送先指定が無効な場合はエラー if (USE_MULTIPLE_SHIPPING === false) { - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(PAGE_ERROR, '', true); + Response::actionExit(); } - SC_Response_Ex::sendRedirect('multiple.php'); - SC_Response_Ex::actionExit(); + Response::sendRedirect('multiple.php'); + Response::actionExit(); break; default: // 配送IDの取得 $shippingData = $objPurchase->getShippingTemp(); - if (!SC_Utils_Ex::isBlank($shippingData)) { + if (!Utils::isBlank($shippingData)) { $arrShippingId = array_keys($shippingData); } if (isset($arrShippingId[0])) { @@ -196,7 +195,7 @@ public function action() /** * パラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) @@ -214,12 +213,12 @@ public function lfInitParam(&$objFormParam) * * @param integer $other_deliv_id * @param string $uniqid 受注一時テーブルのユニークID - * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス - * @param SC_Customer $objCustomer SC_Customer インスタンス - * @param SC_Helper_Address_Ex $objAddress + * @param PurchaseHelper $objPurchase PurchaseHelper インスタンス + * @param Customer $objCustomer Customer インスタンス + * @param AddressHelper $objAddress * @return boolean お届け先チェックの値が妥当な場合 true */ - public function registerDeliv($other_deliv_id, $uniqid, &$objPurchase, &$objCustomer, $objAddress) + public function registerDeliv($other_deliv_id, $uniqid, &$objPurchase, Customer &$objCustomer, $objAddress) { $arrValues = array(); // 会員登録住所がチェックされている場合 diff --git a/data/class/pages/shopping/LC_Page_Shopping.php b/data/Eccube/Page/Shopping/Index.php similarity index 73% rename from data/class/pages/shopping/LC_Page_Shopping.php rename to data/Eccube/Page/Shopping/Index.php index 4e1e3886d73..4c2ad665ff7 100644 --- a/data/class/pages/shopping/LC_Page_Shopping.php +++ b/data/Eccube/Page/Shopping/Index.php @@ -1,36 +1,38 @@ tpl_title = 'ログイン'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); $this->arrCountry = $masterData->getMasterData('mtb_country'); $this->arrSex = $masterData->getMasterData('mtb_sex'); $this->arrJob = $masterData->getMasterData('mtb_job'); $this->tpl_onload = 'eccube.toggleDeliveryForm();'; - $objDate = new SC_Date_Ex(BIRTH_YEAR, date('Y')); + $objDate = new Date(BIRTH_YEAR, date('Y'), strtotime('now')); $this->arrYear = $objDate->getYear('', START_BIRTH_YEAR, ''); $this->arrMonth = $objDate->getMonth(true); $this->arrDay = $objDate->getDay(true); @@ -76,14 +78,14 @@ public function process() public function action() { //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - $objSiteSess = new SC_SiteSession_Ex(); - $objCartSess = new SC_CartSession_Ex(); - $objCustomer = new SC_Customer_Ex(); - $objCookie = new SC_Cookie_Ex(); - $objFormParam = new SC_FormParam_Ex(); + $objSiteSess = new SiteSession(); + $objCartSess = new CartSession(); + $objCustomer = new Customer(); + $objCookie = new Cookie(); + $objFormParam = new FormParam(); $nonmember_mainpage = 'shopping/nonmember_input.tpl'; $nonmember_title = 'お客様情報入力'; @@ -95,23 +97,23 @@ public function action() // ログイン済みの場合は次画面に遷移 if ($objCustomer->isLoginSuccess(true)) { - SC_Response_Ex::sendRedirect( + Response::sendRedirect( $this->getNextlocation($this->cartKey, $this->tpl_uniqid, $objCustomer, $objPurchase, - $objSiteSess)); - SC_Response_Ex::actionExit(); + $objSiteSess, $objCartSess)); + Response::actionExit(); // 非会員かつ, ダウンロード商品の場合はエラー表示 } else { if ($this->cartKey == PRODUCT_TYPE_DOWNLOAD) { $msg = 'ダウンロード商品を含むお買い物は、会員登録が必要です。
' . 'お手数ですが、会員登録をお願いします。'; - SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, $objSiteSess, false, $msg); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(FREE_ERROR_MSG, $objSiteSess, false, $msg); + Response::actionExit(); } } // 携帯端末IDが一致する会員が存在するかどうかをチェックする。 - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() === DEVICE_TYPE_MOBILE) { $this->tpl_valid_phone_id = $objCustomer->checkMobilePhoneId(); } @@ -126,7 +128,7 @@ public function action() $this->arrErr = $objFormParam->checkError(); // ログイン判定 - if (SC_Utils_Ex::isBlank($this->arrErr) + if (Utils::isBlank($this->arrErr) && $objCustomer->doLogin($objFormParam->getValue('login_email'), $objFormParam->getValue('login_pass'))) { // クッキー保存判定 @@ -137,43 +139,43 @@ public function action() } // モバイルサイトで携帯アドレスの登録が無い場合、携帯アドレス登録ページへ遷移 - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE) { if (!$objCustomer->hasValue('email_mobile')) { - SC_Response_Ex::sendRedirectFromUrlPath('entry/email_mobile.php'); - SC_Response_Ex::actionExit(); + Response::sendRedirectFromUrlPath('entry/email_mobile.php'); + Response::actionExit(); } // スマートフォンの場合はログイン成功を返す - } elseif (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { - echo SC_Utils_Ex::jsonEncode(array('success' => + } elseif (Display::detectDevice() === DEVICE_TYPE_SMARTPHONE) { + echo Utils::jsonEncode(array('success' => $this->getNextLocation($this->cartKey, $this->tpl_uniqid, $objCustomer, $objPurchase, - $objSiteSess))); - SC_Response_Ex::actionExit(); + $objSiteSess, $objCartSess))); + Response::actionExit(); } - SC_Response_Ex::sendRedirect( + Response::sendRedirect( $this->getNextLocation($this->cartKey, $this->tpl_uniqid, $objCustomer, $objPurchase, $objSiteSess)); - SC_Response_Ex::actionExit(); + Response::actionExit(); // ログインに失敗した場合 } else { // 仮登録の場合 - if (SC_Helper_Customer_Ex::checkTempCustomer($objFormParam->getValue('login_email'))) { - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { + if (CustomerHelper::checkTempCustomer($objFormParam->getValue('login_email'))) { + if (Display::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(TEMP_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Response::actionExit(); } else { - SC_Utils_Ex::sfDispSiteError(TEMP_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(TEMP_LOGIN_ERROR); + Response::actionExit(); } } else { - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_SMARTPHONE) { + if (Display::detectDevice() === DEVICE_TYPE_SMARTPHONE) { echo $this->lfGetErrorMessage(SITE_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Response::actionExit(); } else { - SC_Utils_Ex::sfDispSiteError(SITE_LOGIN_ERROR); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(SITE_LOGIN_ERROR); + Response::actionExit(); } } } @@ -186,7 +188,7 @@ public function action() $objFormParam->setParam($_POST); $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->lfRegistData($this->tpl_uniqid, $objPurchase, $objCustomer, $objFormParam); $arrParams = $objFormParam->getHashArray(); @@ -195,36 +197,36 @@ public function action() $objSiteSess->setRegistFlag(); - SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); - SC_Response_Ex::actionExit(); + Response::sendRedirect(SHOPPING_PAYMENT_URLPATH); + Response::actionExit(); } break; // 前のページに戻る case 'return': - SC_Response_Ex::sendRedirect(CART_URL); - SC_Response_Ex::actionExit(); + Response::sendRedirect(CART_URL); + Response::actionExit(); break; // 複数配送ページへ遷移 case 'multiple': // 複数配送先指定が無効な場合はエラー if (USE_MULTIPLE_SHIPPING === false) { - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(PAGE_ERROR, '', true); + Response::actionExit(); } $this->lfInitParam($objFormParam); $objFormParam->setParam($_POST); $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $this->lfRegistData($this->tpl_uniqid, $objPurchase, $objCustomer, $objFormParam, true); $objSiteSess->setRegistFlag(); - SC_Response_Ex::sendRedirect(MULTIPLE_URLPATH); - SC_Response_Ex::actionExit(); + Response::sendRedirect(MULTIPLE_URLPATH); + Response::actionExit(); } $this->tpl_mainpage = $nonmember_mainpage; $this->tpl_title = $nonmember_title; @@ -257,7 +259,7 @@ public function action() // 記憶したメールアドレスを取得 $this->tpl_login_email = $objCookie->getCookie('login_email'); - if (!SC_Utils_Ex::isBlank($this->tpl_login_email)) { + if (!Utils::isBlank($this->tpl_login_email)) { $this->tpl_login_memory = '1'; } } @@ -265,13 +267,13 @@ public function action() /** * お客様情報入力時のパラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitParam(&$objFormParam) { - SC_Helper_Customer_Ex::sfCustomerCommonParam($objFormParam, 'order_'); - SC_Helper_Customer_Ex::sfCustomerRegisterParam($objFormParam, false, false, 'order_'); + CustomerHelper::sfCustomerCommonParam($objFormParam, 'order_'); + CustomerHelper::sfCustomerRegisterParam($objFormParam, false, false, 'order_'); // 不要なパラメーターの削除 // XXX: 共通化したことをうまく使えば、以前あった購入同時会員登録も復活出来そうですが @@ -283,13 +285,13 @@ public function lfInitParam(&$objFormParam) $objFormParam->addParam('別のお届け先', 'deliv_check', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); - SC_Helper_Customer_Ex::sfCustomerCommonParam($objFormParam, 'shipping_'); + CustomerHelper::sfCustomerCommonParam($objFormParam, 'shipping_'); } /** * ログイン時のパラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ public function lfInitLoginFormParam(&$objFormParam) @@ -316,25 +318,26 @@ public function lfInitLoginFormParam(&$objFormParam) * * @param integer $product_type_id 商品種別ID * @param string $uniqid 受注一時テーブルのユニークID - * @param SC_Customer $objCustomer SC_Customer インスタンス - * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス - * @param SC_SiteSession $objSiteSess SC_SiteSession インスタンス + * @param Customer $objCustomer Customer インスタンス + * @param PurchaseHelper $objPurchase PurchaseHelper インスタンス + * @param SiteSession $objSiteSess SiteSession インスタンス * @return string 遷移先のパス */ - public function getNextLocation($product_type_id, $uniqid, &$objCustomer, &$objPurchase, &$objSiteSess) + public function getNextLocation($product_type_id, $uniqid, Customer &$objCustomer, &$objPurchase, SiteSession &$objSiteSess, &$objCartSess) { + $objPurchase->setDefaultPurchase($uniqid, $product_type_id, $objCustomer, $objCartSess); switch ($product_type_id) { case PRODUCT_TYPE_DOWNLOAD: $objPurchase->unsetAllShippingTemp(true); $objPurchase->saveOrderTemp($uniqid, array(), $objCustomer); - $objSiteSess->setRegistFlag(); - - return 'payment.php'; + break; case PRODUCT_TYPE_NORMAL: default: - return 'deliv.php'; + break; } + $objSiteSess->setRegistFlag(); + return 'confirm.php'; } /** @@ -342,12 +345,12 @@ public function getNextLocation($product_type_id, $uniqid, &$objCustomer, &$objP * * 非会員向けの処理 * @param integer $uniqid 受注一時テーブルのユニークID - * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス - * @param SC_Customer $objCustomer SC_Customer インスタンス - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param PurchaseHelper $objPurchase PurchaseHelper インスタンス + * @param Customer $objCustomer Customer インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param boolean $isMultiple 複数配送の場合 true */ - public function lfRegistData($uniqid, &$objPurchase, &$objCustomer, &$objFormParam, $isMultiple = false) + public function lfRegistData($uniqid, &$objPurchase, Customer &$objCustomer, &$objFormParam, $isMultiple = false) { $arrParams = $objFormParam->getHashArray(); @@ -377,7 +380,7 @@ public function lfRegistData($uniqid, &$objPurchase, &$objCustomer, &$objFormPar $arrValues = $objFormParam->getDbArray(); // 登録データの作成 - $arrValues['order_birth'] = SC_Utils_Ex::sfGetTimestamp($arrParams['order_year'], $arrParams['order_month'], $arrParams['order_day']); + $arrValues['order_birth'] = Utils::sfGetTimestamp($arrParams['order_year'], $arrParams['order_month'], $arrParams['order_day']); $arrValues['update_date'] = 'CURRENT_TIMESTAMP'; $arrValues['customer_id'] = '0'; $objPurchase->saveOrderTemp($uniqid, $arrValues, $objCustomer); @@ -386,20 +389,20 @@ public function lfRegistData($uniqid, &$objPurchase, &$objCustomer, &$objFormPar /** * 入力内容のチェックを行う. * - * 追加の必須チェック, 相関チェックを行うため, SC_CheckError を使用する. + * 追加の必須チェック, 相関チェックを行うため, CheckError を使用する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array エラー情報の配 */ public function lfCheckError(&$objFormParam) { $arrParams = $objFormParam->getHashArray(); - $objErr = SC_Helper_Customer_Ex::sfCustomerCommonErrorCheck($objFormParam, 'order_'); + $objErr = CustomerHelper::sfCustomerCommonErrorCheck($objFormParam, 'order_'); // 別のお届け先チェック if (isset($arrParams['deliv_check']) && $arrParams['deliv_check'] == '1') { - $objErr2 = SC_Helper_Customer_Ex::sfCustomerCommonErrorCheck($objFormParam, 'shipping_'); + $objErr2 = CustomerHelper::sfCustomerCommonErrorCheck($objFormParam, 'shipping_'); $objErr->arrErr = array_merge((array) $objErr->arrErr, (array) $objErr2->arrErr); } else { // shipping系のエラーは無視 @@ -423,15 +426,15 @@ public function lfCheckError(&$objFormParam) * 受注一時テーブル, セッションの配送情報から入力済みの購入情報を取得し, * フォームに設定する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス + * @param FormParam $objFormParam FormParam インスタンス + * @param PurchaseHelper $objPurchase PurchaseHelper インスタンス * @param integer $uniqid 購入一時情報のユニークID * @return void */ public function setFormParams(&$objFormParam, &$objPurchase, $uniqid) { $arrOrderTemp = $objPurchase->getOrderTemp($uniqid); - if (SC_Utils_Ex::isBlank($arrOrderTemp)) { + if (Utils::isBlank($arrOrderTemp)) { $arrOrderTemp = array( 'order_email' => '', 'order_birth' => '', @@ -478,6 +481,6 @@ public function lfGetErrorMessage($error) $msg = 'メールアドレスもしくはパスワードが正しくありません。'; } - return SC_Utils_Ex::jsonEncode(array('login_error' => $msg)); + return Utils::jsonEncode(array('login_error' => $msg)); } } diff --git a/data/class/pages/shopping/LC_Page_Shopping_LoadPaymentModule.php b/data/Eccube/Page/Shopping/LoadPaymentModule.php similarity index 72% rename from data/class/pages/shopping/LC_Page_Shopping_LoadPaymentModule.php rename to data/Eccube/Page/Shopping/LoadPaymentModule.php index 57eaca56174..58b826ef0f8 100644 --- a/data/class/pages/shopping/LC_Page_Shopping_LoadPaymentModule.php +++ b/data/Eccube/Page/Shopping/LoadPaymentModule.php @@ -1,27 +1,21 @@ getOrderId(); if ($order_id === false) { - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); + Utils::sfDispSiteError(PAGE_ERROR, '', true); return; } @@ -63,7 +57,7 @@ public function process() $module_path = $this->getModulePath($order_id); if ($module_path === false) { $msg = 'モジュールファイルの取得に失敗しました。
この手続きは無効となりました。'; - SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', true, $msg); + Utils::sfDispSiteError(FREE_ERROR_MSG, '', true, $msg); return; } @@ -82,8 +76,8 @@ public function process() */ public function getModulePath($order_id) { - $objPurchase = new SC_Helper_Purchase_Ex(); - $objPayment = new SC_Helper_Payment_Ex(); + $objPurchase = new PurchaseHelper(); + $objPayment = new PaymentHelper(); $order = $objPurchase->getOrder($order_id); $payment = $objPayment->get($order['payment_id']); @@ -129,20 +123,20 @@ public function getModulePath($order_id) public function getOrderId() { if (isset($_SESSION['order_id']) - && !SC_Utils_Ex::isBlank($_SESSION['order_id']) - && SC_Utils_Ex::sfIsInt($_SESSION['order_id'])) { + && !Utils::isBlank($_SESSION['order_id']) + && Utils::sfIsInt($_SESSION['order_id'])) { return $_SESSION['order_id']; } if (isset($_POST['order_id']) - && !SC_Utils_Ex::isBlank($_POST['order_id']) - && SC_Utils_Ex::sfIsInt($_POST['order_id'])) { + && !Utils::isBlank($_POST['order_id']) + && Utils::sfIsInt($_POST['order_id'])) { return $_POST['order_id']; } if (isset($_GET['order_id']) - && !SC_Utils_Ex::isBlank($_GET['order_id']) - && SC_Utils_Ex::sfIsInt($_GET['order_id'])) { + && !Utils::isBlank($_GET['order_id']) + && Utils::sfIsInt($_GET['order_id'])) { return $_GET['order_id']; } diff --git a/data/class/pages/shopping/LC_Page_Shopping_Multiple.php b/data/Eccube/Page/Shopping/Multiple.php similarity index 57% rename from data/class/pages/shopping/LC_Page_Shopping_Multiple.php rename to data/Eccube/Page/Shopping/Multiple.php index c7afd684d2f..cc0f8a748d4 100644 --- a/data/class/pages/shopping/LC_Page_Shopping_Multiple.php +++ b/data/Eccube/Page/Shopping/Multiple.php @@ -1,36 +1,35 @@ cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - $objSiteSess = new SC_SiteSession_Ex(); - $objCartSess = new SC_CartSession_Ex(); - $objCustomer = new SC_Customer_Ex(); - $objFormParam = new SC_FormParam_Ex(); - $objAddress = new SC_Helper_Address_Ex(); + $objSiteSess = new SiteSession(); + $objCartSess = new CartSession(); + $objCustomer = new Customer(); + $objFormParam = new FormParam(); + $objAddress = new AddressHelper(); // 複数配送先指定が無効な場合はエラー if (USE_MULTIPLE_SHIPPING === false) { - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, '', true); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(PAGE_ERROR, '', true); + Response::actionExit(); } $this->tpl_uniqid = $objSiteSess->getUniqId(); - $this->addrs = $this->getDelivAddrs($objCustomer, $objPurchase, $objAddress); - $this->tpl_addrmax = count($this->addrs) - 2; // 「選択してください」と会員の住所をカウントしない - $this->lfInitParam($objFormParam); + $this->arrAddress = $this->getDelivAddress($objCustomer, $objPurchase, $objAddress); + $this->tpl_addrmax = count($this->arrAddress) - 2; // 「選択してください」と会員の住所をカウントしない $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); + $this->arrCartItem = $objCartSess->getCartList($objCartSess->getKey()); + $this->lfInitParam($objFormParam, $this->arrCartItem); + $objFormParam->setParam($_POST); + $objFormParam->convParam(); + switch ($this->getMode()) { case 'confirm': - $objFormParam->setParam($_POST); - $this->arrErr = $this->lfCheckError($objFormParam); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + $this->arrErr = $this->lfCheckError($objFormParam, $this->arrCartItem); + if (Utils::isBlank($this->arrErr)) { // フォームの情報を一時保存しておく $_SESSION['multiple_temp'] = $objFormParam->getHashArray(); $this->saveMultipleShippings($this->tpl_uniqid, $objFormParam, @@ -99,73 +101,46 @@ public function action() $objAddress); $objSiteSess->setRegistFlag(); - SC_Response_Ex::sendRedirect('payment.php'); - SC_Response_Ex::actionExit(); + Response::sendRedirect('confirm.php'); + Response::actionExit(); } break; + // 前のページに戻る + case 'return': + $objSiteSess->setRegistFlag(); + + // 確認ページへ移動 + Response::sendRedirect('confirm.php'); + Response::actionExit(); + break; + default: - $this->setParamToSplitItems($objFormParam, $objCartSess); + break; } - // 前のページから戻ってきた場合 - if ($_GET['from'] == 'multiple') { - $objFormParam->setParam($_SESSION['multiple_temp']); - } $this->arrForm = $objFormParam->getFormParamList(); } /** * フォームを初期化する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return void */ - public function lfInitParam(&$objFormParam) + public function lfInitParam(&$objFormParam, &$arrCartItem) { $objFormParam->addParam('商品規格ID', 'product_class_id', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); - $objFormParam->addParam('商品名', 'name'); - $objFormParam->addParam('規格1', 'class_name1'); - $objFormParam->addParam('規格2', 'class_name2'); - $objFormParam->addParam('規格分類1', 'classcategory_name1'); - $objFormParam->addParam('規格分類2', 'classcategory_name2'); - $objFormParam->addParam('メイン画像', 'main_image'); - $objFormParam->addParam('メイン一覧画像', 'main_list_image'); - $objFormParam->addParam(SALE_PRICE_TITLE, 'price'); - $objFormParam->addParam(SALE_PRICE_TITLE . '(税込)', 'price_inctax'); $objFormParam->addParam('数量', 'quantity', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK'), 1); $objFormParam->addParam('お届け先', 'shipping', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); - $objFormParam->addParam('カート番号', 'cart_no', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); $objFormParam->addParam('行数', 'line_of_num', INT_LEN, 'n', array('EXIST_CHECK', 'MAX_LENGTH_CHECK', 'NUM_CHECK')); - } - - /** - * カートの商品を数量ごとに分割し, フォームに設定する. - * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @param SC_CartSession $objCartSess SC_CartSession インスタンス - * @return void - */ - public function setParamToSplitItems(&$objFormParam, &$objCartSess) - { - $cartLists =& $objCartSess->getCartList($objCartSess->getKey()); - $arrItems = array(); - $index = 0; - foreach (array_keys($cartLists) as $key) { - $arrProductsClass = $cartLists[$key]['productsClass']; - $quantity = (int) $cartLists[$key]['quantity']; - for ($i = 0; $i < $quantity; $i++) { - foreach ($arrProductsClass as $key2 => $val) { - $arrItems[$key2][$index] = $val; - } - $arrItems['quantity'][$index] = 1; - $arrItems['price'][$index] = $cartLists[$key]['price']; - $arrItems['price_inctax'][$index] = $cartLists[$key]['price_inctax']; - $index++; - } + $arrItem = array(); + foreach ($arrCartItem as $item) { + $product_class_id = $item['productsClass']['product_class_id']; + $arrItem['line_of_num'][$product_class_id] = 1; + $arrItem['quantity'][] = 1; } - $objFormParam->setParam($arrItems); - $objFormParam->setValue('line_of_num', $index); + $objFormParam->setParam($arrItem); } /** @@ -174,14 +149,14 @@ public function setParamToSplitItems(&$objFormParam, &$objCartSess) * 会員ログイン済みの場合は, 会員登録住所及び追加登録住所を取得する. * 非会員の場合は, 「お届け先の指定」画面で入力した住所を取得する. * - * @param SC_Customer $objCustomer SC_Customer インスタンス - * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス - * @param SC_Helper_Address_Ex $objAddress + * @param Customer $objCustomer Customer インスタンス + * @param PurchaseHelper $objPurchase PurchaseHelper インスタンス + * @param AddressHelper $objAddress * @return array 配送住所のプルダウン用連想配列 */ - public function getDelivAddrs(&$objCustomer, &$objPurchase, &$objAddress) + public function getDelivAddress(Customer &$objCustomer, &$objPurchase, &$objAddress) { - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $arrPref = $masterData->getMasterData('mtb_pref'); $arrResults = array('' => '選択してください'); @@ -205,9 +180,9 @@ public function getDelivAddrs(&$objCustomer, &$objPurchase, &$objAddress) 'tel03' => $objCustomer->getValue('tel03'), ) ); - $arrAddrs = array_merge($addr, $objAddress->getList($objCustomer->getValue('customer_id'))); - foreach ($arrAddrs as $val) { - $other_deliv_id = SC_Utils_Ex::isBlank($val['other_deliv_id']) ? 0 : $val['other_deliv_id']; + $arrAddress = array_merge($addr, $objAddress->getList($objCustomer->getValue('customer_id'))); + foreach ($arrAddress as $val) { + $other_deliv_id = Utils::isBlank($val['other_deliv_id']) ? 0 : $val['other_deliv_id']; $arrResults[$other_deliv_id] = $val['name01'] . $val['name02'] . ' ' . $arrPref[$val['pref']] . $val['addr01'] . $val['addr02']; } @@ -227,29 +202,26 @@ public function getDelivAddrs(&$objCustomer, &$objPurchase, &$objAddress) /** * 入力チェックを行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @return array エラー情報の配列 */ - public function lfCheckError(&$objFormParam) + public function lfCheckError(FormParam &$objFormParam, &$arrCartItem) { - $objCartSess = new SC_CartSession_Ex(); + $objCartSess = new CartSession(); - $objFormParam->convParam(); - // 数量未入力は0に置換 $objFormParam->setValue('quantity', $objFormParam->getValue('quantity', 0)); - $arrErr = $objFormParam->checkError(); - $arrParams = $objFormParam->getSwapArray(); if (empty($arrErr)) { - foreach ($arrParams as $index => $arrParam) { + $arrTarget = array('product_class_id', 'quantity', 'shipping'); + $arrParams = $objFormParam->getSwapArray($arrTarget); foreach ($arrParams as $index => $arrParam) { // 数量0で、お届け先を選択している場合 - if ($arrParam['quantity'] == 0 && !SC_Utils_Ex::isBlank($arrParam['shipping'])) { + if ($arrParam['quantity'] == 0 && !Utils::isBlank($arrParam['shipping'])) { $arrErr['shipping'][$index] = '※ 数量が0の場合、お届け先を入力できません。
';; } // 数量の入力があり、お届け先を選択していない場合 - if ($arrParam['quantity'] > 0 && SC_Utils_Ex::isBlank($arrParam['shipping'])) { + if ($arrParam['quantity'] > 0 && Utils::isBlank($arrParam['shipping'])) { $arrErr['shipping'][$index] = '※ お届け先が入力されていません。
'; } } @@ -264,14 +236,13 @@ public function lfCheckError(&$objFormParam) $arrQuantity[$product_class_id] += $arrParam['quantity']; } // カゴの中身と突き合わせ - $cartLists =& $objCartSess->getCartList($objCartSess->getKey()); - foreach ($cartLists as $arrCartRow) { - $product_class_id = $arrCartRow['id']; + foreach ($arrCartItem as $item) { + $product_class_id = $item['id']; // 差異がある場合、エラーを記録 - if ($arrCartRow['quantity'] != $arrQuantity[$product_class_id]) { + if ($item['quantity'] != $arrQuantity[$product_class_id]) { foreach ($arrParams as $index => $arrParam) { if ($arrParam['product_class_id'] == $product_class_id) { - $arrErr['quantity'][$index] = '※ 数量合計を「' . $arrCartRow['quantity'] .'」にしてください。
'; + $arrErr['line_of_num'][$product_class_id] = "※ 数量合計を「{$item['quantity']}」にしてください。
"; } } } @@ -287,38 +258,41 @@ public function lfCheckError(&$objFormParam) * 会員ログインしている場合は, その他のお届け先から住所情報を取得する. * * @param integer $uniqid 一時受注テーブルのユニークID - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @param SC_Customer $objCustomer SC_Customer インスタンス - * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス - * @param SC_Helper_Address_Ex $objAddress + * @param FormParam $objFormParam FormParam インスタンス + * @param Customer $objCustomer Customer インスタンス + * @param PurchaseHelper $objPurchase PurchaseHelper インスタンス + * @param AddressHelper $objAddress * @return void */ public function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$objPurchase, &$objAddress) { + $arrValues = array(); + $arrItemTemp = array(); $arrParams = $objFormParam->getSwapArray(); - foreach ($arrParams as $arrParam) { $other_deliv_id = $arrParam['shipping']; - if ($objCustomer->isLoginSuccess(true)) { if ($other_deliv_id != 0) { $otherDeliv = $objAddress->getAddress($other_deliv_id, $objCustomer->getValue('customer_id')); - if (!$otherDeliv) { - SC_Utils_Ex::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。
正しい値を入力してください。"); - SC_Response_Ex::actionExit(); + Utils::sfDispSiteError(FREE_ERROR_MSG, '', false, "入力値が不正です。
正しい値を入力してください。"); + Response::actionExit(); } - foreach ($otherDeliv as $key => $val) { - $arrValues[$other_deliv_id]['shipping_' . $key] = $val; + $arrValues[$other_deliv_id]["shipping_{$key}"] = $val; } } else { - $objPurchase->copyFromCustomer($arrValues[0], $objCustomer, - 'shipping'); + $objPurchase->copyFromCustomer($arrValues[0], $objCustomer, 'shipping'); } } else { $arrValues = $objPurchase->getShippingTemp(); } + if (!isset($arrItemTemp[$other_deliv_id])) { + $arrItemTemp[$other_deliv_id] = array(); + } + if (!isset($arrItemTemp[$other_deliv_id][$arrParam['product_class_id']])) { + $arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] = 0; + } $arrItemTemp[$other_deliv_id][$arrParam['product_class_id']] += $arrParam['quantity']; } @@ -331,14 +305,12 @@ public function saveMultipleShippings($uniqid, &$objFormParam, &$objCustomer, &$ foreach ($arrItemTemp as $other_deliv_id => $arrProductClassIds) { foreach ($arrProductClassIds as $product_class_id => $quantity) { if ($quantity == 0) continue; - $objPurchase->setShipmentItemTemp($other_deliv_id, - $product_class_id, - $quantity); + $objPurchase->setShipmentItemTemp($other_deliv_id, $product_class_id, $quantity); } } //不必要な配送先を削除 - foreach ($_SESSION['shipping'] as $id=>$arrShipping) { + foreach ($_SESSION['shipping'] as $id => $arrShipping) { if (!isset($arrShipping['shipment_item'])) { $objPurchase->unsetOneShippingTemp($id); } diff --git a/data/class/pages/shopping/LC_Page_Shopping_Payment.php b/data/Eccube/Page/Shopping/Payment.php similarity index 83% rename from data/class/pages/shopping/LC_Page_Shopping_Payment.php rename to data/Eccube/Page/Shopping/Payment.php index cc04d6b9ea4..0529cef5e0b 100644 --- a/data/class/pages/shopping/LC_Page_Shopping_Payment.php +++ b/data/Eccube/Page/Shopping/Payment.php @@ -1,36 +1,38 @@ tpl_onload = 'eccube.togglePointForm();'; $this->tpl_title = 'お支払方法・お届け時間等の指定'; - $masterData = new SC_DB_MasterData_Ex(); + $masterData = new MasterData(); $this->arrPref = $masterData->getMasterData('mtb_pref'); } @@ -66,14 +68,14 @@ public function process() public function action() { //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); + $objPurchase = new PurchaseHelper(); $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - $objSiteSess = new SC_SiteSession_Ex(); - $objCartSess = new SC_CartSession_Ex(); - $objCustomer = new SC_Customer_Ex(); - $objFormParam = new SC_FormParam_Ex(); - $objDelivery = new SC_Helper_Delivery_Ex(); + $objSiteSess = new SiteSession(); + $objCartSess = new CartSession(); + $objCustomer = new Customer(); + $objFormParam = new FormParam(); + $objDelivery = new DeliveryHelper(); $this->is_multiple = $objPurchase->isMultiple(); @@ -104,16 +106,16 @@ public function action() $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid); // 正常に受注情報が格納されていない場合はカート画面へ戻す - if (SC_Utils_Ex::isBlank($arrOrderTemp)) { - SC_Response_Ex::sendRedirect(CART_URL); - SC_Response_Ex::actionExit(); + if (Utils::isBlank($arrOrderTemp)) { + Response::sendRedirect(CART_URL); + Response::actionExit(); } // カート内商品の妥当性チェック $this->tpl_message = $objCartSess->checkProducts($cart_key); if (strlen($this->tpl_message) >= 1) { - SC_Response_Ex::sendRedirect(CART_URL); - SC_Response_Ex::actionExit(); + Response::sendRedirect(CART_URL); + Response::actionExit(); } /* @@ -134,7 +136,7 @@ public function action() $this->setFormParams($objFormParam, $arrOrderTemp, true, $this->arrShipping); $objFormParam->setParam($_POST); $this->arrErr = $objFormParam->checkError(); - if (SC_Utils_Ex::isBlank($this->arrErr)) { + if (Utils::isBlank($this->arrErr)) { $deliv_id = $objFormParam->getValue('deliv_id'); $arrSelectedDeliv = $this->getSelectedDeliv($objCartSess, $deliv_id); $arrSelectedDeliv['error'] = false; @@ -143,9 +145,9 @@ public function action() $this->tpl_mainpage = 'shopping/select_deliv.tpl'; // モバイル用 } - if (SC_Display_Ex::detectDevice() != DEVICE_TYPE_MOBILE) { - echo SC_Utils_Ex::jsonEncode($arrSelectedDeliv); - SC_Response_Ex::actionExit(); + if (Display::detectDevice() != DEVICE_TYPE_MOBILE) { + echo Utils::jsonEncode($arrSelectedDeliv); + Response::actionExit(); } else { $this->arrPayment = $arrSelectedDeliv['arrPayment']; $this->arrDelivTime = $arrSelectedDeliv['arrDelivTime']; @@ -166,8 +168,8 @@ public function action() $objSiteSess->setRegistFlag(); // 確認ページへ移動 - SC_Response_Ex::sendRedirect(SHOPPING_CONFIRM_URLPATH); - SC_Response_Ex::actionExit(); + Response::sendRedirect(SHOPPING_CONFIRM_URLPATH); + Response::actionExit(); } else { $deliv_id = $objFormParam->getValue('deliv_id'); @@ -204,8 +206,8 @@ public function action() $url = SHOPPING_URL . '?from=nonmember'; } - SC_Response_Ex::sendRedirect($url); - SC_Response_Ex::actionExit(); + Response::sendRedirect($url); + Response::actionExit(); break; default: @@ -218,7 +220,7 @@ public function action() $deliv_id = $this->arrDeliv[0]['deliv_id']; } - if (!SC_Utils_Ex::isBlank($deliv_id)) { + if (!Utils::isBlank($deliv_id)) { $objFormParam->setValue('deliv_id', $deliv_id); $arrSelectedDeliv = $this->getSelectedDeliv($objCartSess, $deliv_id); $this->arrPayment = $arrSelectedDeliv['arrPayment']; @@ -229,8 +231,8 @@ public function action() } // モバイル用 ポストバック処理 - if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE - && SC_Utils_Ex::isBlank($this->arrErr)) { + if (Display::detectDevice() == DEVICE_TYPE_MOBILE + && Utils::isBlank($this->arrErr)) { $this->tpl_mainpage = $this->getMobileMainpage($this->is_single_deliv, $this->getMode()); } @@ -240,7 +242,7 @@ public function action() /** * パラメーターの初期化を行い, 初期値を設定する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param array $arrParam 設定する値の配列 * @param boolean $deliv_only deliv_id チェックのみの場合 true * @param array $arrShipping 配送先情報の配列 @@ -255,7 +257,7 @@ public function setFormParams(&$objFormParam, $arrParam, $deliv_only, &$arrShipp /** * パラメーター情報の初期化を行う. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param boolean $deliv_only 必須チェックは deliv_id のみの場合 true * @param array $arrShipping 配送先情報の配列 * @return void @@ -285,7 +287,7 @@ public function lfInitParam(&$objFormParam, $deliv_only, &$arrShipping) /** * 入力内容のチェックを行なう. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param integer $subtotal 購入金額の小計 * @param integer $max_point 会員の保持ポイント * @return array 入力チェック結果の配列 @@ -294,7 +296,7 @@ public function lfCheckError(&$objFormParam, $subtotal, $max_point) { // 入力データを渡す。 $arrForm = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrForm); + $objErr = new CheckError($arrForm); $objErr->arrErr = $objFormParam->checkError(); if (USE_POINT === false) { @@ -304,7 +306,7 @@ public function lfCheckError(&$objFormParam, $subtotal, $max_point) $objErr->doFunc(array('ポイントを使用する', 'point_check'), array('EXIST_CHECK')); if ($arrForm['point_check'] == '1' - && SC_Utils_Ex::isBlank($objErr->arrErr['use_point'])) { + && Utils::isBlank($objErr->arrErr['use_point'])) { $objErr->doFunc(array('ポイント', 'use_point'), array('EXIST_CHECK')); if ($max_point == '') { @@ -318,7 +320,7 @@ public function lfCheckError(&$objFormParam, $subtotal, $max_point) $objErr->arrErr['use_point'] = '※ ご利用ポイントがご購入金額を超えています。
'; } // ポイント差し引き後のお支払い方法チェック - $objPayment = new SC_Helper_Payment_Ex(); + $objPayment = new PaymentHelper(); $arrPayments = $objPayment->get($arrForm['payment_id']); if ($arrPayments['rule_max'] > $subtotal - $arrForm['use_point'] * POINT_VALUE) { $objErr->arrErr['use_point'] = '※ 選択したお支払い方法では、ポイントは'.($subtotal - $arrPayments['rule_max']).'ポイントまでご利用いただけます。
'; @@ -331,7 +333,7 @@ public function lfCheckError(&$objFormParam, $subtotal, $max_point) /** * 配送情報を保存する. * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス + * @param FormParam $objFormParam FormParam インスタンス * @param array $arrDelivTime 配送時間の配列 */ public function saveShippings(&$objFormParam, $arrDelivTime) @@ -341,7 +343,7 @@ public function saveShippings(&$objFormParam, $arrDelivTime) $deliv_id = $objFormParam->getValue('deliv_id'); /* TODO - * SC_Purchase::getShippingTemp() で取得して, + * Purchase::getShippingTemp() で取得して, * リファレンスで代入すると, セッションに添字を追加できない? */ foreach (array_keys($_SESSION['shipping']) as $key) { @@ -359,7 +361,7 @@ public function saveShippings(&$objFormParam, $arrDelivTime) * * @param integer $uniqid 受注一時テーブルのユニークID * @param array $arrForm フォームの入力値 - * @param SC_Helper_Purchase $objPurchase SC_Helper_Purchase インスタンス + * @param PurchaseHelper $objPurchase PurchaseHelper インスタンス * @param array $arrPayment お支払い方法の配列 * @return void */ @@ -390,18 +392,18 @@ public function lfRegistData($uniqid, $arrForm, &$objPurchase, $arrPayment) * - 'arrPayment' - 支払い方法の配列 * - 'img_show' - 支払い方法の画像の有無 * - * @param SC_CartSession $objCartSess SC_CartSession インスタンス + * @param CartSession $objCartSess CartSession インスタンス * @param integer $deliv_id 配送業者ID * @return array 支払い方法, お届け時間を格納した配列 */ - public function getSelectedDeliv(&$objCartSess, $deliv_id) + public function getSelectedDeliv(CartSession &$objCartSess, $deliv_id) { $arrResults = array(); if (strval($deliv_id) === strval(intval($deliv_id))) { - $arrResults['arrDelivTime'] = SC_Helper_Delivery_Ex::getDelivTime($deliv_id); + $arrResults['arrDelivTime'] = DeliveryHelper::getDelivTime($deliv_id); $total = $objCartSess->getAllProductsTotal($objCartSess->getKey()); - $payments_deliv = SC_Helper_Delivery_Ex::getPayments($deliv_id); - $objPayment = new SC_Helper_Payment_Ex(); + $payments_deliv = DeliveryHelper::getPayments($deliv_id); + $objPayment = new PaymentHelper(); $payments_total = $objPayment->getByPrice($total); $arrPayment = array(); foreach ($payments_total as $payment) { @@ -424,7 +426,7 @@ public function getSelectedDeliv(&$objCartSess, $deliv_id) public function hasPaymentImage($arrPayment) { foreach ($arrPayment as $val) { - if (!SC_Utils_Ex::isBlank($val['payment_image'])) { + if (!Utils::isBlank($val['payment_image'])) { return true; } } diff --git a/data/class/pages/LC_Page_Sitemap.php b/data/Eccube/Page/Sitemap.php similarity index 96% rename from data/class/pages/LC_Page_Sitemap.php rename to data/Eccube/Page/Sitemap.php index 2a4b9af3431..b38d85ba585 100644 --- a/data/class/pages/LC_Page_Sitemap.php +++ b/data/Eccube/Page/Sitemap.php @@ -21,7 +21,10 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ -require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Ex.php'; +namespace Eccube\Page; + +use Eccube\Common\Product; +use Eccube\Common\Query; /** * Sitemapプロトコル ファイル生成モジュール. @@ -49,7 +52,7 @@ * :TODO: 各ページの changefreq や priority を指定できるようにする * :TODO: filemtime 関数を使えば、静的なページの更新時間も取得できそう */ -class LC_Page_Sitemap extends LC_Page_Ex +class Sitemap extends AbstractPage { /** 動的に生成しないページの配列 */ public $staticURL; @@ -201,7 +204,7 @@ public function getEditablePage($arrPageList) public function getAllProducts() { // XXX: 商品登録の無いカテゴリは除外する方が良い気もする - $objQuery = SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $sql = 'SELECT category_id FROM dtb_category WHERE del_flg = 0'; $result = $objQuery->getAll($sql); @@ -223,8 +226,8 @@ public function getAllProducts() */ public function getAllDetail() { - $objQuery = SC_Query_Ex::getSingletonInstance(); - $sql = 'SELECT product_id, update_date FROM dtb_products WHERE ' . SC_Product_Ex::getProductDispConditions(); + $objQuery = Query::getSingletonInstance(); + $sql = 'SELECT product_id, update_date FROM dtb_products WHERE ' . Product::getProductDispConditions(); $result = $objQuery->getAll($sql); $arrRet = array(); @@ -247,7 +250,7 @@ public function getAllDetail() */ public function getPageData($where = '', $arrVal = '') { - $objQuery = SC_Query_Ex::getSingletonInstance(); // DB操作オブジェクト + $objQuery = Query::getSingletonInstance(); // DB操作オブジェクト $sql = ''; // データ取得SQL生成用 $arrPageList = array(); // データ取得用 diff --git a/data/Eccube/Page/Unsupported/Index.php b/data/Eccube/Page/Unsupported/Index.php new file mode 100644 index 00000000000..da441a98079 --- /dev/null +++ b/data/Eccube/Page/Unsupported/Index.php @@ -0,0 +1,51 @@ +tpl_title = '未対応デバイス'; + } + + /** + * Page のプロセス. + * + * @return void + */ + public function process() + { + parent::process(); + $this->action(); + $this->sendResponse(); + } + + public function action() + { + } +} diff --git a/data/class/pages/upgrade/LC_Page_Upgrade_Base.php b/data/Eccube/Page/Upgrade/AbstractUpgrade.php similarity index 77% rename from data/class/pages/upgrade/LC_Page_Upgrade_Base.php rename to data/Eccube/Page/Upgrade/AbstractUpgrade.php index ded9da2df3a..0fdaf9e30c6 100644 --- a/data/class/pages/upgrade/LC_Page_Upgrade_Base.php +++ b/data/Eccube/Page/Upgrade/AbstractUpgrade.php @@ -1,16 +1,28 @@ select('auto_update_flg', 'dtb_module', $where, array($product_id)); if (isset($arrRet[0]['auto_update_flg']) @@ -48,11 +60,11 @@ public function autoUpdateEnable($product_id) * * @param string $mode * @param array $arrParams 追加パラメーター.連想配列で渡す. - * @return string|object レスポンスボディ|エラー時にはPEAR::Errorオブジェクトを返す. + * @return string|object レスポンスボディ|エラー時には\PEAR::Errorオブジェクトを返す. */ public function request($mode, $arrParams = array(), $arrCookies = array()) { - $objReq = new HTTP_Request(); + $objReq = new \HTTP_Request(); $objReq->setUrl(OSTORE_URL . 'upgrade/index.php'); $objReq->setMethod('POST'); $objReq->addPostData('mode', $mode); @@ -65,7 +77,7 @@ public function request($mode, $arrParams = array(), $arrCookies = array()) } $e = $objReq->sendRequest(); - if (PEAR::isError($e)) { + if (\PEAR::isError($e)) { return $e; } else { return $objReq; @@ -74,7 +86,7 @@ public function request($mode, $arrParams = array(), $arrCookies = array()) public function isLoggedInAdminPage() { - $objSess = new SC_Session_Ex(); + $objSess = new Session(); if ($objSess->isSuccess() === SUCCESS) { return true; @@ -95,7 +107,7 @@ public function createSeed() public function getPublicKey() { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrRet = $objQuery->select('*', 'dtb_ownersstore_settings'); return isset($arrRet[0]['public_key']) diff --git a/data/class/pages/upgrade/LC_Page_Upgrade_Download.php b/data/Eccube/Page/Upgrade/Download.php similarity index 89% rename from data/class/pages/upgrade/LC_Page_Upgrade_Download.php rename to data/Eccube/Page/Upgrade/Download.php index 62f29c1b89b..9103c3e56bd 100644 --- a/data/class/pages/upgrade/LC_Page_Upgrade_Download.php +++ b/data/Eccube/Page/Upgrade/Download.php @@ -1,27 +1,22 @@ start($mode); - $objJson = new LC_Upgrade_Helper_Json; + $objJson = new JsonHelper; // アクセスチェック $objLog->log('* auth start'); @@ -132,7 +126,7 @@ public function process($mode) // リクエストチェック $objLog->log('* http request check start'); - if (PEAR::isError($objReq)) { + if (\PEAR::isError($objReq)) { $objJson->setError(OSTORE_E_C_HTTP_REQ); $objJson->display(); $objLog->error(OSTORE_E_C_HTTP_REQ, $objReq); @@ -200,8 +194,7 @@ public function process($mode) $tar->extract($exract_dir); $objLog->log('* copy batch start'); - @include_once CLASS_REALDIR . 'batch/SC_Batch_Update.php'; - $objBatch = new SC_Batch_Update(); + $objBatch = new BatchUpdate(); $arrCopyLog = $objBatch->execute($exract_dir); $objLog->log('* copy batch check start'); @@ -251,7 +244,7 @@ public function process($mode) public function initParam() { - $this->objForm = new SC_FormParam_Ex(); + $this->objForm = new FormParam(); $this->objForm->addParam( 'product_id', 'product_id', INT_LEN, '', array('EXIST_CHECK', 'NUM_CHECK', 'MAX_LENGTH_CHECK') ); @@ -267,7 +260,7 @@ public function updateMdlTable($objRet) { $table = 'dtb_module'; $where = 'module_id = ?'; - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $exists = $objQuery->exists($table, $where, array($objRet->product_id)); if ($exists) { @@ -314,7 +307,7 @@ public function notifyDownload($mode, $arrCookies) */ public function isValidAccess($mode) { - $objLog = new LC_Upgrade_Helper_Log; + $objLog = new LogHelper; switch ($mode) { // モジュールダウンロード case 'download': @@ -328,7 +321,7 @@ public function isValidAccess($mode) case 'patch_download': // モジュール自動アップロード case 'auto_update': - $objForm = new SC_FormParam; + $objForm = new FormParam; $objForm->addParam('public_key', 'public_key', MTEXT_LEN, '', array('EXIST_CHECK', 'ALNUM_CHECK', 'MAX_LENGTH_CHECK')); $objForm->addParam('sha1_key', 'sha1_key', MTEXT_LEN, '', array('EXIST_CHECK', 'ALNUM_CHECK', 'MAX_LENGTH_CHECK')); $objForm->setParam($_POST); @@ -370,7 +363,7 @@ public function isValidAccess($mode) public function registerUpdateLog($arrLog, $objRet) { - $objQuery =& SC_Query_Ex::getSingletonInstance(); + $objQuery = Query::getSingletonInstance(); $arrInsert = array( 'log_id' => $objQuery->nextVal('dtb_module_update_logs_log_id'), 'module_id' => $objRet->product_id, diff --git a/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php b/data/Eccube/Page/Upgrade/Helper/JsonHelper.php similarity index 79% rename from data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php rename to data/Eccube/Page/Upgrade/Helper/JsonHelper.php index 576cb41ada7..6159ee0d3d6 100644 --- a/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Json.php +++ b/data/Eccube/Page/Upgrade/Helper/JsonHelper.php @@ -1,9 +1,25 @@ getMasterData('mtb_ownersstore_err'); $this->arrData['status'] = OSTORE_STATUS_ERROR; @@ -89,10 +105,10 @@ public function display() * * @param string $str * @return StdClass - * @see SC_Utils_Ex::jsonDecode + * @see Utils::jsonDecode */ public function decode($str) { - return SC_Utils_Ex::jsonDecode($str); + return Utils::jsonDecode($str); } } diff --git a/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Log.php b/data/Eccube/Page/Upgrade/Helper/LogHelper.php similarity index 56% rename from data/class/pages/upgrade/helper/LC_Upgrade_Helper_Log.php rename to data/Eccube/Page/Upgrade/Helper/LogHelper.php index 88c3c68a8e4..c1db267496f 100644 --- a/data/class/pages/upgrade/helper/LC_Upgrade_Helper_Log.php +++ b/data/Eccube/Page/Upgrade/Helper/LogHelper.php @@ -1,31 +1,24 @@ start($mode); @@ -89,7 +81,7 @@ public function process($mode) // リクエストチェック $objLog->log('* http request check start'); - if (PEAR::isError($objReq)) { + if (\PEAR::isError($objReq)) { $objJson->setError(OSTORE_E_C_HTTP_REQ); $objJson->display(); $objLog->error(OSTORE_E_C_HTTP_REQ, $objReq); @@ -130,7 +122,7 @@ public function process($mode) foreach ($objRet->data as $product) { $arrProducts[] = get_object_vars($product); } - $objView = new SC_AdminView_Ex(); + $objView = new AdminView(); $objView->assign('arrProducts', $arrProducts); $template = 'ownersstore/products_list.tpl'; diff --git a/data/class/pages/upgrade/LC_Page_Upgrade_SiteCheck.php b/data/Eccube/Page/Upgrade/SiteCheck.php similarity index 51% rename from data/class/pages/upgrade/LC_Page_Upgrade_SiteCheck.php rename to data/Eccube/Page/Upgrade/SiteCheck.php index fe5ac8df9ad..2ca1a55928d 100644 --- a/data/class/pages/upgrade/LC_Page_Upgrade_SiteCheck.php +++ b/data/Eccube/Page/Upgrade/SiteCheck.php @@ -1,36 +1,28 @@ start($mode); - $dbFactory = SC_DB_DBFactory_Ex::getInstance(); + $dbFactory = DBFactory::getInstance(); $arrSystemInfo = array( 'eccube_version' => ECCUBE_VERSION, 'php_version' => phpversion(), diff --git a/data/Eccube/RouteMap.php b/data/Eccube/RouteMap.php new file mode 100644 index 00000000000..2ec0cb599fd --- /dev/null +++ b/data/Eccube/RouteMap.php @@ -0,0 +1,768 @@ + array( + 'method' => 'GET|DELETE', + 'class' => '\\customer\\Index', + 'action' => 'process', + ), + 'api/customer' => array( + 'method' => 'POST|PUT', + 'class' => '\\customer\\Index', + 'action' => 'process', + ), + +// sample + 'products/detail/[:product_id]/[:category_id]' => array( + 'class' => '\\Products\\Detail', + 'action' => 'process', + 'template' => 'produdcts_detail', + ), + 'products/detail/[:product_id]/' => array( + 'class' => '\\Products\\Detail', + 'action' => 'process', + 'template' => 'produdcts_detail', + ), +// front + 'index' => array( + 'method' => 'GET|POST', + 'class' => '\\Index', + 'action' => 'process', + 'template' => 'index', + ), + 'abouts' => array( + 'class' => '\\Abouts\\Index', + 'action' => 'process', + 'template' => 'abouts', + ), + 'cart/index' => array( + 'class' => '\\Cart\\Index', + 'action' => 'process', + 'template' => 'cart', + ), + 'contact' => array( + 'class' => '\\Contact\\Index', + 'action' => 'process', + 'template' => 'contact', + ), + 'contact/complete' => array( + 'class' => '\\Contact\\Complete', + 'action' => 'process', + 'template' => 'comtact_complete', + ), + 'entry' => array( + 'class' => '\\Entry\\Index', + 'action' => 'process', + 'template' => 'entry', + ), + 'entry/kiyaku' => array( + 'class' => '\\Entry\\Kiyaku', + 'action' => 'process', + 'template' => 'entry_kiyaku', + ), + 'entry/email_mobile' => array( + 'class' => '\\Entry\\EmailMobile', + 'action' => 'process', + 'template' => 'email_mobile', + ), + 'entry/complete' => array( + 'class' => '\\Entry\\Complete', + 'action' => 'process', + 'template' => 'entry_complete', + ), + 'error' => array( + 'class' => '\\Error\\Index', + 'action' => 'process', + 'template' => 'error', + ), + 'error/disp_error' => array( + 'class' => '\\Error\\DispError', + 'action' => 'process', + 'template' => 'disp_error', + ), + 'error/system_error' => array( + 'class' => '\\Error\\SystemError', + 'action' => 'process', + 'template' => 'system_error', + ), + 'forgot' => array( + 'class' => '\\Forgot\\Index', + 'action' => 'process', + 'template' => 'forgot', + ), + 'frontparts/login_check' => array( + 'class' => '\\Frontparts\\LoginCheck', + 'action' => 'process', + 'template' => 'frontparts_login_check', + ), + 'guide' => array( + 'class' => '\\Guide\\Index', + 'action' => 'process', + 'template' => 'guide', + ), + 'guide/about' => array( + 'class' => '\\Guide\\About', + 'action' => 'process', + 'template' => 'guide_about', + ), + 'guide/charge' => array( + 'class' => '\\Guide\\Charge', + 'action' => 'process', + 'template' => 'guide_charge', + ), + 'guide/kiyaku' => array( + 'class' => '\\Guide\\Kiyaku', + 'action' => 'process', + 'template' => 'guide_kiyaku', + ), + 'guide/privacy' => array( + 'class' => '\\Guide\\Privacy', + 'action' => 'process', + 'template' => 'guide_privacy', + ), + 'guide/usage' => array( + 'class' => '\\Guide\\Usage', + 'action' => 'process', + 'template' => 'guide_usage', + ), + 'mypage' => array( + 'class' => '\\Mypage\\Index', + 'action' => 'process', + 'template' => 'mypage', + ), + 'mypage/change' => array( + 'class' => '\\Mypage\\Change', + 'action' => 'process', + 'template' => 'mypage_charge', + ), + 'mypage/change_complete' => array( + 'class' => '\\Mypage\\ChangeComplete', + 'action' => 'process', + 'template' => 'mypage_change_complete', + ), + 'mypage/delivery' => array( + 'class' => '\\Mypage\\Delivery', + 'action' => 'process', + 'template' => 'mypage_delivery', + ), + 'mypage/delivery_addr' => array( + 'class' => '\\Mypage\\DeliveryAddr', + 'action' => 'process', + 'template' => 'mypage_delivery_addr', + ), + 'mypage/download' => array( + 'class' => '\\Mypage\\Download', + 'action' => 'process', + 'template' => 'mypage_download', + ), + 'mypage/favorite' => array( + 'class' => '\\Mypage\\Favorite', + 'action' => 'process', + 'template' => 'mypage_favorite', + ), + 'mypage/history' => array( + 'class' => '\\Mypage\\History', + 'action' => 'process', + 'template' => 'mypage_history', + ), + 'mypage/login' => array( + 'class' => '\\Mypage\\Login', + 'action' => 'process', + 'template' => 'mypage_login', + ), + 'mypage/mail_view' => array( + 'dir' => '', + 'class' => '\\Mypage\\MailView', + 'action' => 'process', + 'template' => 'mypage_mail_view', + ), + 'mypage/order' => array( + 'class' => '\\Mypage\\Order', + 'action' => 'process', + 'template' => 'mypage_order', + ), + 'mypage/refusal' => array( + 'class' => '\\Mypage\\Refusal', + 'action' => 'process', + 'template' => 'mypage_refusal', + ), + 'mypage/refusal_complete' => array( + 'class' => '\\Mypage\\RefusalComplete', + 'action' => 'process', + 'template' => 'mypage_refusal_complete', + ), + 'order' => array( + 'class' => '\\Order\\Index', + 'action' => 'process', + 'template' => 'order', + ), + 'preview' => array( + 'class' => '\\Preview\\Index', + 'action' => 'process', + 'template' => 'preview', + ), + 'products' => array( + 'class' => '\\Prodcuts\\Index', + 'action' => 'process', + 'template' => 'products', + ), + 'products/category_list' => array( + 'class' => '\\Products\\CategoryList', + 'action' => 'process', + 'template' => 'products_category_list', + ), + 'products/list' => array( + 'class' => '\\Products\\ProductsList', + 'action' => 'process', + 'template' => 'products_products_list', + ), + 'products/detail' => array( + 'class' => '\\Products\\Detail', + 'action' => 'process', + 'template' => 'produdcts_detail', + ), + 'proudcts/search' => array( + 'class' => '\\Products\\Search', + 'action' => 'process', + 'template' => 'proudcts_search', + ), + 'regist' => array( + 'class' => '\\Regist\\Index', + 'action' => 'process', + 'template' => 'regist', + ), + 'regist/complete' => array( + 'class' => '\\Regist\\Complete', + 'action' => 'process', + 'template' => 'regist_complete', + ), + 'rss' => array( + 'class' => '\\Rss\\Index', + 'action' => 'process', + 'template' => 'rss', + ), + 'rss/products' => array( + 'class' => '\\Rss\\Products', + 'action' => 'process', + 'template' => 'rss_products', + ), + 'shopping/index' => array( + 'class' => '\\Shopping\\Index', + 'action' => 'process', + 'template' => 'shopping', + ), + 'shopping/confirm' => array( + 'class' => '\\Shopping\\Confirm', + 'action' => 'process', + 'template' => 'shopping_confirm', + ), + 'shopping/complete' => array( + 'class' => '\\Shopping\\Complete', + 'action' => 'process', + 'template' => 'shopping_complete', + ), + 'shopping/deliv' => array( + 'class' => '\\Shopping\\Deliv', + 'action' => 'process', + 'template' => 'shopping_deliv', + ), + 'shopping/load_payment_module' => array( + 'class' => '\\Shopping\\LoadPaymentModule', + 'action' => 'process', + 'template' => 'shopping_load_payment_module', + ), + 'shopping/multiple' => array( + 'class' => '\\Shopping\\Multiple', + 'action' => 'process', + 'template' => 'shopping_multiple', + ), + 'shopping/payment' => array( + 'class' => '\\Shopping\\Payment', + 'action' => 'process', + 'template' => 'shopping_payment', + ), + 'unsupported' => array( + 'class' => '\\Unsupported\\Index', + 'action' => 'process', + 'template' => 'unsupported', + ), + 'upgrade' => array( + 'class' => '\\Upgrade\\Index', + 'action' => 'process', + 'template' => 'upgrade', + ), + 'upgrade/download' => array( + 'class' => '\\Upgrade\\Index', + 'action' => 'process', + 'template' => 'upgrade_download', + ), + 'upgrade/products_list' => array( + 'class' => '\\Upgrade\\ProductsList', + 'action' => 'process', + 'template' => 'upgrade_products_list', + ), + 'upgrade/site_check' => array( + 'class' => '\\Upgrade\\SiteCheck', + 'action' => 'process', + 'template' => 'upgrade_site_check', + ), + 'input_zip' => array( + 'class' => 'InputZip', + 'action' => 'process', + 'template' => 'input_zip', + ), + 'resize_image' => array( + 'class' => 'ResizeImage', + 'action' => 'process', + 'template' => 'resize_image', + ), + 'sitemap' => array( + 'class' => 'Sitemap', + 'action' => 'process', + 'template' => 'sitemap', + ), + +// admin + 'admin/index' => array( + 'class' => '\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_index', + ), + 'admin/home' => array( + 'class' => '\\Home', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_home', + ), + 'admin/logout' => array( + 'class' => '\\Logout', + 'action' => 'action', + 'ssl' => true, + 'template' => 'admin_logout', + ), + 'admin/basis/' => array( + 'class' => '\\Basis\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis', + ), + 'admin/basis/delivery' => array( + 'class' => '\\Basis\\Delivery', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_delivery', + ), + 'admin/basis/delivery_input' => array( + 'class' => '\\Basis\\DeliveryINput', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_delivery_input', + ), + 'admin/basis/holiday' => array( + 'class' => '\\Basis\\Holiday', + 'action' => 'process', + 'ssl' => true, + 'template' => '', + ), + 'admin/basis/kiyaku' => array( + 'class' => '\\Basis\\Kiyaku', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_kiyaku', + ), + 'admin/basis/mail' => array( + 'class' => '\\Basis\\Mail', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_mail', + ), + 'admin/basis/payment' => array( + 'class' => '\\Basis\\Payment', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_payment', + ), + 'admin/basis/payment_input' => array( + 'class' => '\\Basis\\PaymentInput', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_payment_input', + ), + 'admin/basis/point' => array( + 'class' => '\\Basis\\Point', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_point', + ), + 'admin/basis/tax' => array( + 'class' => '\\Basis\\Tax', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_tax', + ), + 'admin/basis/tradelaw' => array( + 'class' => '\\Basis\\Tradelaw', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_tradelaw', + ), + 'admin/basis/zip_install' => array( + 'class' => '\\Basis\\ZipInstall', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_basis_zip_install', + ), + 'admin/contents' => array( + 'class' => '\\Contents\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_contents', + ), + 'admin/contents/csv' => array( + 'class' => '\\Contents\\Csv', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_contents_csv', + ), + 'admin/contents/file_manager' => array( + 'class' => '\\Contents\\FileManager', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_contents_file_manager', + ), + 'admin/contents/file_view' => array( + 'class' => '\\Contents\\FileView', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_contentes_file_view', + ), + 'admin/contents/recommend' => array( + 'class' => '\\Contents\\Recommend', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_contents_recommend', + ), + 'admin/contents/recommend_search' => array( + 'class' => '\\Contents\\RecommendSearch', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_contents_recommend_search', + ), + 'admin/customer/index' => array( + 'class' => '\\Customer\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_customer', + ), + 'admin/customer/edit' => array( + 'class' => '\\Customer\\Edit', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_customer_edit', + ), + 'admin/customer/search_customer' => array( + 'class' => '\\Customer\\SearchCustomer', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_customer_search_customer', + ), + 'admin/design/' => array( + 'class' => '\\Design\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin/design', + ), + 'admin/design/bloc' => array( + 'class' => '\\Design\\Bloc', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_design_bloc', + ), + 'admin/design/css' => array( + 'class' => '\\Design\\Css', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_design_css', + ), + 'admin/design/header' => array( + 'class' => '\\Design\\Header', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_design_header', + ), + 'admin/design/main_edit' => array( + 'class' => '\\Design\\MainEdit', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_design_main_edit', + ), + 'admin/design/template' => array( + 'class' => '\\Design\\Template', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_design_template', + ), + 'admin/design/up_down' => array( + 'class' => '\\Design\\UpDown', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_design_up_down', + ), + 'admin/mail/' => array( + 'class' => '\\Mail\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_mail', + ), + 'admin/mail/history' => array( + 'class' => '\\Mail\\History', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_mail_history', + ), + 'admin/mail/preview' => array( + 'class' => '\\Mail\\Preview', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_mail_preview', + ), + 'admin/mail/template' => array( + 'class' => '\\Mail\\Template', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_mail_template', + ), + 'admin/mail/template_input' => array( + 'class' => '\\Mail\\TemplateInput', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_mail_template_input', + ), + 'admin/order/' => array( + 'class' => '\\Order\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_order', + ), + 'admin/order/disp' => array( + 'class' => '\\Order\\Disp', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_order_disp', + ), + 'admin/order/edit' => array( + 'class' => '\\Order\\Edit', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_order_edit', + ), + 'admin/order/mail' => array( + 'class' => '\\Order\\Mail', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_order_mail', + ), + 'admin/order/mail_view' => array( + 'class' => '\\Order\\MailView', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_order_mail_view', + ), + 'admin/order/multiple' => array( + 'class' => '\\Order\\Multiple', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_order_multiple', + ), + 'admin/order/pdf' => array( + 'class' => 'Pdf', + 'action' => '\\Order\\process', + 'ssl' => true, + 'template' => 'admin_order_pdf', + ), + 'admin/order/product_select' => array( + 'class' => '\\Order\\ProductSelect', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_order_product_select', + ), + 'admin/order/status' => array( + 'class' => '\\Order\\Status', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_order_status', + ), + 'admin/ownersstore/' => array( + 'class' => '\\Ownersstore\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_ownersstore', + ), + 'admin/ownersstore/log' => array( + 'class' => '\\Ownersstore\\Log', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_ownersstore_log', + ), + 'admin/ownersstore/module' => array( + 'class' => '\\Ownersstore\\Module', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_ownersstore_module', + ), + 'admin/ownersstore/plugin_hook_point_list' => array( + 'class' => '\\Ownersstore\\PluginHookPointList', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_ownersstore_plugin_hook_point_list', + ), + 'admin/ownersstore/settgings' => array( + 'class' => '\\Ownersstore\\Settings', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_ownersstore_settings', + ), + 'admin/products/' => array( + 'class' => '\\Products\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products', + ), + 'admin/products/category' => array( + 'class' => '\\Products\\Category', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products_category', + ), + 'admin/products/class_category' => array( + 'class' => '\\Products\\ClassCategory', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products_class_category', + ), + 'admin/products/class_list' => array( + 'class' => '\\Products\\ClassList', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products_class_list', + ), + 'admin/products/maker' => array( + 'class' => '\\Products\\Maker', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products_maker', + ), + 'admin/products/product_class' => array( + 'class' => '\\Products\\ProductClass', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products_product_class', + ), + 'admin/products/product' => array( + 'class' => '\\Products\\ProductEdit', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products_product_edit', + ), + 'admin/products/product_rank' => array( + 'class' => '\\Products\\ProductRank', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products_product_rank', + ), + 'admin/products/upload_csv' => array( + 'class' => '\\Products\\UploadCSV', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products_upload_csv', + ), + 'admin/products/upload_csv_category' => array( + 'class' => '\\Products\\UploadCSVCategory', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_products_upload_csv_category', + ), + 'admin/system/' => array( + 'class' => '\\System\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system', + ), + 'admin/system/admin_area' => array( + 'class' => '\\System\\AdminArea', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_admin_area', + ), + 'admin/system/bkup' => array( + 'class' => '\\System\\Bkup', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_bkup', + ), + 'admin/system/delete' => array( + 'class' => '\\System\\Delete', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_delete', + ), + 'admin/system/editdb' => array( + 'class' => '\\System\\Editdb', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_editdb', + ), + 'admin/system/input' => array( + 'class' => '\\System\\Input', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_input', + ), + 'admin/system/log' => array( + 'class' => '\\System\\Log', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_log', + ), + 'admin/system/masterdata' => array( + 'class' => '\\System\\Masterdata', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_masterdata', + ), + 'admin/system/parameter' => array( + 'class' => '\\System\\Parameter', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_parameter', + ), + 'admin/system/rank' => array( + 'class' => '\\System\\Rank', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_rank', + ), + 'admin/system/system' => array( + 'class' => '\\System\\System', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_system_system', + ), + 'admin/total/' => array( + 'class' => '\\Total\\Index', + 'action' => 'process', + 'ssl' => true, + 'template' => 'admin_total', + ), + + ); + } + +} \ No newline at end of file diff --git a/data/Eccube/Router.php b/data/Eccube/Router.php new file mode 100644 index 00000000000..d2f0d4aff02 --- /dev/null +++ b/data/Eccube/Router.php @@ -0,0 +1,138 @@ +adminDir = (substr(ADMIN_DIR, -1) === '/' ) ? substr(ADMIN_DIR, 0, strlen(ADMIN_DIR) - 1) : ADMIN_DIR; + $this->method = ($_SERVER['REQUEST_METHOD']) ?: 'GET'; + } + + public function action() + { + // Routingするため値が変わってしまうので戻す + $url = parse_url($_SERVER['REQUEST_URI']); + $path = $url['path']; + /* 既存パス対応 */ + if (end(split('\.', $path)) !== 'php') { + $path .= (substr($path, -1) === '/') ? 'index.php' : '.php'; + } + + $_SERVER['SCRIPT_NAME'] = $path; + $_SERVER['SCRIPT_FILENAME'] = $_SERVER['DOCUMENT_ROOT'] . $path; + $this->template = str_replace('.php', '', str_replace(ROOT_URLPATH, '', $path)); + + $settings = $this->getSettingsFromUrl(); + + $namespace = 'Eccube'; + if ($this->isApi) { + $namespace .= '\\Api'; + } else { + $namespace .= '\\Page'; + } + if ($this->isAdmin) { + $namespace .= '\\Admin'; + } + if (!empty($settings['class'])) { + $namespace .= $settings['class']; + } + + $obj = new $namespace; + call_user_func(array($obj, 'init')); + call_user_func(array($obj, $settings['action'])); + + } + + private function getSettingsFromUrl() + { + $map = RouteMap::getMap(); + $this->isAdmin = strpos($this->template, $this->adminDir) !== FALSE; + $this->isApi = strpos($this->template, 'api/') !== FALSE; + $mapKey= 'index'; + foreach ($map as $path => $settings) { + $pathes = array_filter(explode('/', $path)); + $templates = array_filter(explode('/', $this->template)); + + $pathCount = count($pathes); + $tempCount = count($templates); + + // URL構成が合わない定義は評価しない + if ($pathCount !== $tempCount) { + continue; + } + + // methodが合わない定義は評価しない + $method = ($settings['method']) ?: "GET|POST"; + $methods = explode('|', $method); + if (!in_array($this->method, $methods)) { + continue; + } + if ($this->isAdmin) { + $path = str_replace('admin', $this->adminDir, $path); + } + // 置換文字列がある場合、対応する値をGETパラメータに設定する + if (preg_match_all('/\/\[[^:\]]*(?::([^:\]]*+))?\]/', $path, $matches, PREG_SET_ORDER) > 0) { + $classPath = substr($path, 0, strpos($path, '/[:')); + $argsPath = substr($path, strpos($path, '/[:'), strlen($path)); + $args = array_filter(explode('/', $argsPath)); + if (strpos($this->template, $classPath) !== 0) { + continue; + } + $query = str_replace($classPath, '', $this->template); + $queries = array_filter(explode('/', $query)); + + foreach ($args as $argKey => $argVal) { + $argVal = str_replace(array('[:', ']'), array('', ''), $argVal); + $_REQUEST[$argVal] = $queries[$argKey]; + } + $mapKey = $path; + } else { + if ($pathes == $templates) { + $mapKey = $path; + } + } + } + return $map[$mapKey]; + } + + private function getPathSettingsFromTemplate($templateKey) + { + $map = RouteMap::getMap(); + + foreach ($map as $path => $settings) { + if ($templateKey === $settings['template']) { + return array($$path, $settings); + } + } + } + + public function generatePath($templateKey) + { + list($path) = $this->getPathSettingsFromTemplate($templateKey); + if (strpos($path, 'admin') === 0) { + $path = str_replace('admin', $this->adminDir, $path); + } + $path = $_SERVER['DOCUMENT_ROOT'] . ROOT_URLPATH . $path; + return $path; + } + + public function generateUrl($templateKey) + { + list($path, $settings) = $this->getPathSettingsFromTemplate($templateKey); + $url = (isset($settings['ssl']) && $settings['ssl'] === true) ? HTTPS_URL : HTTP_URL; + if (strpos($path, 'admin') === 0) { + $url .= str_replace('admin', $this->adminDir, $path); + } + return $url; + } + +} \ No newline at end of file diff --git a/data/Smarty/templates/admin/main_frame.tpl b/data/Smarty/templates/admin/main_frame.tpl index 759ae85ae9d..b2350b92a38 100644 --- a/data/Smarty/templates/admin/main_frame.tpl +++ b/data/Smarty/templates/admin/main_frame.tpl @@ -32,6 +32,7 @@ + diff --git a/data/Smarty/templates/default/shopping/confirm.tpl b/data/Smarty/templates/default/shopping/confirm.tpl index cbe6d6b4f37..a44404d8564 100644 --- a/data/Smarty/templates/default/shopping/confirm.tpl +++ b/data/Smarty/templates/default/shopping/confirm.tpl @@ -50,9 +50,7 @@
  • - - 戻る - + 戻る
  • @@ -108,18 +106,8 @@ 小計 - 円 + 円 - - - - 値引き(ポイントご使用時) - - - -円 - - - 送料 円 @@ -134,110 +122,69 @@ - + - - - - - - - +
    ご注文前のポイントPt
    + + - - - - - - - - - - - - - - - - - + +
    ご使用ポイント-Pt
    お誕生月ポイント+Pt
    今回加算予定のポイント+Pt
    加算後のポイントPtポイントのご利用 + の、現在の所持ポイントは「Pt」です。1ポイントを円として使用する事ができます。
    + onclick="eccube.togglePointForm();" />  + + onclick="eccube.togglePointForm();" /> + +
    - + - -

    ご注文者

    - - - +

    配送方法・お支払方法

    +
    + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + +
    お名前
    お名前(フリガナ)
    会社名
    ZIPCODE
    郵便番号-
    住所
    電話番号--
    FAX番号 - - -- - -
    メールアドレス
    性別
    職業
    生年月日 - -
    配送方法 + + + + + + + + +
    お支払方法 + + + +
    +

    お届け先情報  + + 変更する  + + + お届け先を複数指定する + +

    -

    お届け先

    +

    お届け先

    @@ -275,61 +222,58 @@
    - - - + + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + - - - - - + @@ -337,30 +281,27 @@ -

    配送方法・お支払方法・その他お問い合わせ

    -
    お名前
    お名前(フリガナ)
    会社名
    ZIPCODE
    郵便番号-
    住所
    電話番号--
    FAX番号お届け先 +
    + + ( )
    + +
    +
    + + 〒-
    + + + + TEL:-- - -- +
    FAX:--
    お届け日
    お届け時間 + + + + お届け日: + + ご指定頂けません。 + +   + + + + + お届け時間: + +
    - - - - - - - - - - - - - - - - -
    配送方法
    お支払方法
    その他お問い合わせ
    +
    +

    お問い合わせ

    + + + + + + + +
    お問い合わせ + + + +

    (文字まで)

    +
    +
    • - 戻る + 戻る
    • diff --git a/data/Smarty/templates/default/shopping/deliv.tpl b/data/Smarty/templates/default/shopping/deliv.tpl index 4be04d7115e..9b842bbc0c4 100644 --- a/data/Smarty/templates/default/shopping/deliv.tpl +++ b/data/Smarty/templates/default/shopping/deliv.tpl @@ -35,14 +35,6 @@

      ※最大件まで登録できます。

    - -
    -

    この商品を複数の
    お届け先に送りますか?

    - - お届け先を複数指定する - -
    -
@@ -122,9 +114,7 @@
  • - - 戻る - + 戻る
  • diff --git a/data/Smarty/templates/default/shopping/multiple.tpl b/data/Smarty/templates/default/shopping/multiple.tpl index b428decd6ca..746d01d4874 100644 --- a/data/Smarty/templates/default/shopping/multiple.tpl +++ b/data/Smarty/templates/default/shopping/multiple.tpl @@ -20,6 +20,49 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *}--> +

    @@ -34,9 +77,7 @@

    - - 新しいお届け先を追加する - + 新しいお届け先を追加する

    @@ -46,80 +87,80 @@ - - + + - + - - + + + + + + - - - - - + + + + + + - +
    商品写真 商品名数量 お届け先数量
    - = 1}--> href="" class="expansion" target="_blank" - - > - <!--{$arrForm.name.value[$index]|h}--> + + = 1}--> href="" class="expansion" target="_blank"><!--{$p.name|h}-->
    - -
    +
    +
    + +
    - -
    + +
    - 円 +
    - - - + + + +
    + + + + +
    + + +
    + + + + + + + + + + + +
    - - - - - - - - - - - - - - - - - - - - - - - -
    - - + お届け先の追加 + +
    /
    • - - 戻る - + 戻る
    • @@ -127,5 +168,21 @@
    + + + + + +
    + + + +
    +
    + + +
    diff --git a/data/class_extends/SC_AdminView_Ex.php b/data/_class_extends/SC_AdminView_Ex.php similarity index 100% rename from data/class_extends/SC_AdminView_Ex.php rename to data/_class_extends/SC_AdminView_Ex.php diff --git a/data/class_extends/SC_Batch_Ex.php b/data/_class_extends/SC_Batch_Ex.php similarity index 100% rename from data/class_extends/SC_Batch_Ex.php rename to data/_class_extends/SC_Batch_Ex.php diff --git a/data/class_extends/SC_Cache_Ex.php b/data/_class_extends/SC_Cache_Ex.php similarity index 100% rename from data/class_extends/SC_Cache_Ex.php rename to data/_class_extends/SC_Cache_Ex.php diff --git a/data/class_extends/SC_CartSession_Ex.php b/data/_class_extends/SC_CartSession_Ex.php similarity index 100% rename from data/class_extends/SC_CartSession_Ex.php rename to data/_class_extends/SC_CartSession_Ex.php diff --git a/data/class_extends/SC_CheckError_Ex.php b/data/_class_extends/SC_CheckError_Ex.php similarity index 100% rename from data/class_extends/SC_CheckError_Ex.php rename to data/_class_extends/SC_CheckError_Ex.php diff --git a/data/class_extends/SC_ClassAutoloader_Ex.php b/data/_class_extends/SC_ClassAutoloader_Ex.php similarity index 100% rename from data/class_extends/SC_ClassAutoloader_Ex.php rename to data/_class_extends/SC_ClassAutoloader_Ex.php diff --git a/data/class_extends/SC_Cookie_Ex.php b/data/_class_extends/SC_Cookie_Ex.php similarity index 100% rename from data/class_extends/SC_Cookie_Ex.php rename to data/_class_extends/SC_Cookie_Ex.php diff --git a/data/class_extends/SC_CustomerList_Ex.php b/data/_class_extends/SC_CustomerList_Ex.php similarity index 100% rename from data/class_extends/SC_CustomerList_Ex.php rename to data/_class_extends/SC_CustomerList_Ex.php diff --git a/data/class_extends/SC_Customer_Ex.php b/data/_class_extends/SC_Customer_Ex.php similarity index 100% rename from data/class_extends/SC_Customer_Ex.php rename to data/_class_extends/SC_Customer_Ex.php diff --git a/data/class_extends/SC_Date_Ex.php b/data/_class_extends/SC_Date_Ex.php similarity index 100% rename from data/class_extends/SC_Date_Ex.php rename to data/_class_extends/SC_Date_Ex.php diff --git a/data/class_extends/SC_Display_Ex.php b/data/_class_extends/SC_Display_Ex.php similarity index 100% rename from data/class_extends/SC_Display_Ex.php rename to data/_class_extends/SC_Display_Ex.php diff --git a/data/class_extends/SC_FormParam_Ex.php b/data/_class_extends/SC_FormParam_Ex.php similarity index 100% rename from data/class_extends/SC_FormParam_Ex.php rename to data/_class_extends/SC_FormParam_Ex.php diff --git a/data/class_extends/SC_Fpdf_Ex.php b/data/_class_extends/SC_Fpdf_Ex.php similarity index 100% rename from data/class_extends/SC_Fpdf_Ex.php rename to data/_class_extends/SC_Fpdf_Ex.php diff --git a/data/class_extends/SC_Image_Ex.php b/data/_class_extends/SC_Image_Ex.php similarity index 100% rename from data/class_extends/SC_Image_Ex.php rename to data/_class_extends/SC_Image_Ex.php diff --git a/data/class_extends/SC_Initial_Ex.php b/data/_class_extends/SC_Initial_Ex.php similarity index 100% rename from data/class_extends/SC_Initial_Ex.php rename to data/_class_extends/SC_Initial_Ex.php diff --git a/data/class_extends/SC_InstallView_Ex.php b/data/_class_extends/SC_InstallView_Ex.php similarity index 100% rename from data/class_extends/SC_InstallView_Ex.php rename to data/_class_extends/SC_InstallView_Ex.php diff --git a/data/class_extends/SC_MobileEmoji_Ex.php b/data/_class_extends/SC_MobileEmoji_Ex.php similarity index 100% rename from data/class_extends/SC_MobileEmoji_Ex.php rename to data/_class_extends/SC_MobileEmoji_Ex.php diff --git a/data/class_extends/SC_MobileImage_Ex.php b/data/_class_extends/SC_MobileImage_Ex.php similarity index 100% rename from data/class_extends/SC_MobileImage_Ex.php rename to data/_class_extends/SC_MobileImage_Ex.php diff --git a/data/class_extends/SC_MobileUserAgent_Ex.php b/data/_class_extends/SC_MobileUserAgent_Ex.php similarity index 100% rename from data/class_extends/SC_MobileUserAgent_Ex.php rename to data/_class_extends/SC_MobileUserAgent_Ex.php diff --git a/data/class_extends/SC_MobileView_Ex.php b/data/_class_extends/SC_MobileView_Ex.php similarity index 100% rename from data/class_extends/SC_MobileView_Ex.php rename to data/_class_extends/SC_MobileView_Ex.php diff --git a/data/class_extends/SC_PageNavi_Ex.php b/data/_class_extends/SC_PageNavi_Ex.php similarity index 100% rename from data/class_extends/SC_PageNavi_Ex.php rename to data/_class_extends/SC_PageNavi_Ex.php diff --git a/data/class_extends/SC_Product_Ex.php b/data/_class_extends/SC_Product_Ex.php similarity index 100% rename from data/class_extends/SC_Product_Ex.php rename to data/_class_extends/SC_Product_Ex.php diff --git a/data/class_extends/SC_Query_Ex.php b/data/_class_extends/SC_Query_Ex.php similarity index 100% rename from data/class_extends/SC_Query_Ex.php rename to data/_class_extends/SC_Query_Ex.php diff --git a/data/class_extends/SC_Response_Ex.php b/data/_class_extends/SC_Response_Ex.php similarity index 100% rename from data/class_extends/SC_Response_Ex.php rename to data/_class_extends/SC_Response_Ex.php diff --git a/data/class_extends/SC_SelectSql_Ex.php b/data/_class_extends/SC_SelectSql_Ex.php similarity index 100% rename from data/class_extends/SC_SelectSql_Ex.php rename to data/_class_extends/SC_SelectSql_Ex.php diff --git a/data/class_extends/SC_SendMail_Ex.php b/data/_class_extends/SC_SendMail_Ex.php similarity index 100% rename from data/class_extends/SC_SendMail_Ex.php rename to data/_class_extends/SC_SendMail_Ex.php diff --git a/data/class_extends/SC_SessionFactory_Ex.php b/data/_class_extends/SC_SessionFactory_Ex.php similarity index 100% rename from data/class_extends/SC_SessionFactory_Ex.php rename to data/_class_extends/SC_SessionFactory_Ex.php diff --git a/data/class_extends/SC_Session_Ex.php b/data/_class_extends/SC_Session_Ex.php similarity index 100% rename from data/class_extends/SC_Session_Ex.php rename to data/_class_extends/SC_Session_Ex.php diff --git a/data/class_extends/SC_SiteSession_Ex.php b/data/_class_extends/SC_SiteSession_Ex.php similarity index 100% rename from data/class_extends/SC_SiteSession_Ex.php rename to data/_class_extends/SC_SiteSession_Ex.php diff --git a/data/class_extends/SC_SiteView_Ex.php b/data/_class_extends/SC_SiteView_Ex.php similarity index 100% rename from data/class_extends/SC_SiteView_Ex.php rename to data/_class_extends/SC_SiteView_Ex.php diff --git a/data/class_extends/SC_SmartphoneUserAgent_Ex.php b/data/_class_extends/SC_SmartphoneUserAgent_Ex.php similarity index 100% rename from data/class_extends/SC_SmartphoneUserAgent_Ex.php rename to data/_class_extends/SC_SmartphoneUserAgent_Ex.php diff --git a/data/class_extends/SC_SmartphoneView_Ex.php b/data/_class_extends/SC_SmartphoneView_Ex.php similarity index 100% rename from data/class_extends/SC_SmartphoneView_Ex.php rename to data/_class_extends/SC_SmartphoneView_Ex.php diff --git a/data/class_extends/SC_UploadFile_Ex.php b/data/_class_extends/SC_UploadFile_Ex.php similarity index 100% rename from data/class_extends/SC_UploadFile_Ex.php rename to data/_class_extends/SC_UploadFile_Ex.php diff --git a/data/class_extends/SC_View_Ex.php b/data/_class_extends/SC_View_Ex.php similarity index 100% rename from data/class_extends/SC_View_Ex.php rename to data/_class_extends/SC_View_Ex.php diff --git a/data/class_extends/api_extends/SC_Api_Abstract_Ex.php b/data/_class_extends/api_extends/SC_Api_Abstract_Ex.php similarity index 100% rename from data/class_extends/api_extends/SC_Api_Abstract_Ex.php rename to data/_class_extends/api_extends/SC_Api_Abstract_Ex.php diff --git a/data/class_extends/api_extends/SC_Api_Operation_Ex.php b/data/_class_extends/api_extends/SC_Api_Operation_Ex.php similarity index 100% rename from data/class_extends/api_extends/SC_Api_Operation_Ex.php rename to data/_class_extends/api_extends/SC_Api_Operation_Ex.php diff --git a/data/class_extends/api_extends/SC_Api_Utils_Ex.php b/data/_class_extends/api_extends/SC_Api_Utils_Ex.php similarity index 100% rename from data/class_extends/api_extends/SC_Api_Utils_Ex.php rename to data/_class_extends/api_extends/SC_Api_Utils_Ex.php diff --git a/data/class_extends/api_extends/operations/AddrFromZip_Ex.php b/data/_class_extends/api_extends/operations/AddrFromZip_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/AddrFromZip_Ex.php rename to data/_class_extends/api_extends/operations/AddrFromZip_Ex.php diff --git a/data/class_extends/api_extends/operations/BrowseNodeLookup_Ex.php b/data/_class_extends/api_extends/operations/BrowseNodeLookup_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/BrowseNodeLookup_Ex.php rename to data/_class_extends/api_extends/operations/BrowseNodeLookup_Ex.php diff --git a/data/class_extends/api_extends/operations/CartAdd_Ex.php b/data/_class_extends/api_extends/operations/CartAdd_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/CartAdd_Ex.php rename to data/_class_extends/api_extends/operations/CartAdd_Ex.php diff --git a/data/class_extends/api_extends/operations/CartClear_Ex.php b/data/_class_extends/api_extends/operations/CartClear_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/CartClear_Ex.php rename to data/_class_extends/api_extends/operations/CartClear_Ex.php diff --git a/data/class_extends/api_extends/operations/CartCreate_Ex.php b/data/_class_extends/api_extends/operations/CartCreate_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/CartCreate_Ex.php rename to data/_class_extends/api_extends/operations/CartCreate_Ex.php diff --git a/data/class_extends/api_extends/operations/CartGet_Ex.php b/data/_class_extends/api_extends/operations/CartGet_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/CartGet_Ex.php rename to data/_class_extends/api_extends/operations/CartGet_Ex.php diff --git a/data/class_extends/api_extends/operations/CartModify_Ex.php b/data/_class_extends/api_extends/operations/CartModify_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/CartModify_Ex.php rename to data/_class_extends/api_extends/operations/CartModify_Ex.php diff --git a/data/class_extends/api_extends/operations/Default_Ex.php b/data/_class_extends/api_extends/operations/Default_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/Default_Ex.php rename to data/_class_extends/api_extends/operations/Default_Ex.php diff --git a/data/class_extends/api_extends/operations/GetVersion_Ex.php b/data/_class_extends/api_extends/operations/GetVersion_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/GetVersion_Ex.php rename to data/_class_extends/api_extends/operations/GetVersion_Ex.php diff --git a/data/class_extends/api_extends/operations/ItemLookup_Ex.php b/data/_class_extends/api_extends/operations/ItemLookup_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/ItemLookup_Ex.php rename to data/_class_extends/api_extends/operations/ItemLookup_Ex.php diff --git a/data/class_extends/api_extends/operations/ItemSearch_Ex.php b/data/_class_extends/api_extends/operations/ItemSearch_Ex.php similarity index 100% rename from data/class_extends/api_extends/operations/ItemSearch_Ex.php rename to data/_class_extends/api_extends/operations/ItemSearch_Ex.php diff --git a/data/class_extends/batch_extends/SC_Batch_Update_Ex.php b/data/_class_extends/batch_extends/SC_Batch_Update_Ex.php similarity index 100% rename from data/class_extends/batch_extends/SC_Batch_Update_Ex.php rename to data/_class_extends/batch_extends/SC_Batch_Update_Ex.php diff --git a/data/class_extends/db_extends/SC_DB_DBFactory_Ex.php b/data/_class_extends/db_extends/SC_DB_DBFactory_Ex.php similarity index 100% rename from data/class_extends/db_extends/SC_DB_DBFactory_Ex.php rename to data/_class_extends/db_extends/SC_DB_DBFactory_Ex.php diff --git a/data/class_extends/db_extends/SC_DB_MasterData_Ex.php b/data/_class_extends/db_extends/SC_DB_MasterData_Ex.php similarity index 100% rename from data/class_extends/db_extends/SC_DB_MasterData_Ex.php rename to data/_class_extends/db_extends/SC_DB_MasterData_Ex.php diff --git a/data/class_extends/db_extends/dbfactory/SC_DB_DBFactory_MYSQL_Ex.php b/data/_class_extends/db_extends/dbfactory/SC_DB_DBFactory_MYSQL_Ex.php similarity index 100% rename from data/class_extends/db_extends/dbfactory/SC_DB_DBFactory_MYSQL_Ex.php rename to data/_class_extends/db_extends/dbfactory/SC_DB_DBFactory_MYSQL_Ex.php diff --git a/data/class_extends/db_extends/dbfactory/SC_DB_DBFactory_PGSQL_Ex.php b/data/_class_extends/db_extends/dbfactory/SC_DB_DBFactory_PGSQL_Ex.php similarity index 100% rename from data/class_extends/db_extends/dbfactory/SC_DB_DBFactory_PGSQL_Ex.php rename to data/_class_extends/db_extends/dbfactory/SC_DB_DBFactory_PGSQL_Ex.php diff --git a/data/class_extends/graph_extends/SC_Graph_Bar_Ex.php b/data/_class_extends/graph_extends/SC_Graph_Bar_Ex.php similarity index 100% rename from data/class_extends/graph_extends/SC_Graph_Bar_Ex.php rename to data/_class_extends/graph_extends/SC_Graph_Bar_Ex.php diff --git a/data/class_extends/graph_extends/SC_Graph_Base_Ex.php b/data/_class_extends/graph_extends/SC_Graph_Base_Ex.php similarity index 100% rename from data/class_extends/graph_extends/SC_Graph_Base_Ex.php rename to data/_class_extends/graph_extends/SC_Graph_Base_Ex.php diff --git a/data/class_extends/graph_extends/SC_Graph_Line_Ex.php b/data/_class_extends/graph_extends/SC_Graph_Line_Ex.php similarity index 100% rename from data/class_extends/graph_extends/SC_Graph_Line_Ex.php rename to data/_class_extends/graph_extends/SC_Graph_Line_Ex.php diff --git a/data/class_extends/graph_extends/SC_Graph_Pie_Ex.php b/data/_class_extends/graph_extends/SC_Graph_Pie_Ex.php similarity index 100% rename from data/class_extends/graph_extends/SC_Graph_Pie_Ex.php rename to data/_class_extends/graph_extends/SC_Graph_Pie_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_Address_Ex.php b/data/_class_extends/helper_extends/SC_Helper_Address_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_Address_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_Address_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_BestProducts_Ex.php b/data/_class_extends/helper_extends/SC_Helper_BestProducts_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_BestProducts_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_BestProducts_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_Bloc_Ex.php b/data/_class_extends/helper_extends/SC_Helper_Bloc_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_Bloc_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_Bloc_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_CSV_Ex.php b/data/_class_extends/helper_extends/SC_Helper_CSV_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_CSV_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_CSV_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_Category_Ex.php b/data/_class_extends/helper_extends/SC_Helper_Category_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_Category_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_Category_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_Customer_Ex.php b/data/_class_extends/helper_extends/SC_Helper_Customer_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_Customer_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_Customer_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_DB_Ex.php b/data/_class_extends/helper_extends/SC_Helper_DB_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_DB_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_DB_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_Delivery_Ex.php b/data/_class_extends/helper_extends/SC_Helper_Delivery_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_Delivery_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_Delivery_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_FPDI_Ex.php b/data/_class_extends/helper_extends/SC_Helper_FPDI_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_FPDI_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_FPDI_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_FileManager_Ex.php b/data/_class_extends/helper_extends/SC_Helper_FileManager_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_FileManager_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_FileManager_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_HandleError_Ex.php b/data/_class_extends/helper_extends/SC_Helper_HandleError_Ex.php similarity index 100% rename from data/class_extends/helper_extends/SC_Helper_HandleError_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_HandleError_Ex.php diff --git a/data/class_extends/helper_extends/SC_Helper_Holiday_Ex.php b/data/_class_extends/helper_extends/SC_Helper_Holiday_Ex.php similarity index 96% rename from data/class_extends/helper_extends/SC_Helper_Holiday_Ex.php rename to data/_class_extends/helper_extends/SC_Helper_Holiday_Ex.php index fadf69a79e6..d0306d3849b 100644 --- a/data/class_extends/helper_extends/SC_Helper_Holiday_Ex.php +++ b/data/_class_extends/helper_extends/SC_Helper_Holiday_Ex.php @@ -1,38 +1,38 @@ ->>>>>> e96c4c175cdfde99ea5b44f68bd09ada46bac4c3 -SC_Helper_HandleError_Ex::load(); +Eccube\Common\Helper\HandleErrorHelper::load(); +//SC_Helper_HandleError_Ex::load(); // アプリケーション初期化処理 -$objInit = new SC_Initial_Ex(); +$objInit = new Eccube\Common\Initial(); $objInit->init(); - diff --git a/data/class/SC_Batch.php b/data/class/SC_Batch.php deleted file mode 100644 index 0c6714449da..00000000000 --- a/data/class/SC_Batch.php +++ /dev/null @@ -1,42 +0,0 @@ -_smarty->template_dir = realpath($template_dir); - $this->_smarty->compile_dir = realpath($compile_dir); - } -} diff --git a/data/class/SC_MobileEmoji.php b/data/class/SC_MobileEmoji.php deleted file mode 100644 index f3fa1c75dd8..00000000000 --- a/data/class/SC_MobileEmoji.php +++ /dev/null @@ -1,69 +0,0 @@ -_smarty->template_dir = realpath(MOBILE_TEMPLATE_REALDIR); - $this->_smarty->compile_dir = realpath(MOBILE_COMPILE_REALDIR); - $this->assignTemplatePath(DEVICE_TYPE_MOBILE); - } -} diff --git a/data/class/SC_SmartphoneView.php b/data/class/SC_SmartphoneView.php deleted file mode 100644 index 44c379b225b..00000000000 --- a/data/class/SC_SmartphoneView.php +++ /dev/null @@ -1,39 +0,0 @@ -_smarty->template_dir = realpath(SMARTPHONE_TEMPLATE_REALDIR); - $this->_smarty->compile_dir = realpath(SMARTPHONE_COMPILE_REALDIR); - $this->assignTemplatePath(DEVICE_TYPE_SMARTPHONE); - } -} diff --git a/data/class/pages/LC_Page_Index.php b/data/class/pages/LC_Page_Index.php deleted file mode 100644 index c46ec0f33a1..00000000000 --- a/data/class/pages/LC_Page_Index.php +++ /dev/null @@ -1,72 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); - $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - - $this->tpl_title = ''; - $objCustomer = new SC_Customer_Ex(); - $this->isLogin = $objCustomer->isLoginSuccess(true); - } -} diff --git a/data/class/pages/abouts/LC_Page_Abouts.php b/data/class/pages/abouts/LC_Page_Abouts.php deleted file mode 100644 index 73870d7d620..00000000000 --- a/data/class/pages/abouts/LC_Page_Abouts.php +++ /dev/null @@ -1,68 +0,0 @@ -tpl_title = '当サイトについて'; - $masterData = new SC_DB_MasterData_Ex(); - $this->arrPref = $masterData->getMasterData('mtb_pref'); - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - parent::process(); - $this->action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/admin/LC_Page_Admin_Logout.php b/data/class/pages/admin/LC_Page_Admin_Logout.php deleted file mode 100644 index a5e99e50825..00000000000 --- a/data/class/pages/admin/LC_Page_Admin_Logout.php +++ /dev/null @@ -1,78 +0,0 @@ -action(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - $this->lfDoLogout(); - - // ログイン画面に遷移 - SC_Response_Ex::sendRedirectFromUrlPath(ADMIN_DIR . DIR_INDEX_PATH); - } - - /** - * ログアウト処理 - * - * @return void - */ - public function lfDoLogout() - { - $objSess = new SC_Session_Ex(); - $objSess->logout(); - } -} diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_Review.php b/data/class/pages/admin/products/LC_Page_Admin_Products_Review.php deleted file mode 100644 index 092c7aae044..00000000000 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_Review.php +++ /dev/null @@ -1,415 +0,0 @@ -tpl_mainpage = 'products/review.tpl'; - $this->tpl_mainno = 'products'; - $this->tpl_subno = 'review'; - $this->tpl_pager = 'pager.tpl'; - $this->tpl_maintitle = '商品管理'; - $this->tpl_subtitle = 'レビュー管理'; - - $masterData = new SC_DB_MasterData_Ex(); - $this->arrPageMax = $masterData->getMasterData('mtb_page_max'); - $this->arrRECOMMEND = $masterData->getMasterData('mtb_recommend'); - $this->arrSex = $masterData->getMasterData('mtb_sex'); - - $objDate = new SC_Date_Ex(); - // 登録・更新検索開始年 - $objDate->setStartYear(RELEASE_YEAR); - $objDate->setEndYear(DATE('Y')); - $this->arrStartYear = $objDate->getYear(); - $this->arrStartMonth = $objDate->getMonth(); - $this->arrStartDay = $objDate->getDay(); - // 登録・更新検索終了年 - $objDate->setStartYear(RELEASE_YEAR); - $objDate->setEndYear(DATE('Y')); - $this->arrEndYear = $objDate->getYear(); - $this->arrEndMonth = $objDate->getMonth(); - $this->arrEndDay = $objDate->getDay(); - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - $this->action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - $objReview = new SC_Helper_Review_Ex(); - // パラメーター管理クラス - $objFormParam = new SC_FormParam_Ex(); - $this->lfInitParam($objFormParam); - $objFormParam->setParam($_POST); - $objFormParam->convParam(); - // URLを小文字に変換 - $objFormParam->toLower('search_reviewer_url'); - - $this->arrForm = $objFormParam->getHashArray(); - $this->arrHidden = $this->lfSetHidden($this->arrForm); - - // 入力パラメーターチェック - $this->arrErr = $this->lfCheckError($objFormParam); - if (!SC_Utils_Ex::isBlank($this->arrErr)) { - return; - } - - switch ($this->getMode()) { - case 'delete': - $objReview->delete($this->arrForm['review_id']); - case 'search': - case 'csv': - - // 検索結果を取得 - $this->arrReview = $this->lfGetReview($objReview); - - //CSVダウンロード - if ($this->getMode() == 'csv') { - // 検索条件を取得 - list($where, $arrWhereVal) = $this->lfGetWhere($this->arrForm); - $this->lfDoOutputCsv($where, $arrWhereVal); - - SC_Response_Ex::actionExit(); - } - - break; - default: - break; - } - - } - - /** - * 入力内容のチェックを行う. - * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @return void - */ - public function lfCheckError(&$objFormParam) - { - // 入力データを渡す。 - $arrRet = $objFormParam->getHashArray(); - $objErr = new SC_CheckError_Ex($arrRet); - $objErr->arrErr = $objFormParam->checkError(); - - switch ($this->getMode()) { - case 'search': - $objErr->doFunc(array('開始日', 'search_startyear', 'search_startmonth', 'search_startday'), array('CHECK_DATE')); - $objErr->doFunc(array('終了日', 'search_endyear', 'search_endmonth', 'search_endday'), array('CHECK_DATE')); - $objErr->doFunc(array('開始日', '終了日', 'search_startyear', 'search_startmonth', 'search_startday', 'search_endyear', 'search_endmonth', 'search_endday'), array('CHECK_SET_TERM')); - break; - - case 'complete': - $objErr->doFunc(array('おすすめレベル', 'recommend_level'), array('SELECT_CHECK')); - $objErr->doFunc(array('タイトル', 'title', STEXT_LEN), array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); - $objErr->doFunc(array('コメント', 'comment', LTEXT_LEN), array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); - break; - default: - break; - } - - return $objErr->arrErr; - } - - /** - * hidden情報の作成 - * - * @param array $arrForm フォームデータ - * @return array hidden情報 - */ - public function lfSetHidden($arrForm) - { - $arrHidden = array(); - foreach ($arrForm AS $key=>$val) { - if (preg_match('/^search_/', $key)) { - switch ($key) { - case 'search_sex': - $arrHidden[$key] = SC_Utils_Ex::sfMergeParamCheckBoxes($val); - if (!is_array($val)) { - $arrForm[$key] = explode('-', $val); - } - break; - default: - $arrHidden[$key] = $val; - break; - } - } - } - - return $arrHidden; - } - - /** - * パラメーター情報の初期化を行う. - * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @return void - */ - public function lfInitParam(&$objFormParam) - { - $objFormParam->addParam('投稿者名', 'search_reviewer_name', STEXT_LEN, 'KVas', array('MAX_LENGTH_CHECK'), '', false); - $objFormParam->addParam('投稿者URL', 'search_reviewer_url', STEXT_LEN, 'KVas', array('MAX_LENGTH_CHECK'), '', false); - $objFormParam->addParam('商品名', 'search_name', STEXT_LEN, 'KVas', array('MAX_LENGTH_CHECK'), '', false); - $objFormParam->addParam('商品コード', 'search_product_code', STEXT_LEN, 'KVas', array('MAX_LENGTH_CHECK'), '', false); - $objFormParam->addParam('性別', 'search_sex', INT_LEN, 'n', array('MAX_LENGTH_CHECK'), '', false); - $objFormParam->addParam('おすすめレベル', 'search_recommend_level', INT_LEN, 'n', array('MAX_LENGTH_CHECK'), '', false); - $objFormParam->addParam('投稿年', 'search_startyear', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '', false); - $objFormParam->addParam('投稿月', 'search_startmonth', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '', false); - $objFormParam->addParam('投稿日', 'search_startday', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '', false); - $objFormParam->addParam('投稿年', 'search_endyear', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '', false); - $objFormParam->addParam('投稿月', 'search_endmonth', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '', false); - $objFormParam->addParam('投稿日', 'search_endday', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK'), '', false); - $objFormParam->addParam('最大表示件数', 'search_page_max', INT_LEN, 'n', array('MAX_LENGTH_CHECK'), '', false); - $objFormParam->addParam('ページ番号件数', 'search_pageno', INT_LEN, 'n', array('MAX_LENGTH_CHECK'), '', false); - $objFormParam->addParam('レビューID', 'review_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK'), '', false); - } - - /** - * CSV ファイル出力実行 - * - * @param string $where WHERE文 - * @param array $arrWhereVal WHERE文の判定値 - * @return void - */ - public function lfDoOutputCsv($where, $arrWhereVal) - { - $objCSV = new SC_Helper_CSV_Ex(); - $objCSV->sfDownloadCsv('4', $where, $arrWhereVal, '', true); - } - - /** - * WHERE文の作成 - * - * @param array $arrForm フォームデータ - * @return array WHERE文、判定値 - */ - public function lfGetWhere($arrForm) - { - //削除されていない商品を検索 - $where = 'A.del_flg = 0 AND B.del_flg = 0'; - $arrWhereVal = array(); - - foreach ($arrForm AS $key=>$val) { - if (empty($val)) continue; - - switch ($key) { - case 'search_reviewer_name': - $val = preg_replace('/ /', '%', $val); - $where.= ' AND reviewer_name LIKE ? '; - $arrWhereVal[] = "%$val%"; - break; - - case 'search_reviewer_url': - $val = preg_replace('/ /', '%', $val); - $where.= ' AND reviewer_url LIKE ? '; - $arrWhereVal[] = "%$val%"; - break; - - case 'search_name': - $val = preg_replace('/ /', '%', $val); - $where.= ' AND name LIKE ? '; - $arrWhereVal[] = "%$val%"; - break; - - case 'search_product_code': - $val = preg_replace('/ /', '%', $val); - $where.= ' AND A.product_id IN (SELECT product_id FROM dtb_products_class WHERE product_code LIKE ?)'; - $arrWhereVal[] = "%$val%"; - break; - - case 'search_sex': - $tmp_where = ''; - //$val=配列の中身,$element=各キーの値(1,2) - if (is_array($val)) { - foreach ($val as $element) { - if ($element != '') { - if ($tmp_where == '') { - $tmp_where .= ' AND (sex = ?'; - } else { - $tmp_where .= ' OR sex = ?'; - } - $arrWhereVal[] = $element; - } - } - if ($tmp_where != '') { - $tmp_where .= ')'; - $where .= " $tmp_where "; - } - } - - break; - - case 'search_recommend_level': - $where.= ' AND recommend_level = ? '; - $arrWhereVal[] = $val; - break; - - case 'search_startyear': - if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) { - $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']); - $where.= ' AND A.create_date >= ? '; - $arrWhereVal[] = $date; - } - break; - - case 'search_endyear': - if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) { - $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday']); - $end_date = date('Y/m/d', strtotime('1 day', strtotime($date))); - $where.= " AND A.create_date <= cast('$end_date' as date) "; - } - break; - - default: - break; - } - - } - - return array($where, $arrWhereVal); - } - - /** - * レビュー検索結果の取得 - * - * @param SC_Helper_Review $objReview - * @return array レビュー一覧 - */ - public function lfGetReview(SC_Helper_Review $objReview) - { - $arrForm = $this->arrForm; - - $query = $this->makeQuery($arrForm); - $linemax = $objReview->count($query); - - $this->tpl_linemax = $linemax; - $this->tpl_pageno = isset($arrForm['search_pageno']) ? $arrForm['search_pageno'] : ''; - - // ページ送りの取得 - $page_max = SC_Utils_Ex::sfGetSearchPageMax($arrForm['search_page_max']); - $objNavi = new SC_PageNavi_Ex($this->tpl_pageno, $linemax, $page_max, - 'eccube.moveNaviPage', NAVI_PMAX); - $this->arrPagenavi = $objNavi->arrPagenavi; - $startno = $objNavi->start_row; - - // 取得範囲の指定(開始行番号、行数のセット) - $params = array( - 'query' => $query, - 'limit' => $page_max, - 'offset' => $startno - ); - $arrReview = $objReview->find($params); - - return $arrReview; - } - - /** - * SC_Helper_Reviewインスタンスへ渡す検索条件の配列を作成. - * - * @param array $data - * @return array - */ - private function makeQuery($data = array()) { - $query = array(); - - foreach ($data AS $key => $val) { - if (empty($val)) continue; - - switch ($key) { - case 'search_reviewer_name': - $query['reviewer_name'] = $val; - break; - - case 'search_reviewer_url': - $query['reviewer_url'] = $val; - break; - - case 'search_name': - $query['product_name'] = $val; - break; - - case 'search_product_code': - $query['product_code'] = $val; - break; - - case 'search_sex': - $query['reviewer_sex'] = $val; - break; - - case 'search_recommend_level': - $query['recommend_level'] = $val; - break; - - case 'search_startyear': - if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) { - $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_startyear'], $_POST['search_startmonth'], $_POST['search_startday']); - $query['date_from'] = $date; - } - break; - - case 'search_endyear': - if (isset($_POST['search_startyear']) && isset($_POST['search_startmonth']) && isset($_POST['search_startday'])) { - $date = SC_Utils_Ex::sfGetTimestamp($_POST['search_endyear'], $_POST['search_endmonth'], $_POST['search_endday']); - $end_date = date('Y/m/d', strtotime('1 day', strtotime($date))); - $query['date_to'] = $end_date; - } - break; - - default: - break; - } - - } - - return $query; - } -} diff --git a/data/class/pages/admin/products/LC_Page_Admin_Products_ReviewEdit.php b/data/class/pages/admin/products/LC_Page_Admin_Products_ReviewEdit.php deleted file mode 100644 index 70e3495cd72..00000000000 --- a/data/class/pages/admin/products/LC_Page_Admin_Products_ReviewEdit.php +++ /dev/null @@ -1,129 +0,0 @@ -tpl_mainpage = 'products/review_edit.tpl'; - $this->tpl_mainno = 'products'; - $this->tpl_subno = 'review'; - // 両方選択可能 - $this->tpl_status_change = true; - - $masterData = new SC_DB_MasterData_Ex(); - $this->arrRECOMMEND = $masterData->getMasterData('mtb_recommend'); - $this->tpl_maintitle = '商品管理'; - $this->tpl_subtitle = 'レビュー管理'; - $this->arrSex = $masterData->getMasterData('mtb_sex'); - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - $this->action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - $objReview = new SC_Helper_Review_Ex(); - // パラメーター情報の初期化 - $objFormParam = new SC_FormParam_Ex(); - $this->lfInitParam($objFormParam); - $objFormParam->setParam($_POST); - $objFormParam->convParam(); - // 検索ワードの引き継ぎ - $this->arrSearchHidden = $objFormParam->getSearchArray(); - $this->arrForm = $objFormParam->getHashArray(); - - switch ($this->getMode()) { - // 登録 - case 'complete': - $this->arrErr = $objFormParam->checkError(); - // エラー無し - if (SC_Utils_Ex::isBlank($this->arrErr)) { - // レビュー情報の更新 - $arrValues = $objFormParam->getDbArray(); - $objReview->save($arrValues); - // レビュー情報のDB取得 - $this->arrForm = $objReview->get($this->arrForm['review_id']); - $this->tpl_onload = "alert('登録が完了しました。');"; - } - break; - default: - // レビュー情報のDB取得 - $this->arrForm = $objReview->get($this->arrForm['review_id']); - break; - } - - } - - /** - * パラメーター情報の初期化を行う. - * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @return void - */ - public function lfInitParam(&$objFormParam) - { - // 検索条件のパラメーターを初期化 - parent::lfInitParam($objFormParam); - $objFormParam->addParam('レビューID', 'review_id', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); - $objFormParam->addParam('商品名', 'name', '', '', array(), '', false); - $objFormParam->addParam('投稿日', 'create_date', '', '', array(), '', false); - - // 登録情報 - $objFormParam->addParam('レビュー表示', 'status', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); - $objFormParam->addParam('投稿者名', 'reviewer_name', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); - $objFormParam->addParam('投稿者URL', 'reviewer_url', URL_LEN, 'KVCa', array('SPTAB_CHECK', 'MAX_LENGTH_CHECK')); - $objFormParam->addParam('性別', 'sex', INT_LEN, 'n', array('MAX_LENGTH_CHECK', 'NUM_CHECK')); - $objFormParam->addParam('おすすめレベル', 'recommend_level', INT_LEN, 'n', array('SELECT_CHECK')); - $objFormParam->addParam('タイトル', 'title', STEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); - $objFormParam->addParam('コメント', 'comment', LTEXT_LEN, 'KVa', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); - } -} diff --git a/data/class/pages/api/LC_Page_Api.php b/data/class/pages/api/LC_Page_Api.php deleted file mode 100644 index c4585532f59..00000000000 --- a/data/class/pages/api/LC_Page_Api.php +++ /dev/null @@ -1,70 +0,0 @@ -action(); -// $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - $arrParam = $_REQUEST; - - list($response_outer, $arrResponse) = SC_Api_Operation::doApiAction($arrParam); - SC_Api_Operation_Ex::sendApiResponse('xml', $response_outer, $arrResponse); - SC_Response_Ex::actionExit(); - } -} diff --git a/data/class/pages/api/LC_Page_Api_Json.php b/data/class/pages/api/LC_Page_Api_Json.php deleted file mode 100644 index a8547f44ef8..00000000000 --- a/data/class/pages/api/LC_Page_Api_Json.php +++ /dev/null @@ -1,75 +0,0 @@ -action(); -// $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - $arrParam = $_REQUEST; - - list($response_outer, $arrResponse) = SC_Api_Operation::doApiAction($arrParam); - - if (isset($arrParam["callback"])) { - $arrResponse["callback"] = $arrParam["callback"]; - } - - SC_Api_Operation_Ex::sendApiResponse('json', $response_outer, $arrResponse); - SC_Response_Ex::actionExit(); - } -} diff --git a/data/class/pages/api/LC_Page_Api_Php.php b/data/class/pages/api/LC_Page_Api_Php.php deleted file mode 100644 index cd90bdc661e..00000000000 --- a/data/class/pages/api/LC_Page_Api_Php.php +++ /dev/null @@ -1,70 +0,0 @@ -action(); -// $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - $arrParam = $_REQUEST; - - list($response_outer, $arrResponse) = SC_Api_Operation::doApiAction($arrParam); - SC_Api_Operation_Ex::sendApiResponse('php', $response_outer, $arrResponse); - SC_Response_Ex::actionExit(); - } -} diff --git a/data/class/pages/api/LC_Page_Api_Xml.php b/data/class/pages/api/LC_Page_Api_Xml.php deleted file mode 100644 index b459c58e7be..00000000000 --- a/data/class/pages/api/LC_Page_Api_Xml.php +++ /dev/null @@ -1,70 +0,0 @@ -action(); -// $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - $arrParam = $_REQUEST; - - list($response_outer, $arrResponse) = SC_Api_Operation::doApiAction($arrParam); - SC_Api_Operation_Ex::sendApiResponse('xml', $response_outer, $arrResponse); - SC_Response_Ex::actionExit(); - } -} diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_LoginFooter.php b/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_LoginFooter.php deleted file mode 100644 index edb6b435f3e..00000000000 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_LoginFooter.php +++ /dev/null @@ -1,65 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - parent::action(); - } -} diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_LoginHeader.php b/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_LoginHeader.php deleted file mode 100644 index 9fb1eff5f76..00000000000 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_LoginHeader.php +++ /dev/null @@ -1,65 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - parent::action(); - } -} diff --git a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_NaviFooter.php b/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_NaviFooter.php deleted file mode 100644 index bb888fa33cf..00000000000 --- a/data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_NaviFooter.php +++ /dev/null @@ -1,65 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - parent::action(); - } -} diff --git a/data/class/pages/guide/LC_Page_Guide.php b/data/class/pages/guide/LC_Page_Guide.php deleted file mode 100644 index d6e1b0be377..00000000000 --- a/data/class/pages/guide/LC_Page_Guide.php +++ /dev/null @@ -1,65 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/guide/LC_Page_Guide_About.php b/data/class/pages/guide/LC_Page_Guide_About.php deleted file mode 100644 index 08756d7a00a..00000000000 --- a/data/class/pages/guide/LC_Page_Guide_About.php +++ /dev/null @@ -1,67 +0,0 @@ -arrPref = $masterData->getMasterData('mtb_pref'); - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - parent::process(); - $this->action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/guide/LC_Page_Guide_Charge.php b/data/class/pages/guide/LC_Page_Guide_Charge.php deleted file mode 100644 index 16198573292..00000000000 --- a/data/class/pages/guide/LC_Page_Guide_Charge.php +++ /dev/null @@ -1,65 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/guide/LC_Page_Guide_Privacy.php b/data/class/pages/guide/LC_Page_Guide_Privacy.php deleted file mode 100644 index 7adf1c88fb8..00000000000 --- a/data/class/pages/guide/LC_Page_Guide_Privacy.php +++ /dev/null @@ -1,65 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/guide/LC_Page_Guide_Usage.php b/data/class/pages/guide/LC_Page_Guide_Usage.php deleted file mode 100644 index 4527766d77f..00000000000 --- a/data/class/pages/guide/LC_Page_Guide_Usage.php +++ /dev/null @@ -1,65 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/mypage/LC_Page_Mypage_ChangeComplete.php b/data/class/pages/mypage/LC_Page_Mypage_ChangeComplete.php deleted file mode 100644 index 23f362b55fd..00000000000 --- a/data/class/pages/mypage/LC_Page_Mypage_ChangeComplete.php +++ /dev/null @@ -1,65 +0,0 @@ -tpl_subtitle = '会員登録内容変更(完了ページ)'; - $this->tpl_mypageno = 'change'; - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - parent::process(); - } - - /** - * Page のAction. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/mypage/LC_Page_Mypage_Login.php b/data/class/pages/mypage/LC_Page_Mypage_Login.php deleted file mode 100644 index 1a9d908e774..00000000000 --- a/data/class/pages/mypage/LC_Page_Mypage_Login.php +++ /dev/null @@ -1,69 +0,0 @@ -httpCacheControl('nocache'); - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - parent::process(); - } - - /** - * Page のAction. - * - * @return void - */ - public function action() - { - //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); - $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - - SC_Response_Ex::sendRedirect(DIR_INDEX_PATH); - } -} diff --git a/data/class/pages/mypage/LC_Page_Mypage_RefusalComplete.php b/data/class/pages/mypage/LC_Page_Mypage_RefusalComplete.php deleted file mode 100644 index f7e32d87606..00000000000 --- a/data/class/pages/mypage/LC_Page_Mypage_RefusalComplete.php +++ /dev/null @@ -1,75 +0,0 @@ -tpl_title = 'MYページ'; - - if (SC_Display_Ex::detectDevice() === DEVICE_TYPE_MOBILE) { - $this->tpl_title .= '/退会手続き(完了ページ)'; - } else { - $this->tpl_subtitle = '退会手続き(完了ページ)'; - } - $this->tpl_navi = SC_Helper_PageLayout::getTemplatePath(SC_Display_Ex::detectDevice()) . 'mypage/navi.tpl'; - $this->tpl_mypageno = 'refusal'; - $this->point_disp = false; - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - parent::process(); - $this->action(); - $this->sendResponse(); - } - - /** - * Page のAction. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/order/LC_Page_Order.php b/data/class/pages/order/LC_Page_Order.php deleted file mode 100644 index 4c7d82d9410..00000000000 --- a/data/class/pages/order/LC_Page_Order.php +++ /dev/null @@ -1,70 +0,0 @@ -tpl_title = '特定商取引に関する法律に基づく表記'; - $masterData = new SC_DB_MasterData_Ex(); - $this->arrPref = $masterData->getMasterData('mtb_pref'); - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - parent::process(); - $this->action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - $objDb = new SC_Helper_DB_Ex(); - $this->arrOrder = $objDb->sfGetBasisData(); - } -} diff --git a/data/class/pages/preview/LC_Page_Preview.php b/data/class/pages/preview/LC_Page_Preview.php deleted file mode 100644 index 03ac7a81255..00000000000 --- a/data/class/pages/preview/LC_Page_Preview.php +++ /dev/null @@ -1,72 +0,0 @@ -sfGetPageLayout($this, true); - - // 画面の表示 - $objView->assignobj($this); - $objView->display(SITE_FRAME); - - return; - } - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR); - } -} diff --git a/data/class/pages/products/LC_Page_Products_Review.php b/data/class/pages/products/LC_Page_Products_Review.php deleted file mode 100644 index 45e67b0881d..00000000000 --- a/data/class/pages/products/LC_Page_Products_Review.php +++ /dev/null @@ -1,191 +0,0 @@ -arrRECOMMEND = $masterData->getMasterData('mtb_recommend'); - $this->arrSex = $masterData->getMasterData('mtb_sex'); - $this->arrReviewDenyURL = $masterData->getMasterData('mtb_review_deny_url'); - $this->tpl_mainpage = 'products/review.tpl'; - $this->httpCacheControl('nocache'); - } - - /** - * Page のプロセス. - */ - public function process() - { - parent::process(); - $this->action(); - $this->sendResponse(); - } - - /** - * Page のAction. - * - * @return void - */ - public function action() - { - $objFormParam = new SC_FormParam_Ex(); - $this->lfInitParam($objFormParam); - $objFormParam->setParam($_POST); - $objFormParam->convParam(); - - switch ($this->getMode()) { - case 'confirm': - $this->arrErr = $this->lfCheckError($objFormParam); - - //エラーチェック - if (empty($this->arrErr)) { - $this->tpl_mainpage = 'products/review_confirm.tpl'; - } - break; - - case 'return': - break; - - case 'complete': - $this->arrErr = $this->lfCheckError($objFormParam); - //エラーチェック - if (empty($this->arrErr)) { - //登録実行 - $this->lfRegistRecommendData($objFormParam); - - //レビュー書き込み完了ページへ - SC_Response_Ex::sendRedirect('review_complete.php'); - SC_Response_Ex::actionExit(); - } - break; - - default: - // 最初のproduct_idは、$_GETで渡ってくる。 - $objFormParam->setParam($_GET); - break; - } - - $this->arrForm = $objFormParam->getHashArray(); - - //商品名の取得 - $this->arrForm['name'] = $this->lfGetProductName($this->arrForm['product_id']); - if (empty($this->arrForm['name'])) { - SC_Utils_Ex::sfDispSiteError(PRODUCT_NOT_FOUND); - } - - $this->setTemplate($this->tpl_mainpage); - } - - /** - * パラメーター情報の初期化を行う. - * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @return void - */ - public function lfInitParam(&$objFormParam) - { - $objFormParam->addParam('レビューID', 'review_id', INT_LEN, 'aKV'); - $objFormParam->addParam('商品ID', 'product_id', INT_LEN, 'n', array('NUM_CHECK','EXIST_CHECK', 'MAX_LENGTH_CHECK')); - $objFormParam->addParam('投稿者名', 'reviewer_name', STEXT_LEN, 'aKV', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); - $objFormParam->addParam('投稿者URL', 'reviewer_url', MTEXT_LEN, 'a', array('NO_SPTAB', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK', 'URL_CHECK')); - $objFormParam->addParam('性別', 'sex', INT_LEN, 'n', array('NUM_CHECK', 'MAX_LENGTH_CHECK')); - $objFormParam->addParam('おすすめレベル', 'recommend_level', INT_LEN, 'n', array('EXIST_CHECK', 'SELECT_CHECK')); - $objFormParam->addParam('タイトル', 'title', STEXT_LEN, 'aKV', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); - $objFormParam->addParam('コメント', 'comment', LTEXT_LEN, 'aKV', array('EXIST_CHECK', 'SPTAB_CHECK', 'MAX_LENGTH_CHECK')); - } - - /** - * 入力内容のチェックを行う. - * - * @param SC_FormParam $objFormParam SC_FormParam インスタンス - * @return array エラーメッセージの配列 - */ - public function lfCheckError(&$objFormParam) - { - $arrErr = $objFormParam->checkError(); - - if (REVIEW_ALLOW_URL == false) { - $objErr = new SC_CheckError_Ex($objFormParam->getHashArray()); - // コメント欄へのURLの入力を禁止 - $objErr->doFunc(array('URL', 'comment', $this->arrReviewDenyURL), array('PROHIBITED_STR_CHECK')); - $arrErr += $objErr->arrErr; - } - - return $arrErr; - } - - /** - * 商品名を取得 - * - * @param integer $product_id 商品ID - * @return string $product_name 商品名 - */ - public function lfGetProductName($product_id) - { - $objQuery =& SC_Query_Ex::getSingletonInstance(); - - return $objQuery->get('name', 'dtb_products', 'product_id = ? AND ' . SC_Product_Ex::getProductDispConditions(), array($product_id)); - } - - //登録実行 - public function lfRegistRecommendData(SC_FormParam &$objFormParam) - { - $arrRegist = $objFormParam->getDbArray(); - - $objCustomer = new SC_Customer_Ex(); - if ($objCustomer->isLoginSuccess(true)) { - $arrRegist['customer_id'] = $objCustomer->getValue('customer_id'); - } - - //-- 登録実行 - $objReview = new SC_Helper_Review_Ex(); - $objReview->save($arrRegist); - } -} diff --git a/data/class/pages/products/LC_Page_Products_ReviewComplete.php b/data/class/pages/products/LC_Page_Products_ReviewComplete.php deleted file mode 100644 index 7cdac7713bc..00000000000 --- a/data/class/pages/products/LC_Page_Products_ReviewComplete.php +++ /dev/null @@ -1,66 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のAction. - * - * @return void - */ - public function action() - { - $this->setTemplate('products/review_complete.tpl'); - } -} diff --git a/data/class/pages/products/LC_Page_Products_Search.php b/data/class/pages/products/LC_Page_Products_Search.php deleted file mode 100644 index 56b8ed69c5e..00000000000 --- a/data/class/pages/products/LC_Page_Products_Search.php +++ /dev/null @@ -1,65 +0,0 @@ -action(); - $this->sendResponse(); - } - - /** - * Page のプロセス. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/regist/LC_Page_Regist_Complete.php b/data/class/pages/regist/LC_Page_Regist_Complete.php deleted file mode 100644 index 814059528d1..00000000000 --- a/data/class/pages/regist/LC_Page_Regist_Complete.php +++ /dev/null @@ -1,66 +0,0 @@ -tpl_title = '会員登録(完了ページ)'; - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - parent::process(); - $this->action(); - $this->sendResponse(); - } - - /** - * Page のAction. - * - * @return void - */ - public function action() - { - } -} diff --git a/data/class/pages/shopping/LC_Page_Shopping_Confirm.php b/data/class/pages/shopping/LC_Page_Shopping_Confirm.php deleted file mode 100644 index e6d4dfd31a3..00000000000 --- a/data/class/pages/shopping/LC_Page_Shopping_Confirm.php +++ /dev/null @@ -1,181 +0,0 @@ -tpl_title = '入力内容のご確認'; - $masterData = new SC_DB_MasterData_Ex(); - $this->arrPref = $masterData->getMasterData('mtb_pref'); - $this->arrCountry = $masterData->getMasterData('mtb_country'); - $this->arrSex = $masterData->getMasterData('mtb_sex'); - $this->arrJob = $masterData->getMasterData('mtb_job'); - $this->arrMAILMAGATYPE = $masterData->getMasterData('mtb_mail_magazine_type'); - $this->arrReminder = $masterData->getMasterData('mtb_reminder'); - $this->arrDeliv = SC_Helper_Delivery_Ex::getIDValueList('service_name'); - $this->httpCacheControl('nocache'); - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - parent::process(); - $this->action(); - $this->sendResponse(); - } - - /** - * Page のアクション. - * - * @return void - */ - public function action() - { - //決済処理中ステータスのロールバック - $objPurchase = new SC_Helper_Purchase_Ex(); - $objPurchase->cancelPendingOrder(PENDING_ORDER_CANCEL_FLAG); - - $objCartSess = new SC_CartSession_Ex(); - $objSiteSess = new SC_SiteSession_Ex(); - $objCustomer = new SC_Customer_Ex(); - - $this->is_multiple = $objPurchase->isMultiple(); - - // 前のページで正しく登録手続きが行われた記録があるか判定 - if (!$objSiteSess->isPrePage()) { - // エラー時は、正当なページ遷移とは認めない - $objSiteSess->setNowPage(''); - - SC_Utils_Ex::sfDispSiteError(PAGE_ERROR, $objSiteSess); - } - - // ユーザユニークIDの取得と購入状態の正当性をチェック - $this->tpl_uniqid = $objSiteSess->getUniqId(); - $objPurchase->verifyChangeCart($this->tpl_uniqid, $objCartSess); - - $this->cartKey = $objCartSess->getKey(); - - // カート内商品のチェック - $this->tpl_message = $objCartSess->checkProducts($this->cartKey); - if (!SC_Utils_Ex::isBlank($this->tpl_message)) { - SC_Response_Ex::sendRedirect(CART_URL); - SC_Response_Ex::actionExit(); - } - - // カートの商品を取得 - $this->arrShipping = $objPurchase->getShippingTemp($this->is_multiple); - $this->arrCartItems = $objCartSess->getCartList($this->cartKey); - // 合計金額 - $this->tpl_total_inctax[$this->cartKey] = $objCartSess->getAllProductsTotal($this->cartKey); - // 税額 - $this->tpl_total_tax[$this->cartKey] = $objCartSess->getAllProductsTax($this->cartKey); - // ポイント合計 - $this->tpl_total_point[$this->cartKey] = $objCartSess->getAllProductsPoint($this->cartKey); - - // 一時受注テーブルの読込 - $arrOrderTemp = $objPurchase->getOrderTemp($this->tpl_uniqid); - // カート集計を元に最終計算 - $arrCalcResults = $objCartSess->calculate($this->cartKey, $objCustomer, - $arrOrderTemp['use_point'], - $objPurchase->getShippingPref($this->is_multiple), - $arrOrderTemp['charge'], - $arrOrderTemp['discount'], - $arrOrderTemp['deliv_id'], - $arrOrderTemp['order_pref'], // 税金計算の為に追加 注文者基準 - $arrOrderTemp['order_country_id'] // 税金計算の為に追加 注文者基準 - ); - - $this->arrForm = array_merge($arrOrderTemp, $arrCalcResults); - - // 会員ログインチェック - if ($objCustomer->isLoginSuccess(true)) { - $this->tpl_login = '1'; - $this->tpl_user_point = $objCustomer->getValue('point'); - } - - // 決済モジュールを使用するかどうか - $this->use_module = SC_Helper_Payment_Ex::useModule($this->arrForm['payment_id']); - - switch ($this->getMode()) { - // 前のページに戻る - case 'return': - // 正常な推移であることを記録しておく - $objSiteSess->setRegistFlag(); - - SC_Response_Ex::sendRedirect(SHOPPING_PAYMENT_URLPATH); - SC_Response_Ex::actionExit(); - break; - case 'confirm': - /* - * 決済モジュールで必要なため, 受注番号を取得 - */ - $this->arrForm['order_id'] = $objPurchase->getNextOrderID(); - $_SESSION['order_id'] = $this->arrForm['order_id']; - - // 集計結果を受注一時テーブルに反映 - $objPurchase->saveOrderTemp($this->tpl_uniqid, $this->arrForm, - $objCustomer); - - // 正常に登録されたことを記録しておく - $objSiteSess->setRegistFlag(); - - // 決済モジュールを使用する場合 - if ($this->use_module) { - $objPurchase->completeOrder(ORDER_PENDING); - - SC_Response_Ex::sendRedirect(SHOPPING_MODULE_URLPATH); - // 購入完了ページ - } else { - $objPurchase->completeOrder(ORDER_NEW); - SC_Helper_Purchase_Ex::sendOrderMail($this->arrForm['order_id'], $this); - - SC_Response_Ex::sendRedirect(SHOPPING_COMPLETE_URLPATH); - } - SC_Response_Ex::actionExit(); - break; - default: - break; - } - - } -} diff --git a/data/class/pages/unsupported/LC_Page_Unsupported.php b/data/class/pages/unsupported/LC_Page_Unsupported.php deleted file mode 100644 index ea9ba14c3ab..00000000000 --- a/data/class/pages/unsupported/LC_Page_Unsupported.php +++ /dev/null @@ -1,61 +0,0 @@ -tpl_title = '未対応デバイス'; - } - - /** - * Page のプロセス. - * - * @return void - */ - public function process() - { - parent::process(); - $this->action(); - $this->sendResponse(); - } - - public function action() - { - } -} diff --git a/data/require_base.php b/data/require_base.php index 5567e4696c5..0f902b9910a 100644 --- a/data/require_base.php +++ b/data/require_base.php @@ -20,7 +20,6 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ - if (!defined('DATA_REALDIR')) { define('DATA_REALDIR', HTML_REALDIR . HTML2DATA_DIR); } @@ -31,18 +30,15 @@ // 定数 SAFE が設定されている場合、DBアクセスを回避する。主に、エラー画面を意図する。 if (!defined('SAFE') || !SAFE) { // インストール中で無い場合、 - if (!GC_Utils_Ex::isInstallFunction()) { - // インストールチェック - SC_Utils_Ex::sfInitInstall(); - + if (!Eccube\Common\Util\GcUtils::isInstallFunction()) { + Eccube\Common\Util\Utils::sfInitInstall(); // セッション初期化・開始 - $sessionFactory = SC_SessionFactory_Ex::getInstance(); + $sessionFactory = Eccube\Common\SessionFactory::getInstance(); $sessionFactory->initSession(); - /* * 管理画面の場合は認証行う. * 認証処理忘れ防止のため, LC_Page_Admin::init() 等ではなく, ここでチェックする. */ - SC_Helper_Session_Ex::adminAuthorization(); + Eccube\Common\Helper\SessionHelper::adminAuthorization(); } } diff --git a/eccube/.idea/.name b/eccube/.idea/.name new file mode 100644 index 00000000000..8ab43cc39a6 --- /dev/null +++ b/eccube/.idea/.name @@ -0,0 +1 @@ +eccube \ No newline at end of file diff --git a/eccube/.idea/eccube.iml b/eccube/.idea/eccube.iml new file mode 100644 index 00000000000..6b8184f8eff --- /dev/null +++ b/eccube/.idea/eccube.iml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/eccube/.idea/encodings.xml b/eccube/.idea/encodings.xml new file mode 100644 index 00000000000..e206d70d859 --- /dev/null +++ b/eccube/.idea/encodings.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/eccube/.idea/misc.xml b/eccube/.idea/misc.xml new file mode 100644 index 00000000000..1162f43828b --- /dev/null +++ b/eccube/.idea/misc.xml @@ -0,0 +1,5 @@ + + + + + diff --git a/eccube/.idea/modules.xml b/eccube/.idea/modules.xml new file mode 100644 index 00000000000..85b09547091 --- /dev/null +++ b/eccube/.idea/modules.xml @@ -0,0 +1,9 @@ + + + + + + + + + diff --git a/eccube/.idea/scopes/scope_settings.xml b/eccube/.idea/scopes/scope_settings.xml new file mode 100644 index 00000000000..922003b8433 --- /dev/null +++ b/eccube/.idea/scopes/scope_settings.xml @@ -0,0 +1,5 @@ + + + + \ No newline at end of file diff --git a/eccube/.idea/vcs.xml b/eccube/.idea/vcs.xml new file mode 100644 index 00000000000..def6a6a1845 --- /dev/null +++ b/eccube/.idea/vcs.xml @@ -0,0 +1,7 @@ + + + + + + + diff --git a/eccube/.idea/workspace.xml b/eccube/.idea/workspace.xml new file mode 100644 index 00000000000..51cb3144d6f --- /dev/null +++ b/eccube/.idea/workspace.xml @@ -0,0 +1,143 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 1420703828244 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/html/.htaccess b/html/.htaccess index 0e45931441c..eae124271d0 100644 --- a/html/.htaccess +++ b/html/.htaccess @@ -13,3 +13,13 @@ php_value mbstring.internal_encoding UTF-8 php_value upload_max_filesize 5M #php_value post_max_size 8M php_flag register_globals off + +RewriteEngine On +RewriteCond %{REQUEST_URI} !.*install.* +RewriteCond %{REQUEST_URI} \.php* [OR] +RewriteCond %{REQUEST_FILENAME} !-f +RewriteRule . index.php [L] + + +php_flag display_errors on +php_value error_reporting 6143 \ No newline at end of file diff --git a/html/admin/home.php b/html/admin/_home.php similarity index 100% rename from html/admin/home.php rename to html/admin/_home.php diff --git a/html/admin/index.php b/html/admin/_index.php similarity index 100% rename from html/admin/index.php rename to html/admin/_index.php diff --git a/html/frontparts/bloc/calendar.php b/html/frontparts/bloc/calendar.php index 6e968336aea..fc5bc22da41 100644 --- a/html/frontparts/bloc/calendar.php +++ b/html/frontparts/bloc/calendar.php @@ -22,9 +22,8 @@ */ require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Calendar_Ex.php'; -$objPage = new LC_Page_FrontParts_Bloc_Calendar_Ex(); +$objPage = new Eccube\Page\Bloc\Calendar(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/cart.php b/html/frontparts/bloc/cart.php index d024268a4e9..80305fd7140 100644 --- a/html/frontparts/bloc/cart.php +++ b/html/frontparts/bloc/cart.php @@ -22,9 +22,8 @@ */ require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Cart_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_Cart_Ex(); +$objPage = new Eccube\Page\Bloc\Cart(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/category.php b/html/frontparts/bloc/category.php index 5b9ab3b1ce0..b08014101ac 100644 --- a/html/frontparts/bloc/category.php +++ b/html/frontparts/bloc/category.php @@ -22,9 +22,8 @@ */ require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Category_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_Category_Ex(); +$objPage = new Eccube\Page\Bloc\Category(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/login.php b/html/frontparts/bloc/login.php index 5a88fe85abd..c71d0027716 100644 --- a/html/frontparts/bloc/login.php +++ b/html/frontparts/bloc/login.php @@ -22,9 +22,8 @@ */ require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Login_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_Login_Ex(); +$objPage = new Eccube\Page\Bloc\Login(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/login_footer.php b/html/frontparts/bloc/login_footer.php index a98f8b78890..86b5809509a 100644 --- a/html/frontparts/bloc/login_footer.php +++ b/html/frontparts/bloc/login_footer.php @@ -22,9 +22,8 @@ */ require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_LoginFooter_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_LoginFooter_Ex(); +$objPage = new Eccube\Page\Bloc\LoginFooter(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/login_header.php b/html/frontparts/bloc/login_header.php index 0be7ce639cf..69d7c5fc07c 100644 --- a/html/frontparts/bloc/login_header.php +++ b/html/frontparts/bloc/login_header.php @@ -22,9 +22,8 @@ */ require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_LoginHeader_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_LoginHeader_Ex(); +$objPage = new Eccube\Page\Bloc\LoginHeader(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/navi_footer.php b/html/frontparts/bloc/navi_footer.php index 443cb6fa483..d4b6149ca27 100644 --- a/html/frontparts/bloc/navi_footer.php +++ b/html/frontparts/bloc/navi_footer.php @@ -22,9 +22,8 @@ */ require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_NaviFooter_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_NaviFooter_Ex(); +$objPage = new Eccube\Page\Bloc\NaviFooter(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/navi_header.php b/html/frontparts/bloc/navi_header.php index dfa75884a4d..e2dcdd50d85 100644 --- a/html/frontparts/bloc/navi_header.php +++ b/html/frontparts/bloc/navi_header.php @@ -22,9 +22,8 @@ */ require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_NaviHeader_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_NaviHeader_Ex(); +$objPage = new Eccube\Page\Bloc\NaviHeader(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/news.php b/html/frontparts/bloc/news.php index 1c883472424..ef41d182581 100644 --- a/html/frontparts/bloc/news.php +++ b/html/frontparts/bloc/news.php @@ -20,10 +20,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_News_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_News_Ex(); +$objPage = new Eccube\Page\Bloc\News(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/recommend.php b/html/frontparts/bloc/recommend.php index 16471ee3d36..b59636bfe74 100644 --- a/html/frontparts/bloc/recommend.php +++ b/html/frontparts/bloc/recommend.php @@ -22,9 +22,8 @@ */ require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_Recommend_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_Recommend_Ex(); +$objPage = new Eccube\Page\Bloc\Recommend(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/bloc/search_products.php b/html/frontparts/bloc/search_products.php index 4b4a04f0d48..069cdd92c30 100644 --- a/html/frontparts/bloc/search_products.php +++ b/html/frontparts/bloc/search_products.php @@ -20,10 +20,10 @@ * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ + require_once realpath(dirname(__FILE__)) . '/../../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/bloc/LC_Page_FrontParts_Bloc_SearchProducts_Ex.php'; -$objPage = new LC_Page_FrontParts_BLoc_SearchProducts_Ex(); +$objPage = new Eccube\Page\Bloc\SearchProducts(); $objPage->blocItems = $params['items']; $objPage->init(); $objPage->process(); diff --git a/html/frontparts/login_check.php b/html/frontparts/login_check.php index 83b2c82598a..77f16078a20 100644 --- a/html/frontparts/login_check.php +++ b/html/frontparts/login_check.php @@ -22,8 +22,7 @@ */ require_once '../require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/frontparts/LC_Page_FrontParts_LoginCheck_Ex.php'; -$objPage = new LC_Page_FrontParts_LoginCheck_Ex(); +$objPage = new Eccube\Page\Bloc\LoginCheck(); $objPage->init(); $objPage->process(); diff --git a/html/index.php b/html/index.php index fec0efa6235..6f97954a0f2 100644 --- a/html/index.php +++ b/html/index.php @@ -21,8 +21,5 @@ * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ require_once './require.php'; -require_once CLASS_EX_REALDIR . 'page_extends/LC_Page_Index_Ex.php'; - -$objPage = new LC_Page_Index_Ex(); -$objPage->init(); -$objPage->process(); +$router = new Eccube\Router(); +$router->action(); diff --git a/html/install/index.php b/html/install/index.php index a464a84b398..53f9ebd4e27 100644 --- a/html/install/index.php +++ b/html/install/index.php @@ -1,4 +1,4 @@ - 'SMTP', 'sendmail' => 'sendmail'); -$objDb = new SC_Helper_DB_Ex(); +$objDb = new Eccube\Common\Helper\DbHelper(); // テンプレートコンパイルディレクトリの書込み権限チェック $temp_dir = $ownDir . 'temp'; if (!is_writable($temp_dir)) { - SC_Utils_Ex::sfErrorHeader($temp_dir . 'にユーザ書込み権限(777, 707等)を付与して下さい。', true); + Eccube\Common\Util\Utils::sfErrorHeader($temp_dir . 'にユーザ書込み権限(777, 707等)を付与して下さい。', true); exit; } -$objView = new SC_InstallView_Ex($ownDir . 'templates', $ownDir . 'temp'); +$objView = new Eccube\Common\View\InstallView($ownDir . 'templates', $ownDir . 'temp'); // パラメーター管理クラス -$objWebParam = new SC_FormParam(); -$objDBParam = new SC_FormParam(); +$objWebParam = new Eccube\Common\FormParam(); +$objDBParam = new Eccube\Common\FormParam(); // パラメーター情報の初期化 $objWebParam = lfInitWebParam($objWebParam); $objDBParam = lfInitDBParam($objDBParam); @@ -353,14 +354,14 @@ function lfDispStep0($objPage) $mess .= ">> ×:$real_path($filemode) \nユーザ書込み権限(777, 707等)を付与して下さい。\n"; $hasErr = true; } else { - GC_Utils_Ex::gfPrintLog('WRITABLE:' . $path, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog('WRITABLE:' . $path, INSTALL_LOG); } } else { if (!is_writable($path)) { $mess .= ">> ×:$real_path($filemode) \nユーザ書込み権限(666, 606等)を付与して下さい。\n"; $hasErr = true; } else { - GC_Utils_Ex::gfPrintLog('WRITABLE:' . $path, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog('WRITABLE:' . $path, INSTALL_LOG); } } } else { @@ -464,7 +465,7 @@ function lfDispStep0_1($objPage) $objPage->tpl_mainpage = 'step0_1.tpl'; $objPage->tpl_mode = 'step0_1'; // ファイルコピー - $objPage->copy_mess = SC_Utils_Ex::sfCopyDir('./save_image/', HTML_REALDIR . 'upload/save_image/', $objPage->copy_mess); + $objPage->copy_mess = Eccube\Common\Util\Utils::sfCopyDir('./save_image/', HTML_REALDIR . 'upload/save_image/', $objPage->copy_mess); return $objPage; } @@ -546,7 +547,7 @@ function lfDispStep4($objPage) $objPage->tpl_shop_name = $objWebParam->getValue('shop_name'); $objPage->tpl_cube_ver = ECCUBE_VERSION; $objPage->tpl_php_ver = phpversion(); - $dbFactory = SC_DB_DBFactory_Ex::getInstance($arrDsn['phptype']); + $dbFactory = Eccube\Common\Db\DbFactory::getInstance($arrDsn['phptype']); $objPage->tpl_db_ver = $dbFactory->sfGetDBVersion($arrDsn); $objPage->tpl_db_skip = $_POST['db_skip']; $objPage->tpl_mainpage = 'step4.tpl'; @@ -578,7 +579,7 @@ function lfDispComplete($objPage) $sqlval['mypage_tpl'] = 'default1'; $sqlval['update_date'] = 'CURRENT_TIMESTAMP'; $sqlval['country_id'] = DEFAULT_COUNTRY_ID; - $objQuery = new SC_Query($arrDsn); + $objQuery = new Eccube\Common\Query($arrDsn); $cnt = $objQuery->count('dtb_baseinfo'); if ($cnt > 0) { $objQuery->update('dtb_baseinfo', $sqlval); @@ -588,8 +589,8 @@ function lfDispComplete($objPage) // 管理者登録 $login_id = $objWebParam->getValue('login_id'); - $salt = SC_Utils_Ex::sfGetRandomString(10); - $login_pass = SC_Utils_Ex::sfGetHashString($objWebParam->getValue('login_pass'), $salt); + $salt = Eccube\Common\Util\Utils::sfGetRandomString(10); + $login_pass = Eccube\Common\Util\Utils::sfGetHashString($objWebParam->getValue('login_pass'), $salt); $arrVal = array( 'login_id' => $login_id, @@ -648,7 +649,7 @@ function lfInitWebParam($objWebParam) // 店名、管理者メールアドレスを取得する。(再インストール時) if (defined('DEFAULT_DSN')) { - $objQuery = new SC_Query(); + $objQuery = new Eccube\Common\Query(); $tables = $objQuery->listTables(); if (!PEAR::isError($tables) && in_array('dtb_baseinfo', $tables)) { @@ -660,7 +661,7 @@ function lfInitWebParam($objWebParam) // 管理機能のディレクトリ名を取得(再インストール時) if (defined('ADMIN_DIR')) { - $oldAdminDir = SC_Utils_Ex::sfTrimURL(ADMIN_DIR); + $oldAdminDir = Eccube\Common\Util\Utils::sfTrimURL(ADMIN_DIR); } if (defined('ADMIN_FORCE_SSL')) { @@ -765,7 +766,7 @@ function lfCheckWebError($objWebParam) { // 入力データを渡す。 $arrRet = $objWebParam->getHashArray(); - $objErr = new SC_CheckError($arrRet); + $objErr = new Eccube\Common\CheckError($arrRet); $objErr->arrErr = $objWebParam->checkError(); // ディレクトリ名のみ取得する @@ -786,7 +787,7 @@ function lfCheckWebError($objWebParam) // 管理機能ディレクトリのチェック $objErr->doFunc(array('管理機能:ディレクトリ', 'admin_dir', ID_MIN_LEN, ID_MAX_LEN), array('SPTAB_CHECK', 'NUM_RANGE_CHECK')); - $oldAdminDir = SC_Utils_Ex::sfTrimURL(ADMIN_DIR); + $oldAdminDir = Eccube\Common\Util\Utils::sfTrimURL(ADMIN_DIR); $newAdminDir = $objWebParam->getValue('admin_dir'); if ($newAdminDir) { if ($oldAdminDir !== $newAdminDir AND file_exists(HTML_REALDIR . $newAdminDir) and $newAdminDir != 'admin') { @@ -805,7 +806,7 @@ function lfCheckDBError($objDBParam) // 入力データを渡す。 $arrRet = $objDBParam->getHashArray(); - $objErr = new SC_CheckError($arrRet); + $objErr = new Eccube\Common\CheckError($arrRet); $objErr->arrErr = $objDBParam->checkError(); if (count($objErr->arrErr) == 0) { @@ -815,7 +816,7 @@ function lfCheckDBError($objDBParam) $objDB = MDB2::connect($arrDsn, $options); // 接続成功 if (!PEAR::isError($objDB)) { - $dbFactory = SC_DB_DBFactory_Ex::getInstance($arrDsn['phptype']); + $dbFactory = Eccube\Common\Db\DbFactory::getInstance($arrDsn['phptype']); // データベースバージョン情報の取得 $objPage->tpl_db_version = $dbFactory->sfGetDBVersion($arrDsn); } else { @@ -823,7 +824,7 @@ function lfCheckDBError($objDBParam) // エラー文を取得する preg_match('/\[(.*)\]/', $objDB->userinfo, $arrKey); $objErr->arrErr['all'] .= $arrKey[0] . '
    '; - GC_Utils_Ex::gfPrintLog($objDB->userinfo, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog($objDB->userinfo, INSTALL_LOG); } } return $objErr->arrErr; @@ -857,7 +858,7 @@ function lfExecuteSQL($filepath, $arrDsn, $disp_err = true) $sql_split = split(';', $sql); foreach ($sql_split as $key => $val) { - SC_Utils::sfFlush(true); + Eccube\Common\Util\Utils::sfFlush(true); if (trim($val) != '') { $ret = $objDB->query($val); if (PEAR::isError($ret) && $disp_err) { @@ -866,16 +867,16 @@ function lfExecuteSQL($filepath, $arrDsn, $disp_err = true) preg_match('/\[(.*)\]/', $ret->userinfo, $arrKey); $arrErr['all'] .= $arrKey[0] . '
    '; $arrErr['all'] .= '>> テーブル構成の変更に失敗しました。
    '; - GC_Utils_Ex::gfPrintLog($ret->userinfo, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog($ret->userinfo, INSTALL_LOG); break; } else { - GC_Utils_Ex::gfPrintLog('OK:' . $val, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog('OK:' . $val, INSTALL_LOG); } } } } else { $arrErr['all'] = '>> ' . $objDB->message; - GC_Utils_Ex::gfPrintLog($objDB->userinfo, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog($objDB->userinfo, INSTALL_LOG); } } return $arrErr; @@ -901,21 +902,21 @@ function lfDropSequence($arrSequences, $arrDsn) if (!PEAR::isError($objDB)) { $exists = $objManager->listSequences(); foreach ($arrSequences as $seq) { - SC_Utils::sfFlush(true); + Eccube\Common\Util\Utils::sfFlush(true); $seq_name = $seq[0] . '_' . $seq[1]; if (in_array($seq_name, $exists)) { $result = $objManager->dropSequence($seq_name); if (PEAR::isError($result)) { $arrErr['all'] = '>> ' . $result->message . '
    '; - GC_Utils_Ex::gfPrintLog($result->userinfo, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog($result->userinfo, INSTALL_LOG); } else { - GC_Utils_Ex::gfPrintLog('OK:' . $seq_name, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog('OK:' . $seq_name, INSTALL_LOG); } } } } else { $arrErr['all'] = '>> ' . $objDB->message; - GC_Utils_Ex::gfPrintLog($objDB->userinfo, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog($objDB->userinfo, INSTALL_LOG); } return $arrErr; } @@ -940,11 +941,11 @@ function lfCreateSequence($arrSequences, $arrDsn) if (!PEAR::isError($objDB)) { $exists = $objManager->listSequences(); foreach ($arrSequences as $seq) { - SC_Utils::sfFlush(true); + Eccube\Common\Util\Utils::sfFlush(true); $res = $objDB->query('SELECT max(' . $seq[1] . ') FROM ' . $seq[0]); if (PEAR::isError($res)) { $arrErr['all'] = '>> ' . $res->userinfo . '
    '; - GC_Utils_Ex::gfPrintLog($res->userinfo, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog($res->userinfo, INSTALL_LOG); return $arrErr; } $max = $res->fetchOne(); @@ -953,14 +954,14 @@ function lfCreateSequence($arrSequences, $arrDsn) $result = $objManager->createSequence($seq_name, $max + 1); if (PEAR::isError($result)) { $arrErr['all'] = '>> ' . $result->message . '
    '; - GC_Utils_Ex::gfPrintLog($result->userinfo, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog($result->userinfo, INSTALL_LOG); } else { - GC_Utils_Ex::gfPrintLog('OK:' . $seq_name, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog('OK:' . $seq_name, INSTALL_LOG); } } } else { $arrErr['all'] = '>> ' . $objDB->message; - GC_Utils_Ex::gfPrintLog($objDB->userinfo, INSTALL_LOG); + Eccube\Common\Util\GcUtils::gfPrintLog($objDB->userinfo, INSTALL_LOG); } return $arrErr; } @@ -1019,7 +1020,7 @@ function lfMakeConfigFile() if ($_POST['db_skip'] && defined('AUTH_MAGIC')) { $auth_magic = AUTH_MAGIC; } else { - $auth_magic = SC_Utils_Ex::sfGetRandomString(40); + $auth_magic = Eccube\Common\Util\Utils::sfGetRandomString(40); define('AUTH_MAGIC', $auth_magic); } @@ -1139,7 +1140,7 @@ function renameAdminDir($adminDir) define('ADMIN_DIR', 'admin/'); } - $oldAdminDir = SC_Utils_Ex::sfTrimURL(ADMIN_DIR); + $oldAdminDir = Eccube\Common\Util\Utils::sfTrimURL(ADMIN_DIR); if ($adminDir === $oldAdminDir) { return true; } @@ -1152,7 +1153,7 @@ function renameAdminDir($adminDir) return true; } -function getArrayDsn(SC_FormParam $objDBParam) +function getArrayDsn(Eccube\Common\FormParam $objDBParam) { $arrRet = $objDBParam->getHashArray(); diff --git a/html/products/detail.php b/html/products/_detail.php similarity index 100% rename from html/products/detail.php rename to html/products/_detail.php diff --git a/html/products/list.php b/html/products/_list.php similarity index 100% rename from html/products/list.php rename to html/products/_list.php diff --git a/html/require.php b/html/require.php index fecb9d18be5..b7d13230bd6 100644 --- a/html/require.php +++ b/html/require.php @@ -37,10 +37,11 @@ // 絵文字変換 (除去) フィルターを組み込む。 ob_start(array('SC_MobileEmoji', 'handler')); -if (SC_Display_Ex::detectDevice() == DEVICE_TYPE_MOBILE) { +if (Eccube\Common\Display::detectDevice() == DEVICE_TYPE_MOBILE) { // resize_image.phpは除外 if (stripos($_SERVER['REQUEST_URI'], ROOT_URLPATH . 'resize_image.php') === FALSE) { - $objMobile = new SC_Helper_Mobile_Ex(); + $objMobile = new Eccube\Common\Helper\MobileHelper(); $objMobile->sfMobileInit(); } } + diff --git a/robots.txt b/robots.txt new file mode 100644 index 00000000000..d9b77923524 --- /dev/null +++ b/robots.txt @@ -0,0 +1 @@ +Disallow: /*.csv$ diff --git a/test/TestSuite.php b/test/TestSuite.php index 6726c0f83bf..88d416ec46d 100644 --- a/test/TestSuite.php +++ b/test/TestSuite.php @@ -39,7 +39,7 @@ class TestSuite { public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('ECCUBE'); + $suite = new PHPUnit_Common_TestSuite('ECCUBE'); $suite->addTest(Page_AllTests::suite()); $suite->addTest(DB_AllTests::suite()); $suite->addTest(Helper_AllTests::suite()); diff --git a/test/class/SC_DbConn_Test.php b/test/class/SC_DbConn_Test.php index ad0a2593fae..e38376e5ec3 100644 --- a/test/class/SC_DbConn_Test.php +++ b/test/class/SC_DbConn_Test.php @@ -31,7 +31,7 @@ * @author Kentaro Ohkouchi * @version $Id$ */ -class SC_DbConn_Test extends PHPUnit_Framework_TestCase +class SC_DbConn_Test extends PHPUnit_Common_TestCase { /** SC_DbConn インスタンス */ diff --git a/test/class/SC_Query_Test.php b/test/class/SC_Query_Test.php index 20e0ea93ddb..692d66c0633 100644 --- a/test/class/SC_Query_Test.php +++ b/test/class/SC_Query_Test.php @@ -32,7 +32,7 @@ * @author Kentaro Ohkouchi * @version $Id$ */ -class SC_Query_Test extends PHPUnit_Framework_TestCase +class SC_Query_Test extends PHPUnit_Common_TestCase { /** SC_Query インスタンス */ diff --git a/test/class/db/DB_AllTests.php b/test/class/db/DB_AllTests.php index 0adf4650764..c4d739b48db 100644 --- a/test/class/db/DB_AllTests.php +++ b/test/class/db/DB_AllTests.php @@ -34,12 +34,12 @@ * @author Kentaro Ohkouchi * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ */ -class DB_AllTests extends PHPUnit_Framework_TestCase +class DB_AllTests extends PHPUnit_Common_TestCase { public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('SC_DB'); + $suite = new PHPUnit_Common_TestSuite('SC_DB'); $suite->addTestSuite('SC_DB_DBFactory_Test'); $suite->addTestSuite('SC_DB_MasterData_Test'); diff --git a/test/class/db/SC_DB_DBFactory_Test.php b/test/class/db/SC_DB_DBFactory_Test.php index cc8f85345c7..3622f180214 100644 --- a/test/class/db/SC_DB_DBFactory_Test.php +++ b/test/class/db/SC_DB_DBFactory_Test.php @@ -32,7 +32,7 @@ * @author LOCKON CO.,LTD. * @version $Id:SC_DB_DBFactory_Test.php 15532 2007-08-31 14:39:46Z nanasess $ */ -class SC_DB_DBFactory_Test extends PHPUnit_Framework_TestCase +class SC_DB_DBFactory_Test extends PHPUnit_Common_TestCase { // }}} diff --git a/test/class/db/SC_DB_MasterData_Test.php b/test/class/db/SC_DB_MasterData_Test.php index 2e02b1853b4..63db811257d 100644 --- a/test/class/db/SC_DB_MasterData_Test.php +++ b/test/class/db/SC_DB_MasterData_Test.php @@ -32,7 +32,7 @@ * @author LOCKON CO.,LTD. * @version $Id:SC_DB_MasterData_Test.php 15532 2007-08-31 14:39:46Z nanasess $ */ -class SC_DB_MasterData_Test extends PHPUnit_Framework_TestCase +class SC_DB_MasterData_Test extends PHPUnit_Common_TestCase { // }}} diff --git a/test/class/helper/Helper_AllTests.php b/test/class/helper/Helper_AllTests.php index 66b2040aa5e..9a0d7196a32 100644 --- a/test/class/helper/Helper_AllTests.php +++ b/test/class/helper/Helper_AllTests.php @@ -35,12 +35,12 @@ * @author Kentaro Ohkouchi * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ */ -class Helper_AllTests extends PHPUnit_Framework_TestCase +class Helper_AllTests extends PHPUnit_Common_TestCase { public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('SC_Helper'); + $suite = new PHPUnit_Common_TestSuite('SC_Helper'); $suite->addTestSuite('SC_Helper_DB_Test'); $suite->addTestSuite('SC_Helper_Session_Test'); $suite->addTestSuite('SC_Helper_Purchase_Test'); diff --git a/test/class/helper/SC_Helper_Address_Test.php b/test/class/helper/SC_Helper_Address_Test.php index 4154cc8e796..820149f87cd 100644 --- a/test/class/helper/SC_Helper_Address_Test.php +++ b/test/class/helper/SC_Helper_Address_Test.php @@ -10,7 +10,7 @@ * * @author cyberwill */ -class SC_Helper_Address_Test extends PHPUnit_Framework_TestCase +class SC_Helper_Address_Test extends PHPUnit_Common_TestCase { public $objQuery = ""; public $objAddress = ""; diff --git a/test/class/helper/SC_Helper_DB_Test.php b/test/class/helper/SC_Helper_DB_Test.php index c80d3a6db6e..8dd3bae4b62 100644 --- a/test/class/helper/SC_Helper_DB_Test.php +++ b/test/class/helper/SC_Helper_DB_Test.php @@ -32,7 +32,7 @@ * @author LOCKON CO.,LTD. * @version $Id$ */ -class SC_Helper_DB_Test extends PHPUnit_Framework_TestCase +class SC_Helper_DB_Test extends PHPUnit_Common_TestCase { /** diff --git a/test/class/helper/SC_Helper_Purchase_Test.php b/test/class/helper/SC_Helper_Purchase_Test.php index 6a3c5276548..d75e6fb7967 100644 --- a/test/class/helper/SC_Helper_Purchase_Test.php +++ b/test/class/helper/SC_Helper_Purchase_Test.php @@ -32,7 +32,7 @@ * @author LOCKON CO.,LTD. * @version $Id$ */ -class SC_Helper_Purchase_Test extends PHPUnit_Framework_TestCase +class SC_Helper_Purchase_Test extends PHPUnit_Common_TestCase { /** * @var SC_Helper_Purchase diff --git a/test/class/helper/SC_Helper_Session_Test.php b/test/class/helper/SC_Helper_Session_Test.php index de2998dc73e..723e2557174 100644 --- a/test/class/helper/SC_Helper_Session_Test.php +++ b/test/class/helper/SC_Helper_Session_Test.php @@ -32,7 +32,7 @@ * @author LOCKON CO.,LTD. * @version $Id$ */ -class SC_Helper_Session_Test extends PHPUnit_Framework_TestCase +class SC_Helper_Session_Test extends PHPUnit_Common_TestCase { /** diff --git a/test/class/page/LC_Page_Admin_Products_ProductClass_Test.php b/test/class/page/LC_Page_Admin_Products_ProductClass_Test.php index be76d5d40ac..58db26e9619 100644 --- a/test/class/page/LC_Page_Admin_Products_ProductClass_Test.php +++ b/test/class/page/LC_Page_Admin_Products_ProductClass_Test.php @@ -32,7 +32,7 @@ * @author Kentaro Ohkouchi * @version $Id$ */ -class LC_Page_Admin_Products_ProductClass_Test extends PHPUnit_Framework_TestCase +class LC_Page_Admin_Products_ProductClass_Test extends PHPUnit_Common_TestCase { function setUp() diff --git a/test/class/page/LC_Page_Test.php b/test/class/page/LC_Page_Test.php index 0af015759c2..eb246d414e4 100644 --- a/test/class/page/LC_Page_Test.php +++ b/test/class/page/LC_Page_Test.php @@ -32,7 +32,7 @@ * @author LOCKON CO.,LTD. * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ */ -class LC_Page_Test extends PHPUnit_Framework_TestCase +class LC_Page_Test extends PHPUnit_Common_TestCase { // }}} diff --git a/test/class/page/Page_AllTests.php b/test/class/page/Page_AllTests.php index 0031313209b..d0291501168 100644 --- a/test/class/page/Page_AllTests.php +++ b/test/class/page/Page_AllTests.php @@ -32,12 +32,12 @@ * @author Kentaro Ohkouchi * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ */ -class Page_AllTests extends PHPUnit_Framework_TestCase +class Page_AllTests extends PHPUnit_Common_TestCase { public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('Page'); + $suite = new PHPUnit_Common_TestSuite('Page'); $suite->addTestSuite('LC_Page_Test'); return $suite; diff --git a/test/class/page/shopping/LC_Page_Shopping_LoadPaymentModule_Test.php b/test/class/page/shopping/LC_Page_Shopping_LoadPaymentModule_Test.php index 20f367f2ed8..129347d75b0 100644 --- a/test/class/page/shopping/LC_Page_Shopping_LoadPaymentModule_Test.php +++ b/test/class/page/shopping/LC_Page_Shopping_LoadPaymentModule_Test.php @@ -32,7 +32,7 @@ * @author Kentaro Ohkouchi * @version $Id$ */ -class LC_Page_Shopping_LoadPaymentModule_Test extends PHPUnit_Framework_TestCase +class LC_Page_Shopping_LoadPaymentModule_Test extends PHPUnit_Common_TestCase { function setUp() diff --git a/test/class/util/SC_Utils_Test.php b/test/class/util/SC_Utils_Test.php index e29c51efe16..a412e6c88a2 100644 --- a/test/class/util/SC_Utils_Test.php +++ b/test/class/util/SC_Utils_Test.php @@ -32,7 +32,7 @@ * @author LOCKON CO.,LTD. * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ */ -class SC_Utils_Test extends PHPUnit_Framework_TestCase +class SC_Utils_Test extends PHPUnit_Common_TestCase { // }}} diff --git a/test/class/util/Util_AllTests.php b/test/class/util/Util_AllTests.php index feb74c36dc3..753d1a05aac 100644 --- a/test/class/util/Util_AllTests.php +++ b/test/class/util/Util_AllTests.php @@ -32,12 +32,12 @@ * @author Kentaro Ohkouchi * @version $Id:LC_Page_Test.php 15116 2007-07-23 11:32:53Z nanasess $ */ -class Util_AllTests extends PHPUnit_Framework_TestCase +class Util_AllTests extends PHPUnit_Common_TestCase { public static function suite() { - $suite = new PHPUnit_Framework_TestSuite('Util'); + $suite = new PHPUnit_Common_TestSuite('Util'); $suite->addTestSuite('SC_Utils_Test'); return $suite;