[17293] | 1 | <!--{* |
---|
| 2 | /* |
---|
| 3 | * This file is part of EC-CUBE |
---|
| 4 | * |
---|
[21867] | 5 | * Copyright(c) 2000-2012 LOCKON CO.,LTD. All Rights Reserved. |
---|
[17293] | 6 | * |
---|
| 7 | * http://www.lockon.co.jp/ |
---|
| 8 | * |
---|
| 9 | * This program is free software; you can redistribute it and/or |
---|
| 10 | * modify it under the terms of the GNU General Public License |
---|
| 11 | * as published by the Free Software Foundation; either version 2 |
---|
| 12 | * of the License, or (at your option) any later version. |
---|
| 13 | * |
---|
| 14 | * This program is distributed in the hope that it will be useful, |
---|
| 15 | * but WITHOUT ANY WARRANTY; without even the implied warranty of |
---|
| 16 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
---|
| 17 | * GNU General Public License for more details. |
---|
| 18 | * |
---|
| 19 | * You should have received a copy of the GNU General Public License |
---|
| 20 | * along with this program; if not, write to the Free Software |
---|
| 21 | * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. |
---|
| 22 | */ |
---|
| 23 | *}--> |
---|
[21539] | 24 | |
---|
[19805] | 25 | <!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_header.tpl"}--> |
---|
[17293] | 26 | |
---|
[21537] | 27 | <script type="text/javascript">//<![CDATA[ |
---|
| 28 | self.moveTo(20,20);self.focus(); |
---|
[17293] | 29 | |
---|
[21537] | 30 | function func_submit(product_id, class_name1, class_name2) { |
---|
| 31 | var err_text = ''; |
---|
| 32 | var fm = window.opener.document.form1; |
---|
| 33 | var fm1 = window.opener.document; |
---|
| 34 | var class1 = "classcategory_id" + product_id + "_1"; |
---|
| 35 | var class2 = "classcategory_id" + product_id + "_2"; |
---|
[17293] | 36 | |
---|
[21537] | 37 | var class1_id = document.getElementById(class1).value; |
---|
| 38 | var class2_id = document.getElementById(class2).value; |
---|
| 39 | var product_class_id = document.getElementById("product_class_id" + product_id).value; |
---|
| 40 | var opner_product_id = 'add_product_id'; |
---|
| 41 | var opner_product_class_id = 'add_product_class_id'; |
---|
| 42 | var tpl_no = '<!--{$tpl_no}-->'; |
---|
[17293] | 43 | |
---|
[21537] | 44 | if (tpl_no != '') { |
---|
| 45 | opner_product_id = 'edit_product_id'; |
---|
| 46 | opner_product_class_id = 'edit_product_class_id'; |
---|
| 47 | fm1.getElementById("no").value = escape('<!--{$tpl_no}-->'); |
---|
| 48 | } |
---|
| 49 | if (document.getElementById(class1).type == 'select-one' && class1_id == '__unselected') { |
---|
[22274] | 50 | err_text = class_name1 + fnT('j_admin_012'); |
---|
[21537] | 51 | } |
---|
| 52 | if (document.getElementById(class2).type == 'select-one' && class2_id == '') { |
---|
[22274] | 53 | err_text = class_name2 + fnT('j_admin_012'); |
---|
[21537] | 54 | } |
---|
| 55 | if (err_text != '') { |
---|
| 56 | alert(err_text); |
---|
| 57 | return false; |
---|
| 58 | } |
---|
[17293] | 59 | |
---|
[21537] | 60 | fm1.getElementById(opner_product_id).value = product_id; |
---|
| 61 | fm1.getElementById(opner_product_class_id).value = product_class_id; |
---|
[17293] | 62 | |
---|
[21537] | 63 | fm.mode.value = 'select_product_detail'; |
---|
| 64 | fm.anchor_key.value = 'order_products'; |
---|
| 65 | fm.submit(); |
---|
| 66 | window.close(); |
---|
[18075] | 67 | |
---|
[21537] | 68 | return true; |
---|
| 69 | } |
---|
[17293] | 70 | |
---|
[21537] | 71 | // 規格2に選択肢を割り当てる。 |
---|
| 72 | function fnSetClassCategories(form, classcat_id2_selected) { |
---|
| 73 | sele1 = form.classcategory_id1; |
---|
| 74 | sele2 = form.classcategory_id2; |
---|
| 75 | product_id = form.product_id.value; |
---|
[18875] | 76 | |
---|
[21537] | 77 | if (sele1) { |
---|
| 78 | if (sele2) { |
---|
| 79 | // 規格2の選択肢をクリア |
---|
| 80 | count = sele2.options.length; |
---|
| 81 | for(i = count; i >= 0; i--) { |
---|
| 82 | sele2.options[i] = null; |
---|
| 83 | } |
---|
[17293] | 84 | |
---|
[21537] | 85 | // 規格2に選択肢を割り当てる |
---|
| 86 | classcats = productsClassCategories[product_id][sele1.value]; |
---|
| 87 | i = 0; |
---|
| 88 | for (var classcat_id2_key in classcats) { |
---|
| 89 | classcategory_id2 = classcats[classcat_id2_key].classcategory_id2; |
---|
| 90 | sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcategory_id2); |
---|
| 91 | if (classcategory_id2 == classcat_id2_selected) { |
---|
| 92 | sele2.options[i].selected = true; |
---|
| 93 | } |
---|
| 94 | i++; |
---|
[17293] | 95 | } |
---|
[18875] | 96 | } |
---|
[21537] | 97 | fnCheckStock(form); |
---|
[17293] | 98 | } |
---|
[18875] | 99 | } |
---|
[17293] | 100 | |
---|
[21537] | 101 | function fnCheckStock(form) { |
---|
| 102 | product_id = form.product_id.value; |
---|
| 103 | classcat_id1 = form.classcategory_id1.value; |
---|
| 104 | classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : ''; |
---|
| 105 | classcat2 = productsClassCategories[product_id][classcat_id1]['#' + classcat_id2]; |
---|
| 106 | // 商品規格 |
---|
| 107 | eleDynamic = document.getElementById('product_class_id' + product_id); |
---|
| 108 | if ( |
---|
| 109 | classcat2 |
---|
| 110 | && typeof classcat2.product_class_id != 'undefined' |
---|
| 111 | && String(classcat2.product_class_id).length >= 1 |
---|
| 112 | ) { |
---|
| 113 | eleDynamic.value = classcat2.product_class_id; |
---|
| 114 | } else { |
---|
[21896] | 115 | // 規格が1つのみの場合 |
---|
| 116 | classcat1 = productsClassCategories[product_id][classcat_id1]['#0']; |
---|
| 117 | eleDynamic.value = classcat1.product_class_id; |
---|
[21537] | 118 | } |
---|
[18875] | 119 | } |
---|
[21537] | 120 | //]]></script> |
---|
[17293] | 121 | |
---|
| 122 | <!--▼検索フォーム--> |
---|
[20941] | 123 | <form name="form1" id="form1" method="post" action="?"> |
---|
[20407] | 124 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
[17351] | 125 | <input name="mode" type="hidden" value="search" /> |
---|
| 126 | <input name="anchor_key" type="hidden" value="" /> |
---|
| 127 | <input name="search_pageno" type="hidden" value="" /> |
---|
[20741] | 128 | <input name="no" type="hidden" value="<!--{$tpl_no|h}-->" /> |
---|
[17351] | 129 | <table class="form"> |
---|
[21343] | 130 | <col width="20%" /> |
---|
| 131 | <col width="80%" /> |
---|
[19687] | 132 | <tr> |
---|
[22121] | 133 | <th><!--{t string="tpl_191"}--></th> |
---|
[19687] | 134 | <td> |
---|
| 135 | <select name="search_category_id"> |
---|
[22121] | 136 | <option value="" selected="selected"><!--{t string="tpl_068"}--></option> |
---|
[19687] | 137 | <!--{html_options options=$arrCatList selected=$arrForm.search_category_id}--> |
---|
| 138 | </select> |
---|
| 139 | </td> |
---|
| 140 | </tr> |
---|
| 141 | <tr> |
---|
[22291] | 142 | <th><!--{t string="tpl_188"}--></th> |
---|
[20741] | 143 | <td><input type="text" name="search_name" value="<!--{$arrForm.search_name|h}-->" size="35" class="box35" /></td> |
---|
[19687] | 144 | </tr> |
---|
| 145 | <tr> |
---|
[22121] | 146 | <th><!--{t string="tpl_192"}--></th> |
---|
[20741] | 147 | <td><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code|h}-->" size="35" class="box35" /></td> |
---|
[19687] | 148 | </tr> |
---|
[17293] | 149 | </table> |
---|
[19909] | 150 | <div class="btn-area"> |
---|
[20516] | 151 | <ul> |
---|
[22121] | 152 | <li><a class="btn-action" href="javascript:;" onclick="fnFormModeSubmit('form1', 'search', '', ''); return false;"><span class="btn-next"><!--{t string="tpl_193"}--></span></a></li> |
---|
[20516] | 153 | </ul> |
---|
[17351] | 154 | </div> |
---|
[18875] | 155 | </form> |
---|
[17351] | 156 | <!--▼検索結果表示--> |
---|
| 157 | <!--{if $tpl_linemax}--> |
---|
[19687] | 158 | <p> |
---|
[22171] | 159 | <!--{t string="tpl_194" T_FIELD=$tpl_linemax}--> |
---|
[19687] | 160 | <!--{$tpl_strnavi}--> |
---|
| 161 | </p> |
---|
[17351] | 162 | |
---|
[19687] | 163 | <!--▼検索後表示部分--> |
---|
| 164 | <table class="list"> |
---|
[21343] | 165 | <col width="20%" /> |
---|
| 166 | <col width="20%" /> |
---|
| 167 | <col width="50%" /> |
---|
| 168 | <col width="10%" /> |
---|
[19687] | 169 | <tr> |
---|
[22121] | 170 | <th class="image"><!--{t string="tpl_195"}--></th> |
---|
| 171 | <th class="id"><!--{t string="tpl_192"}--></th> |
---|
[22291] | 172 | <th class="name"><!--{t string="tpl_188"}--></th> |
---|
[22121] | 173 | <th class="action"><!--{t string="tpl_196"}--></th> |
---|
[19687] | 174 | </tr> |
---|
| 175 | <!--{section name=cnt loop=$arrProducts}--> |
---|
| 176 | <!--{assign var=id value=$arrProducts[cnt].product_id}--> |
---|
[19785] | 177 | <form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;"> |
---|
[20407] | 178 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
[19687] | 179 | <!--▼商品<!--{$smarty.section.cnt.iteration}-->--> |
---|
| 180 | <!--{assign var=status value="`$arrProducts[cnt].status`"}--> |
---|
| 181 | <tr style="background:<!--{$arrPRODUCTSTATUS_COLOR[$status]}-->;"> |
---|
| 182 | <td class="center"> |
---|
[19972] | 183 | <img src="<!--{$smarty.const.ROOT_URLPATH}-->resize_image.php?image=<!--{$arrProducts[cnt].main_list_image|sfNoImageMainList|h}-->&width=65&height=65" alt="<!--{$arrRecommend[$recommend_no].name|h}-->" /> |
---|
[21535] | 184 | </td> |
---|
[19687] | 185 | <td> |
---|
| 186 | <!--{assign var=codemin value=`$arrProducts[cnt].product_code_min`}--> |
---|
| 187 | <!--{assign var=codemax value=`$arrProducts[cnt].product_code_max`}--> |
---|
| 188 | <!--{* 商品コード *}--> |
---|
| 189 | <!--{if $codemin != $codemax}--> |
---|
[22134] | 190 | <!--{$codemin|h}--><!--{t string="-"}--><!--{$codemax|h}--> |
---|
[19687] | 191 | <!--{else}--> |
---|
[19785] | 192 | <!--{$codemin|h}--> |
---|
[19687] | 193 | <!--{/if}--> |
---|
| 194 | </td> |
---|
| 195 | <td> |
---|
[19785] | 196 | <!--{$arrProducts[cnt].name|h}--> |
---|
[18075] | 197 | |
---|
[19687] | 198 | <!--{assign var=class1 value=classcategory_id`$id`_1}--> |
---|
| 199 | <!--{assign var=class2 value=classcategory_id`$id`_2}--> |
---|
| 200 | <!--{if $tpl_classcat_find1[$id]}--> |
---|
[20292] | 201 | <dl> |
---|
| 202 | <dt><!--{$tpl_class_name1[$id]|h}-->:</dt> |
---|
| 203 | <dd> |
---|
| 204 | <select name="classcategory_id1" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->" onchange="fnSetClassCategories(this.form);"> |
---|
| 205 | <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}--> |
---|
| 206 | </select> |
---|
| 207 | <!--{if $arrErr[$class1] != ""}--> |
---|
[22121] | 208 | <br /><span class="attention"><!--{t string="tpl_436" T_FIELD=$tpl_class_name1[$id]}--></span> |
---|
[20292] | 209 | <!--{/if}--> |
---|
| 210 | </dd> |
---|
| 211 | </dl> |
---|
[19687] | 212 | <!--{else}--> |
---|
| 213 | <input type="hidden" name="<!--{$class1}-->" id="<!--{$class1}-->" value="" /> |
---|
| 214 | <!--{/if}--> |
---|
[20292] | 215 | |
---|
[19687] | 216 | <!--{if $tpl_classcat_find2[$id]}--> |
---|
[20292] | 217 | <dl> |
---|
| 218 | <dt><!--{$tpl_class_name2[$id]|h}-->:</dt> |
---|
| 219 | <dd> |
---|
| 220 | <select name="classcategory_id2" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->" onchange="fnCheckStock(this.form);"></select> |
---|
| 221 | <!--{if $arrErr[$class2] != ""}--> |
---|
[22121] | 222 | <br /><span class="attention"><!--{t string="tpl_436" T_FIELD=$tpl_class_name2[$id]}--></span> |
---|
[20292] | 223 | <!--{/if}--> |
---|
| 224 | </dd> |
---|
| 225 | </dl> |
---|
[19687] | 226 | <!--{else}--> |
---|
| 227 | <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="" /> |
---|
| 228 | <!--{/if}--> |
---|
[19785] | 229 | <input type="hidden" name="product_id" value="<!--{$id|h}-->" /> |
---|
| 230 | <input type="hidden" name="product_class_id<!--{$id|h}-->" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" /> |
---|
| 231 | <input type="hidden" name="product_type" id="product_type<!--{$id|h}-->" value="<!--{$tpl_product_type[$id]}-->" /> |
---|
[19687] | 232 | </td> |
---|
[22121] | 233 | <td class="center"><a href="javascript:;" onclick="return func_submit('<!--{$arrProducts[cnt].product_id}-->', '<!--{$tpl_class_name1[$id]}-->', '<!--{$tpl_class_name2[$id]}-->'); return false;"><!--{t string="tpl_196"}--></a></td> |
---|
[19687] | 234 | </tr> |
---|
| 235 | <!--▲商品<!--{$smarty.section.cnt.iteration}-->--> |
---|
| 236 | </form> |
---|
| 237 | <!--{sectionelse}--> |
---|
| 238 | <tr> |
---|
[22121] | 239 | <td colspan="4"><!--{t string="tpl_197"}--></td> |
---|
[19687] | 240 | </tr> |
---|
| 241 | <!--{/section}--> |
---|
| 242 | </table> |
---|
[17351] | 243 | <!--{/if}--> |
---|
| 244 | <!--▲検索結果表示--> |
---|
[17293] | 245 | |
---|
| 246 | |
---|
[19805] | 247 | <!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_footer.tpl"}--> |
---|