Changeset 18875 for branches/version-2_5-dev/data/Smarty
- Timestamp:
- 2010/10/29 21:00:06 (16 years ago)
- bzr:base-revision:
- svn-v4:1e3b908f-19a9-db11-a64c-001125224ba8:branches/version-2_5-dev:18874
- bzr:committer:
- Kentaro Ohkouchi <[email protected]>
- bzr:file-ids:
data/Smarty/templates/admin/order/product_select.tpl 17293@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2FSmarty%2Ftemplates%2Fdefault%2Fadmin%2Forder%2Fproduct_select.tpl
data/class/pages/admin/order/LC_Page_Admin_Order_Edit.php 15594@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Ffeature-module-update%2Fdata%2Fclass%2Fpages%2Fadmin%2Forder%2FLC_Page_Admin_Order_Edit.php
data/class/pages/admin/order/LC_Page_Admin_Order_ProductSelect.php 17293@1e3b908f-19a9-db11-a64c-001125224ba8:branches%2Fcomu-ver2%2Fdata%2Fclass%2Fpages%2Fadmin%2Forder%2FLC_Page_Admin_Order_ProductSelect.php- bzr:mapping-version:
- v4
- bzr:repository-uuid:
- 1e3b908f-19a9-db11-a64c-001125224ba8
- bzr:revision-id:
- [email protected]
- bzr:revno:
- 2355
- bzr:revprop:branch-nick:
- branches/version-2_5-dev
- bzr:root:
- branches/version-2_5-dev
- bzr:timestamp:
- 2010-10-29 21:00:01.309999943 +0900
- bzr:user-agent:
- bzr2.2.0+bzr-svn1.0.3
- svn:original-date:
- 2010-10-29T12:00:01.310000Z
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/version-2_5-dev/data/Smarty/templates/admin/order/product_select.tpl
r18873 r18875 28 28 self.moveTo(20,20);self.focus(); 29 29 30 function func_submit(product_id, class_name1, class_name2 ) {30 function func_submit(product_id, class_name1, class_name2, product_class_id) { 31 31 var err_text = ''; 32 32 var fm = window.opener.document.form1; … … 40 40 <!--{if $tpl_no != ''}--> 41 41 var opner_product_id = 'edit_product_id'; 42 var opner_classcategory_id1 = 'edit_classcategory_id1'; 43 var opner_classcategory_id2 = 'edit_classcategory_id2'; 42 var opner_product_class_id = 'edit_product_class_id'; 44 43 fm1.getElementById("no").value = <!--{$tpl_no}-->; 45 44 <!--{else}--> 46 45 var opner_product_id = 'add_product_id'; 47 var opner_classcategory_id1 = 'add_classcategory_id1'; 48 var opner_classcategory_id2 = 'add_classcategory_id2'; 46 var opner_product_class_id = 'add_product_class_id'; 49 47 <!--{/if}--> 50 48 … … 61 59 62 60 fm1.getElementById(opner_product_id).value = product_id; 63 if (class1_id != '') { 64 fm1.getElementById(opner_classcategory_id1).value = class1_id; 65 } 66 if (class2_id != '') { 67 fm1.getElementById(opner_classcategory_id2).value = class2_id; 68 } 61 fm1.getElementById(opner_product_class_id).value = product_class_id; 69 62 70 63 fm.mode.value = 'select_product_detail'; … … 78 71 </script> 79 72 73 80 74 <script type="text/javascript">//<![CDATA[ 81 // セレクトボックスに項目を割り当てる。 82 function lnSetSelect(name1, name2, id, val) { 83 sele1 = document.form1[name1]; 84 sele2 = document.form1[name2]; 85 lists = eval('lists' + id); 86 vals = eval('vals' + id); 87 88 if(sele1 && sele2) { 89 index = sele1.selectedIndex; 90 91 // セレクトボックスのクリア 92 count = sele2.options.length; 93 for(i = count; i >= 0; i--) { 94 sele2.options[i] = null; 75 // 規格2に選択肢を割り当てる。 76 function fnSetClassCategories(form, classcat_id2_selected) { 77 sele1 = form.classcategory_id1; 78 sele2 = form.classcategory_id2; 79 product_id = form.product_id.value; 80 81 if (sele1) { 82 if (sele2) { 83 // 規格2の選択肢をクリア 84 count = sele2.options.length; 85 for(i = count; i >= 0; i--) { 86 sele2.options[i] = null; 87 } 88 89 // 規格2に選択肢を割り当てる 90 classcats = productsClassCategories[product_id][sele1.value]; 91 i = 0; 92 for (var classcat_id2_key in classcats) { 93 sele2.options[i] = new Option(classcats[classcat_id2_key].name, classcat_id2_key); 94 if (classcat_id2_key == classcat_id2_selected) { 95 sele2.options[i].selected = true; 95 96 } 96 97 // セレクトボックスに値を割り当てる 98 len = lists[index].length; 99 for(i = 0; i < len; i++) { 100 sele2.options[i] = new Option(lists[index][i], vals[index][i]); 101 if(val != "" && vals[index][i] == val) { 102 sele2.options[i].selected = true; 103 } 104 } 97 i++; 98 } 105 99 } 100 fnCheckStock(form); 101 } 106 102 } 107 //]]> 108 </script> 109 110 111 <script type="text/javascript">//<![CDATA[ 112 <!--{$tpl_javascript}--> 103 104 function fnCheckStock(form) { 105 product_id = form.product_id.value; 106 classcat_id1 = form.classcategory_id1.value; 107 classcat_id2 = form.classcategory_id2 ? form.classcategory_id2.value : 0; 108 classcat2 = productsClassCategories[product_id][classcat_id1][classcat_id2]; 109 // 商品規格 110 eleDynamic = document.getElementById('product_class_id' + product_id); 111 if ( 112 classcat2 113 && typeof classcat2.product_class_id != 'undefined' 114 && String(classcat2.product_class_id).length >= 1 115 ) { 116 eleDynamic.value = classcat2.product_class_id; 117 } else { 118 eleDynamic.value = '' 119 } 120 } 113 121 //]]> 114 122 </script> … … 142 150 <button type="submit"><span>検索を開始</span></button> 143 151 </div> 144 152 </form> 145 153 <!--▼検索結果表示--> 146 154 <!--{if $tpl_linemax}--> … … 160 168 <!--{section name=cnt loop=$arrProducts}--> 161 169 <!--{assign var=id value=$arrProducts[cnt].product_id}--> 170 <form name="product_form<!--{$id|escape}-->" action="?" onsubmit="return false;"> 162 171 <!--▼商品<!--{$smarty.section.cnt.iteration}-->--> 163 172 <tr> … … 183 192 <dt><!--{$tpl_class_name1[$id]|escape}-->:</dt> 184 193 <dd> 185 <select name="<!--{$class1}-->" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->" <!--{if $tpl_classcat_find2[$id]}--> onchange="lnSetSelect('<!--{$class1}-->', '<!--{$class2}-->', '<!--{$id}-->','');"<!--{/if}-->> 186 <option value="">選択してください</option> 194 <select name="classcategory_id1" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->" onchange="fnSetClassCategories(this.form);"> 187 195 <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}--> 188 196 </select> … … 197 205 <dt><!--{$tpl_class_name2[$id]|escape}-->:</dt> 198 206 <dd> 199 <select name="<!--{$class2}-->" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->"> 200 <option value="">選択してください</option> 201 </select> 207 <select name="classcategory_id2" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->" onchange="fnCheckStock(this.form);"></select> 202 208 <!--{if $arrErr[$class2] != ""}--> 203 209 <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span> … … 207 213 <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="" /> 208 214 <!--{/if}--> 215 <input type="hidden" name="product_id" value="<!--{$id|escape}-->" /> 216 <input type="hidden" name="product_class_id<!--{$id|escape}-->" id="product_class_id<!--{$id|escape}-->" value="<!--{$tpl_product_class_id[$id]}-->" /> 217 <input type="hidden" name="product_type" id="product_type<!--{$id|escape}-->" value="<!--{$tpl_product_type[$id]}-->" /> 209 218 </td> 210 <td class="center"><a href=" " onclick="return func_submit('<!--{$arrProducts[cnt].product_id}-->', '<!--{$tpl_class_name1[$id]}-->', '<!--{$tpl_class_name2[$id]}-->')">決定</a></td>219 <td class="center"><a href="javascript:;" onclick="return func_submit('<!--{$arrProducts[cnt].product_id}-->', '<!--{$tpl_class_name1[$id]}-->', '<!--{$tpl_class_name2[$id]}-->', '<!--{$tpl_product_class_id[$id]}-->')">決定</a></td> 211 220 </tr> 212 221 <!--▲商品<!--{$smarty.section.cnt.iteration}-->--> 222 </form> 213 223 <!--{sectionelse}--> 214 224 <tr> … … 220 230 <!--▲検索結果表示--> 221 231 222 </form>223 232 224 233 <!--{include file="`$smarty.const.TEMPLATE_ADMIN_DIR`admin_popup_footer.tpl"}-->
Note: See TracChangeset
for help on using the changeset viewer.
