Jacopo Cappellato wrote:
> On Mar 19, 2010, at 6:43 PM, Adam Heath wrote:
> 
>> [email protected] wrote:
>>> Author: jacopoc
>>> Date: Fri Mar 19 17:23:15 2010
>>> New Revision: 925342
>>>
>>> URL: http://svn.apache.org/viewvc?rev=925342&view=rev
>>> Log:
>>> Improved search capabilities of the work effort calendar screens; converted 
>>> ftl template to form widget.
>> This should have been 2 commits, they aren't related.
>>
> 
> I enhanced the search features by replacing the existing ftl forms (one for 
> each search field) with *one* single widget form: in this way searches can be 
> done with multiple constraints.
> Are you saying that instead I should have:
> 
> 1) converted the ftl forms into widget forms in order to preserve the 
> original limitations
> 2) aggregate the widget forms into one widget form in order to implement the 
> new feature
> 
> ?
> 
> This is the most ridiculous thing I have ever heard. Or maybe it is a new 
> *policy*?

The reason it's good to split it, is that the conversion from ftl to
widget might introduce bugs, just the conversion itself.  Trying to
track the problem down in the future when the bug is actually found is
much simpler to do when the change is isolated.

All you can say about any bit of code, is that you've fixed all
*known* bugs.  There could be an unknown bug in the conversion, that
is only discovered in the future.  The split makes it simpler to track
down.

