[Svn-src-all:1259] [version-2_5-dev 20148] リファクタリング #981
kimoto
admin @ mail.ec-cube.net
2011年 2月 11日 (金) 18:57:58 JST
Subversion committed to /home/svn/open 20148
http://svn.ec-cube.net/open_trac/changeset/20148
┌────────────────────────────┐
│更新者 : kimoto │
│更新日時: 2011-02-11 18:57:58 +0900 (金, 11 2月 2011)│
└────────────────────────────┘
Log:
--------------------------------------------------------
リファクタリング #981
Changed: [U:修正,A:追加,D:削除]
--------------------------------------------------------
U branches/version-2_5-dev/data/class/SC_Product.php
U branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php
U branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage.php
U branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php
U branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Login.php
U branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Order.php
U branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Refusal.php
変更: branches/version-2_5-dev/data/class/SC_Product.php
===================================================================
--- branches/version-2_5-dev/data/class/SC_Product.php 2011-02-11 09:57:52 UTC (rev 20147)
+++ branches/version-2_5-dev/data/class/SC_Product.php 2011-02-11 09:57:58 UTC (rev 20148)
@@ -738,7 +738,7 @@
__EOS__;
return $sql;
}
-
+
/**
* 商品規格ID1、2に紐づいた,product_class_idを取得する.
*
変更: branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php
===================================================================
--- branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php 2011-02-11 09:57:52 UTC (rev 20147)
+++ branches/version-2_5-dev/data/class/helper/SC_Helper_Customer.php 2011-02-11 09:57:58 UTC (rev 20148)
@@ -287,10 +287,24 @@
}
+ /**
+ * 会員登録時フォーム初期化
+ *
+ * @param mixed $objFormParam
+ * @access public
+ * @return void
+ */
function sfCustomerEntryParam (&$objFormParam) {
SC_Helper_Customer_Ex::sfCustomerCommonParam($objFormParam);
}
+ /**
+ * 会員情報変更フォーム初期化
+ *
+ * @param mixed $objFormParam
+ * @access public
+ * @return void
+ */
function sfCustomerMypageParam (&$objFormParam) {
SC_Helper_Customer_Ex::sfCustomerCommonParam($objFormParam);
if (SC_Display::detectDevice() !== DEVICE_TYPE_MOBILE){
@@ -299,6 +313,13 @@
}
}
+ /**
+ * 会員フォーム共通
+ *
+ * @param mixed $objFormParam
+ * @access public
+ * @return void
+ */
function sfCustomerCommonParam (&$objFormParam) {
$objFormParam->addParam("お名前(姓)", 'name01', STEXT_LEN, "aKV", array("EXIST_CHECK", "NO_SPTAB", "SPTAB_CHECK" ,"MAX_LENGTH_CHECK"));
@@ -335,11 +356,25 @@
}
}
+ /**
+ * 会員登録エラーチェック
+ *
+ * @param mixed $objFormParam
+ * @access public
+ * @return array エラーの配列
+ */
function sfCustomerEntryErrorCheck(&$objFormParam) {
$objErr->arrErr = SC_Helper_Customer_Ex::sfCustomerCommonErrorCheck(&$objFormParam);
return $objErr->arrErr;
}
+ /**
+ * 会員情報変更エラーチェック
+ *
+ * @param mixed $objFormParam
+ * @access public
+ * @return array エラーの配列
+ */
function sfCustomerMypageErrorCheck(&$objFormParam) {
$objFormParam->toLower('email_mobile');
@@ -358,7 +393,7 @@
}
/**
- * 入力エラーチェック
+ * 会員エラーチェック共通
*
* @param mixed $objFormParam
* @access private
@@ -389,7 +424,4 @@
return $objErr->arrErr;
}
-
-
-
}
変更: branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage.php 2011-02-11 09:57:52 UTC (rev 20147)
+++ branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage.php 2011-02-11 09:57:58 UTC (rev 20148)
@@ -22,7 +22,7 @@
*/
// {{{ requires
-require_once(CLASS_REALDIR . "pages/LC_Page.php");
+require_once(CLASS_REALDIR . "pages/mypage/LC_Page_AbstractMypage.php");
/**
* MyPage のページクラス.
@@ -31,7 +31,7 @@
* @author LOCKON CO.,LTD.
* @version $Id$
*/
-class LC_Page_MyPage extends LC_Page {
+class LC_Page_MyPage extends LC_Page_AbstractMypage {
// {{{ properties
@@ -48,15 +48,15 @@
*/
function init() {
parent::init();
- $this->tpl_title = 'MYページ';
+ $this->tpl_title = 'MYページ';
if (Net_UserAgent_Mobile::isMobile() === true){
$this->tpl_subtitle = 'MYページ';
} else {
$this->tpl_subtitle = '購入履歴一覧';
}
- $this->tpl_navi = TEMPLATE_REALDIR . 'mypage/navi.tpl';
- $this->tpl_mainno = 'mypage';
- $this->tpl_mypageno = 'index';
+ $this->tpl_navi = TEMPLATE_REALDIR . 'mypage/navi.tpl';
+ $this->tpl_mainno = 'mypage';
+ $this->tpl_mypageno = 'index';
$this->httpCacheControl('nocache');
}
@@ -67,10 +67,8 @@
*/
function process() {
parent::process();
- $this->action();
- $this->sendResponse();
}
-
+
/**
* Page のAction.
*
@@ -80,20 +78,7 @@
$objQuery = new SC_Query();
$objCustomer = new SC_Customer();
-
- // 退会判定用情報の取得
- $this->tpl_login = $objCustomer->isLoginSuccess(true);
- // ログインチェック
- if(!$objCustomer->isLoginSuccess(true)) {
- SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
- }else {
- //マイページトップ顧客情報表示用
- $this->CustomerName1 = $objCustomer->getvalue('name01');
- $this->CustomerName2 = $objCustomer->getvalue('name02');
- $this->CustomerPoint = $objCustomer->getvalue('point');
- }
-
//ページ送り用
if (isset($_POST['pageno'])) {
$this->tpl_pageno = htmlspecialchars($_POST['pageno'], ENT_QUOTES, CHAR_CODE);
@@ -145,11 +130,11 @@
$objNavi = new SC_PageNavi($this->tpl_pageno, $linemax, SEARCH_PMAX, "fnNaviPage", NAVI_PMAX);
$this->tpl_strnavi = $objNavi->strnavi; // 表示文字列
$startno = $objNavi->start_row;
-
+
// 取得範囲の指定(開始行番号、行数のセット)
$objQuery->setLimitOffset(SEARCH_PMAX, $startno);
}
-
+
// 表示順序
$objQuery->setOrder($order);
@@ -170,23 +155,4 @@
function destroy() {
parent::destroy();
}
-
- //エラーチェック
-
- function lfErrorCheck() {
- $objErr = new SC_CheckError();
- $objErr->doFunc(array("メールアドレス", "login_email", MTEXT_LEN), array("EXIST_CHECK","SPTAB_CHECK","EMAIL_CHECK","MAX_LENGTH_CHECK"));
- $objErr->dofunc(array("パスワード", "login_password", PASSWORD_LEN2), array("EXIST_CHECK","ALNUM_CHECK"));
- return $objErr->arrErr;
- }
-
- /* パラメータ情報の初期化 */
- function lfInitParam(&$objFormParam) {
-
- $objFormParam->addParam("記憶する", "login_memory", INT_LEN, "n", array("MAX_LENGTH_CHECK", "NUM_CHECK"));
- $objFormParam->addParam("メールアドレス", "login_email", MTEXT_LEN, "a", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
- $objFormParam->addParam("パスワード", "login_pass", STEXT_LEN, "a", array("EXIST_CHECK", "MAX_LENGTH_CHECK"));
- }
-
}
-?>
変更: branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php 2011-02-11 09:57:52 UTC (rev 20147)
+++ branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_History.php 2011-02-11 09:57:58 UTC (rev 20148)
@@ -67,7 +67,6 @@
* @return void
*/
function action() {
- $objQuery = new SC_Query();
$objCustomer = new SC_Customer();
$objDb = new SC_Helper_DB_Ex();
@@ -170,4 +169,3 @@
return $objQuery->select($col, 'dtb_mail_history', $where, array($order_id));
}
}
-?>
変更: branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Login.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Login.php 2011-02-11 09:57:52 UTC (rev 20147)
+++ branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Login.php 2011-02-11 09:57:58 UTC (rev 20148)
@@ -43,7 +43,6 @@
*/
function init() {
parent::init();
- $this->tpl_title = 'MYページ(ログイン)';
$this->httpCacheControl('nocache');
}
変更: branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Order.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Order.php 2011-02-11 09:57:52 UTC (rev 20147)
+++ branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Order.php 2011-02-11 09:57:58 UTC (rev 20148)
@@ -22,7 +22,7 @@
*/
// {{{ requires
-require_once(CLASS_REALDIR . "pages/LC_Page.php");
+require_once(CLASS_REALDIR . "pages/mypage/LC_Page_AbstractMypage.php");
/**
* 受注履歴からカート遷移 のページクラス.
@@ -31,7 +31,7 @@
* @author LOCKON CO.,LTD.
* @version $Id$
*/
-class LC_Page_Mypage_Order extends LC_Page {
+class LC_Page_Mypage_Order extends LC_Page_AbstractMypage {
// }}}
// {{{ functions
@@ -52,8 +52,6 @@
*/
function process() {
parent::process();
- $this->action();
- $this->sendResponse();
}
/**
@@ -68,7 +66,7 @@
$arrOrderDetail = $this->lfGetOrderDetail($_POST['order_id']);
//ログインしていない、またはDBに情報が無い場合
- if (!$objCustomer->isLoginSuccess(true) || empty($arrOrderDetail)){
+ if (empty($arrOrderDetail)){
SC_Utils_Ex::sfDispSiteError(CUSTOMER_ERROR);
}
変更: branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Refusal.php
===================================================================
--- branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Refusal.php 2011-02-11 09:57:52 UTC (rev 20147)
+++ branches/version-2_5-dev/data/class/pages/mypage/LC_Page_Mypage_Refusal.php 2011-02-11 09:57:58 UTC (rev 20148)
@@ -43,10 +43,7 @@
*/
function init() {
parent::init();
- $this->tpl_title = 'MYページ';
$this->tpl_subtitle = '退会手続き(入力ページ)';
- $this->tpl_navi = TEMPLATE_REALDIR . 'mypage/navi.tpl';
- $this->tpl_mainno = 'mypage';
$this->tpl_mypageno = 'refusal';
}
@@ -103,7 +100,7 @@
* @return void
*/
function lfDeleteCustomer($customer_id){
- $objQuery = SC_Query::getSingletonInstance();
+ $objQuery = SC_Query::getSingletonInstance();
$sqlval['del_flg'] = 1;
$sqlval['update_date'] = 'now()';
Svn-src-all メーリングリストの案内