Changeset 17874


Ignore:
Timestamp:
2009/03/06 13:24:35 (15 years ago)
Author:
Seasoft
Message:

リザルトが0件または1件の場合を考慮していないバグを修正。(JavaScript?)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2/data/Smarty/templates/default/admin/order/index.tpl

    r17612 r17874  
    314314 
    315315        var fm = document.form1; 
    316                  
    317         var i; 
    318         var checkflag = 0; 
     316         
     317        if (!fm["pdf_order_id[]"]) { 
     318            return false; 
     319        } 
     320         
     321        var checkflag = false; 
    319322        var max = fm["pdf_order_id[]"].length; 
    320323         
    321         if(max) { 
    322             for (i=0;i<max;i++){ 
     324        if (max) { 
     325            for (var i=0; i<max; i++) { 
    323326                if(fm["pdf_order_id[]"][i].checked == true){ 
    324                     checkflag = 1; 
     327                    checkflag = true; 
    325328                } 
    326329            } 
    327330        } else { 
    328331            if(fm["pdf_order_id[]"].checked == true) { 
    329                 checkflag = 1; 
     332                checkflag = true; 
    330333            } 
    331334        } 
    332335 
    333         if(checkflag == 0){ 
     336        if(!checkflag){ 
    334337            alert('チェックボックスが選択されていません'); 
    335338            return false; 
    336339        } 
    337340         
    338         if(checkflag == 1){  
    339             window.open("about:blank", "pdf", "width=1000,height=800,scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no"); 
    340             document.form1.target = "pdf"; 
    341             document.form1.mode.value = 'pdf'; 
    342             document.form1.action = 'pdf.php'; 
    343             document.form1.submit();  
    344         } 
     341        window.open("about:blank", "pdf", "width=1000,height=800,scrollbars=yes,resizable=yes,toolbar=no,location=no,directories=no,status=no"); 
     342        fm.target = "pdf"; 
     343        fm.mode.value = 'pdf'; 
     344        fm.action = 'pdf.php'; 
     345        fm.submit();  
    345346    } 
    346347     
    347348    function fnBoxChecked(check){ 
    348         var count; 
    349349        var fm = document.form1; 
    350350        var max = fm["pdf_order_id[]"].length; 
    351         for(count=0; count<max; count++){ 
    352             fm["pdf_order_id[]"][count].checked = check; 
     351        if (max) { 
     352            for (var i=0; i<max; i++) { 
     353                fm["pdf_order_id[]"][i].checked = check; 
     354            } 
     355        } else { 
     356            fm["pdf_order_id[]"].checked = check; 
    353357        } 
    354358    } 
Note: See TracChangeset for help on using the changeset viewer.