<inp2:m_include t="incs/header"/>

<inp2:m_RenderElement name="combined_header" prefix="ord.search" section="in-commerce:orders" grid="Search" title_preset="orders_search" pagination="1" tabs="in-commerce/orders/orders_list_tabs"/>

<!-- ToolBar -->
<table class="toolbar" height="30" cellspacing="0" cellpadding="0" width="100%" border="0">
<tbody>
	<tr>
  		<td>
	  		<script type="text/javascript">
	  			//do not rename - this function is used in default grid for double click!
	  			function edit()
	  			{
	  				set_hidden_field('remove_specials[ord.search]',1);
	  				std_edit_item('ord.search', 'in-commerce/orders/orders_edit');
	  			}

	  			var a_toolbar = new ToolBar();

  				a_toolbar.AddButton( new ToolBarButton('in-commerce:goto_order', '<inp2:m_phrase label="la_ToolTip_GoToOrder" escape="1"/>',
						function() {
							submit_event('ord.search','OnGoToOrder');
						} ) );

				a_toolbar.AddButton( new ToolBarButton('edit', '<inp2:m_phrase label="la_ToolTip_Edit" escape="1"/>', edit) );

				a_toolbar.AddButton( new ToolBarSeparator('sep3') );

 				a_toolbar.AddButton( new ToolBarButton('export', '<inp2:m_phrase label="la_ToolTip_Export" escape="1"/>', function() {
				 			set_hidden_field('export_finish_t', 'in-commerce/orders/export/export_finish');
				 			set_hidden_field('export_progress_t', 'in-commerce/orders/export/export_progress');
							open_popup('ord.search', 'OnExport', 'in-commerce/orders/export/export');
						}
				 	) );


				 a_toolbar.AddButton( new ToolBarButton('print', '<inp2:m_phrase label="la_ToolTip_Print" escape="1"/>', function() {
							print_orders('ord.search', 'in-commerce/orders/orders_print');
						}
				 ) );

				 a_toolbar.AddButton( new ToolBarButton('view', '<inp2:m_phrase label="la_ToolTip_View" escape="1"/>', function() {
							show_viewmenu(a_toolbar,'view');
						}
				) );

				a_toolbar.Render();
			</script>
		</td>

		<inp2:m_RenderElement name="search_main_toolbar" prefix="ord.search" grid="Search"/>
	</tr>
</tbody>
</table>

<inp2:m_RenderElement name="grid" PrefixSpecial="ord.search" IdField="OrderId" grid="Search" menu_filters="yes"/>

<script type="text/javascript">
	Grids['ord.search'].SetDependantToolbarButtons( new Array('edit','delete','print','goto_order','archive') );

	function processUserSelector($field, $selector) {
		var $user_id = parseInt( $selector.Grids['u'].GetSelected() );
		var $field_mask = '<inp2:ord.search_SearchInputName field="#FIELD_NAME#" filter_type="like" grid="Search"/>';

		document.getElementById( $field_mask.replace('#FIELD_NAME#', $field) ).value = $selector.$user_logins[ $user_id ];
	}
</script>
<inp2:m_include t="incs/footer"/>
<script type="text/javascript">
	set_hidden_field('order_type','search');
</script>