{extends file='ModulesAbstract/Dashboard/View/_tpl/index.tpl'}

{block name="template-head" append}
	{$CSS->load("Modules/Partners/Customers/Dashboard/View/_css/index.css")}
{/block}

{block name="subsection"}
	<div class="chooseCustomer">
		<form id="form" class="form" method="post" action="">
			<table>
				<tbody>
					<tr>
						<td class="inputElement">
							{$value = []}
							{$value['id'] = $idEntity}
							{input type='\App\Form\Input\Autocomplete_Customer' name="customer" value=$value assign=fld_customer}
							{$fld_customer->setStyle('buttons', false) assign=fld_customer}
							{$fld_customer->onPostSelect('MVC.dashboardCustomer.changeCustomer($F(this.element.code));') assign=fld_customer}
							{$fld_customer->render()}
						</td>
					</tr>
				</tbody>
			</table>
		</form>
	</div>
{/block}

{block name="js" append}
	<script type="text/javascript">
		MVC.dashboardCustomer = {};
		MVC.dashboardCustomer.changeCustomer = function(idCustomer) {
			window.location = MVC.appUrl(MVC.CURRENT_MODULE, 'index', { 'idEntity' : idCustomer});
		};
	</script>
{/block}