Ignore:
Timestamp:
2010/09/20 20:40:27 (12 years ago)
Author:
nanasess
bzr:base-revision:
svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18814
bzr:committer:
Kentaro Ohkouchi <nanasess@fsm.ne.jp>
bzr:file-ids:

data/Smarty/templates/default/admin/products/product_class.tpl 15732@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fadmin%2Fproducts%2Fproduct_class.tpl
data/class/SC_Initial.php 16506@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_Initial.php
data/class/SC_Product.php 18277@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2FSC_Product.php
data/class/SC_Query.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2FSC_Query.php
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php 15123@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fdb%2Fdbfactory%2FSC_DB_DBFactory_MYSQL.php
data/class/helper/SC_Helper_CSV.php 15535@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_CSV.php
data/class/helper/SC_Helper_DB.php 15176@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fhelper%2FSC_Helper_DB.php
data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php 15661@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fcontents%2FLC_Page_Admin_Contents_RecommendSearch.php
data/class/pages/admin/customer/LC_Page_Admin_Customer.php 15568@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fcustomer%2FLC_Page_Admin_Customer.php
data/class/pages/admin/mail/LC_Page_Admin_Mail.php 15640@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fmail%2FLC_Page_Admin_Mail.php
data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php 15654@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fmail%2FLC_Page_Admin_Mail_Preview.php
data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php 17293@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2Fpages%2Fadmin%2Forder%2FLC_Page_Admin_Order_ProductSelect.php
data/class/pages/admin/products/LC_Page_Admin_Products.php 15342@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products.php
data/class/pages/admin/products/LC_Page_Admin_Products_Product.php 15342@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products_Product.php
data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php 15559@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products_ProductClass.php
data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php 15526@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products_ProductRank.php
data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php 15557@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Fproducts%2FLC_Page_Admin_Products_ProductSelect.php
data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Best5.php 15367@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Ffrontparts%2Fbloc%2FLC_Page_FrontParts_Bloc_Best5.php
data/class/pages/mypage/LC_Page_Mypage_Favorite.php 17162@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2Fpages%2Fmypage%2FLC_Page_Mypage_Favorite.php
data/class/pages/products/LC_Page_Products_Detail.php 15154@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fproducts%2FLC_Page_Products_Detail.php
data/class/pages/products/LC_Page_Products_List.php 15154@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fproducts%2FLC_Page_Products_List.php
data/class/pages/rss/LC_Page_Rss_Products.php 16193@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Frss%2FLC_Page_Rss_Products.php
data/class/pages/shopping/LC_Page_Shopping_Complete.php 15223@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fshopping%2FLC_Page_Shopping_Complete.php
data/class/util/SC_Utils.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Futil%2FSC_Utils.php
data/install.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Finstall.php
data/require_classes.php 18500@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fversion-2_4-dev%2Fdata%2Frequire_classes.php
html/admin/require.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Fadmin%2Frequire.php
html/handle_error.php 18500@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fversion-2_4-dev%2Fhtml%2Fhandle_error.php
html/install/index.php 16809@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Findex.php
html/install/sql/create_table_mysql.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_table_mysql.sql
html/install/sql/create_table_pgsql.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_table_pgsql.sql
html/install/sql/create_view.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fcreate_view.sql
html/install/sql/drop_table.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fdrop_table.sql
html/install/sql/drop_view.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Fdrop_view.sql
html/install/sql/insert_data.sql 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Finstall%2Fsql%2Finsert_data.sql
html/require.php 15078@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fhtml%2Frequire.php
test/class/page/LC_Page_Admin_Products_ProductClass_Test.php lc_page_admin_produc-20100910101923-ux7d8xbbsd4inq1c-1
bzr:mapping-version:
v4
bzr:merge:

nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
nanasess@fsm.ne.jp-20100920113958-9zux6qc07fmrp1fp
bzr:revno:
2298
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:text-parents:

