{extends file=$smarty.const.SMARTY_LAYOUT_CONTENT_LIST_TABLE_CURRENT_DATA}

{block name="listing-td-idExecution"}
	{$dataRepeats=true}
	{if $prevIdExecution!=$rowFields['idExecution']}
		{$dataRepeats=false}
	{/if}
	<td class="id {if $dataRepeats}dataRepeats{/if}" style="background-color:{pickUniqueColor key=$rowFields['idExecution'] cycles=9};">
		<div>
			{$rowFields['idExecution']}
		</div>
	</td>
	{$prevIdExecution=$rowFields['idExecution']}
{/block}

{block name="listing-td-idRule"}
	{$dataRepeats=true}
	{if $prevIdRule!=$rowFields['idRule']}
		{$dataRepeats=false}
	{/if}
	
	<td class="id {if $dataRepeats}dataRepeats{/if}" style="background-color:{pickUniqueColor key=$rowFields['idRule'] cycles=9};">
		<div>
			{$ruleEnt = \Entity\AutoProcessRule::select($rowFields['idRule'])}
			{autoProcessRuleLabel ref=$rowFields['idRule']}
			<br/>	
			{if $ruleEnt->name}
				({$ruleEnt->name})
			{else}
				({$_LANG['Admin']['AutoProcessRulesLogs']['index']['listCols']['typeList'][$ruleEnt->type]})	
			{/if}
		</div>
	</td>
	{$prevIdRule=$rowFields['idRule']}
{/block}

{block name="listing-td-idTransaction"}
	{$dataRepeats=true}
	{if $prevIdTransaction!=$rowFields['idTransaction']}
		{$dataRepeats=false}
	{/if}
	<td class="id {if $dataRepeats}dataRepeats{/if}" style="background-color:{pickUniqueColor key=$rowFields['idTransaction'] cycles=9};">
		<div>
			<a href="{appUrl module={module} params=["filters[idTransaction]"=>"{$rowFields['idTransaction']}", "filters[logMsg]"=>"", "filters[entityOperation]"=>"", "filters[entityType]"=>"", "filters[idEntity]"=>"", "filters[status]"=>["success", "warning", "error", "info"] ]}" class="link">{$rowFields['idTransaction']}</a>
		</div>
	</td>
	{$prevIdTransaction=$rowFields['idTransaction']}
{/block}

{block name="listing-td-content-type"}
	{if $rowFields['type'] == 'error'}
		<b class='type-error'>{$_LANG['Admin']['AutoProcessRulesLogs']['index']['filters']['statusType'][$rowFields['type']]}</b>
	{elseif $rowFields['type'] == 'warning'}
		<b class='type-warning'>{$_LANG['Admin']['AutoProcessRulesLogs']['index']['filters']['statusType'][$rowFields['type']]}</b>
	{elseif $rowFields['type'] == 'info'}
		<b class='type-info'>{$_LANG['Admin']['AutoProcessRulesLogs']['index']['filters']['statusType'][$rowFields['type']]}</b>
	{elseif $rowFields['type'] == 'success'}
		<b class='type-success'>{$_LANG['Admin']['AutoProcessRulesLogs']['index']['filters']['statusType'][$rowFields['type']]}</b>
	{/if}
{/block}

{block name="listing-td-content-entityType"}
	{$_LANG['Admin']['AutoProcessRulesLogs']['index']['filters']['entityType'][$rowFields['entityType']]}
{/block}

{block name="listing-td-content-idEntity"}
	{if $rowFields['idEntity']}
		{if $rowFields['entityType']=="Customer"}
		   	{customerLabel ref=$rowFields['idEntity']}
		   	
		{elseif $rowFields['entityType']=="Corporate"}
			{corporateLabel ref=$rowFields['idEntity']}
			
		{elseif $rowFields['entityType']=="Supplier"}
			{supplierLabel ref=$rowFields['idEntity']}
			
		{elseif $rowFields['entityType']=="SupplierProduct"}
			{supplierProductLabel ref=$rowFields['idEntity']}
			
		{elseif $rowFields['entityType']=="Invoice"}
			{invoiceLabel ref=$rowFields['idEntity']}
			
		{elseif $rowFields['entityType']=="InvoiceCashing"}
			{invoiceCashingLabel ref=$rowFields['idEntity']}
		
		{elseif $rowFields['entityType']=="SupplierInvoice"}
			{supplierInvoiceLabel ref=$rowFields['idEntity']}

		{elseif $rowFields['entityType']=="SupplierInvoicePayment"}
			{supplierInvoicePaymentLabel ref=$rowFields['idEntity']}
			
		{elseif $rowFields['entityType']=="Order"}
			{orderLabel ref=$rowFields['idEntity']}
			
		{elseif $rowFields['entityType']=="Service"}
			{serviceLabel ref=$rowFields['idEntity']}
			
		{elseif $rowFields['entityType']=="ImportedService"}
			{importedServiceLabel ref=$rowFields['idEntity']}
		
		{elseif $rowFields['entityType']=="ImportedDocument"}
			{importedDocumentLabel ref=$rowFields['idEntity']}
			
		{else}
			#{$rowFields['idEntity']}
		{/if}
	{/if}
	 
{/block}

{block name="listing-td-content-id"}
	{$rowFields['addTime']|dateTimeFormat:'dateWithHMS'} {* TODO: dateTimeFormat - sa aiba un default stabdard *}
{/block}