Search code examples
phphtmltestlink

PHP - replacing select by radio button


Use TestLink 1.9.14 for managing the testing and implementation of the page there is the implementation status of select , I want to change the select by a radio button , as pictured below. I do not know which or what files you need to change to effect this change .

the system is in php and has TPL files , of which I do not Fawn knowledge , I am afraid to move and end up damaging some functionality.

Testlink

<div class="resultBox">
          {if $args_save_type == 'bulk'}
            {foreach key=verbose_status item=locale_status from=$tlCfg->results.status_label_for_exec_ui}
                              <input type="radio" {$args_input_enable_mgmt} name="{$radio_id_prefix}[{$args_tcversion_id}]" 
                              id="{$radio_id_prefix}_{$args_tcversion_id}_{$ResultsStatusCode.$verbose_status}" 
                                value="{$ResultsStatusCode.$verbose_status}"
                                            onclick="javascript:set_combo_group('execSetResults','status_','{$ResultsStatusCode.$verbose_status}');"
                                {if $verbose_status eq $tlCfg->results.default_status}
                                    checked="checked" 
                                {/if} /> &nbsp;{lang_get s=$locale_status}<br />
                      {/foreach}
          {else}
            {$args_labels.test_exec_result}&nbsp;
            <select name="statusSingle[{$tcversion_id}]" id="statusSingle_{$tcversion_id}">
            {html_options options=$gui->execStatusValues}
            </select>
          {/if}
          </div>

Solution

  • It looks like you want to change a select option box to a radio list.

    old code would be:

    <select>
    <option value="Nao Exectute">Nao Exectute<option>
    <option value="Passou">Passou<option>
    <option value="Others">others<option>
    </select>
    

    New code would be:

    <input type="radio" name="radioList" id="radioList01" value="Nao Exectute"><label for="radioList01">Nao Exectute</label><br />
    <input type="radio" name="radioList" id="radioList02" value="Passou"><label for="radioList02">Passou</label><br />
    <input type="radio" name="radioList" id="radioList03" value="Others"><label for="radioList03">Others</label><br />
    

    That should be enough to get you started.