Index: branches/version-2_4/data/Smarty/templates/default/admin/products/product_select.tpl
===================================================================
--- branches/version-2_4/data/Smarty/templates/default/admin/products/product_select.tpl	(revision 17773)
+++ branches/version-2_4/data/Smarty/templates/default/admin/products/product_select.tpl	(revision 17952)
@@ -40,90 +40,15 @@
 self.moveTo(20,20);self.focus();
 
-function func_submit( product_id, class_name1, class_name2 ){
-    var err_text = '';
-    var fm = window.opener.document.form1;
-    var fm1 = window.opener.document;
-    var class1 = "classcategory_id" + product_id + "_1";
-    var class2 = "classcategory_id" + product_id + "_2";
-
-    var class1_id = document.getElementById(class1).value;
-    var class2_id = document.getElementById(class2).value;
-
-    <!--{if $tpl_no != ''}-->
-        var opner_product_id = 'edit_product_id';
-        var opner_classcategory_id1 = 'edit_classcategory_id1';
-        var opner_classcategory_id2 = 'edit_classcategory_id2';
-        fm1.getElementById("no").value = <!--{$tpl_no}-->;
-    <!--{else}-->
-        var opner_product_id = 'add_product_id';
-        var opner_classcategory_id1 = 'add_classcategory_id1';
-        var opner_classcategory_id2 = 'add_classcategory_id2';
-    <!--{/if}-->
-
-    if (document.getElementById(class1).type == 'select-one' && class1_id == '') {
-        err_text = class_name1 + "を選択してください。\n";
-    }
-    if (document.getElementById(class2).type == 'select-one' && class2_id == '') {
-        err_text = err_text + class_name2 + "を選択してください。\n";
-    }
-    if (err_text != '') {
-        alert(err_text);
-        return false;
-    }
-
-    fm1.getElementById(opner_product_id).value = product_id;
-    if (class1_id != '') {
-        fm1.getElementById(opner_classcategory_id1).value = class1_id;
-    }
-    if (class2_id != '') {
-        fm1.getElementById(opner_classcategory_id2).value = class2_id;
-    }
-
-    fm.mode.value = 'select_product_detail';
-    fm.anchor_key.value = 'order_products';
-    fm.submit();
-    window.close();
-
-    return true;
+function func_submit( id ){
+	var fm = window.opener.document.form1;
+	fm.recommend_id<!--{$smarty.get.no}-->.value = id;
+	fm.mode.value = 'recommend_select';
+	fm.anchor_key.value = 'recommend_no<!--{$smarty.get.no}-->';
+	fm.submit();
+	window.close();
+	return false;
 }
 //-->
 </script>
-
-<script type="text/javascript">//<![CDATA[
-// セレクトボックスに項目を割り当てる。
-function lnSetSelect(name1, name2, id, val) {
-    sele1 = document.form1[name1];
-    sele2 = document.form1[name2];
-    lists = eval('lists' + id);
-    vals = eval('vals' + id);
-
-    if(sele1 && sele2) {
-        index = sele1.selectedIndex;
-
-        // セレクトボックスのクリア
-        count = sele2.options.length;
-        for(i = count; i >= 0; i--) {
-            sele2.options[i] = null;
-        }
-
-        // セレクトボックスに値を割り当てる
-        len = lists[index].length;
-        for(i = 0; i < len; i++) {
-            sele2.options[i] = new Option(lists[index][i], vals[index][i]);
-            if(val != "" && vals[index][i] == val) {
-                sele2.options[i].selected = true;
-            }
-        }
-    }
-}
-//]]>
-</script>
-
-
-<script type="text/javascript">//<![CDATA[
-    <!--{$tpl_javascript}-->
-//]]>
-</script>
-
 <title>ECサイト管理者ページ</title>
 </head>
@@ -144,20 +69,16 @@
 <input name="search_pageno" type="hidden" value="">
 <table bgcolor="#cccccc" width="420" border="0" cellspacing="1" cellpadding="5" summary=" ">
-    <tr class="fs12n">
-        <td bgcolor="#f0f0f0" width="100">カテゴリ</td>
-        <td bgcolor="#ffffff" width="287"><select name="search_category_id">
-        <option value="" selected="selected">選択してください</option>
-        <!--{html_options options=$arrCatList selected=$arrForm.search_category_id}-->
-        </select>
-        </td>
-    </tr>
-    <tr class="fs12n">
-        <td bgcolor="#f0f0f0">商品名</td>
-        <td bgcolor="#ffffff"><input type="text" name="search_name" value="<!--{$arrForm.search_name}-->" size="35" class="box35" /></td>
-    </tr>
-    <tr class="fs12n">
-        <td bgcolor="#f0f0f0">商品番号</td>
-        <td bgcolor="#ffffff"><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code}-->" size="35" class="box35" /></td>
-    </tr>
+	<tr class="fs12n">
+		<td bgcolor="#f0f0f0" width="100">カテゴリ</td>
+		<td bgcolor="#ffffff" width="287"><select name="search_category_id">
+		<option value="" selected="selected">選択してください</option>
+		<!--{html_options options=$arrCatList selected=$arrForm.search_category_id}-->
+		</select>
+		</td>
+	</tr>
+	<tr class="fs12n">
+		<td bgcolor="#f0f0f0">商品名</td>
+		<td bgcolor="#ffffff"><input type="text" name="search_name" value="<!--{$arrForm.search_name}-->" size="35" class="box35" /></td>
+	</tr>
 </table>
 <br />
