Author: deepak
Date: Sat Sep 3 19:24:00 2016 New Revision: 1759127 URL: http://svn.apache.org/viewvc?rev=1759127&view=rev Log: (OFBIZ-7969) Applied slightly modified patch from jira issue. ================================= Enable adding a content to an agreement ================================= Thanks Leila Mekika for your contribution. Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml ofbiz/trunk/applications/accounting/data/AccountingHelpData.xml ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml ofbiz/trunk/applications/accounting/widget/AgreementForms.xml ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml ofbiz/trunk/applications/datamodel/entitydef/party-entitymodel.xml ofbiz/trunk/applications/party/data/PartyTypeData.xml Modified: ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml?rev=1759127&r1=1759126&r2=1759127&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml (original) +++ ofbiz/trunk/applications/accounting/config/AccountingUiLabels.xml Sat Sep 3 19:24:00 2016 @@ -720,6 +720,10 @@ <value xml:lang="zh">ååç¼å·</value> <value xml:lang="zh-TW">åç´èå¥</value> </property> + <property key="AccountingAgreementContents"> + <value xml:lang="en">Agreement Contents</value> + <value xml:lang="fr">Contenu de l'accord commercial</value> + </property> <property key="AccountingAgreementInformation"> <value xml:lang="ar">٠عÙÙ٠ات اÙإتÙاÙÙØ©</value> <value xml:lang="de">Vereinbarungsinformation</value> @@ -17291,6 +17295,10 @@ <value xml:lang="zh">æ·»å è°æ¥ååº</value> <value xml:lang="zh-TW">å¢å 調æ¥åæ</value> </property> + <property key="FormFieldTitle_agreementContentTypeId"> + <value xml:lang="en">Agreement Content Type Id</value> + <value xml:lang="fr">Type de contenu</value> + </property> <property key="FormFieldTitle_agreementDate"> <value xml:lang="ar">تارÙØ® اÙإتÙاÙÙØ©</value> <value xml:lang="de">Vereinbarungsdatum</value> @@ -22117,6 +22125,10 @@ <value xml:lang="zh">ç¼è¾åå</value> <value xml:lang="zh-TW">編輯åç´</value> </property> + <property key="PageTitleAddAgreementContent"> + <value xml:lang="en">Add Agreement Content</value> + <value xml:lang="fr">Ajout de contenu à l'accord commercial</value> + </property> <property key="PageTitleEditAgreementGeographicalApplic"> <value xml:lang="de">Standort Vereinbarung bearbeiten</value> <value xml:lang="en">Edit Agreement Geographical Applic</value> Modified: ofbiz/trunk/applications/accounting/data/AccountingHelpData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/data/AccountingHelpData.xml?rev=1759127&r1=1759126&r2=1759127&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/data/AccountingHelpData.xml (original) +++ ofbiz/trunk/applications/accounting/data/AccountingHelpData.xml Sat Sep 3 19:24:00 2016 @@ -467,6 +467,11 @@ under the License. <Content contentId="ACCOUNTING_EditAgrRo" contentTypeId="DOCUMENT" contentName="Edit Agreement Roles." templateDataResourceId="HELP_TEMPL" dataResourceId="ACCOUNTING_EditAgrRo" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/> <ContentAssoc contentId="ACCOUNTING_Agreement" contentIdTo="ACCOUNTING_EditAgrRo" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="ACCOUNTING_EditAgreementRoles"/> + <DataResource dataResourceId="ACCOUNTING_EditAgrCo" localeString="en" dataResourceTypeId="OFBIZ_FILE" + objectInfo="applications/accounting/data/helpdata/HELP_ACCOUNTING_EditAgreementContents.xml" dataTemplateTypeId="NONE" statusId="CTNT_IN_PROGRESS" dataResourceName="Edit Agreement Contents Help" mimeTypeId="text/xml" isPublic="Y" /> + <Content contentId="ACCOUNTING_EditAgrCo" contentTypeId="DOCUMENT" contentName="Edit Agreement Roles." templateDataResourceId="HELP_TEMPL" dataResourceId="ACCOUNTING_EditAgrCo" statusId="CTNT_IN_PROGRESS" mimeTypeId="text/html"/> + <ContentAssoc contentId="ACCOUNTING_Agreement" contentIdTo="ACCOUNTING_EditAgrCo" contentAssocTypeId="TREE_CHILD" fromDate="2006-01-12 01:01:01" sequenceNum="000" mapKey="ACCOUNTING_EditAgreementContents"/> + <!-- Global GL Settings --> <DataResource dataResourceId="ACCOUNTING_GLSetting" localeString="en" dataResourceTypeId="OFBIZ_FILE" Modified: ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml?rev=1759127&r1=1759126&r2=1759127&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml (original) +++ ofbiz/trunk/applications/accounting/servicedef/services_agreement.xml Sat Sep 3 19:24:00 2016 @@ -236,6 +236,31 @@ under the License. <auto-attributes mode="IN" include="pk" optional="false"/> </service> + <!-- Agreement content services --> + <service name="createAgreementContent" default-entity-name="AgreementContent" engine="entity-auto" invoke="create" auth="true"> + <description>Create Agreement Content</description> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + <override name="fromDate" optional="true"/> + </service> + <service name="updateAgreementContent" default-entity-name="AgreementContent" engine="entity-auto" invoke="update" auth="true"> + <description>Update Agreement Content</description> + <auto-attributes include="pk" mode="IN" optional="false"/> + <auto-attributes include="nonpk" mode="IN" optional="true"/> + </service> + <service name="removeAgreementContent" default-entity-name="AgreementContent" engine="entity-auto" invoke="delete" auth="true"> + <description>Remove Content From Agreement</description> + <auto-attributes mode="IN" include="pk" optional="false"/> + </service> + + <service name="uploadAgreementContentFile" engine="group" transaction-timeout="300"> + <description>Upload and attach a file to an agreement</description> + <group> + <invoke name="createContentFromUploadedFile" result-to-context="true"/> + <invoke name="createAgreementContent"/> + </group> + </service> + <service name="getCommissionForProduct" engine="java" location="org.apache.ofbiz.accounting.agreement.AgreementServices" invoke="getCommissionForProduct" auth="true"> <description>Get commission receiving parties and amounts for a product. <br/> Modified: ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml?rev=1759127&r1=1759126&r2=1759127&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/accounting/webapp/accounting/WEB-INF/controller.xml Sat Sep 3 19:24:00 2016 @@ -23,7 +23,7 @@ under the License. <include location="component://common/webcommon/WEB-INF/common-controller.xml"/> <include location="component://commonext/webapp/WEB-INF/controller.xml"/> <description>Accounting Manager Module Site Configuration File</description> - + <!-- Events to run on every request before security (chains exempt) --> <!-- <preprocessor> @@ -1206,6 +1206,22 @@ under the License. <response name="error" type="view" value="EditAgreementTerms"/> </request-map> + <request-map uri="EditAgreementContents"> + <security https="true" auth="true"/> + <response name="success" type="view" value="EditAgreementContents"/> + </request-map> + <request-map uri="uploadAgreementContent"> + <security https="true" auth="true"/> + <event type="service" invoke="uploadAgreementContentFile" /> + <response name="success" type="view" value="EditAgreementContents"/> + <response name="error" type="view" value="EditAgreementContents"/> + </request-map> + <request-map uri="removeAgreementContent"> + <security https="true" auth="true"/> + <event type="service" invoke="removeAgreementContent"/> + <response name="success" type="view" value="EditAgreementContents"/> + <response name="error" type="view" value="EditAgreementContents"/> + </request-map> <request-map uri="ListAgreementPromoAppls"><security https="true" auth="true"/><response name="success" type="view" value="ListAgreementPromoAppls"/></request-map> <request-map uri="removeAgreementPromoAppl"> @@ -2697,6 +2713,7 @@ under the License. <view-map name="ListAgreementItems" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItems"/> <view-map name="EditAgreementItem" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementItem"/> <view-map name="EditAgreementTerms" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementTerms"/> + <view-map name="EditAgreementContents" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementContents"/> <view-map name="ListAgreementPromoAppls" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementPromoAppls"/> <view-map name="EditAgreementPromoAppl" type="screen" page="component://accounting/widget/AgreementScreens.xml#EditAgreementPromoAppl"/> <view-map name="ListAgreementItemTerms" type="screen" page="component://accounting/widget/AgreementScreens.xml#ListAgreementItemTerms"/> Modified: ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml?rev=1759127&r1=1759126&r2=1759127&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml (original) +++ ofbiz/trunk/applications/accounting/widget/AccountingMenus.xml Sat Sep 3 19:24:00 2016 @@ -1174,6 +1174,11 @@ under the License. <parameter param-name="agreementId" from-field="agreement.agreementId"/> </link> </menu-item> + <menu-item name="AgreementContents" title="${uiLabelMap.AccountingAgreementContents}"> + <link target="EditAgreementContents"> + <parameter param-name="agreementId" from-field="agreement.agreementId"/> + </link> + </menu-item> </menu> <menu name="AgreementItemTabBar" extends="CommonTabBarMenu" extends-resource="component://common/widget/CommonMenus.xml" Modified: ofbiz/trunk/applications/accounting/widget/AgreementForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementForms.xml?rev=1759127&r1=1759126&r2=1759127&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/AgreementForms.xml (original) +++ ofbiz/trunk/applications/accounting/widget/AgreementForms.xml Sat Sep 3 19:24:00 2016 @@ -263,6 +263,51 @@ under the License. <submit button-type="button"/> </field> </form> + <form name="ListAgreementContent" target="removeAgreementContent" list-name="contentDataResourceList" paginate-target="ListAgreementContents" title="" type="list" + odd-row-style="alternate-row" header-row-style="header-row-2" default-table-style="basic-table hover-bar"> + <field name="agreementId"><hidden/></field> + <field name="contentId"><hidden/></field> + <field name="contentName"> + <display-entity entity-name="Content" description="${contentName}" key-field-name="contentId"> + <sub-hyperlink target="stream" description="${contentId}" link-style="smallSubmit"> + <parameter param-name="contentId"/> + </sub-hyperlink> + </display-entity> + </field> + <field name="agreementContentTypeId"><display-entity entity-name="AgreementContentType"/></field> + <field name="statusId"><display-entity entity-name="StatusItem"></display-entity></field> + <field name="contentTypeId"><display-entity entity-name="ContentType"></display-entity></field> + <field name="fromDate"><display type="date-time"/></field> + <field name="thruDate"><display type="date-time"/></field> + <field name="remove" title="${uiLabelMap.CommonRemove}"><submit/></field> + </form> + <form name="AddAgreementContent" type="upload" target="uploadAgreementContent"> + <field name="agreementId"><hidden value="${agreement.agreementId}"/></field> + <field name="agreementContentTypeId" > + <drop-down allow-empty="false"> + <entity-options entity-name="AgreementContentType"> + <entity-order-by field-name="description"/> + </entity-options> + </drop-down> + </field> + <field name="contentTypeId"> + <drop-down allow-empty="false" no-current-selected-key="DOCUMENT"> + <entity-options entity-name="ContentType"/> + </drop-down> + </field> + <field name="statusId"> + <drop-down allow-empty="false" no-current-selected-key="CTNT_AVAILABLE"> + <entity-options entity-name="StatusItem"> + <entity-constraint name="statusTypeId" value="CONTENT_STATUS"/> + <entity-order-by field-name="sequenceId"/> + </entity-options> + </drop-down> + </field> + <field name="fromDate"><date-time/></field> + <field name="thruDate"><date-time/></field> + <field name="uploadedFile" title="${uiLabelMap.ContentFile}"><file/></field> + <field name="submitButton" title="${uiLabelMap.CommonUpload}"><submit/></field> + </form> <form name="EditAgreementItemTerm" type="single" target="updateAgreementItemTerm" title="" default-map-name="agreementTerm" header-row-style="header-row" default-table-style="basic-table"> <alt-target use-when="agreementTerm==null" target="createAgreementItemTerm"/> Modified: ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml?rev=1759127&r1=1759126&r2=1759127&view=diff ============================================================================== --- ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml (original) +++ ofbiz/trunk/applications/accounting/widget/AgreementScreens.xml Sat Sep 3 19:24:00 2016 @@ -29,6 +29,7 @@ under the License. <set field="headerItem" value="agreements"/> <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/> <property-map resource="WorkEffortUiLabels" map-name="uiLabelMap" global="true"/> + <property-map resource="ContentUiLabels" map-name="uiLabelMap" global="true"/> </actions> <widgets> <decorator-screen name="main-decorator" location="${parameters.mainDecoratorLocation}"> @@ -227,6 +228,33 @@ under the License. </decorator-section> </decorator-screen> </widgets> + </section> + </screen> + + <screen name="EditAgreementContents"> + <section> + <actions> + <set field="titleProperty" value="PageTitleAddAgreementContent"/> + <set field="tabButtonItem" value="AgreementContents"/> + <set field="buttonBarItem" value="EditAgreementContents"/> + <set field="agreementId" from-field="parameters.agreementId"/> + <entity-one entity-name="Agreement" value-field="agreement"/> + <entity-and entity-name="AgreementContentAndInfo" list="contentDataResourceList"> + <field-map field-name="agreementId" from-field="parameters.agreementId"/> + </entity-and> + </actions> + <widgets> + <decorator-screen name="CommonAgreementDecorator" location="${parameters.agreementDecoratorLocation}"> + <decorator-section name="body"> + <screenlet id="AgreementContentPanel" title="${uiLabelMap.PageTitleAddAgreementContent}" collapsible="true"> + <include-form name="AddAgreementContent" location="component://accounting/widget/AgreementForms.xml"/> + </screenlet> + <screenlet title="${uiLabelMap.PageTitleListContent}"> + <include-form name="ListAgreementContent" location="component://accounting/widget/AgreementForms.xml"/> + </screenlet> + </decorator-section> + </decorator-screen> + </widgets> </section> </screen> Modified: ofbiz/trunk/applications/datamodel/entitydef/party-entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/datamodel/entitydef/party-entitymodel.xml?rev=1759127&r1=1759126&r2=1759127&view=diff ============================================================================== --- ofbiz/trunk/applications/datamodel/entitydef/party-entitymodel.xml (original) +++ ofbiz/trunk/applications/datamodel/entitydef/party-entitymodel.xml Sat Sep 3 19:24:00 2016 @@ -219,6 +219,40 @@ under the License. <key-map field-name="agreementItemTypeId"/> </relation> </entity> + <entity entity-name="AgreementContent" + package-name="org.apache.ofbiz.party.agreement" + title="Agreement Content Entity"> + <field name="agreementId" type="id-ne"></field> + <field name="agreementContentTypeId" type="id-ne"></field> + <field name="contentId" type="id-ne"></field> + <field name="fromDate" type="date-time"></field> + <field name="thruDate" type="date-time"></field> + <prim-key field="contentId"/> + <prim-key field="agreementId"/> + <prim-key field="agreementContentTypeId"/> + <prim-key field="fromDate"/> + <relation type="one" fk-name="AG_CNT_PROD" rel-entity-name="Agreement"> + <key-map field-name="agreementId"/> + </relation> + <relation type="one" fk-name="AG_CNT_CNT" rel-entity-name="Content"> + <key-map field-name="contentId"/> + </relation> + <relation type="one" fk-name="AG_CNT_TYPE" rel-entity-name="AgreementContentType"> + <key-map field-name="agreementContentTypeId"/> + </relation> + </entity> + <entity entity-name="AgreementContentType" + package-name="org.apache.ofbiz.party.agreement" + title="Agreement Content Type Entity"> + <field name="agreementContentTypeId" type="id-ne"></field> + <field name="parentTypeId" type="id-ne"></field> + <field name="hasTable" type="indicator"></field> + <field name="description" type="description"></field> + <prim-key field="agreementContentTypeId"/> + <relation type="one" fk-name="AGCT_TYP_PARENT" title="Parent" rel-entity-name="AgreementContentType"> + <key-map field-name="parentTypeId" rel-field-name="agreementContentTypeId"/> + </relation> + </entity> <entity entity-name="AgreementPartyApplic" package-name="org.apache.ofbiz.party.agreement" title="Agreement Party Application Entity"> @@ -566,6 +600,37 @@ under the License. <key-map field-name="agreementId"/> </view-link> </view-entity> + <view-entity entity-name="AgreementContentAndInfo" + package-name="org.apache.ofbiz.accounting.invoice" + title="AgreementContent Content and DataResource View Entity"> + <member-entity entity-alias="AGC" entity-name="AgreementContent"/> + <member-entity entity-alias="CO" entity-name="Content"/> + <member-entity entity-alias="DR" entity-name="DataResource"/> + <alias-all entity-alias="AGC"/> + <alias-all entity-alias="CO"/> + <alias-all entity-alias="DR" prefix="dr"/> + <view-link entity-alias="AGC" rel-entity-alias="CO"> + <key-map field-name="contentId"/> + </view-link> + <view-link entity-alias="CO" rel-entity-alias="DR"> + <key-map field-name="dataResourceId"/> + </view-link> + <relation type="one-nofk" rel-entity-name="ElectronicText"> + <key-map field-name="dataResourceId"/> + </relation> + <relation type="one-nofk" rel-entity-name="ImageDataResource"> + <key-map field-name="dataResourceId"/> + </relation> + <relation type="one-nofk" rel-entity-name="OtherDataResource"> + <key-map field-name="dataResourceId"/> + </relation> + <relation type="many" rel-entity-name="ContentAssocDataResourceViewFrom"> + <key-map field-name="contentId" rel-field-name="contentIdStart"/> + </relation> + <relation type="many" rel-entity-name="ContentAssocDataResourceViewTo"> + <key-map field-name="contentId" rel-field-name="contentIdStart"/> + </relation> + </view-entity> <!-- ========================================================= --> <!-- org.apache.ofbiz.party.communication --> Modified: ofbiz/trunk/applications/party/data/PartyTypeData.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/data/PartyTypeData.xml?rev=1759127&r1=1759126&r2=1759127&view=diff ============================================================================== --- ofbiz/trunk/applications/party/data/PartyTypeData.xml (original) +++ ofbiz/trunk/applications/party/data/PartyTypeData.xml Sat Sep 3 19:24:00 2016 @@ -33,6 +33,9 @@ under the License. <AgreementType agreementTypeId="COMMISSION_AGREEMENT" description="Commission" hasTable="N" parentTypeId=""/> <AgreementType agreementTypeId="EULA" description="End User License Agreement" hasTable="N" parentTypeId=""/> + <!-- Agreement content type--> + <AgreementContentType agreementContentTypeId="CONTRACT" description="Contract" hasTable="N" parentTypeId=""/> + <ContactMechPurposeType contactMechPurposeTypeId="SHIPPING_LOCATION" description="Shipping Destination Address"/> <ContactMechPurposeType contactMechPurposeTypeId="SHIP_ORIG_LOCATION" description="Shipping Origin Address"/> <ContactMechPurposeType contactMechPurposeTypeId="BILLING_LOCATION" description="Billing (AP) Address"/> |
Free forum by Nabble | Edit this page |