Ignore:
Timestamp:
2013/02/01 14:11:51 (11 years ago)
Author:
undertree
Message:

#2095 受注画面の商品追加で、在庫が0の商品も追加できてしまう。

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/version-2_12-dev/data/Smarty/templates/admin/order/product_select.tpl

    r22206 r22491  
    3737        var class1_id = document.getElementById(class1).value; 
    3838        var class2_id = document.getElementById(class2).value; 
     39 
    3940        var product_class_id = document.getElementById("product_class_id" + product_id).value; 
    4041        var opner_product_id = 'add_product_id'; 
     
    5354            err_text = err_text + class_name2 + "を選択してください。\n"; 
    5455        } 
     56 
     57        if(!class1_id){ 
     58            err_text = productsClassCategories[product_id]['__unselected2']['#0']['stock_find'] ? '' : '只今品切れ中です'; 
     59        }else if(class1_id && !class2_id){ 
     60            err_text = productsClassCategories[product_id][class1_id]['#0']['stock_find'] ? '' : '只今品切れ中です'; 
     61        }else{ 
     62            err_text = productsClassCategories[product_id][class1_id]['#' + class2_id]['stock_find'] ? '' : '只今品切れ中です'; 
     63        } 
     64 
    5565        if (err_text != '') { 
    5666            alert(err_text); 
     
    194204                    </td> 
    195205                    <td> 
    196                         <!--{$arrProducts[cnt].name|h}--> 
    197  
    198                         <!--{assign var=class1 value=classcategory_id`$id`_1}--> 
    199                         <!--{assign var=class2 value=classcategory_id`$id`_2}--> 
    200                         <!--{if $tpl_classcat_find1[$id]}--> 
    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] != ""}--> 
    208                                 <br /><span class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</span> 
    209                                 <!--{/if}--> 
    210                             </dd> 
    211                         </dl> 
    212                         <!--{else}--> 
    213                         <input type="hidden" name="<!--{$class1}-->" id="<!--{$class1}-->" value="" /> 
    214                         <!--{/if}--> 
    215  
    216                         <!--{if $tpl_classcat_find2[$id]}--> 
    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] != ""}--> 
    222                                 <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span> 
    223                                 <!--{/if}--> 
    224                             </dd> 
    225                         </dl> 
    226                         <!--{else}--> 
    227                         <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="" /> 
    228                         <!--{/if}--> 
    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]}-->" /> 
     206                    <!--{$arrProducts[cnt].name|h}--> 
     207                    <!--{assign var=class1 value=classcategory_id`$id`_1}--> 
     208                    <!--{assign var=class2 value=classcategory_id`$id`_2}--> 
     209                    <!--{if $tpl_classcat_find1[$id]}--> 
     210                    <dl> 
     211                        <dt><!--{$tpl_class_name1[$id]|h}-->:</dt> 
     212                        <dd> 
     213                            <select name="classcategory_id1" id="<!--{$class1}-->" style="<!--{$arrErr[$class1]|sfGetErrorColor}-->"    onchange="fnSetClassCategories(this.form);"> 
     214                                <!--{html_options options=$arrClassCat1[$id] selected=$arrForm[$class1]}--> 
     215                            </select> 
     216                            <!--{if $arrErr[$class1] != ""}--> 
     217                            <br /><span class="attention">※ <!--{$tpl_class_name1[$id]}-->を入力して下さい。</span> 
     218                            <!--{/if}--> 
     219                        </dd> 
     220                    </dl> 
     221                    <!--{else}--> 
     222                    <input type="hidden" name="<!--{$class1}-->" id="<!--{$class1}-->" value="" /> 
     223                    <!--{/if}--> 
     224 
     225                    <!--{if $tpl_classcat_find2[$id]}--> 
     226                    <dl> 
     227                        <dt><!--{$tpl_class_name2[$id]|h}-->:</dt> 
     228                        <dd> 
     229                            <select name="classcategory_id2" id="<!--{$class2}-->" style="<!--{$arrErr[$class2]|sfGetErrorColor}-->" onchange="fnCheckStock(this.form);"></select> 
     230                            <!--{if $arrErr[$class2] != ""}--> 
     231                            <br /><span class="attention">※ <!--{$tpl_class_name2[$id]}-->を入力して下さい。</span> 
     232                            <!--{/if}--> 
     233                        </dd> 
     234                    </dl> 
     235                    <!--{else}--> 
     236                    <input type="hidden" name="<!--{$class2}-->" id="<!--{$class2}-->" value="" /> 
     237                    <!--{/if}--> 
     238                    <!--{if !$tpl_stock_find[$id]}--> 
     239                        <div class="attention">只今品切れ中です。</div> 
     240                    <!--{/if}--> 
     241                    <input type="hidden" name="product_id" value="<!--{$id|h}-->" /> 
     242                    <input type="hidden" name="product_class_id<!--{$id|h}-->" id="product_class_id<!--{$id|h}-->" value="<!--{$tpl_product_class_id[$id]}-->" /> 
     243                    <input type="hidden" name="product_type" id="product_type<!--{$id|h}-->" value="<!--{$tpl_product_type[$id]}-->" /> 
    232244                    </td> 
    233245                    <td class="center"><a href="javascript:;" onclick="return func_submit('<!--{$arrProducts[cnt].product_id}-->', '<!--{$tpl_class_name1[$id]}-->', '<!--{$tpl_class_name2[$id]}-->'); return false;">決定</a></td> 
Note: See TracChangeset for help on using the changeset viewer.