@@ -166,99 +87,54 @@
 <br />
 
-    <!--▼検索結果表示-->
-    <!--{if $tpl_linemax}-->
-    <table width="420" border="0" cellspacing="0" cellpadding="0" summary=" " bgcolor="#FFFFFF">
-        <tr class="fs12">
-            <td align="left"><!--{$tpl_linemax}-->件が該当しました。	</td>
-        </tr>
-        <tr class="fs12">
-            <td align="center">
-            <!--▼ページナビ-->
-            <!--{$tpl_strnavi}-->
-            <!--▲ページナビ-->
-            </td>
-        </tr>
-        <tr><td height="10"></td></tr>
-    </table>
-
-    <!--▼検索後表示部分-->
-    <table width="420" border="0" cellspacing="1" cellpadding="5" bgcolor="#cccccc">
-        <tr bgcolor="#f0f0f0" align="center" class="fs12">
-            <td>商品画像</td>
-            <td>商品番号</td>
-            <td>商品名</td>
-            <td>決定</td>
-        </tr>
-        <!--{section name=cnt loop=$arrProducts}-->
-        <!--{assign var=id value=$arrProducts[cnt].product_id}-->
-        <!--▼商品<!--{$smarty.section.cnt.iteration}-->-->
-        <tr bgcolor="#FFFFFF" class="fs12n">
-            <td width="90" align="center">
-            <!--{if $arrProducts[cnt].main_list_image != ""}-->
-                <!--{assign var=image_path value="`$arrProducts[cnt].main_list_image`"}-->
-            <!--{else}-->
-                <!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
-            <!--{/if}-->
-            <img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$image_path}-->&width=65&height=65" alt="<!--{$arrRecommend[$recommend_no].name|escape}-->">
-            </td>
-            <td>
-            <!--{$arrProducts[cnt].name|escape}-->
-
-            <!--{assign var=codemin value=`$arrProducts[cnt].product_code_min`}-->
-            <!--{assign var=codemax value=`$arrProducts[cnt].product_code_max`}-->
-            <!--{* 商品コード *}-->
-                <!--{if $codemin != $codemax}-->
-                    <!--{$codemin|escape}-->〜<!--{$codemax|escape}-->
-                <!--{else}-->
-                    <!--{$codemin|escape}-->
-                <!--{/if}-->
-            </td>
-            <td>
-                <!--{$arrProducts[cnt].name|escape}-->
-
-                <!--{assign var=class1 value=classcategory_id`$id`_1}-->
-                <!--{assign var=class2 value=classcategory_id`$id`_2}-->
-                <!--{if $tpl_classcat_find1[$id]}-->
-                <dt><!--{$tpl_class_name1[$id]|escape}-->：</dt>
-                <dd>
-                    <select name="<!--{$class1}-->" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->" onchange="lnSetSelect('<!--{$class1}-->', '<!--{$class2}-->', '<!--{$id}-->','');">
-                    <option value="">選択してください</option>
-                    <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}-->
-                    </select>
-                    <!--{if $arrErr[$class1] != ""}-->
-                    <br /><span class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</span>
-                    <!--{/if}-->
-                </dd>
-                <!--{else}-->
-                <input type="hidden" name="<!--{$class1}-->" id="<!--{$class1}-->" value="">
-                <!--{/if}-->
-                <!--{if $tpl_classcat_find2[$id]}-->
-                    <dt><!--{$tpl_class_name2[$id]|escape}-->：</dt>
-                    <dd>
-                        <select name="<!--{$class2}-->" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->">
-                        <option value="">選択してください</option>
-                        </select>
-                        <!--{if $arrErr[$class2] != ""}-->
-                        <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span>
-                        <!--{/if}-->
-                    </dd>
-                <!--{else}-->
-                    <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="">
-                <!--{/if}-->
-            </td>
-
-            <td align="center"><a href="" onclick="return func_submit('<!--{$arrProducts[cnt].product_id}-->', '<!--{$tpl_class_name1[$id]}-->', '<!--{$tpl_class_name2[$id]}-->')">決定</a></td>
-        </tr>
-        <!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
-        <!--{sectionelse}-->
-        <tr bgcolor="#FFFFFF" class="fs10n">
-            <td colspan="4">商品が登録されていません</td>
-        </tr>
-        <!--{/section}-->
-    </table>
-    <br />
-    <br />
-    <!--{/if}-->
-    <!--▲検索結果表示-->
+	<!--▼検索結果表示-->
+	<!--{if $tpl_linemax}-->
+	<table width="420" border="0" cellspacing="0" cellpadding="0" summary=" " bgcolor="#FFFFFF">
+		<tr class="fs12">
+			<td align="left"><!--{$tpl_linemax}-->件が該当しました。	</td>
+		</tr>
+		<tr class="fs12">
+			<td align="center">
+			<!--▼ページナビ-->
+			<!--{$tpl_strnavi}-->
+			<!--▲ページナビ-->
+			</td>
+		</tr>
+		<tr><td height="10"></td></tr>
+	</table>
+		
+	<!--▼検索後表示部分-->
+	<table width="420" border="0" cellspacing="1" cellpadding="5" bgcolor="#cccccc">
+		<tr bgcolor="#f0f0f0" align="center" class="fs12">
+			<td>商品画像</td>
+			<td>商品番号</td>
+			<td>商品名</td>
+			<td>決定</td>
+		</tr>
+		<!--{section name=cnt loop=$arrProducts}-->
+		<!--▼商品<!--{$smarty.section.cnt.iteration}-->-->
+		<tr bgcolor="#FFFFFF" class="fs12n">
+			<td width="90" align="center">
+			<!--{if $arrProducts[cnt].main_list_image != ""}-->
+				<!--{assign var=image_path value="`$arrProducts[cnt].main_list_image`"}-->
+			<!--{else}-->
+				<!--{assign var=image_path value="`$smarty.const.NO_IMAGE_DIR`"}-->
+			<!--{/if}-->
+			<img src="<!--{$smarty.const.SITE_URL}-->resize_image.php?image=<!--{$image_path}-->&width=65&height=65" alt="<!--{$arrRecommend[$recommend_no].name|escape}-->">
+			</td>	
+			<td><!--{$arrProducts[cnt].product_code|escape|default:"-"}--></td>
+			<td><!--{$arrProducts[cnt].name|escape}--></td>
+			<td align="center"><a href="" onClick="return func_submit(<!--{$arrProducts[cnt].product_id}-->)">決定</a></td>
+		</tr>
+		<!--▲商品<!--{$smarty.section.cnt.iteration}-->-->
+		<!--{sectionelse}-->
+		<tr bgcolor="#FFFFFF" class="fs10n">
+			<td colspan="4">商品が登録されていません</td>
+		</tr>	
+		<!--{/section}-->
+	</table>
+	<br />
+	<br />
+	<!--{/if}-->
+	<!--▲検索結果表示-->
 
 </form>
