Changeset 18863


Ignore:
Timestamp:
2010/10/21 18:12:45 (10 years ago)
Author:
nanasess
bzr:base-revision:
ohkouchi@loop-az.jp-20101021042440-gpxusyehl2k95qsv
bzr:committer:
Kentaro Ohkouchi <ohkouchi@loop-az.jp>
bzr:file-ids:

data/Smarty/templates/default/admin/products/confirm.tpl 15732@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fadmin%2Fproducts%2Fconfirm.tpl
data/Smarty/templates/default/admin/products/product.tpl 15732@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fadmin%2Fproducts%2Fproduct.tpl
data/class/SC_Product.php 18277@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2FSC_Product.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
bzr:mapping-version:
v4
bzr:repository-uuid:
1e3b908f-19a9-db11-a64c-001125224ba8
bzr:revision-id:
ohkouchi@loop-az.jp-20101021091242-zmf1sgnqnjj8z2bm
bzr:revno:
2343
bzr:revprop:branch-nick:
branches/version-2_5-dev
bzr:root:
branches/version-2_5-dev
bzr:timestamp:
2010-10-21 18:12:42.286999941 +0900
bzr:user-agent:
bzr2.2.0+bzr-svn1.0.3
svn:original-date:
2010-10-21T09:12:42.287000Z
Message:

#781 規格のデータベースを木構造に

  • 商品ステータスの登録/更新に対応
Location:
branches/version-2_5-dev/data
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_5-dev/data/Smarty/templates/default/admin/products/confirm.tpl

    r18819 r18863  
    2525<form name="form1" id="form1" method="post" action="?" enctype="multipart/form-data"> 
    2626  <!--{foreach key=key item=item from=$arrForm}--> 
    27   <input type="hidden" name="<!--{$key}-->" value="<!--{$item|escape}-->" /> 
     27    <!--{if $key == 'product_status'}--> 
     28      <!--{foreach item=statusVal from=$item}--> 
     29      <input type="hidden" name="<!--{$key}-->[]" value="<!--{$statusVal|escape}-->" /> 
     30      <!--{/foreach}--> 
     31    <!--{else}--> 
     32      <input type="hidden" name="<!--{$key}-->" value="<!--{$item|escape}-->" /> 
     33    <!--{/if}--> 
    2834  <!--{/foreach}--> 
    2935  <div id="products" class="contents-main"> 
     
    5460      <th>商品ステータス</th> 
    5561      <td> 
    56       <!--{section name=cnt loop=$arrForm.product_flag|count_characters}--> 
    57         <!--{if $arrForm.product_flag[cnt] == "1"}--><!--{assign var=key value="`$smarty.section.cnt.iteration`"}--><img src="<!--{$TPL_DIR}--><!--{$arrSTATUS_IMAGE[$key]}-->"><!--{/if}--> 
    58       <!--{/section}--> 
     62      <!--{foreach from=$arrForm.product_status item=status}--> 
     63        <img src="<!--{$TPL_DIR}--><!--{$arrSTATUS_IMAGE[$status]}-->"> 
     64      <!--{/foreach}--> 
    5965      </td> 
    6066    </tr> 
  • branches/version-2_5-dev/data/Smarty/templates/default/admin/products/product.tpl

    r18853 r18863  
    121121      <th>商品ステータス</th> 
    122122      <td> 
    123         <!--{html_checkboxes name="product_flag" options=$arrSTATUS selected=$arrForm.product_flag}--> 
     123        <!--{html_checkboxes name="product_status" options=$arrSTATUS selected=$arrForm.product_status}--> 
    124124      </td> 
    125125    </tr> 
  • branches/version-2_5-dev/data/class/SC_Product.php

    r18862 r18863  
    2222 */ 
    2323 
    24 /*  [名称] SC_Product 
    25  *  [概要] 商品クラス 
     24/** 
     25 * 商品を扱うサービスクラス. 
     26 * 
     27 * @author LOCKON CO.,LTD. 
     28 * @author Kentaro Ohkouchi 
     29 * @version $Id$ 
    2630 */ 
    2731class SC_Product { 
     
    439443        } 
    440444        return $results; 
     445    } 
     446 
     447    /** 
     448     * 商品ステータスを設定する. 
     449     * 
     450     * TODO 現在は DELETE/INSERT だが, UPDATE を検討する. 
     451     * 
     452     * @param integer $productId 商品ID 
     453     * @param array $productStatusIds ON にする商品ステータスIDの配列 
     454     */ 
     455    function setProductStatus($productId, $productStatusIds) { 
     456 
     457        $val['product_id'] = $productId; 
     458        $val['creator_id'] = $_SESSION['member_id']; 
     459        $val['create_date'] = 'Now()'; 
     460        $val['update_date'] = 'Now()'; 
     461        $val['del_flg'] = '0'; 
     462 
     463        $objQuery =& SC_Query::getSingletonInstance(); 
     464        $objQuery->delete('dtb_product_status', 'product_id = ?', array($productId)); 
     465        foreach ($productStatusIds as $productStatusId) { 
     466            $val['product_status_id'] = $productStatusId; 
     467            $objQuery->insert('dtb_product_status', $val); 
     468        } 
    441469    } 
    442470 
  • branches/version-2_5-dev/data/class/pages/admin/products/LC_Page_Admin_Products_Product.php

    r18820 r18863  
    8787        $objQuery = new SC_Query(); 
    8888        $objDb = new SC_Helper_DB_Ex(); 
     89        $objProduct = new SC_Product(); 
    8990 
    9091        // 認証可否の判定 
     
    132133                // DBから商品情報の読込 
    133134                $this->arrForm = $this->lfGetProduct($_POST['product_id']); 
     135                $productStatus= $objProduct->getProductStatus(array($_POST['product_id'])); 
     136                $this->arrForm['product_status'] = $productStatus[$_POST['product_id']]; 
     137 
    134138                // DBデータから画像ファイル名の読込 
    135139                $this->objUpFile->setDBFileList($this->arrForm); 
     
    403407        } 
    404408 
    405         if(isset($this->arrForm['product_flag']) && !is_array($this->arrForm['product_flag'])) { 
    406             // 商品ステータスの分割読込 
    407             $this->arrForm['product_flag'] = SC_Utils_Ex::sfSplitCheckBoxes($this->arrForm['product_flag']); 
    408         } 
    409  
    410409        // HIDDEN用に配列を渡す。 
    411410        $this->arrHidden = array_merge((array)$this->arrHidden, (array)$this->objUpFile->getHiddenFileList()); 
     
    545544        } 
    546545 
     546        // ステータス設定 
     547        $objProduct = new SC_Product(); 
     548        $objProduct->setProductStatus($product_id, $arrList['product_status']); 
     549 
    547550        // 関連商品登録 
    548551        $this->lfInsertRecommendProducts($objQuery, $arrList, $product_id); 
Note: See TracChangeset for help on using the changeset viewer.