Bad variable naming (Fwd: svn commit: r791389 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy widget/forms/ProjectForms.xml)

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Bad variable naming (Fwd: svn commit: r791389 - in /ofbiz/trunk/specialpurpose/projectmgr: webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy widget/forms/ProjectForms.xml)

Anil Patel-3
Hans,
Variable naming in the lines below

> +            <entity-and entity-name="WorkEffortPartyAssignment"  
> list="assigns" filter-by-date="true">
> +                <field-map field-name="workEffortId" from-
> field="parameters.projectId"/>
> +                <field-map field-name="roleTypeId"  
> value="CLIENT_BILLING"/>
> +            </entity-and>
> +            <set field="project.clientBillingPartyId" from-
> field="assigns[0].partyId"/>
> +            <entity-and entity-name="WorkEffortPartyAssignment"  
> list="assignsOrg" filter-by-date="true">
> +                <field-map field-name="workEffortId" from-
> field="parameters.projectId"/>
> +                <field-map field-name="roleTypeId"  
> value="INTERNAL_ORGANIZATIO"/>
> +            </entity-and>
> +            <set field="project.organizationPartyId" from-
> field="assignsOrg[0].partyId"/>


is not good. I'll appreciate if you can spend little more effort in  
naming variables as per the Ofbiz best practices.

Regards
Anil Patel


Begin forwarded message:

> From: [hidden email]
> Date: July 6, 2009 11:30:55 AM GMT+05:30
> To: [hidden email]
> Subject: svn commit: r791389 - in /ofbiz/trunk/specialpurpose/
> projectmgr: webapp/projectmgr/WEB-INF/actions/
> ProjectIsBillable.groovy widget/forms/ProjectForms.xml
> Reply-To: [hidden email]
>
> Author: hansbak
> Date: Mon Jul  6 06:00:54 2009
> New Revision: 791389
>
> URL: http://svn.apache.org/viewvc?rev=791389&view=rev
> Log:
> edit project did not show the client billing partyId, also do not  
> show nonbilled hours when either billing partyId or organization  
> party is missing
>
> Modified:
>    ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/
> actions/ProjectIsBillable.groovy
>    ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml
>
> Modified: ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/
> WEB-INF/actions/ProjectIsBillable.groovy
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/actions/ProjectIsBillable.groovy?rev=791389&r1=791388&r2=791389&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/
> actions/ProjectIsBillable.groovy (original)
> +++ ofbiz/trunk/specialpurpose/projectmgr/webapp/projectmgr/WEB-INF/
> actions/ProjectIsBillable.groovy Mon Jul  6 06:00:54 2009
> @@ -33,7 +33,9 @@
> }
> if (fromPartyId && toPartyId && fromPartyId.equals(toPartyId)) {
> context.isBillable = false;
> - } else {
> + } else if (!toPartyId || !fromPartyId){
> +        context.isBillable = false;
> + } else {
> context.isBillable = true;
> }
> }
>
> Modified: ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
> ProjectForms.xml
> URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/projectmgr/widget/forms/ProjectForms.xml?rev=791389&r1=791388&r2=791389&view=diff
> =
> =
> =
> =
> =
> =
> =
> =
> ======================================================================
> --- ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
> ProjectForms.xml (original)
> +++ ofbiz/trunk/specialpurpose/projectmgr/widget/forms/
> ProjectForms.xml Mon Jul  6 06:00:54 2009
> @@ -25,6 +25,16 @@
>             <entity-one entity-name="PartyGroup" value-
> field="partyGroup">
>                 <field-map field-name="partyId" from-field="partyId"/>
>             </entity-one>
> +            <entity-and entity-name="WorkEffortPartyAssignment"  
> list="assigns" filter-by-date="true">
> +                <field-map field-name="workEffortId" from-
> field="parameters.projectId"/>
> +                <field-map field-name="roleTypeId"  
> value="CLIENT_BILLING"/>
> +            </entity-and>
> +            <set field="project.clientBillingPartyId" from-
> field="assigns[0].partyId"/>
> +            <entity-and entity-name="WorkEffortPartyAssignment"  
> list="assignsOrg" filter-by-date="true">
> +                <field-map field-name="workEffortId" from-
> field="parameters.projectId"/>
> +                <field-map field-name="roleTypeId"  
> value="INTERNAL_ORGANIZATIO"/>
> +            </entity-and>
> +            <set field="project.organizationPartyId" from-
> field="assignsOrg[0].partyId"/>
>         </actions>
>         <alt-target use-when="project==null" target="createProject"/>
>         <field use-when="project==null" name="templateId">
>
>