Ignore:
Timestamp:
2010/05/08 21:47:08 (14 years ago)
Author:
Seasoft
Message:

merge r18519

  • 取得元: version-2_4

【取得元のログメッセージ】
merged r18468:18470

  • [アンケート管理]チェックボックスの回答に同じ回答を登録した場合に不具合となる場合がある(#535)
Location:
branches/comu-ver2
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/comu-ver2

  • branches/comu-ver2/data/Smarty/templates/default/admin/contents/inquiry.tpl

    r18254 r18640  
    2424<script type="text/javascript"> 
    2525<!-- 
    26   function func_check() { 
    27     res = confirm('登録します。宜しいですか?'); 
    28     if( res == true ) { 
    29       return true; 
     26    function func_check() { 
     27        res = confirm('登録します。宜しいですか?'); 
     28        if( res == true ) { 
     29            return true; 
     30        } 
     31        return false; 
    3032    } 
    31     return false; 
    32   } 
    33      
    34      
    35   function func_disp( no ){ 
     33         
     34         
     35    function func_disp( no ){ 
    3636 
    37     ml = document.form1.elements['question[' + no + '][kind]']; 
    38     len = ml.length; 
     37        ml = document.form1.elements['question[' + no + '][kind]']; 
     38        len = ml.length; 
    3939 
    40     optd = $("#Q" + no + "-option"); 
    41     nmth = $("#Q" + no + "-name").children("th"); 
    42     var flag = 0; 
    43      
    44     for( i = 0; i < len ; i++) { 
    45        
    46         if ( ml[i].checked ){ 
    47           if ( (ml[i].value == 3) || (ml[i].value == 4) ) { 
    48             optd.show(); 
    49             nmth.attr("rowspan", "3"); 
    50           } else { 
     40        optd = $("#Q" + no + "-option"); 
     41        nmth = $("#Q" + no + "-name").children("th"); 
     42        var flag = 0; 
     43         
     44        for( i = 0; i < len ; i++) { 
     45             
     46                if ( ml[i].checked ){ 
     47                    if ( (ml[i].value == 3) || (ml[i].value == 4) ) { 
     48                        optd.show(); 
     49                        nmth.attr("rowspan", "3"); 
     50                    } else { 
     51                        optd.hide(); 
     52                        nmth.attr("rowspan", "2"); 
     53                    } 
     54                    flag = 1; 
     55                }  
     56         
     57        } 
     58 
     59        if ( flag == 0 ){ 
    5160            optd.hide(); 
    5261            nmth.attr("rowspan", "2"); 
    53           } 
    54           flag = 1; 
    55         }  
    56      
    57     } 
    58  
    59     if ( flag == 0 ){ 
    60       optd.hide(); 
    61       nmth.attr("rowspan", "2"); 
     62        } 
     63         
    6264    } 
    6365     
    64   } 
    65    
    66   function delete_check() { 
    67     res = confirm('アンケートを削除しても宜しいですか?'); 
    68     if(res == true) { 
    69       return true; 
     66    function delete_check() { 
     67        res = confirm('アンケートを削除しても宜しいですか?'); 
     68        if(res == true) { 
     69            return true; 
     70        } 
     71        return false; 
    7072    } 
    71     return false; 
    72   } 
    7373// --> 
    7474</script> 
     
    7777<form name="form1" method="post" action="?mode=regist" onSubmit="return func_check(); false;"> 
    7878<input type="hidden" name="question_id" value="<!--{$QUESTION_ID}-->" /> 
    79   <h2><!--{if $QUESTION_ID}-->修正<!--{else}-->新規<!--{/if}-->登録</h2> 
    80   <!--{if $MESSAGE != ""}--> 
    81   <div class="message"><span class="attention"><!--{$MESSAGE}--></span></div> 
    82   <!--{/if}--> 
     79    <h2><!--{if $QUESTION_ID}-->修正<!--{else}-->新規<!--{/if}-->登録</h2> 
     80    <!--{if $MESSAGE != ""}--> 
     81    <div class="message"><span class="attention"><!--{$MESSAGE}--></span></div> 
     82    <!--{/if}--> 
    8383 
    84   <table> 
    85     <tr> 
    86       <th>稼働・非稼働<span class="attention">*</span></th> 
    87       <td> 
    88         <span <!--{if $ERROR.active}--><!--{sfSetErrorStyle}--><!--{/if}-->> 
    89         <!--{html_radios name="active" options=$arrActive selected=$smarty.post.active}--> 
    90         </span> 
    91         <!--{if $ERROR.active}--><br /><span class="attention"><!--{$ERROR.active}--></span><!--{/if}--> 
    92       </td> 
    93     </tr> 
    94     <tr> 
    95       <th>アンケートタイトル<span class="attention">*</span></th> 
    96       <td> 
    97         <input type="text" name="title" size="70" class="box70"  maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.title|escape}-->" <!--{if $ERROR.title}--><!--{sfSetErrorStyle}--><!--{/if}--> /> 
    98         <!--{if $ERROR.title}--><br /><span class="attention"><!--{$ERROR.title}--></span><!--{/if}--> 
    99       </td> 
    100     </tr> 
    101     <tr> 
    102       <th>アンケート内容<span class="attention">*</span></th> 
    103       <td> 
    104         <textarea name="contents" cols="60" rows="4" class="area60" wrap="physical" <!--{if $ERROR.contents}--><!--{sfSetErrorStyle}--><!--{/if}-->><!--{$smarty.post.contents}--></textarea> 
    105         <!--{if $ERROR.contents}--><br /><span class="attention"><!--{$ERROR.contents}--></span><!--{/if}--> 
    106       </td> 
    107     </tr> 
    108     <!--{section name=question loop=$cnt_question}--> 
    109     <tr id="Q<!--{$smarty.section.question.index}-->-name"> 
    110       <th rowspan="3">質問<!--{$smarty.section.question.iteration}--><!--{if $smarty.section.question.iteration eq 1}--><span class="attention">*</span><!--{/if}--></th> 
    111       <td> 
    112         <input type="text" name="question[<!--{$smarty.section.question.index}-->][name]" size="70" class="box70" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].name|escape}-->" <!--{if $ERROR.question[$smarty.section.question.index].name}--><!--{sfSetErrorStyle}--><!--{/if}--> /> 
    113         <!--{if $ERROR.question[$smarty.section.question.index].name}--><br /><span class="attention"><!--{$ERROR.question[$smarty.section.question.index].name}--></span><!--{/if}--> 
    114       </td> 
    115     </tr> 
    116     <tr id="Q<!--{$smarty.section.question.index}-->-kind"> 
    117       <td> 
    118         <span<!--{if $ERROR_COLOR.question[$smarty.section.question.index].kind}--> style="background-color:<!--{$ERROR_COLOR.question[$smarty.section.question.index].kind}-->"<!--{/if}-->> 
    119         <!--{html_radios_ex onClick="func_disp(`$smarty.section.question.index`)" name="question[`$smarty.section.question.index`][kind]" options="$arrQuestion" selected="`$smarty.post.question[$smarty.section.question.index].kind`"}--> 
    120         </span> 
    121         <!--{if $ERROR.question[$smarty.section.question.index].kind}--><br /><span class="attention"><!--{$ERROR.question[$smarty.section.question.index].kind}--></span><!--{/if}--> 
    122       </td> 
    123     </tr> 
    124     <tr id="Q<!--{$smarty.section.question.index}-->-option"> 
    125       <td> 
    126         1 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][0]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].option.0|escape}-->" <!--{if $ERROR.question[$smarty.section.question.index].kind}--><!--{sfSetErrorStyle}--><!--{/if}--> /> 2 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][1]" size="40" class="box40" value="<!--{$smarty.post.question[$smarty.section.question.index].option.1|escape}-->" <!--{if $ERROR.question[$smarty.section.question.index].kind}--><!--{sfSetErrorStyle}--><!--{/if}--> /><br /> 
    127         3 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][2]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].option.2|escape}-->" /> 4 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][3]" size="40" class="box40" value="<!--{$smarty.post.question[$smarty.section.question.index].option.3|escape}-->" /><br /> 
    128         5 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][4]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].option.4|escape}-->" /> 6 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][5]" size="40" class="box40" value="<!--{$smarty.post.question[$smarty.section.question.index].option.5|escape}-->" /><br /> 
    129         7 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][6]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$smarty.section.question.index].option.6|escape}-->" /> 8 <input type="text" name="question[<!--{$smarty.section.question.index}-->][option][7]" size="40" class="box40" value="<!--{$smarty.post.question[$smarty.section.question.index].option.7|escape}-->" /> 
    130       </td> 
    131     </tr> 
    132     <!--{/section}--> 
    133   </table> 
     84    <table> 
     85        <tr> 
     86            <th>稼働・非稼働<span class="attention">*</span></th> 
     87            <td> 
     88                <span <!--{if $ERROR.active}--><!--{sfSetErrorStyle}--><!--{/if}-->> 
     89                <!--{html_radios name="active" options=$arrActive selected=$smarty.post.active}--> 
     90                </span> 
     91                <!--{if $ERROR.active}--><br /><span class="attention"><!--{$ERROR.active}--></span><!--{/if}--> 
     92            </td> 
     93        </tr> 
     94        <tr> 
     95            <th>アンケートタイトル<span class="attention">*</span></th> 
     96            <td> 
     97                <input type="text" name="title" size="70" class="box70" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.title|escape}-->" <!--{if $ERROR.title}--><!--{sfSetErrorStyle}--><!--{/if}--> /> 
     98                <!--{if $ERROR.title}--><br /><span class="attention"><!--{$ERROR.title}--></span><!--{/if}--> 
     99            </td> 
     100        </tr> 
     101        <tr> 
     102            <th>アンケート内容<span class="attention">*</span></th> 
     103            <td> 
     104                <textarea name="contents" cols="60" rows="4" class="area60" wrap="physical" <!--{if $ERROR.contents}--><!--{sfSetErrorStyle}--><!--{/if}-->><!--{$smarty.post.contents}--></textarea> 
     105                <!--{if $ERROR.contents}--><br /><span class="attention"><!--{$ERROR.contents}--></span><!--{/if}--> 
     106            </td> 
     107        </tr> 
     108        <!--{section name=question loop=$cnt_question}--> 
     109            <!--{assign var=index value=$smarty.section.question.index}--> 
     110            <tr id="Q<!--{$smarty.section.question.index|escape}-->-name"> 
     111                <th rowspan="3">質問<!--{$smarty.section.question.iteration}--><!--{if $smarty.section.question.iteration eq 1}--><span class="attention">*</span><!--{/if}--></th> 
     112                <td> 
     113                    <input type="text" name="question[<!--{$index|escape}-->][name]" size="70" class="box70" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$index].name|escape}-->" <!--{if $ERROR.question[$index].name}--><!--{sfSetErrorStyle}--><!--{/if}-->> 
     114                    <!--{if $ERROR.question[$index].name}--><br /><span class="attention"><!--{$ERROR.question[$index].name}--></span><!--{/if}--> 
     115                </td> 
     116            </tr> 
     117            <tr> 
     118                <td> 
     119                    <span style=background-color:"<!--{$ERROR_COLOR.question[$index].kind}-->"> 
     120                    <!--{html_radios_ex onClick="func_disp(`$index`)" name="question[`$index`][kind]" options="$arrQuestion" selected="`$smarty.post.question[$index].kind`"}--> 
     121                    </span> 
     122                    <!--{if $ERROR.question[$index].kind}--><br><span class="red"><!--{$ERROR.question[$index].kind}--></span><!--{/if}--> 
     123                </td> 
     124            </tr> 
     125            <!--{* ▼回答 *}--> 
     126            <tr id="Q<!--{$index|escape}-->-option"> 
     127                <td> 
     128                    <!--{section name=option loop=4 start=0 max=7}--> 
     129                        <div> 
     130                            <!--{assign var=option_index1 value=$smarty.section.option.index*2}--> 
     131                            <!--{assign var=option_index2 value=$option_index1+1}--> 
     132                            <!--{assign var=num1 value=$option_index1+1}--> 
     133                            <!--{assign var=num2 value=$option_index2+1}--> 
     134                            <!--{assign var=error1 value=$ERROR.question[$index].option[$option_index1]}--> 
     135                            <!--{assign var=error2 value=$ERROR.question[$index].option[$option_index2]}--> 
     136                            <!--{* 回答エラー *}--> 
     137                            <!--{if $error1}--><span class="red"><!--{$error1}--></span><br /><!--{/if}--> 
     138                            <!--{if $error2}--><span class="red"><!--{$error2}--></span><br /><!--{/if}--> 
     139                            <!--{* 回答フォーム *}--> 
     140                            <!--{$num1}--> <input type="text" name="question[<!--{$index|escape}-->][option][<!--{$option_index1|escape}-->]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$index].option[$option_index1]|escape}-->" <!--{if $error1}--><!--{sfSetErrorStyle}--><!--{/if}-->>  
     141                            <!--{$num2}--> <input type="text" name="question[<!--{$index|escape}-->][option][<!--{$option_index2|escape}-->]" size="40" class="box40" maxlength="<!--{$smarty.const.STEXT_LEN}-->" value="<!--{$smarty.post.question[$index].option[$option_index2]|escape}-->" <!--{if $error2}--><!--{sfSetErrorStyle}--><!--{/if}-->> 
     142                        </div> 
     143                    <!--{/section}--> 
     144                </td> 
     145            </tr> 
     146            <!--{* ▲回答 *}--> 
     147        <!--{/section}--> 
     148    </table> 
    134149 
    135   <div class="btn"> 
    136     <button type="submit"><span>登録する</span></button> 
    137     <button type="reset"><span>内容をクリア</span></button> 
    138   </div> 
     150    <div class="btn"> 
     151        <button type="submit"><span>登録する</span></button> 
     152        <button type="reset"><span>内容をクリア</span></button> 
     153    </div> 
    139154</form> 
    140155 
    141156<form name="form2" method="post" action="?"> 
    142   <h2>登録済みアンケート</h2> 
    143   <table class="list center"> 
    144     <tr> 
    145       <th>編集</th> 
    146       <th>登録日</th> 
    147       <th>アンケートタイトル</th> 
    148       <th>ページ参照</th> 
    149       <th>結果取得</th> 
    150       <th>削除</th> 
    151     </tr> 
    152     <!--{section name=data loop=$list_data}--> 
    153     <tr <!--{if $list_data[data].question_id eq $smarty.request.question_id}--><!--{sfSetErrorStyle}--><!--{/if}-->> 
    154       <td class="main"><a href="<!--{$smarty.server.PHP_SELF|escape}-->?question_id=<!--{$list_data[data].question_id}-->">編集</a></td> 
    155       <td><!--{$list_data[data].disp_date}--></td> 
    156       <td class="left"><!--{$list_data[data].question_name|escape}--></td> 
    157       <td><a href="<!--{$smarty.const.SITE_URL}-->inquiry/<!--{$smarty.const.DIR_INDEX_URL}-->?question_id=<!--{$list_data[data].question_id}-->" target="_blank">参照</a></td> 
    158       <td><a href="<!--{$smarty.server.PHP_SELF|escape}-->?mode=csv&amp;question_id=<!--{$list_data[data].question_id}-->">download</a></td> 
    159       <td><a href="<!--{$smarty.server.PHP_SELF|escape}-->?mode=delete&amp;question_id=<!--{$list_data[data].question_id}-->" onClick="return delete_check()">削除</a></td> 
    160     </tr> 
    161     <!--{/section}--> 
    162   </table> 
     157    <h2>登録済みアンケート</h2> 
     158    <table class="list center"> 
     159        <tr> 
     160            <th>編集</th> 
     161            <th>登録日</th> 
     162            <th>アンケートタイトル</th> 
     163            <th>ページ参照</th> 
     164            <th>結果取得</th> 
     165            <th>削除</th> 
     166        </tr> 
     167        <!--{section name=data loop=$list_data}--> 
     168        <tr <!--{if $list_data[data].question_id eq $smarty.request.question_id}--><!--{sfSetErrorStyle}--><!--{/if}-->> 
     169            <td class="main"><a href="<!--{$smarty.server.PHP_SELF|escape}-->?question_id=<!--{$list_data[data].question_id}-->">編集</a></td> 
     170            <td><!--{$list_data[data].disp_date}--></td> 
     171            <td class="left"><!--{$list_data[data].question_name|escape}--></td> 
     172            <td><a href="<!--{$smarty.const.SITE_URL}-->inquiry/<!--{$smarty.const.DIR_INDEX_URL}-->?question_id=<!--{$list_data[data].question_id}-->" target="_blank">参照</a></td> 
     173            <td><a href="<!--{$smarty.server.PHP_SELF|escape}-->?mode=csv&amp;question_id=<!--{$list_data[data].question_id}-->">download</a></td> 
     174            <td><a href="<!--{$smarty.server.PHP_SELF|escape}-->?mode=delete&amp;question_id=<!--{$list_data[data].question_id}-->" onClick="return delete_check()">削除</a></td> 
     175        </tr> 
     176        <!--{/section}--> 
     177    </table> 
    163178</form> 
    164179 
     
    167182<script type="text/javascript"> 
    168183<!-- 
    169   <!--{section name=question loop=$cnt_question}--> 
    170     func_disp(<!--{$smarty.section.question.index}-->); 
    171   <!--{/section}-->   
     184    <!--{section name=question loop=$cnt_question}--> 
     185        func_disp(<!--{$smarty.section.question.index}-->); 
     186    <!--{/section}--> 
    172187//--> 
    173188</script> 
Note: See TracChangeset for help on using the changeset viewer.