<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * The contents of this file are subject to the terms of the Liferay Enterprise
 * Subscription License ("License"). You may not use this file except in
 * compliance with the License. You can obtain a copy of the License by
 * contacting Liferay, Inc. See the License for the specific language governing
 * permissions and limitations under the License, including but not limited to
 * distribution rights of the Software.
 *
 *
 *
 */
--%>

<%@ include file="/init.jsp" %>

<%
AuditDisplayContext auditDisplayContext = (AuditDisplayContext)request.getAttribute(AuditDisplayContext.class.getName());

SearchContainer<?> searchContainer = (SearchContainer<?>)request.getAttribute("liferay-ui:search:searchContainer");
%>

<liferay-ui:search-toggle
	buttonLabel="search"
	displayTerms="<%= searchContainer.getDisplayTerms() %>"
	id="toggle_id_audit_event_search"
>
	<aui:input label="user-id" name="userId" value="<%= (auditDisplayContext.getUserId() != 0) ? String.valueOf(auditDisplayContext.getUserId()) : StringPool.BLANK %>" />

	<aui:input label="user-name" name="userName" value="<%= auditDisplayContext.getUserName() %>" />

	<c:if test='<%= FeatureFlagManagerUtil.isEnabled("LPS-177194") %>'>
		<aui:input label="group-id" name="groupId" value="<%= (auditDisplayContext.getGroupId() != 0) ? String.valueOf(auditDisplayContext.getGroupId()) : StringPool.BLANK %>" />
	</c:if>

	<aui:input label="resource-id" name="classPK" value="<%= auditDisplayContext.getClassPK() %>" />

	<aui:input label="class-name" name="className" value="<%= auditDisplayContext.getClassName() %>" />

	<aui:input label="resource-action" name="eventType" value="<%= auditDisplayContext.getEventType() %>" />

	<aui:input label="client-ip" name="clientIP" value="<%= auditDisplayContext.getClientIP() %>" />

	<aui:input label="client-host" name="clientHost" value="<%= auditDisplayContext.getClientHost() %>" />

	<aui:input label="server-name" name="serverName" value="<%= auditDisplayContext.getServerName() %>" />

	<aui:input label="server-port" name="serverPort" value="<%= (auditDisplayContext.getServerPort() != 0) ? String.valueOf(auditDisplayContext.getServerPort()) : StringPool.BLANK %>" />

	<aui:field-wrapper label="start-date">
		<liferay-ui:input-date
			dayParam="startDateDay"
			dayValue="<%= auditDisplayContext.getStartDateDay() %>"
			monthParam="startDateMonth"
			monthValue="<%= auditDisplayContext.getStartDateMonth() %>"
			name="startDate"
			useNamespace="<%= false %>"
			yearParam="startDateYear"
			yearValue="<%= auditDisplayContext.getStartDateYear() %>"
		/>

		<liferay-ui:input-time
			amPmParam="startDateAmPm"
			amPmValue="<%= auditDisplayContext.getStartDateAmPm() %>"
			hourParam="startDateHour"
			hourValue="<%= auditDisplayContext.getStartDateHour() %>"
			minuteParam="startDateMinute"
			minuteValue="<%= auditDisplayContext.getStartDateMinute() %>"
			name="startDateTime"
			useNamespace="<%= false %>"
		/>
	</aui:field-wrapper>

	<aui:field-wrapper label="end-date">
		<liferay-ui:input-date
			dayParam="endDateDay"
			dayValue="<%= auditDisplayContext.getEndDateDay() %>"
			monthParam="endDateMonth"
			monthValue="<%= auditDisplayContext.getEndDateMonth() %>"
			name="endDate"
			useNamespace="<%= false %>"
			yearParam="endDateYear"
			yearValue="<%= auditDisplayContext.getEndDateYear() %>"
		/>

		<liferay-ui:input-time
			amPmParam="endDateAmPm"
			amPmValue="<%= auditDisplayContext.getEndDateAmPm() %>"
			hourParam="endDateHour"
			hourValue="<%= auditDisplayContext.getEndDateHour() %>"
			minuteParam="endDateMinute"
			minuteValue="<%= auditDisplayContext.getEndDateMinute() %>"
			name="endDateTime"
			useNamespace="<%= false %>"
		/>
	</aui:field-wrapper>
</liferay-ui:search-toggle>