[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') { |
---|
| 50 | err_text = class_name1 + "を選択してください。\n"; |
---|
[22121] | 51 | err_text = class_name1 + "を選択してください。\n"; |
---|
[21537] | 52 | } |
---|
| 53 | if (document.getElementById(class2).type == 'select-one' && class2_id == '') { |
---|
| 54 | err_text = err_text + class_name2 + "を選択してください。\n"; |
---|
| 55 | } |
---|
| 56 | if (err_text != '') { |
---|
| 57 | alert(err_text); |
---|
| 58 | return false; |
---|
| 59 | } |
---|
[17293] | 60 | |
---|
[21537] | 61 | fm1.getElementById(opner_product_id).value = product_id; |
---|
| 62 | fm1.getElementById(opner_product_class_id).value = product_class_id; |
---|
[17293] | 63 | |
---|
[21537] | 64 | fm.mode.value = 'select_product_detail'; |
---|
| 65 | fm.anchor_key.value = 'order_products'; |
---|
| 66 | fm.submit(); |
---|
| 67 | window.close(); |
---|
[18075] | 68 | |
---|
[21537] | 69 | return true; |
---|
| 70 | } |
---|
[17293] | 71 | |
---|
[21537] | 72 | // 規格2に選択肢を割り当てる。 |
---|
| 73 | function fnSetClassCategories(form, classcat_id2_selected) { |
---|
| 74 | sele1 = form.classcategory_id1; |
---|
| 75 | sele2 = form.classcategory_id2; |
---|
| 76 | product_id = form.product_id.value; |
---|
[18875] | 77 | |
---|
[21537] | 78 | if (sele1) { |
---|
| 79 | if (sele2) { |
---|
| 80 | // 規格2の選択肢をクリア |
---|
| 81 | count = sele2.options.length; |
---|
| 82 | for(i = count; i >= 0; i--) { |
---|
| 83 | sele2.options[i] = null; |
---|
| 84 | } |
---|
[17293] | 85 | |
---|
[21537] | 86 | // 規格2に選択肢を割り当てる |
---|
| 87 | classcats = productsClassCategories[product_id][sele1.value]; |
---|
| 88 | i = 0; |
---|
| 89 | for (var classcat_id2_key in classcats) { |
---|
| 90 | classcategory_id2 = classcats[classcat_id2_key].classcategory_id2; |
---|
| 91 | sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcategory_id2); |
---|
| 92 | if (classcategory_id2 == classcat_id2_selected) { |
---|
| 93 | sele2.options[i].selected = true; |
---|
| 94 | } |
---|
| 95 | i++; |
---|
[17293] | 96 | } |
---|
[18875] | 97 | } |
---|
[21537] | 98 | fnCheckStock(form); |
---|
[17293] | 99 | } |
---|
[18875] | 100 | } |
---|
[17293] | 101 | |
---|
[21537] | 102 | function fnCheckStock(form) { |
---|
| 103 | product_id = form.product_id.value; |
---|
| 104 | classcat_id1 = form.classcategory_id1.value; |
---|
| 105 | classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : ''; |
---|
| 106 | classcat2 = productsClassCategories[product_id][classcat_id1]['#' + classcat_id2]; |
---|
| 107 | // 商品規格 |
---|
| 108 | eleDynamic = document.getElementById('product_class_id' + product_id); |
---|
| 109 | if ( |
---|
| 110 | classcat2 |
---|
| 111 | && typeof classcat2.product_class_id != 'undefined' |
---|
| 112 | && String(classcat2.product_class_id).length >= 1 |
---|
| 113 | ) { |
---|
| 114 | eleDynamic.value = classcat2.product_class_id; |
---|
| 115 | } else { |
---|
[21896] | 116 | // 規格が1つのみの場合 |
---|
| 117 | classcat1 = productsClassCategories[product_id][classcat_id1]['#0']; |
---|
| 118 | eleDynamic.value = classcat1.product_class_id; |
---|
[21537] | 119 | } |
---|
[18875] | 120 | } |
---|
[21537] | 121 | //]]></script> |
---|
[17293] | 122 | |
---|
| 123 | <!--▼検索フォーム--> |
---|
[20941] | 124 | <form name="form1" id="form1" method="post" action="?"> |
---|
[20407] | 125 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
[17351] | 126 | <input name="mode" type="hidden" value="search" /> |
---|
| 127 | <input name="anchor_key" type="hidden" value="" /> |
---|
| 128 | <input name="search_pageno" type="hidden" value="" /> |
---|
[20741] | 129 | <input name="no" type="hidden" value="<!--{$tpl_no|h}-->" /> |
---|
[17351] | 130 | <table class="form"> |
---|
[21343] | 131 | <col width="20%" /> |
---|
| 132 | <col width="80%" /> |
---|
[19687] | 133 | <tr> |
---|
[22121] | 134 | <th><!--{t string="tpl_191"}--></th> |
---|
[19687] | 135 | <td> |
---|
| 136 | <select name="search_category_id"> |
---|
[22121] | 137 | <option value="" selected="selected"><!--{t string="tpl_068"}--></option> |
---|
[19687] | 138 | <!--{html_options options=$arrCatList selected=$arrForm.search_category_id}--> |
---|
| 139 | </select> |
---|
| 140 | </td> |
---|
| 141 | </tr> |
---|
| 142 | <tr> |
---|
[22121] | 143 | <th><!--{t string="tpl_189"}--></th> |
---|
[20741] | 144 | <td><input type="text" name="search_name" value="<!--{$arrForm.search_name|h}-->" size="35" class="box35" /></td> |
---|
[19687] | 145 | </tr> |
---|
| 146 | <tr> |
---|
[22121] | 147 | <th><!--{t string="tpl_192"}--></th> |
---|
[20741] | 148 | <td><input type="text" name="search_product_code" value="<!--{$arrForm.search_product_code|h}-->" size="35" class="box35" /></td> |
---|
[19687] | 149 | </tr> |
---|
[17293] | 150 | </table> |
---|
[19909] | 151 | <div class="btn-area"> |
---|
[20516] | 152 | <ul> |
---|
[22121] | 153 | <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] | 154 | </ul> |
---|
[17351] | 155 | </div> |
---|
[18875] | 156 | </form> |
---|
[17351] | 157 | <!--▼検索結果表示--> |
---|
| 158 | <!--{if $tpl_linemax}--> |
---|
[19687] | 159 | <p> |
---|
[22171] | 160 | <!--{t string="tpl_194" T_FIELD=$tpl_linemax}--> |
---|
[19687] | 161 | <!--{$tpl_strnavi}--> |
---|
| 162 | </p> |
---|
[17351] | 163 | |
---|
[19687] | 164 | <!--▼検索後表示部分--> |
---|
| 165 | <table class="list"> |
---|
[21343] | 166 | <col width="20%" /> |
---|
| 167 | <col width="20%" /> |
---|
| 168 | <col width="50%" /> |
---|
| 169 | <col width="10%" /> |
---|
[19687] | 170 | <tr> |
---|
[22121] | 171 | <th class="image"><!--{t string="tpl_195"}--></th> |
---|
| 172 | <th class="id"><!--{t string="tpl_192"}--></th> |
---|
| 173 | <th class="name"><!--{t string="tpl_189"}--></th> |
---|
| 174 | <th class="action"><!--{t string="tpl_196"}--></th> |
---|
[19687] | 175 | </tr> |
---|
| 176 | <!--{section name=cnt loop=$arrProducts}--> |
---|
| 177 | <!--{assign var=id value=$arrProducts[cnt].product_id}--> |
---|
[19785] | 178 | <form name="product_form<!--{$id|h}-->" action="?" onsubmit="return false;"> |
---|
[20407] | 179 | <input type="hidden" name="<!--{$smarty.const.TRANSACTION_ID_NAME}-->" value="<!--{$transactionid}-->" /> |
---|
[19687] | 180 | <!--▼商品<!--{$smarty.section.cnt.iteration}-->--> |
---|
| 181 | <!--{assign var=status value="`$arrProducts[cnt].status`"}--> |
---|
| 182 | <tr style="background:<!--{$arrPRODUCTSTATUS_COLOR[$status]}-->;"> |
---|
| 183 | <td class="center"> |
---|
[19972] | 184 | <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] | 185 | </td> |
---|
[19687] | 186 | <td> |
---|
| 187 | <!--{assign var=codemin value=`$arrProducts[cnt].product_code_min`}--> |
---|
| 188 | <!--{assign var=codemax value=`$arrProducts[cnt].product_code_max`}--> |
---|
| 189 | <!--{* 商品コード *}--> |
---|
| 190 | <!--{if $codemin != $codemax}--> |
---|
[22134] | 191 | <!--{$codemin|h}--><!--{t string="-"}--><!--{$codemax|h}--> |
---|
[19687] | 192 | <!--{else}--> |
---|
[19785] | 193 | <!--{$codemin|h}--> |
---|
[19687] | 194 | <!--{/if}--> |
---|
| 195 | </td> |
---|
| 196 | <td> |
---|
[19785] | 197 | <!--{$arrProducts[cnt].name|h}--> |
---|
[18075] | 198 | |
---|
[19687] | 199 | <!--{assign var=class1 value=classcategory_id`$id`_1}--> |
---|
| 200 | <!--{assign var=class2 value=classcategory_id`$id`_2}--> |
---|
| 201 | <!--{if $tpl_classcat_find1[$id]}--> |
---|
[20292] | 202 | <dl> |
---|
| 203 | <dt><!--{$tpl_class_name1[$id]|h}-->:</dt> |
---|
| 204 | <dd> |
---|
| 205 | <select name="classcategory_id1" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->" onchange="fnSetClassCategories(this.form);"> |
---|
| 206 | <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}--> |
---|
| 207 | </select> |
---|
| 208 | <!--{if $arrErr[$class1] != ""}--> |
---|
[22121] | 209 | <br /><span class="attention"><!--{t string="tpl_436" T_FIELD=$tpl_class_name1[$id]}--></span> |
---|
[20292] | 210 | <!--{/if}--> |
---|
| 211 | </dd> |
---|
| 212 | </dl> |
---|
[19687] | 213 | <!--{else}--> |
---|
| 214 | <input type="hidden" name="<!--{$class1}-->" id="<!--{$class1}-->" value="" /> |
---|
| 215 | <!--{/if}--> |
---|
[20292] | 216 | |
---|
[19687] | 217 | <!--{if $tpl_classcat_find2[$id]}--> |
---|
[20292] | 218 | <dl> |
---|
| 219 | <dt><!--{$tpl_class_name2[$id]|h}-->:</dt> |
---|
| 220 | <dd> |
---|
| 221 | <select name="classcategory_id2" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->" onchange="fnCheckStock(this.form);"></select> |
---|
| 222 | <!--{if $arrErr[$class2] != ""}--> |
---|
[22121] | 223 | <br /><span class="attention"><!--{t string="tpl_436" T_FIELD=$tpl_class_name2[$id]}--></span> |
---|
[20292] | 224 | <!--{/if}--> |
---|
| 225 | </dd> |
---|
| 226 | </dl> |
---|
[19687] | 227 | <!--{else}--> |
---|
| 228 | <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="" /> |
---|
| 229 | <!--{/if}--> |
---|
[19785] | 230 | <input type="hidden" name="product_id" value="<!--{$id|h}-->" /> |
---|
| 231 | <input type="hidden" name="product_class_id<!--{$id|h}-->" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" /> |
---|
| 232 | <input type="hidden" name="product_type" id="product_type<!--{$id|h}-->" value="<!--{$tpl_product_type[$id]}-->" /> |
---|
[19687] | 233 | </td> |
---|
[22121] | 234 | <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] | 235 | </tr> |
---|
| 236 | <!--▲商品<!--{$smarty.section.cnt.iteration}-->--> |
---|
| 237 | </form> |
---|
| 238 | <!--{sectionelse}--> |
---|
| 239 | <tr> |
---|
[22121] | 240 | <td colspan="4"><!--{t string="tpl_197"}--></td> |
---|
[19687] | 241 | </tr> |
---|
| 242 | <!--{/section}--> |
---|
| 243 | </table> |
---|
[17351] | 244 | <!--{/if}--> |
---|
| 245 | <!--▲検索結果表示--> |
---|
[17293] | 246 | |
---|
| 247 | |
---|
[19805] | 248 | <!--{include file="`$smarty.const.TEMPLATE_ADMIN_REALDIR`admin_popup_footer.tpl"}--> |
---|