ilscipio/scipio-erp

View on GitHub
applications/product/widget/catalog/ReviewForms.xml

Summary

Maintainability
Test Coverage
<?xml version="1.0" encoding="UTF-8"?>
<!--
This file is subject to the terms and conditions defined in the
files 'LICENSE' and 'NOTICE', which are part of this source
code package.
-->

<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xsi:noNamespaceSchemaLocation="http://ofbiz.apache.org/dtds/widget-form.xsd">
    
    <form name="FindReviews" type="single" target="FindReviews" title="" header-row-style="header-row" default-map-name="productReview"> <!-- orig: default-table-style=-style="basic-table" -->
        <field name="noConditionFind"><hidden value="Y"/><!-- if this isn't there then with all fields empty no query will be done --></field>
        <field name="productId" title="${uiLabelMap.ProductId}"><text-find/></field>
        <field name="statusId" title="${uiLabelMap.CommonStatus}">
            <drop-down allow-empty="true">
                <entity-options entity-name="StatusItem" description="${description}">
                    <entity-constraint name="statusTypeId" operator="equals" value="PRODUCT_REVIEW_STTS"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="productReview" title="${uiLabelMap.ProductReviews}"><text-find/></field>
        <field name="submitAction" title="${uiLabelMap.CommonFind}" widget-style="${styles.link_run_sys} ${styles.action_find}">
            <submit button-type="button"/>
        </field>
    </form>
    
    <form name="ListReviews" type="list" list-name="listIt" target="updateProductReview" title="" paginate-target="FindReviews"
        odd-row-style="alternate-row" header-row-style="header-row-2"> <!-- orig: default-table-style=-style="basic-table hover-bar" -->
        <actions>
            <set field="entityName" value="ProductReview"/>
            <service service-name="performFind" result-map="result" result-map-list="listIt">
                <field-map field-name="inputFields" from-field="requestParameters"/>
                <field-map field-name="entityName" from-field="entityName"/>
                <field-map field-name="orderBy" value="postedDateTime"/>
                <field-map field-name="viewIndex" from-field="viewIndex"/>
                <field-map field-name="viewSize" from-field="viewSize"/>
            </service>
        </actions>
        <row-actions>
            <entity-and entity-name="UserLoginAndPartyDetails" list="userLoginAndPartyDetails">
                <field-map field-name="userLoginId" from-field="userLoginId"/>
            </entity-and>
            <set field="reviewBy" value="${userLoginAndPartyDetails[0].firstName} ${userLoginAndPartyDetails[0].middleName} ${userLoginAndPartyDetails[0].lastName}"/>
        </row-actions>
        <field name="productId" widget-style="${styles.link_nav_info_id}">
            <hyperlink also-hidden="false" description="${productId}" target="ViewProduct">
                <parameter param-name="productId"/>
            </hyperlink>
        </field>
        <field name="statusId" title="${uiLabelMap.CommonStatus}"><display-entity entity-name="StatusItem"/></field>
        <field name="userLoginId" title="${uiLabelMap.ProductReviewBy}" ><display/></field>
        <field name="productRating" use-when="${statusId != 'PRR_DELETED'}"><text/></field>
        <field name="productRating" use-when="${statusId == 'PRR_DELETED'}"><text disabled="true"/></field>
        <field name="productReview" use-when="${statusId != 'PRR_DELETED'}"><textarea/></field>
        <field name="productReview" use-when="${statusId == 'PRR_DELETED'}"><textarea read-only="true"/></field>
        <field name="submitAction" title="${uiLabelMap.CommonUpdate}" widget-style="${styles.link_run_sys} ${styles.action_update}" use-when="${statusId != 'PRR_DELETED'}" ><submit button-type="button"/></field>
        <field name="approveAction" widget-style="${styles.link_run_sys} ${styles.action_updatestatus}" use-when="${statusId == 'PRR_PENDING'}">
            <hyperlink target="updateProductReviewStatus" description="${uiLabelMap.FormFieldTitle_approve}" also-hidden="false">
                <parameter param-name="statusId" value="PRR_APPROVED"/>
                <parameter param-name="productReviewId" from-field="productReviewId"/>
            </hyperlink>
        </field>
        <field name="rejectAction" widget-style="${styles.link_run_sys} ${styles.action_terminate}" use-when="${statusId != 'PRR_DELETED'}">
            <hyperlink target="updateProductReviewStatus" description="${uiLabelMap.FormFieldTitle_rejectButton}" also-hidden="false" confirmation-message="Do you want to reject this review?">
                <parameter param-name="statusId" value="PRR_DELETED"/>
                <parameter param-name="productReviewId" from-field="productReviewId"/>
            </hyperlink>
        </field>
        <field name="productReviewId"><hidden/></field>
        
    </form>
</forms>