{** this should extend SMARTY_LAYOUT_CONTENT_LIST_TABLE_CURRENT_DATA, but we need control over all the TD's present in the page ***}

{* TABLE BODY ************************************************************************** *}
{$idTable=uniqid()}
{counter name="listCounter_{$idTable}" start=($listObj->getCurrentPage()*$listObj->getResultsPerPage()) print=false}

{block name=preRender}{/block}
{foreach $listObj->getRecords() as $rowFields}
	{cycle values="odd,even" print=0 assign="listTrClass"}
	<tr data-id="{block name="record-id"}{$rowFields['id']}{/block}" {block name="listing-tr-extraData"}{/block}
		data-serviceName="{$rowFields['name']}"
		class="{$listTrClass}
			{if $listObj->getListingSelection() and $listObj->getListingSelection()->isSelected($rowFields['id'])}
				selected
			{/if}
			{block name="listing-tr-class"}{/block}
		"
	>
		{if $listObj->getColumn_select()}
			{block name="listing-td-SELECT"}
				<td class="select">
					{block name="listing-td-content-SELECT"}
						<span class="checkbox"><var class="tick"></var></span>
					{/block}
				</td>
			{/block}
		{/if}

		{if $listObj->getColumn_counter()}
			{block name="listing-td-COUNTER"}
				<td class="counter">
					{block name="listing-td-content-COUNTER"}
						{counter name="listCounter_{$idTable}"}
					{/block}
				</td>
			{/block}
		{/if}

		<td class="serviceName">{$rowFields['name']}</td>
		{$columns=$listObj->getColumns()->getAllVisible()}
		{foreach $columns as $column}
			{assign var='id' value=$column->getId()}
			{if $id!='name'}
				<td data-productField="{$id}">
					<select class="changeOption">
						<option value="">-</option>
						<option value="mandatory" {if $rowFields[{$id}]=='mandatory'} selected {/if}>{$lang['formFields']['mandatory']}</option>
						<option value="optional" {if $rowFields[{$id}]=='optional'} selected {/if}>{$lang['formFields']['optional']}</option>
					</select>
				</td>
			{/if}
		{/foreach}
		
		{if $listObj->getColumn_options()}
			{block name="listing-td-OPTIONS"}
				<td class="optionsBox sectionRow">
					{block name="listing-td-content-OPTIONS"}
						{$x = $mvcController->populateOptions($filteredModuleOptions, [$rowFields['id']])}
						{$filteredModuleMenuComponent->renderHtml()}
					{/block}
				</td>
			{/block}
		{/if}
	</tr>
{/foreach}