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

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

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

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