📄 viewrelationships.jsp
字号:
<%--
* Copyright (c) 2002-2003 The Open For Business Project - www.ofbiz.org
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
* to deal in the Software without restriction, including without limitation
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
* and/or sell copies of the Software, and to permit persons to whom the
* Software is furnished to do so, subject to the following conditions:
*
* The above copyright notice and this permission notice shall be included
* in all copies or substantial portions of the Software.
*
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
* OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
* MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
* IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
* CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT
* OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR
* THE USE OR OTHER DEALINGS IN THE SOFTWARE.
*
*@author David E. Jones
*@author Andy Zeneski
*@version $Revision: 1.6 $
*@since 1.0
--%>
<%@ taglib uri="ofbizTags" prefix="ofbiz" %>
<%@ page import="java.util.*" %>
<%@ page import="org.ofbiz.base.util.*, org.ofbiz.content.webapp.pseudotag.*" %>
<%@ page import="org.ofbiz.entity.*, org.ofbiz.entity.util.*, org.ofbiz.entity.condition.*" %>
<%@ page import="org.ofbiz.party.contact.*, org.ofbiz.party.party.*" %>
<%@ page import="org.ofbiz.accounting.payment.*" %>
<jsp:useBean id="delegator" type="org.ofbiz.entity.GenericDelegator" scope="request" />
<jsp:useBean id="security" type="org.ofbiz.security.Security" scope="request" />
<%if(security.hasEntityPermission("PARTYMGR", "_VIEW", session)) {%>
<%
String partyId = request.getParameter("party_id");
if (partyId == null) partyId = request.getParameter("partyId");
if (partyId == null) partyId = (String) request.getAttribute("partyId");
Collection roleTypes = delegator.findAll("RoleType", UtilMisc.toList("description", "roleTypeId"));
if (roleTypes != null) pageContext.setAttribute("roleTypes", roleTypes);
Collection relateTypes = delegator.findAll("PartyRelationshipType", UtilMisc.toList("description", "partyRelationshipTypeId"));
if (relateTypes != null) pageContext.setAttribute("relateTypes", relateTypes);
Collection partyRelationships = delegator.findByOr("PartyRelationship", UtilMisc.toList(new EntityExpr("partyIdTo", EntityOperator.EQUALS, partyId), new EntityExpr("partyIdFrom", EntityOperator.EQUALS, partyId)));
if (partyRelationships != null && partyRelationships.size() > 0) pageContext.setAttribute("partyRelationships", partyRelationships);
PartyWorker.getPartyOtherValues(pageContext, partyId, "party", "lookupPerson", "lookupGroup");
%>
<%EntityField entityField = new EntityField(pageContext);%>
<%InputValue inputValue = new InputValue(pageContext);%>
<script language='JavaScript'>
function setNowFromDate(formName) { eval('document.' + formName + '.fromDate.value="<%=UtilDateTime.nowTimestamp().toString()%>"'); }
</script>
<%-- Main Heading --%>
<table width='100%' cellpadding='0' cellspacing='0' border='0'>
<tr>
<td align='left'>
<div class="head1">The Profile of
<ofbiz:if name="lookupPerson">
<%entityField.run("lookupPerson", "personalTitle");%>
<%entityField.run("lookupPerson", "firstName");%>
<%entityField.run("lookupPerson", "middleName");%>
<%entityField.run("lookupPerson", "lastName");%>
<%entityField.run("lookupPerson", "suffix");%>
</ofbiz:if>
<ofbiz:unless name="lookupPerson">
<ofbiz:if name="lookupGroup">
<%entityField.run("lookupGroup", "groupName");%>
</ofbiz:if>
<ofbiz:unless name="lookupGroup">"New User"</ofbiz:unless>
</ofbiz:unless>
</div>
</td>
<td align='right'>
<div class='tabContainer'>
<a href="<ofbiz:url>/viewprofile?partyId=<%=partyId%></ofbiz:url>" class="tabButton">Profile</a>
<a href="<ofbiz:url>/viewvendor?partyId=<%=partyId%></ofbiz:url>" class="tabButton">Vendor</a>
<a href="<ofbiz:url>/viewroles?partyId=<%=partyId%></ofbiz:url>" class="tabButton">Role(s)</a>
<a href="<ofbiz:url>/viewrelationships?partyId=<%=partyId%></ofbiz:url>" class="tabButtonSelected">Relationships</a>
<a href="<ofbiz:url>/viewcommunications?partyId=<%=partyId%></ofbiz:url>" class="tabButton">Communications</a>
</div>
</td>
</tr>
</table>
<%-- Party Relationships --%>
<br>
<TABLE border=0 width='100%' cellspacing='0' cellpadding='0' class='boxoutside'>
<TR>
<TD width='100%'>
<table width='100%' border='0' cellspacing='0' cellpadding='0' class='boxtop'>
<tr>
<td valign="middle" align="left">
<div class="boxhead"> Party Relationships</div>
</td>
</tr>
</table>
</TD>
</form>
</TR>
<TR>
<TD width='100%'>
<table width='100%' border='0' cellspacing='0' cellpadding='0' class='boxbottom'>
<tr>
<td>
<ofbiz:if name="partyRelationships">
<table width="100%" border="1" cellpadding="1" cellspacing="0">
<tr>
<td><div class="tabletext"><b> Description</b></div></td>
<td><div class="tabletext"><b> From Date</b></div></td>
<%if(security.hasEntityPermission("PARTYMGR", "_DELETE", session)) {%>
<td> </td>
<%}%>
</tr>
<ofbiz:iterator name="partyRelationship" property="partyRelationships">
<%GenericValue partyRelationshipType = partyRelationship.getRelatedOneCache("PartyRelationshipType");%>
<%if (partyRelationshipType != null) pageContext.setAttribute("partyRelationshipType", partyRelationshipType);%>
<%GenericValue roleTypeTo = partyRelationship.getRelatedOneCache("ToRoleType");%>
<%if (roleTypeTo != null) pageContext.setAttribute("roleTypeTo", roleTypeTo);%>
<%GenericValue roleTypeFrom = partyRelationship.getRelatedOneCache("FromRoleType");%>
<%if (roleTypeFrom != null) pageContext.setAttribute("roleTypeFrom", roleTypeFrom);%>
<tr>
<td><div class="tabletext">
party <b><%entityField.run("partyRelationship", "partyIdTo");%></b>
<%if (!"_NA_".equals(partyRelationship.getString("roleTypeIdTo"))) {%>
in role <b><%entityField.run("roleTypeTo", "description");%></b>
<%}%>
is a <b><%entityField.run("partyRelationshipType", "partyRelationshipName");%></b>
of party <b><%entityField.run("partyRelationship", "partyIdFrom");%></b>
<%if (!"_NA_".equals(partyRelationship.getString("roleTypeIdFrom"))) {%>
in role <b><%entityField.run("roleTypeFrom", "description");%></b>
<%}%>
</div></td>
<td><div class="tabletext"> <%inputValue.run("fromDate", "partyRelationship");%></div></td>
<%if(security.hasEntityPermission("PARTYMGR", "_DELETE", session)) {%>
<td align="right">
<a href='<ofbiz:url>/deletePartyRelationship?partyIdTo=<%inputValue.run("partyIdTo", "partyRelationship");%>&roleTypeIdTo=<%inputValue.run("roleTypeIdTo", "partyRelationship");%>&roleTypeIdFrom=<%inputValue.run("roleTypeIdFrom", "partyRelationship");%>&partyIdFrom=<%inputValue.run("partyIdFrom", "partyRelationship");%>&fromDate=<%=UtilFormatOut.encodeQueryValue(partyRelationship.getTimestamp("fromDate").toString())%><%if (partyId != null) {%>&partyId=<%=partyId%><%}%></ofbiz:url>' class="buttontext">[Remove]</a>
</td>
<%}%>
</tr>
<%if(security.hasEntityPermission("PARTYMGR", "_UPDATE", session)) {%>
<tr>
<td colspan='3' align='right'>
<form method="post" action="<ofbiz:url>/updatePartyRelationship</ofbiz:url>">
<input type="hidden" name="partyId" value="<%=partyId%>"/>
<input type="hidden" <ofbiz:inputvalue entityAttr='partyRelationship' field='partyIdFrom' fullattrs="true"/>/>
<input type="hidden" <ofbiz:inputvalue entityAttr='partyRelationship' field='roleTypeIdFrom' fullattrs="true"/>/>
<input type="hidden" <ofbiz:inputvalue entityAttr='partyRelationship' field='partyIdTo' fullattrs="true"/>/>
<input type="hidden" <ofbiz:inputvalue entityAttr='partyRelationship' field='roleTypeIdTo' fullattrs="true"/>/>
<input type="hidden" <ofbiz:inputvalue entityAttr='partyRelationship' field='fromDate' fullattrs="true"/>/>
<span class='tabletext'><b>Thru Date: </b></span><input type="text" size="24" class="inputBox" <ofbiz:inputvalue entityAttr='partyRelationship' field='thruDate' fullattrs="true"/>/>
<%-- <%entityField.run("partyRelationship", "statusId");%>--%>
<span class='tabletext'><b>Comments: </b></span><input type="text" size="50" class="inputBox" <ofbiz:inputvalue entityAttr='partyRelationship' field='comments' fullattrs="true"/>/>
<input type="submit" value="Update" style="font-size: x-small;"/>
</form>
</td>
</tr>
<%}%>
</ofbiz:iterator>
</table>
</ofbiz:if>
<ofbiz:unless name="partyRelationships">
<div class="tabletext">No relationships found.</div>
</ofbiz:unless>
</td>
</tr>
</table>
</TD>
</TR>
<%if(security.hasEntityPermission("PARTYMGR", "_UPDATE", session)) {%>
<TR>
<TD width="100%"><hr class="sepbar"></TD>
</TR>
<TR>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -