META-INF.resources.edit_cp_definition_link.jsp Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of com.liferay.commerce.product.definitions.web
Show all versions of com.liferay.commerce.product.definitions.web
Liferay Commerce Product Definitions Web
The newest version!
<%--
/**
* SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com
* SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06
*/
--%>
<%@ include file="/init.jsp" %>
<%
CPDefinitionLinkDisplayContext cpDefinitionLinkDisplayContext = (CPDefinitionLinkDisplayContext)request.getAttribute(WebKeys.PORTLET_DISPLAY_CONTEXT);
CPDefinitionLink cpDefinitionLink = cpDefinitionLinkDisplayContext.getCPDefinitionLink();
long cpDefinitionLinkId = cpDefinitionLinkDisplayContext.getCPDefinitionLinkId();
CPDefinition cpDefinition = cpDefinitionLink.getCPDefinition();
boolean neverExpire = ParamUtil.getBoolean(request, "neverExpire", true);
if (cpDefinitionLink.getExpirationDate() != null) {
neverExpire = false;
}
%>
<%
boolean pending = false;
if (cpDefinitionLink != null) {
pending = cpDefinitionLink.isPending();
}
%>
<%
String saveButtonLabel = "save";
if (cpDefinitionLink.isDraft() || cpDefinitionLink.isApproved() || cpDefinitionLink.isExpired() || cpDefinitionLink.isScheduled()) {
saveButtonLabel = "save-as-draft";
}
String publishButtonLabel = "publish";
if (cpDefinitionLinkDisplayContext.hasWorkflowDefinitionLink()) {
publishButtonLabel = "submit-for-workflow";
}
%>
var publishButton = A.one('# publishButton');
publishButton.on('click', () => {
var workflowActionInput = A.one('# workflowAction');
if (workflowActionInput) {
workflowActionInput.val('<%= WorkflowConstants.ACTION_PUBLISH %>');
}
});