data/Smarty/templates/default/admin/products/product_class.tpl ohkouchi@loop-az.jp-20100614082324-fsyp4ss6t8s1l9hk
data/class/SC_Initial.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18795 ohkouchi@loop-az.jp-20100910102335-0e7jvlwqa13j60hg
data/class/SC_Product.php ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
data/class/SC_Query.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18813 ohkouchi@loop-az.jp-20100910102335-0e7jvlwqa13j60hg
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php ohkouchi@loop-az.jp-20100826072347-bdrmnk0g8b3llidi
data/class/helper/SC_Helper_CSV.php ohkouchi@loop-az.jp-20100825073846-mzg8ka4y21o1nk6o
data/class/helper/SC_Helper_DB.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php ohkouchi@loop-az.jp-20100803084717-9sbbuk4o59x5sio4
data/class/pages/admin/customer/LC_Page_Admin_Customer.php ohkouchi@loop-az.jp-20100803084717-9sbbuk4o59x5sio4
data/class/pages/admin/mail/LC_Page_Admin_Mail.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18798 nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php ohkouchi@loop-az.jp-20100803084717-9sbbuk4o59x5sio4
data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php ohkouchi@loop-az.jp-20100820090626-dkyj2ngdh7vklaow
data/class/pages/admin/products/LC_Page_Admin_Products.php ohkouchi@loop-az.jp-20100826014156-g12l1o38gsj73acs
data/class/pages/admin/products/LC_Page_Admin_Products_Product.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php ohkouchi@loop-az.jp-20100614082857-g3n9wn9zakpc7a0m
data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php ohkouchi@loop-az.jp-20100820090626-dkyj2ngdh7vklaow
data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Best5.php ohkouchi@loop-az.jp-20100614082857-g3n9wn9zakpc7a0m
data/class/pages/mypage/LC_Page_Mypage_Favorite.php ohkouchi@loop-az.jp-20100803050621-j3gswdse0qsqamvw
data/class/pages/products/LC_Page_Products_Detail.php ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
data/class/pages/products/LC_Page_Products_List.php ohkouchi@loop-az.jp-20100910102335-0e7jvlwqa13j60hg
data/class/pages/rss/LC_Page_Rss_Products.php ohkouchi@loop-az.jp-20100614082857-g3n9wn9zakpc7a0m
data/class/pages/shopping/LC_Page_Shopping_Complete.php ohkouchi@loop-az.jp-20100819104758-beubop5hq0pwdqhx
data/class/util/SC_Utils.php svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18812 ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
data/install.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/require_classes.php ohkouchi@loop-az.jp-20100803111301-u8ph4za35y4il0dh
html/admin/require.php ohkouchi@loop-az.jp-20100917043318-0tabp11gm7myhq3v ohkouchi@loop-az.jp-20100917043051-klyair2x9gha0ike
html/handle_error.php ohkouchi@loop-az.jp-20100917043318-0tabp11gm7myhq3v ohkouchi@loop-az.jp-20100917043051-klyair2x9gha0ike
html/install/index.php ohkouchi@loop-az.jp-20100827013725-2fv0j8mz17eczvmd
html/install/sql/create_table_mysql.sql ohkouchi@loop-az.jp-20100825073846-mzg8ka4y21o1nk6o
html/install/sql/create_table_pgsql.sql ohkouchi@loop-az.jp-20100825073846-mzg8ka4y21o1nk6o
html/install/sql/create_view.sql ohkouchi@loop-az.jp-20100910102335-0e7jvlwqa13j60hg
html/install/sql/drop_table.sql ohkouchi@loop-az.jp-20100825073846-mzg8ka4y21o1nk6o
html/install/sql/drop_view.sql ohkouchi@loop-az.jp-20100818061055-lqje64n4qlsd2ke9
html/install/sql/insert_data.sql ohkouchi@loop-az.jp-20100825073846-mzg8ka4y21o1nk6o
html/require.php ohkouchi@loop-az.jp-20100917043318-0tabp11gm7myhq3v ohkouchi@loop-az.jp-20100917043051-klyair2x9gha0ike
bzr:text-revisions:

data/Smarty/templates/default/admin/products/product_class.tpl ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
data/class/SC_Product.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/db/dbfactory/SC_DB_DBFactory_MYSQL.php ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
data/class/helper/SC_Helper_CSV.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/contents/LC_Page_Admin_Contents_RecommendSearch.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/customer/LC_Page_Admin_Customer.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/mail/LC_Page_Admin_Mail_Preview.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/products/LC_Page_Admin_Products.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/products/LC_Page_Admin_Products_ProductRank.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/frontparts/bloc/LC_Page_FrontParts_Bloc_Best5.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/mypage/LC_Page_Mypage_Favorite.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/products/LC_Page_Products_Detail.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/products/LC_Page_Products_List.php ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
data/class/pages/rss/LC_Page_Rss_Products.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/class/pages/shopping/LC_Page_Shopping_Complete.php nanasess@fsm.ne.jp-20100920101522-xuj8voqfwpoh4ajv
data/require_classes.php ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
html/install/index.php ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
html/install/sql/create_table_mysql.sql ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
html/install/sql/create_table_pgsql.sql ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
html/install/sql/create_view.sql ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
html/install/sql/drop_table.sql ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
html/install/sql/drop_view.sql ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
html/install/sql/insert_data.sql ohkouchi@loop-az.jp-20100917110247-1czbf0nui8rcj7ht
test/class/page/LC_Page_Admin_Products_ProductClass_Test.php ohkouchi@loop-az.jp-20100910102335-0e7jvlwqa13j60hg
bzr:timestamp:
2010-09-20 20:39:58.994999886 +0900
bzr:user-agent:
bzr2.1.1+bzr-svn1.0.2
svn:original-date:
2010-09-20T11:39:58.995000Z
Message:

