Ignore:
Timestamp:
2010/02/12 18:46:50 (14 years ago)
Author:
kajiwara
Message:

EC-CUBE Ver2.4.3 分コミット。詳細はこちら( http://www.ec-cube.net/release/detail.php?release_id=210

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/data/class/pages/admin/contents/LC_Page_Admin_Contents_Inquiry.php

    r17846 r18562  
    110110                for ( $j=0; $j<count( $_POST['question'][$i]['option'] ); $j++ ){ 
    111111                    $_POST['question'][$i]['option'][$j] = mb_convert_kana( trim ( $_POST['question'][$i]['option'][$j] ) ); 
     112                } 
     113            } 
     114 
     115            for( $i = 0; $i < count( $_POST["question"] ); $i++ ) { 
     116                if( $_POST["question"][$i]["kind"] == 3 || $_POST["question"][$i]["kind"] == 4  ) { 
     117                    $temp_data = array(); 
     118                    // 項目間(テキストボックス)があいていたら詰めていく 
     119                    for( $j = 0; $j < count( $_POST["question"][$i]["option"] ); $j++ ) { 
     120                        if( strlen( $_POST["question"][$i]["option"][$j] ) > 0 ) $temp_data[] = mb_convert_kana( trim ( $_POST["question"][$i]["option"][$j]  ), "asKVn" ); 
     121                    } 
     122                    $_POST["question"][$i]["option"] = $temp_data; 
     123                } else { 
     124                    $_POST["question"][$i]["option"] = NULL; 
    112125                } 
    113126            } 
     
    294307            if( $_POST["question"][$i]["kind"] == 3 || $_POST["question"][$i]["kind"] == 4  ) { 
    295308 
    296                 $temp_data = array(); 
    297309                for( $j = 0; $j < count( $_POST["question"][$i]["option"] ); $j++ ) { 
    298  
    299                     // 項目間(テキストボックス)があいていたら詰めていく 
    300                     if( strlen( $_POST["question"][$i]["option"][$j] ) > 0 ) $temp_data[] = mb_convert_kana( trim ( $_POST["question"][$i]["option"][$j]  ), "asKVn" ); 
    301  
    302                 } 
    303  
    304                 $_POST["question"][$i]["option"] = $temp_data; 
     310                    // 同じ回答がないかチェック 
     311                    if (strlen($_POST["question"][$i]["option"][$j]) > 0) { 
     312                        $checkArray = $_POST["question"][$i]["option"]; 
     313                        // 自身の値をunset 
     314                        unset($checkArray[$j]); 
     315                        if (in_array($_POST["question"][$i]["option"][$j], $checkArray)) { 
     316                            $objErr->arrErr["question"][$i]["option"][$j] = "同じ質問に同じ回答は設定出来ません。"; 
     317                        } 
     318                    } 
     319                } 
    305320 
    306321                if( ( strlen( $_POST["question"][$i] ["option"][0] ) == 0 ) || ( strlen( $_POST["question"][$i] ["option"][0] ) > 0 
    307322                                                                                 && strlen( $_POST["question"][$i] ["option"][1] ) == 0 ) ) $objErr->arrErr["question"][$i]['kind'] = "下記の2つ以上の項目に記入してください。"; 
     323 
    308324            } 
    309325        } 
Note: See TracChangeset for help on using the changeset viewer.