> 
> Jacopo
> 
> 
> 
>>> Removed:
>>>    
>>> ofbiz/trunk/applications/workeffort/webapp/workeffort/calendar/eventsByForms.ftl
>>> Modified:
>>>    
>>> ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/CreateUrlParam.groovy
>>>    ofbiz/trunk/applications/workeffort/widget/CalendarForms.xml
>>>    ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml
>>>
>>> Modified: 
>>> ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/CreateUrlParam.groovy
>>> URL: 
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/CreateUrlParam.groovy?rev=925342&r1=925341&r2=925342&view=diff
>>> ==============================================================================
>>> --- 
>>> ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/CreateUrlParam.groovy
>>>  (original)
>>> +++ 
>>> ofbiz/trunk/applications/workeffort/webapp/workeffort/WEB-INF/actions/calendar/CreateUrlParam.groovy
>>>  Fri Mar 19 17:23:15 2010
>>> @@ -22,19 +22,28 @@ fixedAssetId = parameters.fixedAssetId;
>>> partyId = parameters.partyId;
>>> workEffortTypeId = parameters.workEffortTypeId;
>>>
>>> -urlParam = null;
>>> +urlParam = "";
>>> if (facilityId) {
>>>     urlParam = "facilityId=" + facilityId;
>>> }
>>> if (fixedAssetId) {
>>> -    urlParam = "fixedAssetId=" + fixedAssetId;
>>> +    if (urlParam) {
>>> +        urlParam = urlParam + "&";
>>> +    }
>>> +    urlParam = urlParam + "fixedAssetId=" + fixedAssetId;
>>> }
>>> if (partyId) {
>>> -    urlParam = "partyId=" + partyId;
>>> +    if (urlParam) {
>>> +        urlParam = urlParam + "&";
>>> +    }
>>> +    urlParam = urlParam + "partyId=" + partyId;
>>> }
>>>
>>> if (workEffortTypeId) {
>>> -    urlParam = "workEffortTypeId=" + workEffortTypeId;
>>> +    if (urlParam) {
>>> +        urlParam = urlParam + "&";
>>> +    }
>>> +    urlParam = urlParam + "workEffortTypeId=" + workEffortTypeId;
>>> }
>>>
>>> if (urlParam) {
>>>
>>> Modified: ofbiz/trunk/applications/workeffort/widget/CalendarForms.xml
>>> URL: 
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/CalendarForms.xml?rev=925342&r1=925341&r2=925342&view=diff
>>> ==============================================================================
>>> --- ofbiz/trunk/applications/workeffort/widget/CalendarForms.xml (original)
>>> +++ ofbiz/trunk/applications/workeffort/widget/CalendarForms.xml Fri Mar 19 
>>> 17:23:15 2010
>>> @@ -20,6 +20,33 @@ under the License.
>>>
>>> <forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; 
>>>         
>>> xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd";>
>>> +    <form name="FilterCalendarEvents" type="single" target="calendar">
>>> +        <field name="partyId">
>>> +            <lookup target-form-name="LookupPartyName" size="16"/>
>>> +        </field>
>>> +        <field name="workEffortTypeId">
>>> +            <drop-down allow-empty="true">
>>> +                <entity-options entity-name="WorkEffortType" 
>>> description="${description}">
>>> +                    <entity-order-by field-name="description"/>
>>> +                </entity-options>
>>> +            </drop-down>
>>> +        </field>
>>> +        <field name="facilityId">
>>> +            <drop-down allow-empty="true">
>>> +                <entity-options entity-name="Facility" 
>>> description="${facilityName}">
>>> +                    <entity-order-by field-name="facilityName"/>
>>> +                </entity-options>
>>> +            </drop-down>
>>> +        </field>
>>> +        <field name="fixedAssetId">
>>> +            <drop-down allow-empty="true">
>>> +                <entity-options entity-name="FixedAsset" 
>>> description="${fixedAssetId} - ${fixedAssetName}">
>>> +                    <entity-order-by field-name="fixedAssetId"/>
>>> +                </entity-options>
>>> +            </drop-down>
>>> +        </field>
>>> +        <field name="viewButton" 
>>> title="${uiLabelMap.CommonView}"><submit/></field>
>>> +    </form>
>>>     <!-- Forms Specific to portlet -->
>>>     <form name="EditCalendar" extends="CommonPortletEdit" 
>>> extends-resource="component://common/widget/PortletEditForms.xml">
>>>         <field name="initialView" entry-name="attributeMap.initialView">
>>>
>>> Modified: ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml
>>> URL: 
>>> http://svn.apache.org/viewvc/ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml?rev=925342&r1=925341&r2=925342&view=diff
>>> ==============================================================================
>>> --- ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml (original)
>>> +++ ofbiz/trunk/applications/workeffort/widget/CommonScreens.xml Fri Mar 19 
>>> 17:23:15 2010
>>> @@ -147,22 +147,17 @@ under the License.
>>>                                 <if-has-permission 
>>> permission="WORKEFFORTMGR" action="_VIEW"/>
>>>                             </condition>
>>>                             <actions>
>>> -                                <entity-condition entity-name="Facility" 
>>> list="allFacilities">
>>> -                                    <order-by field-name="facilityName"/>
>>> -                                </entity-condition>
>>> -                                <entity-condition entity-name="FixedAsset" 
>>> list="allFixedAssets">
>>> -                                    <order-by field-name="fixedAssetId"/>
>>> -                                </entity-condition>
>>> -                                <entity-condition 
>>> entity-name="WorkEffortType" list="allWorkEffortTypes">
>>> -                                    <order-by field-name="description"/>
>>> -                                </entity-condition>
>>>                                 <script 
>>> location="component://workeffort/webapp/workeffort/WEB-INF/actions/calendar/Days.groovy"/>
>>>                             </actions>
>>>                             <widgets>
>>> -                                <platform-specific>
>>> -                                    <html><html-template 
>>> location="component://workeffort/webapp/workeffort/calendar/eventsByForms.ftl"/></html>
>>> -                                </platform-specific>
>>> -                                <decorator-section-include name="body"/>
>>> +                                <decorator-screen 
>>> name="FindScreenDecorator" 
>>> location="component://common/widget/CommonScreens.xml">
>>> +                                    <decorator-section 
>>> name="search-options">
>>> +                                        <include-form 
>>> name="FilterCalendarEvents" 
>>> location="component://workeffort/widget/CalendarForms.xml"/>
>>> +                                    </decorator-section>
>>> +                                    <decorator-section 
>>> name="search-results">
>>> +                                        <decorator-section-include 
>>> name="body"/>
>>> +                                    </decorator-section>
>>> +                                </decorator-screen>
>>>                             </widgets>
>>>                             <fail-widgets>
>>>                                 <label 
>>> style="h3">${uiLabelMap.WorkEffortViewPermissionError}</label>
>>>
>>>
> 

Reply via email to