Index: branches/version-2_4/data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php
===================================================================
--- branches/version-2_4/data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php	(revision 17777)
+++ branches/version-2_4/data/class/pages/admin/products/LC_Page_Admin_Products_ProductSelect.php	(revision 17952)
@@ -62,5 +62,4 @@
         $objSess = new SC_Session();
         $objDb = new SC_Helper_DB_Ex();
-        $objQuery = new SC_Query();
 
         // 認証可否の判定
@@ -68,10 +67,4 @@
 
         if (!isset($_POST['mode'])) $_POST['mode'] = "";
-
-        if ($_GET['no'] != '') {
-            $this->tpl_no = strval($_GET['no']);
-        }elseif ($_POST['no'] != '') {
-            $this->tpl_no = strval($_POST['no']);
-        }
 
         if ($_POST['mode'] == "search") {
@@ -89,4 +82,5 @@
                     continue;
                 }
+
                 switch ($key) {
                 case 'search_name':
@@ -110,6 +104,4 @@
             }
 
-
-            /*
             $order = "update_date DESC, product_id DESC ";
 
@@ -117,22 +109,4 @@
             $col = "product_id, name, category_id, main_list_image, status, product_code, price01, stock, stock_unlimited";
             $from = "vw_products_nonclass AS noncls ";
-            */
-            $col = "DISTINCT T1.product_id, product_code_min, product_code_max,"
-                 . " price01_min, price01_max, price02_min, price02_max,"
-                 . " stock_min, stock_max, stock_unlimited_min,"
-                 . " stock_unlimited_max, del_flg, status, name, comment1,"
-                 . " comment2, comment3, main_list_comment, main_image,"
-                 . " main_list_image, product_flag, deliv_date_id, sale_limit,"
-                 . " point_rate, sale_unlimited, create_date, deliv_fee, "
-                 . " T4.product_rank, T4.category_rank";
-            $from = "vw_products_allclass AS T1"
-                  . " JOIN ("
-                  . " SELECT max(T3.rank) AS category_rank,"
-                  . "        max(T2.rank) AS product_rank,"
-                  . "        T2.product_id"
-                  . "   FROM dtb_product_categories T2"
-                  . "   JOIN dtb_category T3 USING (category_id)"
-                  . " GROUP BY product_id) AS T4 USING (product_id)";
-            $order = "T4.category_rank DESC, T4.product_rank DESC";
 
             $objQuery = new SC_Query();
