All Downloads are FREE. Search and download functionalities are using the official Maven repository.

META-INF.resources.organization.details.jsp Maven / Gradle / Ivy

There is a newer version: 3.0.6
Show newest version
<%--
/**
 * Copyright (c) 2000-present Liferay, Inc. All rights reserved.
 *
 * This library is free software; you can redistribute it and/or modify it under
 * the terms of the GNU Lesser General Public License as published by the Free
 * Software Foundation; either version 2.1 of the License, or (at your option)
 * any later version.
 *
 * This library is distributed in the hope that it will be useful, but WITHOUT
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
 * details.
 */
--%>

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

<%
long organizationId = ParamUtil.getLong(request, "organizationId");

Organization organization = OrganizationServiceUtil.fetchOrganization(organizationId);

long parentOrganizationId = ParamUtil.getLong(request, "parentOrganizationSearchContainerPrimaryKeys", (organization != null) ? organization.getParentOrganizationId() : OrganizationConstants.DEFAULT_PARENT_ORGANIZATION_ID);

String parentOrganizationName = ParamUtil.getString(request, "parentOrganizationName");

if (parentOrganizationId <= 0) {
	parentOrganizationId = OrganizationConstants.DEFAULT_PARENT_ORGANIZATION_ID;

	if (organization != null) {
		parentOrganizationId = organization.getParentOrganizationId();
	}
}

String type = BeanParamUtil.getString(organization, request, "type", PropsValues.ORGANIZATIONS_TYPES[0]);
long regionId = BeanParamUtil.getLong(organization, request, "regionId");
long countryId = BeanParamUtil.getLong(organization, request, "countryId");

long groupId = 0;

if (organization != null) {
	groupId = organization.getGroupId();
}

User selUser = (User)request.getAttribute("user.selUser");
%>


	






<% for (String curType : PropsValues.ORGANIZATIONS_TYPES) { %> <% } %>
" id="countryDiv">
<% long logoId = organization.getLogoId(); %>
<% Organization parentOrganization = null; if ((organization == null) && (parentOrganizationId == OrganizationConstants.DEFAULT_PARENT_ORGANIZATION_ID) && !permissionChecker.isCompanyAdmin()) { List manageableOrganizations = new ArrayList(); for (Organization curOrganization : user.getOrganizations()) { if (OrganizationPermissionUtil.contains(permissionChecker, curOrganization, ActionKeys.MANAGE_SUBORGANIZATIONS)) { manageableOrganizations.add(curOrganization); } } if (manageableOrganizations.size() == 1) { parentOrganizationId = manageableOrganizations.get(0).getOrganizationId(); } } if (parentOrganizationId != OrganizationConstants.DEFAULT_PARENT_ORGANIZATION_ID) { try { parentOrganization = OrganizationLocalServiceUtil.getOrganization(parentOrganizationId); parentOrganizationName = parentOrganization.getName(); } catch (NoSuchOrganizationException nsoe) { } } List parentOrganizations = new ArrayList(); if (parentOrganization != null) { parentOrganizations.add(parentOrganization); } %>

<%= removeOrganizationIcon %> new Liferay.DynamicSelect( [ { select: 'countryId', selectData: Liferay.Address.getCountries, selectDesc: 'nameCurrentValue', selectId: 'countryId', selectSort: '<%= true %>', selectVal: '<%= countryId %>' }, { select: 'regionId', selectData: Liferay.Address.getRegions, selectDesc: 'name', selectId: 'regionId', selectVal: '<%= regionId %>' } ] ); var searchContainer = Liferay.SearchContainer.get('parentOrganizationSearchContainer'); searchContainer.get('contentBox').delegate( 'click', function(event) { var link = event.currentTarget; var tr = link.ancestor('tr'); searchContainer.deleteRow(tr, link.getAttribute('data-rowId')); }, '.modify-link' ); var selectOrganizationLink = A.one('#selectOrganizationLink'); if (selectOrganizationLink) { selectOrganizationLink.on( 'click', function(event) { Liferay.Util.selectEntity( { dialog: { constrain: true, modal: true }, id: 'selectOrganization', title: '', uri: '' }, function(event) { var rowColumns = []; var href = '&organizationId=' + event.organizationid; rowColumns.push(createURL(href, event.name)); rowColumns.push(createURL(href, event.type)); rowColumns.push('<%= UnicodeFormatter.toString(removeOrganizationIcon) %>'); searchContainer.deleteRow(1, searchContainer.getData()); searchContainer.addRow(rowColumns, event.organizationid); searchContainer.updateDataStore(event.organizationid); } ); } ); } $('#type').on( 'change', function(event) { <% for (String curType : PropsValues.ORGANIZATIONS_TYPES) { %> if ($(event.currentTarget).val() == '<%= curType %>') { $('#countryDiv').toggleClass('hide', !<%= GetterUtil.getBoolean(PropsUtil.get(PropsKeys.ORGANIZATIONS_COUNTRY_ENABLED, new Filter(String.valueOf(curType)))) %>); } <% } %> } );




© 2015 - 2025 Weber Informatics LLC | Privacy Policy