<?php
/**
 * @copyright ONE/DEPO Project
 * @license   PHP License 3.01 <http://www.php.net/license/3_01.txt>
 */


/* vim: set expandtab tabstop=4 shiftwidth=4 softtabstop=4: */

/**
 * 商品マスタメンテ在庫リスト
 *
 * @package     Admin.Itemmanage.Change.Stock.list
 * @author      H.Watanabe <hiroshi.watanabe@netnee.jp>
 * @access      public
 */
class Admin_Itemmanage_Change_Stock_list
{
    var $actionnm;
    var $view;
    var $stockview;

    var $result;
    var $struct;
    var $stock;
    var $from;
    var $div;

    var $itemdiv;
    var $jancode;
    var $hinban;
    var $itemtitle;
    var $release_date_start;
    var $release_date_end;
    var $publish_date_start;
    var $publish_date_end;
    var $maker_capital;
    var $maker_name;
    var $media;
    var $cast;
    var $situation;
    var $photo_situation;
    var $publish_situation;
    var $sort;
    var $genre_select;

    var $cd;
    var $structcd;

    var $supplidiv;

    var $st;

    var $fromlist_salestartdate;
    var $fromlist_orderclosedate;

    /**
     * execute
     *
     * @access  public
     */
    function execute()
    {
        $log =& LogFactory::getLog();
        $log->debug("Admin_Itemmanage_Change_Stock_listが実行されました", "Admin_Itemmanage_Change_Stock_list#execute");

        $div = (empty($this->div)) ? 2 : 1;

        $this->result = $this->view->getOneItem();
        $this->struct = $this->view->getOneStruct();
        $this->stock = $this->stockview->getStockTilteList($this->cd,$this->structcd);


  //      $this->salestartdate  = $this->result[0]["salestartdate"];
  //     $this->orderclosedate = $this->result[0]["orderclosedate"];

        $this->st = $this->stock[0]["stockstate"];



        $this->castnm = $this->view->getCastnmForItemcd();
        $this->genrenm = $this->view->getGenrenmForItemcd();
        $this->img = $this->view->getItemImageForItemcd();

        return 'success_list';
    }

    function getCastname($params)
    {
        return $this->castnm[$params["itemcd"]];
    }

    function getGenrename($params)
    {
        return $this->genrenm[$params["itemcd"]];
    }

    function getImage($params)
    {
        return $this->img[$params["itemcd"]][$params["size"]];
    }

    function getStockOrderCount($params)
    {
        if ($params["stockstate"]!=1) return 0;
        if (empty($params["itemcd"]) || 
            empty($params["structcd"]) || 
            empty($params["stocktitlecd"]))
        {
            return 0;
        }
        return $this->stockview->getStockOrderCount($params["itemcd"],
                                                    $params["structcd"],
                                                    $params["stocktitlecd"]);
    }
}
?>