@@ -167,17 +141,4 @@
             // 検索結果の取得
             $this->arrProducts = $objQuery->select($col, $from, $where, $arrval);
-
-            // 規格名一覧
-            $arrClassName = $objDb->sfGetIDValueList("dtb_class", "class_id", "name");
-
-            // 規格分類名一覧
-            $arrClassCatName = $objDb->sfGetIDValueList("dtb_classcategory", "classcategory_id", "name");
-
-            // 規格セレクトボックス設定
-            for($i = 0; $i < count($this->arrProducts); $i++) {
-                $this->lfMakeSelect($this->arrProducts[$i]['product_id'], $arrClassName, $arrClassCatName);
-                // 購入制限数を取得
-                $this->lfGetSaleLimit($this->arrProducts[$i]);
-            }
         }
 
@@ -219,161 +180,4 @@
         }
     }
-
-    /* 規格セレクトボックスの作成 */
-    function lfMakeSelect($product_id, $arrClassName, $arrClassCatName) {
-
-        $classcat_find1 = false;
-        $classcat_find2 = false;
-        // 在庫ありの商品の有無
-        $stock_find = false;
-
-        // 商品規格情報の取得
-        $arrProductsClass = $this->lfGetProductsClass($product_id);
-
-        // 規格1クラス名の取得
-        $this->tpl_class_name1[$product_id] =
-            isset($arrClassName[$arrProductsClass[0]['class_id1']])
-            ? $arrClassName[$arrProductsClass[0]['class_id1']]
-            : "";
-
-        // 規格2クラス名の取得
-        $this->tpl_class_name2[$product_id] =
-            isset($arrClassName[$arrProductsClass[0]['class_id2']])
-            ? $arrClassName[$arrProductsClass[0]['class_id2']]
-            : "";
-
-        // すべての組み合わせ数
-        $count = count($arrProductsClass);
-
-        $classcat_id1 = "";
-
-        $arrSele = array();
-        $arrList = array();
-
-        $list_id = 0;
-        $arrList[0] = "\tlist". $product_id. "_0 = new Array('選択してください'";
-        $arrVal[0] = "\tval". $product_id. "_0 = new Array(''";
-
-        for ($i = 0; $i < $count; $i++) {
-            // 在庫のチェック
-            if($arrProductsClass[$i]['stock'] <= 0 && $arrProductsClass[$i]['stock_unlimited'] != '1') {
-                continue;
-            }
-
-            $stock_find = true;
-
-            // 規格1のセレクトボックス用
-            if($classcat_id1 != $arrProductsClass[$i]['classcategory_id1']){
-                $arrList[$list_id].=");\n";
-                $arrVal[$list_id].=");\n";
-                $classcat_id1 = $arrProductsClass[$i]['classcategory_id1'];
-                $arrSele[$classcat_id1] = $arrClassCatName[$classcat_id1];
-                $list_id++;
-
-                $arrList[$list_id] = "";
-                $arrVal[$list_id] = "";
-            }
-
-            // 規格2のセレクトボックス用
-            $classcat_id2 = $arrProductsClass[$i]['classcategory_id2'];
-
-            // セレクトボックス表示値
-            if($arrList[$list_id] == "") {
-                $arrList[$list_id] = "\tlist". $product_id. "_". $list_id. " = new Array('選択してください', '". $arrClassCatName[$classcat_id2]. "'";
-            } else {
-                $arrList[$list_id].= ", '".$arrClassCatName[$classcat_id2]."'";
-            }
-
-            // セレクトボックスPOST値
-            if($arrVal[$list_id] == "") {
-                $arrVal[$list_id] = "\tval". $product_id. "_". $list_id. " = new Array('', '". $classcat_id2. "'";
-            } else {
-                $arrVal[$list_id].= ", '".$classcat_id2."'";
-            }
-        }
-
-        $arrList[$list_id].=");\n";
-        $arrVal[$list_id].=");\n";
-
-        // 規格1
-        $this->arrClassCat1[$product_id] = $arrSele;
-
-        $lists = "\tlists".$product_id. " = new Array(";
-        $no = 0;
-        foreach($arrList as $val) {
-            $this->tpl_javascript.= $val;
-            if ($no != 0) {
-                $lists.= ",list". $product_id. "_". $no;
-            } else {
-                $lists.= "list". $product_id. "_". $no;
-            }
-            $no++;
-        }
-        $this->tpl_javascript.= $lists.");\n";
-
-        $vals = "\tvals".$product_id. " = new Array(";
-        $no = 0;
-        foreach($arrVal as $val) {
-            $this->tpl_javascript.= $val;
-            if ($no != 0) {
-                $vals.= ",val". $product_id. "_". $no;
-            } else {
-                $vals.= "val". $product_id. "_". $no;
-            }
-            $no++;
-        }
-        $this->tpl_javascript.= $vals.");\n";
-
-        // 選択されている規格2ID
-        $classcategory_id = "classcategory_id". $product_id;
-
-        $classcategory_id_2 = $classcategory_id . "_2";
-        if (!isset($classcategory_id_2)) $classcategory_id_2 = "";
-        if (!isset($_POST[$classcategory_id_2])) $_POST[$classcategory_id_2] = "";
-
-        $this->tpl_onload .= "lnSetSelect('" . $classcategory_id ."_1', "
-            . "'" . $classcategory_id_2 . "',"
-            . "'" . $product_id . "',"
-            . "'" . $_POST[$classcategory_id_2] ."'); ";
-
-        // 規格1が設定されている
-        if($arrProductsClass[0]['classcategory_id1'] != '0') {
-            $classcat_find1 = true;
-        }
-
-        // 規格2が設定されている
-        if($arrProductsClass[0]['classcategory_id2'] != '0') {
-            $classcat_find2 = true;
-        }
-
-        $this->tpl_classcat_find1[$product_id] = $classcat_find1;
-        $this->tpl_classcat_find2[$product_id] = $classcat_find2;
-        $this->tpl_stock_find[$product_id] = $stock_find;
-    }
-
-    /* 商品規格情報の取得 */
-    function lfGetProductsClass($product_id) {
-        $arrRet = array();
-        if(SC_Utils_Ex::sfIsInt($product_id)) {
-            // 商品規格取得
-            $objQuery = new SC_Query();
-            $col = "product_class_id, classcategory_id1, classcategory_id2, class_id1, class_id2, stock, stock_unlimited";
-            $table = "vw_product_class AS prdcls";
-            $where = "product_id = ?";
-            $objQuery->setorder("rank1 DESC, rank2 DESC");
-            $arrRet = $objQuery->select($col, $table, $where, array($product_id));
-        }
-        return $arrRet;
-    }
-
-    // 購入制限数の設定
-    function lfGetSaleLimit($product) {
-        //在庫が無限または購入制限値が設定値より大きい場合
-        if($product['sale_unlimited'] == 1 || $product['sale_limit'] > SALE_LIMIT_MAX) {
-            $this->tpl_sale_limit[$product['product_id']] = SALE_LIMIT_MAX;
-        } else {
-            $this->tpl_sale_limit[$product['product_id']] = $product['sale_limit'];
-        }
-    }
 }
 ?>
