Author: hansbak
Date: Fri Oct 3 03:16:58 2008 New Revision: 701341 URL: http://svn.apache.org/viewvc?rev=701341&view=rev Log: show partystatus and externalId on partyscreens, and popups only show parties which have the status party_enabled Added: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy (with props) Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml ofbiz/trunk/applications/party/servicedef/services.xml ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java ofbiz/trunk/applications/party/webapp/partymgr/lookup/LookupForms.xml ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml Modified: ofbiz/trunk/applications/party/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/entitydef/entitymodel.xml?rev=701341&r1=701340&r2=701341&view=diff ============================================================================== --- ofbiz/trunk/applications/party/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/party/entitydef/entitymodel.xml Fri Oct 3 03:16:58 2008 @@ -1595,6 +1595,7 @@ <alias entity-alias="PTY" name="partyId"/> <alias entity-alias="PTY" name="partyTypeId"/> <alias entity-alias="PTY" name="createdDate"/> + <alias entity-alias="PTY" name="statusId"/> <alias entity-alias="ULN" name="userLoginId"/> <alias entity-alias="ULN" name="currentPassword"/> <alias entity-alias="ULN" name="passwordHint"/> @@ -1660,6 +1661,7 @@ <alias entity-alias="PTY" name="partyId"/> <alias entity-alias="PTY" name="partyTypeId"/> <alias entity-alias="PTY" name="createdDate"/> + <alias entity-alias="PTY" name="statusId"/> <alias entity-alias="PTYGRP" name="groupName"/> <alias entity-alias="ULN" name="userLoginId"/> <alias entity-alias="ULN" name="currentPassword"/> @@ -1970,6 +1972,7 @@ <member-entity entity-alias="PTYCM" entity-name="ContactMech"/> <alias entity-alias="PTY" name="partyId"/> <alias entity-alias="PTY" name="partyTypeId"/> + <alias entity-alias="PTY" name="statusId"/> <alias entity-alias="PER" name="firstName"/> <alias entity-alias="PER" name="middleName"/> <alias entity-alias="PER" name="lastName"/> @@ -2026,6 +2029,7 @@ <alias entity-alias="PTY" name="partyId"/> <alias entity-alias="PTY" name="partyTypeId"/> <alias entity-alias="PTY" name="description"/> + <alias entity-alias="PTY" name="statusId"/> <alias entity-alias="PER" name="firstName"/> <alias entity-alias="PER" name="middleName"/> <alias entity-alias="PER" name="lastName"/> Modified: ofbiz/trunk/applications/party/servicedef/services.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/servicedef/services.xml?rev=701341&r1=701340&r2=701341&view=diff ============================================================================== --- ofbiz/trunk/applications/party/servicedef/services.xml (original) +++ ofbiz/trunk/applications/party/servicedef/services.xml Fri Oct 3 03:16:58 2008 @@ -73,9 +73,10 @@ <description>Create a Person</description> <auto-attributes mode="INOUT" include="pk" optional="true"/> <auto-attributes mode="IN" include="nonpk" optional="true"/> - <attribute name="statusId" type="String" mode="IN" optional="true"/> <attribute name="preferredCurrencyUomId" type="String" mode="IN" optional="true"/> <attribute name="description" type="String" mode="IN" optional="true"/> + <attribute name="externalId" type="String" mode="IN" optional="true"/> + <attribute name="statusId" type="String" mode="IN" optional="true"/> <override name="firstName" optional="false"/> <override name="lastName" optional="false"/> </service> @@ -95,6 +96,8 @@ <auto-attributes mode="IN" include="nonpk" optional="true"/> <attribute name="preferredCurrencyUomId" type="String" mode="IN" optional="true"/> <attribute name="description" type="String" mode="IN" optional="true"/> + <attribute name="externalId" type="String" mode="IN" optional="true"/> + <attribute name="statusId" type="String" mode="IN" optional="true"/> <override name="firstName" optional="false"/> <override name="lastName" optional="false"/> </service> @@ -106,6 +109,8 @@ <attribute name="partyTypeId" type="String" mode="IN" optional="true"/> <attribute name="description" type="String" mode="IN" optional="true"/> <attribute name="preferredCurrencyUomId" type="String" mode="IN" optional="true"/> + <attribute name="externalId" type="String" mode="IN" optional="true"/> + <attribute name="statusId" type="String" mode="IN" optional="true"/> <override name="groupName" optional="false"/> </service> <service name="updatePartyGroup" engine="java" default-entity-name="PartyGroup" @@ -117,6 +122,8 @@ <attribute name="description" type="String" mode="IN" optional="true"/> <attribute name="partyTypeId" type="String" mode="IN" optional="true"/> <attribute name="preferredCurrencyUomId" type="String" mode="IN" optional="true"/> + <attribute name="externalId" type="String" mode="IN" optional="true"/> + <attribute name="statusId" type="String" mode="IN" optional="true"/> </service> <service name="savePartyNameChange" engine="simple" Modified: ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java?rev=701341&r1=701340&r2=701341&view=diff ============================================================================== --- ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java (original) +++ ofbiz/trunk/applications/party/src/org/ofbiz/party/party/PartyServices.java Fri Oct 3 03:16:58 2008 @@ -150,6 +150,10 @@ if (!UtilValidate.isEmpty(preferredCurrencyUomId)) { newPartyMap.put("preferredCurrencyUomId", preferredCurrencyUomId); } + String externalId = (String) context.get("externalId"); + if (!UtilValidate.isEmpty(externalId)) { + newPartyMap.put("externalId", externalId); + } if (userLogin != null) { newPartyMap.put("createdByUserLogin", userLogin.get("userLoginId")); newPartyMap.put("lastModifiedByUserLogin", userLogin.get("userLoginId")); Added: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy?rev=701341&view=auto ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy (added) +++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy Fri Oct 3 03:16:58 2008 @@ -0,0 +1,62 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you under the Apache License, Version 2.0 (the + * "License"); you may not use this file except in compliance + * with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, + * software distributed under the License is distributed on an + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY + * KIND, either express or implied. See the License for the + * specific language governing permissions and limitations + * under the License. + */ + +import org.ofbiz.base.util.*; +import org.ofbiz.entity.condition.*; + +if (context.noConditionFind == null) { + context.noConditionFind = parameters.noConditionFind; +} +if (context.noConditionFind == null) { + context.noConditionFind = UtilProperties.getPropertyValue("widget", "widget.defaultNoConditionFind"); +} +if (context.filterByDate == null) { + context.filterByDate = parameters.filterByDate; +} +prepareResult = dispatcher.runSync("prepareFind", [entityName : context.entityName, + orderBy : context.orderBy, + inputFields : parameters, + filterByDate : context.filterByDate, + filterByDateValue : context.filterByDateValue, + userLogin : context.userLogin] ); + +exprList = [EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, "PARTY_DISABLED") + , EntityCondition.makeCondition("statusId", EntityOperator.NOT_EQUAL, null)]; +CondList = EntityCondition.makeCondition(exprList, EntityOperator.AND); +CondList1 = EntityCondition.makeCondition("statusId", EntityOperator.EQUALS, null); +statusPartyDisable = EntityCondition.makeCondition([CondList1, CondList], EntityOperator.OR); +entityConditionList = null; +if (prepareResult.entityConditionList != null) { + ConditionList = [ prepareResult.entityConditionList, statusPartyDisable ]; + entityConditionList = EntityCondition.makeCondition(ConditionList); +} else if (context.noConditionFind == "Y") { + entityConditionList = statusPartyDisable; +} + +executeResult = dispatcher.runSync("executeFind", [entityName : context.entityName, + orderByList : prepareResult.orderByList, + entityConditionList : entityConditionList, + noConditionFind :context.noConditionFind + ] ); +if (executeResult.listIt == null) { + Debug.log("No list found for query string + [" + prepareResult.queryString + "]"); +} +context.listIt = executeResult.listIt; +context.queryString = prepareResult.queryString; +context.queryStringMap = prepareResult.queryStringMap; Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy ------------------------------------------------------------------------------ svn:eol-style = native Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy ------------------------------------------------------------------------------ svn:keywords = "Date Rev Author URL Id" Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy ------------------------------------------------------------------------------ svn:mime-type = text/plain Modified: ofbiz/trunk/applications/party/webapp/partymgr/lookup/LookupForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/lookup/LookupForms.xml?rev=701341&r1=701340&r2=701341&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/lookup/LookupForms.xml (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/lookup/LookupForms.xml Fri Oct 3 03:16:58 2008 @@ -40,11 +40,10 @@ <form name="listLookupPartyName" type="list" list-name="listIt" paginate-target="LookupPartyName" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <actions> - <service service-name="performFind" result-map-name="result" result-map-list-name="listIt"> - <field-map field-name="inputFields" env-name="parameters"/> - <field-map field-name="orderBy" value="partyId"/> - <field-map field-name="entityName" value="PartyNameView"/> - </service> + <set field="inputFields" from-field="parameters"/> + <set field="orderBy" value="partyId"/> + <set field="entityName" value="PartyNameView"/> + <script location="component://party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy"/> </actions> <!--<auto-fields-entity entity-name="PartyNameView" default-field-type="display"/>--> <field name="partyId" title="${uiLabelMap.PartyPartyId}" widget-style="smallSubmit"> @@ -78,11 +77,10 @@ <actions> <set field="parameters.contactMechTypeId" value="EMAIL_ADDRESS"/> <set field="filterByDate" value="Y"/> - <service service-name="performFind" result-map-name="result" result-map-list-name="listIt"> - <field-map field-name="inputFields" env-name="parameters"/> - <field-map field-name="orderBy" value="partyId"/> - <field-map field-name="entityName" value="PartyNameContactMechView"/> - </service> + <set field="inputFields" from-field="parameters"/> + <set field="orderBy" value="partyId"/> + <set field="entityName" value="PartyNameContactMechView"/> + <script location="component://party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy"/> </actions> <row-actions> <set field="name" value="${firstName} ${middleName} ${lastName} ${groupName}"/> @@ -113,11 +111,10 @@ <form name="listLookupCustomerName" type="list" list-name="listIt" paginate-target="LookupCustomerName" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <actions> - <service service-name="performFind" result-map-name="result" result-map-list-name="listIt"> - <field-map field-name="inputFields" env-name="parameters"/> - <field-map field-name="orderBy" value="partyId"/> - <field-map field-name="entityName" value="PartyRoleNameDetail"/> - </service> + <set field="inputFields" from-field="parameters"/> + <set field="orderBy" value="partyId"/> + <set field="entityName" value="PartyRoleNameDetail"/> + <script location="component://party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy"/> </actions> <field name="partyId" title="${uiLabelMap.PartyPartyId}" widget-style="smallSubmit"> <hyperlink also-hidden="false" target-type="plain" description="${partyId}" target="javascript:set_value('${partyId}')"/> @@ -217,10 +214,9 @@ <form name="listLookupPartyAndUserLoginAndPerson" type="list" list-name="listIt" paginate-target="LookupPartyAndUserLoginAndPerson" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <actions> - <service service-name="performFind" result-map-name="result" result-map-list-name="listIt"> - <field-map field-name="inputFields" env-name="requestParameters"/> - <field-map field-name="entityName" env-name="entityName"/> - </service> + <set field="inputFields" from-field="requestParameters"/> + <set field="entityName" value="entityName"/> + <script location="component://party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy"/> </actions> <!--<auto-fields-entity entity-name="PartyAndUserLoginAndPerson" default-field-type="display"/>--> <field name="partyId" title="${uiLabelMap.PartyPartyId}"> @@ -248,10 +244,9 @@ <form name="listLookupUserLoginAndPartyDetails" type="list" list-name="listIt" paginate-target="LookupUserLoginAndPartyDetails" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <actions> - <service service-name="performFind" result-map-name="result" result-map-list-name="listIt"> - <field-map field-name="inputFields" env-name="requestParameters"/> - <field-map field-name="entityName" env-name="entityName"/> - </service> + <set field="inputFields" from-field="requestParameters"/> + <set field="entityName" value="entityName"/> + <script location="component://party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy"/> </actions> <field name="userLoginId" title="${uiLabelMap.PartyUserLoginId}" widget-style="smallSubmit"> <hyperlink also-hidden="false" target-type="plain" description="${userLoginId}" target="javascript:set_value('${userLoginId}', '${userLoginId}', '${parameters.webSitePublishPoint}')"/> @@ -416,10 +411,9 @@ <form name="listLookupContactMech" type="list" list-name="listIt" paginate-target="LookupContactMech" odd-row-style="alternate-row" default-table-style="basic-table hover-bar"> <actions> - <service service-name="performFind" result-map-list-name="listIt" result-map-name="result"> - <field-map field-name="inputFields" env-name="parameters"/> - <field-map field-name="entityName" value="PartyAndContactMech"/> - </service> + <set field="inputFields" from-field="parameters"/> + <set field="entityName" value="PartyAndContactMech"/> + <script location="component://party/webapp/partymgr/WEB-INF/actions/party/FindLookUp.groovy"/> </actions> <field name="contactMechId" widget-style="buttontext"> Modified: ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml?rev=701341&r1=701340&r2=701341&view=diff ============================================================================== --- ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml (original) +++ ofbiz/trunk/applications/party/webapp/partymgr/party/PartyForms.xml Fri Oct 3 03:16:58 2008 @@ -72,6 +72,15 @@ </entity-options> </drop-down> </field> + <field name="statusId" use-when="person==null"><hidden/></field> + <field name="statusId" use-when="person!=null"> + <drop-down allow-empty="false"> + <entity-options description="${description}" entity-name="StatusItem" key-field-name="statusId"> + <entity-constraint name="statusTypeId" value="PARTY_STATUS"/> + <entity-order-by field-name="sequenceId"/> + </entity-options> + </drop-down> + </field> <field name="submitButton" title="${uiLabelMap.CommonSave}"><submit button-type="button"/></field> <field name="cancelLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="smallSubmit"><hyperlink target="${donePage}?partyId=${partyId}" also-hidden="false" description="${uiLabelMap.CommonCancelDone}"/></field> </form> @@ -94,6 +103,15 @@ </entity-options> </drop-down> </field> + <field name="statusId" use-when="partyGroup==null"><hidden/></field> + <field name="statusId" use-when="partyGroup!=null"> + <drop-down allow-empty="false"> + <entity-options description="${description}" entity-name="StatusItem" key-field-name="statusId"> + <entity-constraint name="statusTypeId" value="PARTY_STATUS"/> + <entity-order-by field-name="sequenceId"/> + </entity-options> + </drop-down> + </field> <field name="submitButton" title="${uiLabelMap.CommonSave}"><submit button-type="button"/></field> <field name="cancelLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="smallSubmit"><hyperlink target="${donePage}?partyId=${partyId}" also-hidden="false" description="${uiLabelMap.CommonCancelDone}"/></field> </form> @@ -105,12 +123,16 @@ <field name="logoImageUrl"><ignored/></field> <field name="description" title="${uiLabelMap.CommonDescription}"><display/></field> <field name="preferredCurrencyUomId" title="${uiLabelMap.CommonCurrency}"><display-entity entity-name="Uom" key-field-name="uomId" description="${description}"/></field> + <field name="externalId" title="${uiLabelMap.External} ${uiLabelMap.Id}"><display/></field> + <field name="statusId" title="${uiLabelMap.Status} ${uiLabelMap.Id}"><display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/></field> </form> <form name="ViewPartyPerson" type="single" default-map-name="lookupPerson"> <field name="partyId"><display/></field> <field name="name" title="${uiLabelMap.PartyName}"><display description="${lookupPerson.personalTitle} ${lookupPerson.firstName} ${lookupPerson.middleName} ${lookupPerson.lastName}"/></field> <field name="comments" title="${uiLabelMap.PartyComments}"><display/></field> + <field name="externalId" title="${uiLabelMap.External} ${uiLabelMap.Id}"><display/></field> + <field name="statusId" title="${uiLabelMap.Status} ${uiLabelMap.Id}"><display-entity entity-name="StatusItem" key-field-name="statusId" description="${description}"/></field> </form> <form name="ViewPartyPersonHistory" type="list" list-name="partyNameHistoryList" |
Free forum by Nabble | Edit this page |