<p class="formstyle {if isset($collapse)}{$collapse}{/if} {if isset($row_no)}row_no{$row_no}{/if}"
    style="{if isset($hide) && $hide} display:none;{/if} {if isset($color)}background-color:{$color};{/if} {if isset($pstyle) && $pstyle}{$pstyle}{/if}">{*
    *}{include file="r/parts/pre_field.tpl"}{*
    *}<select name="{$name}{if isset($multiple)}[]{/if}" id="{if isset($rep_name_id)}{$rep_name_id}{/if}{$name}"
            class="{if isset($class)}{$class}{/if} {if isset($readonly) && $readonly}ignoredisabled{/if} {if isset($within_filter) && $within_filter}within_filter{/if}"
            style="{if isset($deactivate_possible) && $deactivate}display:none;{/if}
	    {if isset($style)}{$style}{/if}"            
	    {if isset($readonly) && $readonly}disabled="disabled"{/if}
	    {if isset($filter_extra)}{$filter_extra}{/if}
	    {if isset($multiple)}multiple="multiple" size="{$multiple}"{/if}
            {if isset($class) && stripos($class, 'required')!==false} required{/if}
            {if isset($default)} data-filter_default="{if is_array($default)}{$default.0}{else}{$default}{/if}"{/if}
            {if isset($search_function_name)} data-search_function_name="{$search_function_name}"{/if}
	>
	{if !isset($noempty) || !$noempty}<option value="">&nbsp;</option>{/if}
	{if isset($list)}
	    {if isset($group_by_list)}
		{foreach item=group_item from=$group_by_list}
		    <optgroup title="{$group_item|escape:'html'}" label="{$group_item|truncate:100|escape:'html'}">
			{foreach item=item from=$list}
                            {if !isset($item) || empty($item)}{continue}{/if}
			    {if $item->$group_by eq $group_item}
				<option value="{$item->$id}" {if isset($smarty.post.$name) && $smarty.post.$name eq $item->$id}selected="selected"{elseif isset($default) && $default eq $item->$id}selected="selected"{/if}
				    title="{$item->$text|escape:'html'}" {if isset($mapclass) && isset($item->$mapclass)}class="{$item->$mapclass}"{/if} 
                                    {if isset($mapdata) && isset($item->$mapdata)}data-extra="{$item->$mapdata|escape:'html'}"{/if} 
                                    {if isset($item->object_is_editable) && $item->object_is_editable === false} disabled="disabled" {/if} >{$item->$text|truncate:100|escape:'html'|replace:" ":"&nbsp;"}&nbsp;</option>
			    {/if}
			{/foreach}
		    </optgroup>
		{/foreach}
	    {else}
		{foreach item=item from=$list}
                    {if !isset($item) || empty($item)}{continue}{/if}
		    <option value="{$item->$id}" {if isset($smarty.post.$name) && $smarty.post.$name eq $item->$id}selected="selected"{elseif isset($default)}
                        {if !is_array($default) && $default eq $item->$id}selected="selected"{/if}
                        {if is_array($default) && in_array($item->$id, $default)}selected="selected"{/if}
                    {/if}
                        {if isset($item->object_is_editable) && $item->object_is_editable === false} disabled="disabled" {/if}
			title="{*
                            *}{if $item->$text instanceof UsDate}{*
                                *}{$item->$text->us_date()}{*
                            *}{else}{*
                                *}{$item->$text|escape:'html'|replace:" ":"&nbsp;"}{*
                            *}{/if}"
                            {if isset($mapdata) && isset($item->$mapdata)}data-extra="{$item->$mapdata|escape:'html'}"{/if}
                            {if isset($mapclass) && isset($item->$mapclass)}class="{$item->$mapclass}"{/if} >
                            {if $item->$text instanceof UsDate}
                                {$item->$text->us_date()}
                            {else}
                                {$item->$text|truncate:110|escape:'html'|replace:" ":"&nbsp;"}
                            {/if}                            
                          &nbsp;
                    </option>
		{/foreach}
	    {/if}
	{/if}
    </select>{*
    *}{include file="r/parts/past_field.tpl"}
</p>