規格まわりの内部構成変更に伴う修正(#781)

  • 規格のデータ構造を木構造へ変更
  • 商品検索ロジックを SC_Product クラスへできるだけ集約
  • 以下の VIEW を削除
    • vw_category_count;
    • vw_product_class;
    • vw_products_nonclass;
    • vw_cross_products_class;
    • vw_cross_class;
    • vw_download_class;
File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_ProductClass.php

    r18788 r18815  
    4949        $this->tpl_subno = 'product'; 
    5050        $this->tpl_subtitle = '商品登録(商品規格)'; 
    51  
    52         $masterData = new SC_DB_MasterData_Ex(); 
    53         $this->arrSRANK = $masterData->getMasterData("mtb_srank"); 
    54         $this->arrDISP = $masterData->getMasterData("mtb_disp"); 
    55         $this->arrCLASS = $masterData->getMasterData("mtb_class"); 
    56         $this->arrSTATUS = $masterData->getMasterData("mtb_status"); 
    57         $this->tpl_onload = ""; 
    58     } 
    59  
    60     /** 
    61      * Page のプロセス. 
    62      * 
    63      * @return void 
    64      */ 
     51    } 
     52 
    6553    function process() { 
    66         $objView = new SC_AdminView(); 
    67         // 認証可否の判定 
    68         $objSess = new SC_Session(); 
    69         SC_Utils_Ex::sfIsSuccess($objSess); 
    70  
    71         // 検索パラメータの引き継ぎ 
    72         foreach ($_POST as $key => $val) { 
    73             if (ereg("^search_", $key)) { 
    74                 $this->arrSearchHidden[$key] = $val; 
    75             } 
    76         } 
     54        $this->authorization(); 
     55 
     56        $this->arrSearchHidden = $this->createSearchParams($_POST); 
    7757 
    7858        $this->tpl_product_id = 
    7959            isset($_POST['product_id']) ? $_POST['product_id'] : "" ; 
    80  
    8160        $this->tpl_pageno = isset($_POST['pageno']) ? $_POST['pageno'] : ""; 
    82  
    8361        if (!isset($_POST['mode'])) $_POST['mode'] = ""; 
    8462 
    85         switch($_POST['mode']) { 
    86         // 規格削除要求 
    87         case 'delete': 
    88             $objQuery = new SC_Query(); 
    89             $objDb = new SC_Helper_DB_Ex(); 
    90  
    91             $objQuery->setLimitOffset(1); 
    92             $where = "product_id = ? AND NOT (classcategory_id1 = 0 AND classcategory_id2 = 0)"; 
    93             $objQuery->setOrder("rank1 DESC, rank2 DESC"); 
    94             $arrRet = $objQuery->select("*", "vw_cross_products_class AS crs_prd", $where, array($_POST['product_id'])); 
    95  
    96             if(count($arrRet) > 0) { 
    97  
    98                 $sqlval['product_id'] = $arrRet[0]['product_id']; 
    99                 $sqlval['classcategory_id1'] = '0'; 
    100                 $sqlval['classcategory_id2'] = '0'; 
    101                 $sqlval['product_code'] = $arrRet[0]['product_code']; 
    102                 $sqlval['stock'] = $arrRet[0]['stock']; 
    103                 $sqlval['price01'] = $arrRet[0]['price01']; 
    104                 $sqlval['price02'] = $arrRet[0]['price02']; 
    105                 $sqlval['creator_id'] = $_SESSION['member_id']; 
    106                 $sqlval['create_date'] = "now()"; 
    107                 $sqlval['update_date'] = "now()"; 
    108  
    109                 $objQuery->begin(); 
    110                 $where = "product_id = ?"; 
    111                 $objQuery->delete("dtb_products_class", $where, array($_POST['product_id'])); 
    112                 $sqlval['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id'); 
    113                 $objQuery->insert("dtb_products_class", $sqlval); 
    114  
    115                 $objQuery->commit(); 
    116             } 
    117              
    118             // 在庫無し商品の非表示対応 
    119             if (NOSTOCK_HIDDEN === true) { 
    120                 // 件数カウントバッチ実行 
    121                 $objDb->sfCategory_Count($objQuery); 
    122             } 
    123              
    124             $this->lfProductClassPage();   // 規格登録ページ 
    125             break; 
    126  
    127         // 編集要求 
    128         case 'pre_edit': 
    129             $objQuery = new SC_Query(); 
    130             $where = "product_id = ? AND NOT(classcategory_id1 = 0 AND classcategory_id2 = 0) "; 
    131             $ret = $objQuery->count("dtb_products_class", $where, array($_POST['product_id'])); 
    132  
    133             if($ret > 0) { 
    134                 // 規格組み合わせ一覧の取得(DBの値を優先する。) 
    135                 $this->arrClassCat = $this->lfGetClassCatListEdit($_POST['product_id']); 
    136             } 
    137             $this->lfProductClassPage();   // 規格登録ページ 
    138             break; 
    139              
    140         // 規格組み合わせ表示 
    141         case 'disp': 
    142             $this->arrForm['select_class_id1'] = $_POST['select_class_id1']; 
    143             $this->arrForm['select_class_id2'] = $_POST['select_class_id2']; 
    144  
    145             $this->arrErr = $this->lfClassError(); 
    146             if (count($this->arrErr) == 0) { 
    147                 // 規格組み合わせ一覧の取得 
    148                 $this->arrClassCat = $this->lfGetClassCatListDisp($_POST['select_class_id1'], $_POST['select_class_id2']); 
    149             } 
    150             $this->lfProductClassPage();   // 規格登録ページ 
    151             break; 
    152              
    153         // 規格登録要求 
     63        switch ($_POST['mode']) { 
    15464        case 'edit': 
    15565            // 入力値の変換 
    15666            $this->arrForm = $this->lfConvertParam($_POST); 
     67 
    15768            // エラーチェック 
    15869            $this->arrErr = $this->lfProductClassError($this->arrForm); 
    159  
    160             if(count($this->arrErr) == 0) { 
    161                 // 確認ページ設定 
     70            if (SC_Utils_Ex::isBlank($this->arrErr)) { 
    16271                $this->tpl_mainpage = 'products/product_class_confirm.tpl'; 
    16372                $this->lfProductConfirmPage(); // 確認ページ表示 
     73 
    16474            } else { 
    165                 // 規格組み合わせ一覧の取得 
    166                 $this->arrClassCat = $this->lfGetClassCatListDisp($_POST['class_id1'], $_POST['class_id2'], false); 
    167                 $this->lfProductClassPage();   // 規格登録ページ 
     75                $this->doPreEdit(false); 
    16876            } 
    16977            break; 
    170              
    171         // 確認ページからの戻り 
     78 
     79        case 'delete': 
     80            $this->doDelete(); 
     81            break; 
     82 
     83        case 'pre_edit': 
     84            $this->doPreEdit(); 
     85            break; 
     86 
     87        case 'disp': 
     88            $this->doDisp(); 
     89            break; 
     90 
    17291        case 'confirm_return': 
    17392            // フォームパラメータの引き継ぎ 
     
    17695            $this->arrForm['select_class_id1'] = ""; 
    17796            $this->arrForm['select_class_id2'] = ""; 
    178             // 規格組み合わせ一覧の取得(デフォルト値は出力しない) 
    179             $this->arrClassCat = $this->lfGetClassCatListDisp($_POST['class_id1'], $_POST['class_id2'], false); 
    180             $this->lfProductClassPage();   // 規格登録ページ 
     97            $this->doPreEdit(false); 
    18198            break; 
    182              
     99 
    183100        case 'complete': 
    184101            // 完了ページ設定 
    185102            $this->tpl_mainpage = 'products/product_class_complete.tpl'; 
    186103            // 商品規格の登録 
    187             $this->lfInsertProductClass($_POST, $_POST['product_id']); 
     104            $this->registerProductClass($_POST, $_POST['product_id']); 
    188105            break; 
    189              
     106 
    190107        default: 
    191             $this->lfProductClassPage();   // 規格登録ページ 
    192             break; 
    193         } 
    194  
    195         $objView->assignobj($this); 
    196         $objView->display(MAIN_FRAME); 
     108        } 
     109 
     110        $this->arrClass = $this->getAllClass(); 
     111        $this->arrForm['product_name'] = $this->getProductName($_POST['product_id']); 
     112        $this->assignView(); 
    197113    } 
    198114 
     
    206122    } 
    207123 
    208     /* 規格登録ページ表示用 */ 
    209     function lfProductClassPage() { 
     124    /** 
     125     * 規格の登録または更新を行う. 
     126     * 
     127     * TODO dtb_class_combination は, dtb_product_categories に倣って, 
     128     *      DELETE to INSERT だが, UPDATE を検討する. 
     129     * 
     130     * @param array $arrList 入力フォームの内容 
     131     * @param integer $product_id 登録を行う商品ID 
     132     */ 
     133    function registerProductClass($arrList, $product_id) { 
     134        $objQuery =& SC_Query::getSingletonInstance(); 
    210135        $objDb = new SC_Helper_DB_Ex(); 
    211136 
    212         $this->arrHidden = $_POST; 
    213         $this->arrHidden['select_class_id1'] = ""; 
    214         $this->arrHidden['select_class_id2'] = ""; 
    215         $arrClass = $objDb->sfGetIDValueList("dtb_class", 'class_id', 'name'); 
    216  
    217         // 規格分類が登録されていない規格は表示しないようにする。 
    218         $arrClassCatCount = SC_Utils_Ex::sfGetClassCatCount(); 
    219         if (count($arrClass) > 0) { 
    220             foreach($arrClass as $key => $val) { 
    221                 if($arrClassCatCount[$key] > 0) { 
    222                     $this->arrClass[$key] = $arrClass[$key]; 
    223                 } 
    224             } 
    225         } 
    226         // 商品名を取得 
    227         $objQuery = new SC_Query(); 
    228         $product_name = $objQuery->getOne("SELECT name FROM dtb_products WHERE product_id = ?", array($_POST['product_id'])); 
    229         $this->arrForm['product_name'] = $product_name; 
    230     } 
    231      
    232     /** 
    233      * デフォルトの表示 
    234      * 
    235      * @param object $objQuery 
    236      * @param integer $product_id 製品のID 
    237      * @param integer $max 表示される最大値 
    238      */ 
    239     function lfSetDefaultClassCat($objQuery, $product_id, $max) { 
    240  
    241         // デフォルト値の読込 
    242         $col = "product_class_id, product_code, price01, price02, stock, stock_unlimited"; 
    243         $arrRet = $objQuery->select($col, "dtb_products_class", "product_id = ? AND classcategory_id1 = 0 AND classcategory_id2 = 0", array($product_id));; 
    244  
    245         if(count($arrRet) > 0) { 
    246             $no = 1; 
    247             for($cnt = 0; $cnt < $max; $cnt++) { 
    248                 $this->arrForm["product_class_id:".$no] = $arrRet[0]['product_class_id']; 
    249                 $this->arrForm["product_code:".$no] = $arrRet[0]['product_code']; 
    250                 $this->arrForm['stock:'.$no] = $arrRet[0]['stock']; 
    251                 $this->arrForm['price01:'.$no] = $arrRet[0]['price01']; 
    252                 $this->arrForm['price02:'.$no] = $arrRet[0]['price02']; 
    253                 $this->arrForm['stock_unlimited:'.$no] = $arrRet[0]['stock_unlimited']; 
    254                 $no++; 
    255             } 
    256         } 
    257     } 
    258  
    259     /* 規格組み合わせ一覧の取得 */ 
    260     function lfGetClassCatListDisp($class_id1, $class_id2, $default = true) { 
    261         $objQuery = new SC_Query(); 
    262  
    263         if($class_id2 != "") { 
    264             // 規格1と規格2 
    265             $sql = "SELECT * "; 
    266             $sql.= "FROM vw_cross_class AS crs_cls "; 
    267             $sql.= "WHERE class_id1 = ? AND class_id2 = ? ORDER BY rank1 DESC, rank2 DESC;"; 
    268             $arrRet = $objQuery->getAll($sql, array($class_id1, $class_id2)); 
    269         } else { 
    270             // 規格1のみ 
    271             $sql = "SELECT * "; 
    272             $sql.= "FROM vw_cross_class AS crs_cls "; 
    273             $sql.= "WHERE class_id1 = ? AND class_id2 = 0 ORDER BY rank1 DESC;"; 
    274             $arrRet = $objQuery->getAll($sql, array($class_id1)); 
    275              
    276         } 
    277  
    278         $max = count($arrRet); 
    279  
    280         if($default) { 
    281             // デフォルト値を設定 
    282             $this->lfSetDefaultClassCat($objQuery, $_POST['product_id'], $max); 
    283         } 
    284  
    285         $this->arrForm["class_id1"] = $arrRet[0]['class_id1']; 
    286         $this->arrForm["class_id2"] = $arrRet[0]['class_id2']; 
    287         $this->tpl_onload.= "fnCheckAllStockLimit('$max', '" . DISABLED_RGB . "');"; 
    288  
    289         return $arrRet; 
    290     } 
    291  
    292     /* 規格組み合わせ一覧の取得(編集画面) */ 
    293     function lfGetClassCatListEdit($product_id) { 
    294         // 既存編集の場合 
    295         $objQuery = new SC_Query(); 
    296  
    297         $col = "class_id1, class_id2, name1, name2, rank1, rank2, "; 
    298         $col.= "product_class_id, product_id, T1_classcategory_id AS classcategory_id1, T2_classcategory_id AS classcategory_id2, "; 
    299         $col.= "product_code, stock, stock_unlimited, sale_limit, price01, price02, status"; 
    300  
    301         $sql = "SELECT $col FROM "; 
    302         $sql.= "( "; 
    303         $sql.= "SELECT T1.class_id AS class_id1, T2.class_id AS class_id2, T1.classcategory_id AS T1_classcategory_id, T2.classcategory_id AS T2_classcategory_id, T1.name AS name1, T2.name AS name2, T1.rank AS rank1, T2.rank AS rank2 "; 
    304         $sql.= "FROM dtb_classcategory AS T1, dtb_classcategory AS T2 "; 
    305         $sql.= "WHERE T1.class_id IN (SELECT class_id1 FROM vw_cross_products_class AS crs_prd WHERE product_id = ? GROUP BY class_id1, class_id2) AND T2.class_id IN (SELECT class_id2 FROM vw_cross_products_class AS crs_prd WHERE product_id = ? GROUP BY class_id1, class_id2)"; 
    306         $sql.= ") AS T1 "; 
    307  
    308         $sql.= "LEFT JOIN (SELECT * FROM dtb_products_class WHERE product_id = ?) AS T3 "; 
    309         $sql.= "ON T1_classcategory_id = T3.classcategory_id1 AND T2_classcategory_id = T3.classcategory_id2 "; 
    310         $sql.= "ORDER BY rank1 DESC, rank2 DESC"; 
    311  
    312         $arrList =  $objQuery->getAll($sql, array($product_id, $product_id, $product_id)); 
    313  
    314         $this->arrForm["class_id1"] = $arrList[0]['class_id1']; 
    315         $this->arrForm["class_id2"] = $arrList[0]['class_id2']; 
    316  
    317         $max = count($arrList); 
    318  
    319         // デフォルト値を設定 
    320         $this->lfSetDefaultClassCat($objQuery, $product_id, $max); 
    321         $no = 1; 
    322         for($cnt = 0; $cnt < $max; $cnt++) { 
    323             $this->arrForm["classcategory_id1:".$no] = $arrList[$cnt]['classcategory_id1']; 
    324             $this->arrForm["classcategory_id2:".$no] = $arrList[$cnt]['classcategory_id2']; 
    325             $this->arrForm["product_class_id:".$no] = $arrList[$cnt]['product_class_id']; 
    326             if($arrList[$cnt]['product_id'] != "") { 
    327                 $this->arrForm["product_code:".$no] = $arrList[$cnt]['product_code']; 
    328                 $this->arrForm['stock:'.$no] = $arrList[$cnt]['stock']; 
    329                 $this->arrForm['stock_unlimited:'.$no] = $arrList[$cnt]['stock_unlimited']; 
    330                 $this->arrForm['price01:'.$no] = $arrList[$cnt]['price01']; 
    331                 $this->arrForm['price02:'.$no] = $arrList[$cnt]['price02']; 
    332                 // JavaScript初期化用文字列 
    333                 $line.= "'check:".$no."',"; 
    334             } 
    335             $no++; 
    336         } 
    337  
    338         $line = ereg_replace(",$", "", $line); 
    339         $this->tpl_javascript = "list = new Array($line);"; 
    340         $color = DISABLED_RGB; 
    341         $this->tpl_onload.= "fnListCheck(list); fnCheckAllStockLimit('$max', '$color');"; 
    342  
    343         return $arrList; 
    344     } 
    345  
    346     /* 規格の登録 */ 
    347     function lfInsertProductClass($arrList, $product_id) { 
    348         $objQuery = new SC_Query(); 
    349         $objDb = new SC_Helper_DB_Ex(); 
    350  
    351137        $objQuery->begin(); 
    352138 
    353         // 既存規格の削除 
    354         $where = "product_id = ?"; 
    355         $objQuery->delete("dtb_products_class", $where, array($product_id)); 
    356  
    357         $cnt = 1; 
    358         // すべての規格を登録する。 
    359         while($arrList["classcategory_id1:".$cnt] != "") { 
    360             if($arrList["check:".$cnt] == 1) { 
    361                 $sqlval = array(); 
    362                 $sqlval['product_id'] = $product_id; 
    363                 $sqlval['classcategory_id1'] = $arrList["classcategory_id1:".$cnt]; 
    364                 $sqlval['classcategory_id2'] = $arrList["classcategory_id2:".$cnt]; 
    365                 if( strlen($arrList["product_class_id:".$cnt]) > 0 ){ 
    366                     $sqlval['product_class_id'] = $arrList["product_class_id:".$cnt]; 
    367                 } 
    368                 $sqlval['product_code'] = $arrList["product_code:".$cnt]; 
    369                 $sqlval['stock'] = $arrList["stock:".$cnt]; 
    370                 $sqlval['stock_unlimited'] = ($arrList["stock_unlimited:".$cnt]) ? '1' : '0'; 
    371                 $sqlval['price01'] = $arrList['price01:'.$cnt]; 
    372                 $sqlval['price02'] = $arrList['price02:'.$cnt]; 
    373                 $sqlval['creator_id'] = $_SESSION['member_id']; 
    374                 $sqlval['create_date'] = "now()"; 
    375                 $sqlval['update_date'] = "now()"; 
    376                 // INSERTの実行 
    377                 $objQuery->insert("dtb_products_class", $sqlval); 
    378             } 
    379             $cnt++; 
    380         } 
    381          
     139        $productsClass = $objQuery->select("*", "dtb_products_class", "product_id = ?", array($product_id)); 
     140 
     141        $exists = array(); 
     142        foreach ($productsClass as $val) { 
     143            $exists[$val['product_class_id']] = $val; 
     144        } 
     145 
     146        $i = 1; 
     147        while (isset($arrList['classcategory_id1:' . $i])) { 
     148            $pVal = array(); 
     149            $pVal['product_id'] = $product_id;; 
     150            $pVal['product_code'] = $arrList["product_code:".$i]; 
     151            $pVal['stock'] = $arrList["stock:".$i]; 
     152            $pVal['stock_unlimited'] = ($arrList["stock_unlimited:".$i]) ? '1' : '0'; 
     153            $pVal['price01'] = $arrList['price01:'.$i]; 
     154            $pVal['price02'] = $arrList['price02:'.$i]; 
     155            $pVal['creator_id'] = $_SESSION['member_id']; 
     156            $pVal['update_date'] = "now()"; 
     157 
     158            if($arrList["check:".$i] == 1) { 
     159                $pVal['del_flg'] = 0; 
     160            } else { 
     161                $pVal['del_flg'] = 1; 
     162            } 
     163 
     164            // 更新 or 登録 
     165            $isUpdate = false; 
     166            if (!SC_Utils_Ex::isBlank($arrList["product_class_id:".$i])) { 
     167                $isUpdate = true; 
     168                // 更新の場合は規格組み合わせを検索し, 削除しておく 
     169                $class_combination_id = $exists[$arrList["product_class_id:".$i]]['class_combination_id']; 
     170                $existsCombi = $objQuery->getRow("dtb_class_combination", 
     171                                                 "*", "class_combination_id = ?", 
     172                                                 array($class_combination_id)); 
     173 
     174                $objQuery->delete("dtb_class_combination", 
     175                                  "class_combination_id IN (?, ?)", 
     176                                  array($existsCombi['class_combination_id'], 
     177                                        $existsCombi['parent_class_combination_id'])); 
     178            } 
     179 
     180            // 規格組み合わせを登録 
     181            $cVal1['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id'); 
     182 
     183            $cVal1['classcategory_id'] = $arrList["classcategory_id1:".$i]; 
     184            $cVal1['level'] = 1; 
     185            $objQuery->insert("dtb_class_combination", $cVal1); 
     186 
     187            $pVal['class_combination_id'] = $cVal1['class_combination_id']; 
     188 
     189            // 規格2も登録する場合 
     190            if (!SC_Utils_Ex::isBlank($arrList["classcategory_id2:".$i])) { 
     191                $cVal2['class_combination_id'] = $objQuery->nextVal('dtb_class_combination_class_combination_id'); 
     192                $cVal2['classcategory_id'] = $arrList["classcategory_id2:".$i]; 
     193                $cVal2['parent_class_combination_id'] = $cVal1['class_combination_id']; 
     194                $cVal2['level'] = 2; 
     195                $objQuery->insert("dtb_class_combination", $cVal2); 
     196 
     197                $pVal['class_combination_id'] = $cVal2['class_combination_id']; 
     198            } 
     199 
     200            // 更新 
     201            if ($isUpdate) { 
     202                $pVal['product_class_id'] = $arrList["product_class_id:".$i]; 
     203                $objQuery->update("dtb_products_class", $pVal, 
     204                                  "product_class_id = ?", 
     205                                  array($pVal['product_class_id'])); 
     206            } 
     207            // 新規登録 
     208            else { 
     209                $pVal['create_date'] = "now()"; 
     210                $pVal['product_class_id'] = $objQuery->nextVal('dtb_products_class_product_class_id'); 
     211                $objQuery->insert("dtb_products_class", $pVal); 
     212            } 
     213            $i++; 
     214        } 
     215 
     216        // 規格無し用の商品規格を非表示に 
     217        $bVal['del_flg'] = 1; 
     218        $bVal['update_date'] = 'now()'; 
     219        $objQuery->update("dtb_products_class", $bVal, 
     220                          "product_class_id = ? AND class_combination_id IS NULL", 
     221                          array($pVal['product_class_id'])); 
     222 
    382223        // 件数カウントバッチ実行 
    383224        $objDb->sfCategory_Count($objQuery); 
    384          
    385225        $objQuery->commit(); 
    386226    } 
     
    467307        $this->tpl_count = $cnt; 
    468308    } 
     309 
     310    /** 
     311     * 規格の組み合わせ一覧を表示する. 
     312     * 
     313     * 1. 規格1, 規格2を組み合わせた場合の妥当性を検証する. 
     314     * 2. 規格1, 規格2における規格分類のすべての組み合わせを取得し, 
     315     *    該当商品の商品規格の内容を取得し, フォームに設定する. 
     316     */ 
     317    function doDisp() { 
     318        $this->arrForm['select_class_id1'] = $_POST['select_class_id1']; 
     319        $this->arrForm['select_class_id2'] = $_POST['select_class_id2']; 
     320 
     321        $this->arrErr = $this->lfClassError(); 
     322        if (SC_Utils_Ex::isBlank($this->arrErr)) { 
     323            $this->arrClassCat = $this->getAllClassCategory($_POST['select_class_id1'], $_POST['select_class_id2']); 
     324 
     325            $productsClass = $this->getProductsClass($_POST['product_id']); 
     326 
     327            $total = count($this->arrClassCat); 
     328            for ($i = 1; $i <= $total; $i++) { 
     329                foreach ($productsClass as $key => $val) { 
     330                    $this->arrForm[$key . ":" . $i] = $val; 
     331                } 
     332            } 
     333        } 
     334        $this->tpl_onload.= "fnCheckAllStockLimit('$total', '" . DISABLED_RGB . "');"; 
     335    } 
     336 
     337    /** 
     338     * 規格編集画面を表示する. 
     339     */ 
     340    function doPreEdit($existsValue = true) { 
     341        $existsProductsClass = $this->getProductsClassAndClasscategory($_POST['product_id']); 
     342        $productsClass = $this->getProductsClass($_POST['product_id']); 
     343        $this->arrForm["class_id1"] = $existsProductsClass[0]['class_id1']; 
     344        $this->arrForm["class_id2"] = $existsProductsClass[0]['class_id2']; 
     345        $this->arrForm['select_class_id1'] = $this->arrForm["class_id1"]; 
     346        $this->arrForm['select_class_id2'] = $this->arrForm["class_id2"]; 
     347 
     348        $this->arrClassCat = $this->getAllClassCategory($this->arrForm["class_id1"], $this->arrForm["class_id2"]); 
     349        $total = count($this->arrClassCat); 
     350        for ($i = 1; $i <= $total; $i++) { 
     351            if ($existsValue) { 
     352                foreach ($productsClass as $key => $val) { 
     353                    $this->arrForm[$key . ":" . $i] = $val; 
     354                } 
     355            } 
     356            foreach ($existsProductsClass[$i] as $key => $val) { 
     357                $this->arrForm[$key . ":" . $i] = $val; 
     358            } 
     359            if (!SC_Utils_Ex::isBlank($this->arrForm['product_id:' . $i]) 
     360                && $this->arrForm["del_flg:" . $i] == 0) { 
     361                $line .= "'check:" . $i . "',"; 
     362            } 
     363        } 
     364 
     365        $line = preg_replace("/,$/", "", $line); 
     366        $this->tpl_javascript = "list = new Array($line);"; 
     367        $color = DISABLED_RGB; 
     368        $this->tpl_onload.= "fnListCheck(list); fnCheckAllStockLimit('$total', '$color');"; 
     369    } 
     370 
     371    function doDelete() { 
     372        $objQuery =& SC_Query::getSingletonInstance(); 
     373 
     374        $objQuery->begin(); 
     375        $val['del_flg'] = 0; 
     376        $objQuery->update("dtb_products_class", $val, "product_id = ? AND class_combination_id IS NULL", array($_POST['product_id'])); 
     377 
     378        $val['del_flg'] = 1; 
     379        $objQuery->update("dtb_products_class", $val, "product_id = ? AND class_combination_id IS NOT NULL", array($_POST['product_id'])); 
     380 
     381        $objQuery->commit(); 
     382 
     383        // 在庫無し商品の非表示対応 
     384        if (NOSTOCK_HIDDEN === true) { 
     385            // 件数カウントバッチ実行 
     386            //$objDb->sfCategory_Count($objQuery); 
     387        } 
     388    } 
     389 
     390    /** 
     391     * 規格ID1, 規格ID2の規格分類すべてを取得する. 
     392     * 
     393     * @param integer $class_id1 規格ID1 
     394     * @param integer $class_id2 規格ID2 
     395     * @return array 規格と規格分類の配列 
     396     */ 
     397    function getAllClassCategory($class_id1, $class_id2 = null) { 
     398        $objQuery =& SC_Query::getSingletonInstance(); 
     399 
     400        $col = "T1.class_id AS class_id1, " 
     401            . " T1.classcategory_id AS classcategory_id1, " 
     402            . " T1.name AS name1, " 
     403            . " T1.rank AS rank1 "; 
     404 
     405        if(SC_Utils_Ex::isBlank($class_id2)) { 
     406            $table = "dtb_classcategory T1 "; 
     407            $objQuery->setWhere("T1.class_id = ?") 
     408                     ->setOrder("T1.rank DESC"); 
     409            $val = array($class_id1); 
     410        } else { 
     411            $col .= "," 
     412                . "T2.class_id AS class_id2," 
     413                . "T2.classcategory_id AS classcategory_id2," 
     414                . "T2.name AS name2," 
     415                . "T2.rank AS rank2"; 
     416            $table = "dtb_classcategory AS T1, dtb_classcategory AS T2"; 
     417            $objQuery->setWhere("T1.class_id = ? AND T2.class_id = ?") 
     418                     ->setOrder("T1.rank DESC, T2.rank DESC"); 
     419            $val = array($class_id1, $class_id2); 
     420        } 
     421        return $objQuery->select($col, $table, "", $val); 
     422    } 
     423 
     424    /** 
     425     * 商品名を取得する. 
     426     * 
     427     * @access private 
     428     * @param integer $product_id 商品ID 
     429     * @return string 商品名の文字列 
     430     */ 
     431    function getProductName($product_id) { 
     432        $objQuery =& SC_Query::getSingletonInstance(); 
     433        return $objQuery->getOne("SELECT name FROM dtb_products WHERE product_id = ?", array($product_id)); 
     434    } 
     435 
     436    /** 
     437     * 検索パラメータを生成する. 
     438     * 
     439     * "search_" で始まるパラメータのみを生成して返す. 
     440     * 
     441     * TODO パラメータの妥当性検証 
     442     * 
     443     * @access private 
     444     * @param array $params 生成元の POST パラメータ 
     445     * @return array View にアサインするパラメータの配列 
     446     */ 
     447    function createSearchParams($params) { 
     448        $results = array(); 
     449        foreach ($params as $key => $val) { 
     450            if (substr($key, 0, 7) == "search_") { 
     451                $results[$key] = $val; 
     452            } 
     453        } 
     454        return $results; 
     455    } 
     456 
     457    /** 
     458     * 規格分類の登録された, すべての規格を取得する. 
     459     * 
     460     * @access private 
     461     * @return array 規格分類の登録された, すべての規格 
     462     */ 
     463    function getAllClass() { 
     464        $objDb = new SC_Helper_DB_Ex(); 
     465        $arrClass = $objDb->sfGetIDValueList("dtb_class", 'class_id', 'name'); 
     466 
     467        // 規格分類が登録されていない規格は表示しないようにする。 
     468        $arrClassCatCount = SC_Utils_Ex::sfGetClassCatCount(); 
     469 
     470        $results = array(); 
     471        if (!SC_Utils_Ex::isBlank($arrClass)) { 
     472            foreach($arrClass as $key => $val) { 
     473                if($arrClassCatCount[$key] > 0) { 
     474                    $results[$key] = $arrClass[$key]; 
     475                } 
     476            } 
     477        } 
     478        return $results; 
     479    } 
     480 
     481    /** 
     482     * 商品IDをキーにして, 商品規格を取得する. 
     483     * 
     484     * @param integer $product_id 商品ID 
     485     * @return array 商品規格の配列 
     486     */ 
     487    function getProductsClass($product_id) { 
     488        $objQuery =& SC_Query::getSingletonInstance(); 
     489        return $objQuery->getRow("dtb_products_class", "*", "product_id = ?", array($product_id)); 
     490    } 
     491 
     492    /** 
     493     * 登録済みの商品規格, 規格, 規格分類を取得する. 
     494     * 
     495     * @param integer $product_id 商品ID 
     496     * @return array 商品規格, 規格, 規格分類の配列 
     497     */ 
     498    function getProductsClassAndClasscategory($productId) { 
     499        $objProduct = new SC_Product(); 
     500        return $objProduct->getProductsClassFullByProductId($productId); 
     501    } 
     502 
     503    /** 
     504     * @access private 
     505     */ 
     506    function authorization() { 
     507        SC_Utils_Ex::sfIsSuccess(new SC_Session()); 
     508    } 
     509 
     510    /** 
     511     * @access private 
     512     */ 
     513    function assignView() { 
     514        $objView = new SC_AdminView(); 
     515        $objView->assignobj($this); 
     516        $objView->display(MAIN_FRAME); 
     517    } 
    469518} 
    470519?> 
Note: See TracChangeset for help on using the changeset viewer.