<?xml version="1.0" encoding="UTF-8"?>
<!--
    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.
-->

<forms xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
        xmlns="http://ofbiz.apache.org/Widget-Form" xsi:schemaLocation="http://ofbiz.apache.org/Widget-Form http://ofbiz.apache.org/dtds/widget-form.xsd">
    <form name="EditProductFeature" type="single" target="updateProductFeature" title="" default-map-name="productFeature"
        header-row-style="header-row" default-table-style="basic-table">

        <alt-target use-when="productFeature==null" target="createProductFeature"/>

        <auto-fields-service service-name="updateProductFeature" map-name=""/>

        <field use-when="productFeature!=null" name="productFeatureId" title="${uiLabelMap.ProductFeatureId}" tooltip="${uiLabelMap.ProductChangeWithoutProductCatalog}"><display/></field>
        <field use-when="productFeature==null&amp;&amp;productFeatureId!=null" name="productFeatureId" title="${uiLabelMap.ProductFeatureId}" tooltip="${uiLabelMap.ProductCouldNotFindProductConfigItem} [${productFeatureId}]"><text size="20" maxlength="20"/></field>
        <!-- this to be taken care of with auto-fields-service as soon as it uses entity field info too -->
        <field use-when="productFeature==null&amp;&amp;productFeatureId==null" name="productFeatureId" title="${uiLabelMap.ProductFeatureId}"><ignored/></field>

        <field name="productFeatureTypeId" title="${uiLabelMap.ProductFeatureType}">
            <drop-down>
                <entity-options entity-name="ProductFeatureType">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>

        <field name="productFeatureCategoryId" title="${uiLabelMap.ProductFeatureCategory}">
            <drop-down>
                <entity-options entity-name="ProductFeatureCategory" description="${description} [${productFeatureCategoryId}]">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field use-when="productFeature!=null&amp;&amp;productFeature.getString(&quot;productFeatureCategoryId&quot;)!=null" name="categoryLink" title=" " widget-style="buttontext">
            <hyperlink description="${uiLabelMap.ProductGoToFeatureCategory} ${productFeature.productFeatureCategoryId}" target="/EditFeatureCategoryFeatures" target-type="intra-app" also-hidden="false">
                <parameter param-name="productFeatureCategoryId" from-field="productFeature.productFeatureCategoryId"/>
            </hyperlink>
        </field>

        <field name="description" title="${uiLabelMap.CommonDescription}"/>
        <field name="uomId" title="${uiLabelMap.ProductUnitOfMeasureId}"/>
        <field name="numberSpecified" title="${uiLabelMap.ProductNumberQuantity}"/>
        <field name="defaultAmount" title="${uiLabelMap.ProductDefaultAmount}"/>
        <field name="defaultSequenceNum" title="${uiLabelMap.ProductDefaultSequenceNumber}"/>
        <field name="idCode" title="${uiLabelMap.ProductIdCode}"/>
        <field name="abbrev" title="${uiLabelMap.ProductAbbreviation}"/>

        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
    </form>

    <form name="CreateSupplierProductFeature" type="single" target="createSupplierProductFeature" title=""
        header-row-style="header-row" default-table-style="basic-table">
        <auto-fields-service service-name="createSupplierProductFeature" default-field-type="edit"/>
        <field name="partyId" title="${uiLabelMap.ProductSuppliers}">
            <drop-down allow-empty="false">
                <entity-options entity-name="PartyRoleAndPartyDetail" description="${groupName} ${firstName} ${lastName} [${partyId}]">
                    <entity-constraint name="roleTypeId" value="SUPPLIER"/>
                    <entity-order-by field-name="groupName"/>
                    <entity-order-by field-name="lastName"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="uomId" title="${uiLabelMap.ProductCurrency}">
            <drop-down allow-empty="true">
                <entity-options entity-name="Uom" description="${uomId}"/>
            </drop-down>
        </field>
        <field name="idCode" title="${uiLabelMap.ProductIdCode}"></field>
        <field name="productFeatureId" ><hidden/></field>
        <field name="submitForm" title="${uiLabelMap.CommonCreate}"><submit/></field>
    </form>
    <grid name="EditSupplierProductFeatures" target="updateSupplierProductFeature" list-name="supplierProductFeatures"
        odd-row-style="alternate-row" default-table-style="basic-table">
        <auto-fields-service service-name="updateSupplierProductFeature" default-field-type="display"/>
        <field name="productFeatureId"><hidden/></field>
        <field name="partyId" title="${uiLabelMap.ProductSuppliers}">
            <display-entity entity-name="PartyGroup" description="${groupName}"/>
        </field>
        <field name="description" title="${uiLabelMap.ProductProductDescription}"><text size="40"/></field>
        <field name="idCode" title="${uiLabelMap.ProductIdCode}"><text size="5"/></field>
        <field name="uomId" title="${uiLabelMap.ProductCurrency}">
            <drop-down allow-empty="true">
                <entity-options entity-name="Uom" description="${uomId}"/>
            </drop-down>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
        <field name="deleteLink" title=" " widget-style="buttontext">
            <hyperlink description="${uiLabelMap.CommonDelete}" target="removeSupplierProductFeature">
                <parameter param-name="productFeatureId"/>
                <parameter param-name="partyId"/>
            </hyperlink>
        </field>
    </grid>
    <form name="FindFeatureType" type="single" target="EditFeatureTypes"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productFeatureTypeId"><text-find size="25"></text-find></field>
        <field name="description"><text-find size="25"></text-find></field>
        <field name="searchButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit/></field>
    </form>
    <grid name="ListFeatureTypes" list-name="listIt" paginate-target="EditFeatureTypes"
        odd-row-style="alternate-row" default-table-style="basic-table">
        <actions>
            <set field="parameters.noConditionFind" value="Y"/>
            <service service-name="performFind" result-map="result" result-map-list="listIt">
                <field-map field-name="inputFields" from-field="parameters"/>
                <field-map field-name="entityName" value="ProductFeatureType"/>
                <field-map field-name="orderBy" value="productFeatureTypeId"/>
                <field-map field-name="viewIndex" from-field="viewIndex"/>
                <field-map field-name="viewSize" from-field="viewSize"/>
            </service>
        </actions>
        <field name="productFeatureTypeId" widget-style="buttontext">
            <hyperlink description="${productFeatureTypeId}" target="EditFeatureType">
                <parameter param-name="productFeatureTypeId"/>
            </hyperlink>
        </field>
        <field name="description"><display/></field>
        <field name="parentTypeId">
            <display-entity entity-name="ProductFeatureType" key-field-name="productFeatureTypeId">
                <sub-hyperlink target="EditFeatureType" description="${parentTypeId}">
                    <parameter param-name="productFeatureTypeId" from-field="parentTypeId"/>
                </sub-hyperlink>
            </display-entity>
        </field>
        <field name="removeFeatureType" title="${uiLabelMap.CommonDelete}" widget-style="buttontext">
            <hyperlink description="${uiLabelMap.CommonDelete}" target="removeProductFeatureType">
                <parameter param-name="productFeatureTypeId"/>
            </hyperlink>
        </field>
    </grid>
    <form name="EditFeatureType" type="single" target="updateProductFeatureType" title="" default-map-name="productFeatureType"
        header-row-style="header-row" default-table-style="basic-table">
        <alt-target use-when="productFeatureType==null" target="createProductFeatureType"/>
        <auto-fields-entity entity-name="ProductFeatureType"/>
        <field use-when="productFeatureType!=null" name="productFeatureTypeId" title="${uiLabelMap.ProductFeatureType}"><display/></field>
        <field use-when="productFeatureType==null&amp;&amp;productFeatureTypeId!=null" name="productFeatureTypeId" title="${uiLabelMap.ProductFeatureType}" tooltip="${uiLabelMap.ProductCouldNotFindProductFeatureType} [${productFeatureTypeId}]"><text size="20" maxlength="20"/></field>
        <field name="parentTypeId" title="${uiLabelMap.ProductParentType}">
            <drop-down allow-empty="true">
                <entity-options entity-name="ProductFeatureType" key-field-name="productFeatureTypeId">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="hasTable"><hidden/></field>
        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
    </form>
    <form name="FindFeatureInterAction" type="single" target="EditFeatureInterActions"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productFeatureId"><text-find size="25"></text-find></field>
        <field name="productFeatureIdTo"><text-find size="25"></text-find></field>
        <field name="searchButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit"><submit/></field>
    </form>
    <grid name="ListFeatureInterActions" list-name="listIt" paginate-target="EditFeatureInterAction"
        odd-row-style="alternate-row" default-table-style="basic-table">
        <actions>
            <set field="parameters.noConditionFind" value="Y"/>
            <service service-name="performFind" result-map="result" result-map-list="listIt">
                <field-map field-name="inputFields" from-field="parameters"/>
                <field-map field-name="entityName" value="ProductFeatureIactn"/>
                <field-map field-name="orderBy" value="productFeatureId"/>
                <field-map field-name="viewIndex" from-field="viewIndex"/>
                <field-map field-name="viewSize" from-field="viewSize"/>
                </service>
            </actions>
        <field name="productFeatureId">
            <display-entity entity-name="ProductFeature">
                <sub-hyperlink target="EditFeature" description="[${productFeatureId}]">
                <parameter param-name="productFeatureId"/>
            </sub-hyperlink>
            </display-entity>
        </field>
        <field name="productFeatureIdTo">
            <display-entity entity-name="ProductFeature" key-field-name="productFeatureId">
                <sub-hyperlink target="EditFeature" description="[${productFeatureIdTo}]">
                <parameter param-name="productFeatureId" from-field="productFeatureIdTo"/>
            </sub-hyperlink>
            </display-entity>
        </field>
        <field name="productFeatureIactnTypeId"><display-entity entity-name="ProductFeatureIactnType"/></field>
        <field name="removeFeatureInterAction" title="${uiLabelMap.CommonDelete}" widget-style="buttontext">
            <hyperlink description="${uiLabelMap.CommonDelete}" target="removeProductFeatureIactn">
                <parameter param-name="productFeatureId"/>
                <parameter param-name="productFeatureIdTo"/>
            </hyperlink>
        </field>
        </grid>
    <form name="EditFeatureInterAction" type="single" target="createProductFeatureIactn" title="" default-map-name="productFeatureIactn"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productFeatureId">
            <drop-down allow-empty="true">
                <entity-options description="${description} [${productFeatureId}]" entity-name="ProductFeature">
                    <entity-order-by field-name="productFeatureTypeId"/>
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="productFeatureIdTo">
            <drop-down allow-empty="true">
                <entity-options description="${description} [${productFeatureId}]" entity-name="ProductFeature" key-field-name="productFeatureId">
                    <entity-order-by field-name="productFeatureTypeId"/>
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="productFeatureIactnTypeId">
            <drop-down allow-empty="false">
                <entity-options entity-name="ProductFeatureIactnType">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
    </form>
    <form name="ListFeatureGroupAppls" type="multi" use-row-submit="false" list-name="productFeatureGroupAndAppls" target="UpdateProductFeatureGroupAppl?productFeatureGroupId=${productFeatureGroupId}" title=""
        odd-row-style="alternate-row" default-table-style="basic-table">
        <field name="productFeatureGroupId"><hidden/></field>
        <field name="fromDate"><hidden/></field>
        <field name="productFeatureId" title="${uiLabelMap.CommonId}"><display/></field>
        <field name="description" title="${uiLabelMap.ProductFeature}"><display/></field>
        <field name="productFeatureTypeId" title="${uiLabelMap.CommonType}">
            <display-entity entity-name="ProductFeatureType"/>
        </field>
        <field name="productFeatureCategoryId" title="${uiLabelMap.ProductFeatureCategory}">
            <display-entity entity-name="ProductFeatureCategory"/>
        </field>
        <field name="sequenceNum"><text size="3"/></field>
        <field name="removeFeatureGroupAppl" title="${uiLabelMap.CommonRemove}" widget-style="buttontext">
            <hyperlink description="${uiLabelMap.CommonRemove}" target="RemoveProductFeatureGroupAppl">
                <parameter param-name="productFeatureGroupId"/>
                <parameter param-name="productFeatureId"/>
                <parameter param-name="fromDate"/>
            </hyperlink>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit">
            <submit/>
        </field>
    </form>
    <form name="QuickApplyFeatureToGroup" type="single" target="CreateProductFeatureGroupAppl" title=""
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productFeatureGroupId"><hidden/></field>
        <field name="productFeatureId" title="${uiLabelMap.ProductFeatureId}"><text/></field>
        <field name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit">
            <submit button-type="button"/>
        </field>
    </form>
    <form name="ApplyFeatureCategoryToGroup" type="single" target="EditFeatureGroupAppls" title=""
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productFeatureGroupId"><hidden/></field>
        <field name="productFeatureCategoryId">
            <drop-down>
                <list-options key-name="productFeatureCategoryId" list-name="productFeatureCategories"/>
            </drop-down>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonContinue}" widget-style="smallSubmit">
            <submit button-type="button"/>
        </field>
    </form>
    <form name="ApplyFeaturesFromCategoryToGroup" type="multi" use-row-submit="true" list-name="productFeatures" target="ApplyFeaturesFromCategoryToGroup?productFeatureGroupId=${productFeatureGroupId}" title=""
        odd-row-style="alternate-row" default-table-style="basic-table">
        <field name="productFeatureGroupId"><hidden/></field>
        <field name="productFeatureId" title="${uiLabelMap.CommonId}"><display/></field>
        <field name="productFeatureTypeId" title="${uiLabelMap.CommonType}">
            <display-entity entity-name="ProductFeatureType"/>
        </field>
        <field name="description" title="${uiLabelMap.ProductFeature}"><display/></field>
        <field name="idCode" title="${uiLabelMap.CommonIdCode}"><display/></field>
        <field name="abbrev" title="${uiLabelMap.ProductAbbrev}"><display/></field>
        <field name="_rowSubmit" title="${uiLabelMap.CommonSelect}"><check/></field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit">
          <submit/>
        </field>
    </form>

    <form name="FindProductFeature" type="single" target="EditFeatureCategories"
        header-row-style="header-row" default-table-style="basic-table">
        <field name="productFeatureCategoryId" title="${uiLabelMap.CommonId}"><text-find size="20" maxlength="255"></text-find></field>
        <field name="description" title="${uiLabelMap.CommonDescription}"><text-find size="25"></text-find></field>
        <field name="searchButton" title="${uiLabelMap.CommonFind}" widget-style="smallSubmit find"><submit/></field>
    </form>

    <grid name="ListProductFeature" list-name="listIt" paginate-target="EditFeatureCategories" target="UpdateFeatureCategory"
        odd-row-style="alternate-row" default-table-style="basic-table hover-bar" separate-columns="true">
        <actions>
            <set field="parameters.noConditionFind" value="Y"/>
            <service service-name="performFind" result-map="result" result-map-list="listIt">
                <field-map field-name="inputFields" from-field="parameters"/>
                <field-map field-name="entityName" value="ProductFeatureCategory"/>
                <field-map field-name="orderBy" value="productFeatureCategoryId"/>
                <field-map field-name="viewIndex" from-field="viewIndex"/>
                <field-map field-name="viewSize" from-field="viewSize"/>
            </service>
        </actions>
        <field name="productFeatureCategoryId" title="${uiLabelMap.CommonId}" widget-style="buttontext">
            <hyperlink description="${productFeatureCategoryId}" target="EditFeatureCategoryFeatures">
                <parameter param-name="productFeatureCategoryId"/>
            </hyperlink>
        </field>
        <field name="description" title="${uiLabelMap.CommonDescription}"><text/></field>
        <field name="update" title="${uiLabelMap.CommonUpdate}"><submit/></field>
    </grid>
    <form name="CreateProductFeature" type="single" target="CreateFeatureCategory">
        <field name="description" title="${uiLabelMap.CommonDescription}" required-field="true"><text size="25"></text></field>
        <field name="parentCategory" title="${uiLabelMap.ProductParentCategory}">
            <drop-down allow-empty="true">
                <entity-options entity-name="ProductFeatureCategory" key-field-name="description">
                </entity-options>
            </drop-down>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field>

    </form>
    <grid name="ListFeaturePrice" target="updateFeaturePrice" list-name="productFeaturePrice"
        odd-row-style="alternate-row" default-table-style="basic-table">
        <actions>
            <entity-and entity-name="ProductFeaturePrice" list="productFeaturePrice">
                <field-map field-name="productFeatureId" from-field="parameters.productFeatureId"/>
            </entity-and>
        </actions>
        <field name="productFeatureId"><hidden/></field>
        <field name="productPriceTypeId" title="${uiLabelMap.ProductPriceType}"><display-entity entity-name="ProductPriceType"/></field>
        <field name="currencyUomId" title="${uiLabelMap.ProductCurrency}"><display-entity entity-name="Uom" key-field-name="uomId" description="${description} [${uomId}]"/></field>
        <field name="fromDate" title="${uiLabelMap.CommonFromDate}"><display/></field>
        <field name="thruDate" title="${uiLabelMap.CommonThruDate}"><date-time default-value="${thruDate}"/></field>
        <field name="price" title="${uiLabelMap.ProductPrice}" required-field="true"><text size="25" default-value="${price}"/></field>
        <field name="updateFeaturePrice" title="${uiLabelMap.CommonUpdate}" widget-style="smallSubmit"><submit button-type="button"/></field>
        <field name="lastModifiedBy" title="${uiLabelMap.ProductLastModifiedBy}"><display description="[${lastModifiedByUserLogin}] ${uiLabelMap.CommonOn} ${lastModifiedDate}"/></field>
        <field name="deleteFeaturePrice" title="${uiLabelMap.CommonDelete}" widget-style="buttontext">
            <hyperlink description="${uiLabelMap.CommonDelete}" target="deleteFeaturePrice" also-hidden="false">
                <parameter param-name="productFeatureId"/>
                <parameter param-name="productPriceTypeId"/>
                <parameter param-name="currencyUomId"/>
                <parameter param-name="fromDate"/>
            </hyperlink>
        </field>
    </grid>
    <form name="CreateFeaturePrice" type="single" target="createFeaturePrice">
        <actions>
            <property-to-field field="defaultCurrencyUomId" resource="general" property="currency.uom.id.default" default="USD"/>
        </actions>
        <field name="productFeatureId"><hidden/></field>
        <field name="productPriceTypeId" title="${uiLabelMap.ProductPriceType}">
            <drop-down allow-empty="false" no-current-selected-key="DEFAULT_PRICE">
                <entity-options entity-name="ProductPriceType">
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="fromDate" title="${uiLabelMap.CommonFromDate}" position="1"><date-time/></field>
        <field name="thruDate" title="${uiLabelMap.CommonThruDate}" position="2"><date-time/></field>
        <field name="price" title="${uiLabelMap.ProductPrice}" required-field="true" position="1"><text size="25"/></field>
        <field name="currencyUomId" title="${uiLabelMap.ProductCurrency}" position="2">
            <drop-down allow-empty="false" no-current-selected-key="${defaultOrganizationPartyCurrencyUomId}">
                <entity-options key-field-name="uomId" description="${description} - ${abbreviation}" entity-name="Uom">
                    <entity-constraint name="uomTypeId" operator="equals" value="CURRENCY_MEASURE"/>
                    <entity-order-by field-name="description"/>
                </entity-options>
            </drop-down>
        </field>
        <field name="submitButton" title="${uiLabelMap.CommonCreate}" widget-style="smallSubmit"><submit button-type="button"/></field>
    </form>
</forms>
