Author: adrianc
Date: Mon Aug 22 19:47:58 2011 New Revision: 1160402 URL: http://svn.apache.org/viewvc?rev=1160402&view=rev Log: Added notes to quotes. Patch contributed by Anne Jessel (https://issues.apache.org/jira/browse/OFBIZ-4370) with some changes by me. Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml ofbiz/trunk/applications/order/entitydef/entitymodel.xml ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml ofbiz/trunk/applications/order/servicedef/services_quote.xml ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml Modified: ofbiz/trunk/applications/order/config/OrderUiLabels.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/config/OrderUiLabels.xml?rev=1160402&r1=1160401&r2=1160402&view=diff ============================================================================== --- ofbiz/trunk/applications/order/config/OrderUiLabels.xml (original) +++ ofbiz/trunk/applications/order/config/OrderUiLabels.xml Mon Aug 22 19:47:58 2011 @@ -2821,6 +2821,9 @@ <value xml:lang="zh_CN">æ°å»ºæ¥ä»·é¡¹</value> <value xml:lang="zh_TW">æ°å»ºå ±å¹æç´°</value> </property> + <property key="OrderCreateOrderQuoteNote"> + <value xml:lang="en">Create New Quote Note</value> + </property> <property key="OrderCreateOrderQuoteRole"> <value xml:lang="de">Neue Offertrolle erstellen</value> <value xml:lang="de_DE">Neue Angebotsrolle erstellen</value> @@ -6951,6 +6954,12 @@ <value xml:lang="zh_CN">æ¥ä»·å</value> <value xml:lang="zh_TW">å ±å¹å稱</value> </property> + <property key="OrderOrderQuoteNoteList"> + <value xml:lang="en">Quote Note List</value> + </property> + <property key="OrderOrderQuoteNotes"> + <value xml:lang="en">Quote Notes</value> + </property> <property key="OrderOrderQuotePercProfit"> <value xml:lang="de">Prozentualer provisorischer Gewinn</value> <value xml:lang="en">Quote Percentage Profit</value> @@ -12873,4 +12882,7 @@ <value xml:lang="zh">æµè§è¯·æ±</value> <value xml:lang="zh_TW">ç覽è¦æ±</value> </property> + <property key="QuoteEditNote"> + <value xml:lang="en">Update Note</value> + </property> </resource> Modified: ofbiz/trunk/applications/order/entitydef/entitymodel.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel.xml?rev=1160402&r1=1160401&r2=1160402&view=diff ============================================================================== --- ofbiz/trunk/applications/order/entitydef/entitymodel.xml (original) +++ ofbiz/trunk/applications/order/entitydef/entitymodel.xml Mon Aug 22 19:47:58 2011 @@ -1383,6 +1383,9 @@ under the License. <relation type="one" fk-name="QUOTE_CHANNEL" title="SalesChannel" rel-entity-name="Enumeration"> <key-map field-name="salesChannelEnumId" rel-field-name="enumId"/> </relation> + <relation type="many" rel-entity-name="QuoteNoteView"> + <key-map field-name="quoteId"/> + </relation> </entity> <entity entity-name="QuoteAttribute" package-name="org.ofbiz.order.quote" @@ -1465,6 +1468,21 @@ under the License. <key-map field-name="custRequestItemSeqId"/> </relation> </entity> + <entity entity-name="QuoteNote" + package-name="org.ofbiz.order.quote" + never-cache="true" + title="Quote Note Entity"> + <field name="quoteId" type="id-ne"></field> + <field name="noteId" type="id-ne"></field> + <prim-key field="quoteId"/> + <prim-key field="noteId"/> + <relation type="one" fk-name="QUOTE_NT_QTE" rel-entity-name="Quote"> + <key-map field-name="quoteId"/> + </relation> + <relation type="one" fk-name="QUOTE_NT_NOTE" rel-entity-name="NoteData"> + <key-map field-name="noteId"/> + </relation> + </entity> <entity entity-name="QuoteRole" package-name="org.ofbiz.order.quote" title="Quote Role Entity"> Modified: ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml?rev=1160402&r1=1160401&r2=1160402&view=diff ============================================================================== --- ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml (original) +++ ofbiz/trunk/applications/order/entitydef/entitymodel_view.xml Mon Aug 22 19:47:58 2011 @@ -1428,6 +1428,22 @@ under the License. <key-map field-name="noteParty" rel-field-name="partyId"/> </view-link> </view-entity> + <view-entity entity-name="QuoteNoteView" + package-name="org.ofbiz.order.quote" + never-cache="true" + title="Quote Note View Entity"> + <member-entity entity-alias="QD" entity-name="QuoteNote"/> + <member-entity entity-alias="ND" entity-name="NoteData"/> + <alias entity-alias="QD" name="quoteId"/> + <alias entity-alias="ND" name="noteId"/> + <alias entity-alias="ND" name="noteName"/> + <alias entity-alias="ND" name="noteInfo"/> + <alias entity-alias="ND" name="noteDateTime"/> + <alias entity-alias="ND" name="noteParty"/> + <view-link entity-alias="QD" rel-entity-alias="ND"> + <key-map field-name="noteId"/> + </view-link> + </view-entity> <view-entity entity-name="QuoteWorkEffortView" package-name="org.ofbiz.order.quote" title="Quote And Workeffort"> Modified: ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml?rev=1160402&r1=1160401&r2=1160402&view=diff ============================================================================== --- ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml (original) +++ ofbiz/trunk/applications/order/script/org/ofbiz/order/quote/QuoteServices.xml Mon Aug 22 19:47:58 2011 @@ -972,4 +972,22 @@ under the License. <set-pk-fields map="parameters" value-field="newEntity"/> <remove-value value-field="newEntity"/> </simple-method> + <simple-method method-name="createQuoteNote" short-description="Create a new Note associated with a Quote"> + <set-service-fields service-name="createNote" map="parameters" to-map="createNoteMap"/> + <!-- passed in field will be noteInfo, which matches entity, but service expects field called note --> + <set field="createNoteMap.note" from-field="parameters.noteInfo"/> + <call-service service-name="createNote" in-map-name="createNoteMap"> + <result-to-field result-name="noteId"/> + </call-service> + <if-empty field="noteId"> + <add-error> + <fail-property resource="OrderErrorUiLabels" property="OrderProblemCreatingTheNoteNoNoteIdReturned"/> + </add-error> + </if-empty> + <check-errors/> + <make-value value-field="newQuoteNote" entity-name="QuoteNote"/> + <set field="newQuoteNote.quoteId" from-field="parameters.quoteId"/> + <set field="newQuoteNote.noteId" from-field="noteId"/> + <create-value value-field="newQuoteNote"/> + </simple-method> </simple-methods> Modified: ofbiz/trunk/applications/order/servicedef/services_quote.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/servicedef/services_quote.xml?rev=1160402&r1=1160401&r2=1160402&view=diff ============================================================================== --- ofbiz/trunk/applications/order/servicedef/services_quote.xml (original) +++ ofbiz/trunk/applications/order/servicedef/services_quote.xml Mon Aug 22 19:47:58 2011 @@ -251,4 +251,11 @@ under the License. <attribute name="quoteAdjustments" type="List" mode="IN" optional="true"/> <attribute name="quoteId" type="String" mode="OUT" optional="false"/> </service> + <service name="createQuoteNote" engine="simple" + location="component://order/script/org/ofbiz/order/quote/QuoteServices.xml" invoke="createQuoteNote" auth="true"> + <description>Create a note item and associate with a quote</description> + <attribute name="quoteId" type="String" mode="IN"/> + <attribute name="noteInfo" type="String" mode="IN" allow-html="safe"/> + <attribute name="noteName" type="String" mode="IN" optional="true"/> + </service> </services> Modified: ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml?rev=1160402&r1=1160401&r2=1160402&view=diff ============================================================================== --- ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml (original) +++ ofbiz/trunk/applications/order/webapp/ordermgr/WEB-INF/controller.xml Mon Aug 22 19:47:58 2011 @@ -1634,6 +1634,33 @@ under the License. <response name="success" type="view" value="ListQuoteAdjustments"/> </request-map> + <!-- Quote Note Requests --> + <request-map uri="createnewquotenote"> + <security https="true" auth="true"/> + <response name="success" type="view" value="createnewquotenote"/> + </request-map> + <request-map uri="createquotenote"> + <security https="true" auth="true"/> + <event type="service" invoke="createQuoteNote"/> + <response name="success" type="view" value="ListQuoteNotes"/> + <response name="error" type="view" value="createnewquotenote"/> + </request-map> + <request-map uri="updateQuoteNote"> + <security https="true" auth="true"/> + <event type="service" invoke="updateNote"/> + <response name="success" type="request-redirect" value="ListQuoteNotes"><redirect-parameter name="quoteId"/></response> + <response name="error" type="view" value="ListQuoteNotes"/> + </request-map> + <request-map uri="ListQuoteNotes"> + <security https="true" auth="true"/> + <response name="success" type="view" value="ListQuoteNotes"/> + </request-map> + <request-map uri="EditQuoteNote"> + <security https="true" auth="true"/> + <response name="success" type="view" value="EditQuoteNote"/> + </request-map> + + <!-- WorkEffort Quote request mappings --> <request-map uri="ListQuoteWorkEfforts"> <security https="true" auth="true"/> @@ -2012,6 +2039,9 @@ under the License. <view-map name="EditQuoteAdjustment" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteAdjustment"/> <view-map name="ViewQuoteProfit" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#ViewQuoteProfit"/> <view-map name="EditQuoteReportMail" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteReportMail"/> + <view-map name="createnewquotenote" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#QuoteNewNote"/> + <view-map name="ListQuoteNotes" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#ListQuoteNotes"/> + <view-map name="EditQuoteNote" type="screen" page="component://order/widget/ordermgr/QuoteScreens.xml#EditQuoteNote"/> <view-map name="FindRequest" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#FindRequest"/> <view-map name="ViewRequest" type="screen" page="component://order/widget/ordermgr/CustRequestScreens.xml#ViewRequest"/> Modified: ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml?rev=1160402&r1=1160401&r2=1160402&view=diff ============================================================================== --- ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml (original) +++ ofbiz/trunk/applications/order/widget/ordermgr/OrderMenus.xml Mon Aug 22 19:47:58 2011 @@ -161,6 +161,15 @@ under the License. </link> </menu-item> + <menu-item name="ListQuoteNotes" title="${uiLabelMap.OrderOrderQuoteNotes}"> + <condition> + <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/> + </condition> + <link target="ListQuoteNotes"> + <parameter param-name="quoteId" from-field="quote.quoteId"/> + </link> + </menu-item> + <menu-item name="ListQuoteAttributes" title="${uiLabelMap.OrderOrderQuoteAttributes}"> <condition> <if-compare operator="equals" value="QUO_CREATED" field="quote.statusId"/> Modified: ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml?rev=1160402&r1=1160401&r2=1160402&view=diff ============================================================================== --- ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml (original) +++ ofbiz/trunk/applications/order/widget/ordermgr/QuoteForms.xml Mon Aug 22 19:47:58 2011 @@ -545,4 +545,27 @@ under the License. header-row-style="header-row" default-table-style="basic-table" extends="EditQuoteTerm"> <alt-target use-when="quoteTerm==null" target="createQuoteTermFromItem"/> </form> + <form name="ListQuoteNotes" target="" title="" type="list" list-name="quoteNotes" + header-row-style="header-row-2" odd-row-style="alternate-row" default-table-style="basic-table hover-bar" paginate-target="ListQuoteNotes"> + <auto-fields-entity entity-name="QuoteNoteView" default-field-type="display"/> + <field name="quoteId"><hidden/></field> + <field name="noteId"><hidden/></field> + <field name="editLink" title="${uiLabelMap.CommonEmptyHeader}" widget-style="buttontext"> + <hyperlink target="EditQuoteNote" description="${uiLabelMap.CommonEdit}" also-hidden="false"> + <parameter param-name="quoteId"/> + <parameter param-name="noteId"/> + </hyperlink> + </field> + </form> + <form name="ListQuoteNoteInfo" extends="ListQuoteNotes"> + <field name="editLink"><hidden/></field> + <field name="noteInfo"><display size="100"/></field> + </form> + <form name="AddOrEditQuoteNote" target="${target}" type="single" default-entity-name="QuoteNoteView" default-map-name="quoteNoteData"> + <field name="quoteId"><hidden/></field> + <field name="noteId"><hidden/></field> + <field name="noteName"><text/></field> + <field name="noteInfo"><textarea rows="5" cols="70"/></field> + <field name="submitButton" title="${uiLabelMap.CommonSubmit}" widget-style="smallSubmit"><submit button-type="button"/></field> + </form> </forms> Modified: ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml?rev=1160402&r1=1160401&r2=1160402&view=diff ============================================================================== --- ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml (original) +++ ofbiz/trunk/applications/order/widget/ordermgr/QuoteScreens.xml Mon Aug 22 19:47:58 2011 @@ -40,8 +40,8 @@ under the License. </condition> <widgets> <include-menu name="QuoteTabBar" location="component://order/widget/ordermgr/OrderMenus.xml"/> - <container> - <label style="h1">[${uiLabelMap.CommonId}:${quote.quoteId}] ${quote.description}</label> + <container style="page-title"> + <label>${uiLabelMap[titleProperty]} [${uiLabelMap.CommonId}:${quote.quoteId}] ${quote.description}</label> </container> </widgets> </section> @@ -659,6 +659,10 @@ under the License. <field-map field-name="quoteId" from-field="parameters.quoteId"/> <field-map field-name="quoteItemSeqId" value="_NA_"/> </entity-and> + <entity-and entity-name="QuoteNoteView" list="quoteNotes"> + <field-map field-name="quoteId" from-field="parameters.quoteId"/> + <order-by field-name="-noteDateTime"/> + </entity-and> </actions> <widgets> <container style="lefthalf"> @@ -668,6 +672,7 @@ under the License. <include-screen name="quoteDate"/> <include-screen name="quoteRoles"/> <include-screen name="ListQuoteInfo"/> + <include-screen name="ListQuoteNoteInfo"/> </container> </widgets> </section> @@ -693,6 +698,18 @@ under the License. </widgets> </section> </screen> + <screen name="ListQuoteNoteInfo"> + <section> + <condition> + <not><if-empty field="quoteNotes"/></not> + </condition> + <widgets> + <screenlet title="${uiLabelMap.OrderOrderQuoteNotes}"> + <include-form name="ListQuoteNoteInfo" location="component://order/widget/ordermgr/QuoteForms.xml"/> + </screenlet> + </widgets> + </section> + </screen> <screen name="quoteDate"> <section> <widgets> @@ -804,4 +821,84 @@ under the License. </widgets> </section> </screen> + <screen name="ListQuoteNotes"> + <section> + <actions> + <set field="titleProperty" value="OrderOrderQuoteNoteList"/> + <set field="tabButtonItem" value="ListQuoteNotes"/> + <set field="quoteId" from-field="parameters.quoteId"/> + <entity-one entity-name="Quote" value-field="quote" auto-field-map="true"/> + <entity-and entity-name="QuoteNoteView" list="quoteNotes"> + <field-map field-name="quoteId" from-field="parameters.quoteId"/> + <order-by field-name="-noteDateTime"/> + </entity-and> + </actions> + <widgets> + <decorator-screen name="CommonQuoteDecorator" location="${parameters.quoteDecoratorLocation}"> + <decorator-section name="body"> + <container style="button-bar button-style-1"> + <link target="createnewquotenote" text="${uiLabelMap.OrderCreateOrderQuoteNote}"> + <parameter param-name="quoteId" from-field="quote.quoteId"/> + </link> + </container> + <include-form name="ListQuoteNotes" location="component://order/widget/ordermgr/QuoteForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + </section> + </screen> + <screen name="QuoteNewNote"> + <section> + <condition> + <not><if-empty field="parameters.quoteId"/></not> + </condition> + <actions> + <set field="titleProperty" value="OrderAddNote"/> + <set field="tabButtonItem" value="QuoteNotes"/> + <set field="target" value="createquotenote"/> + <set field="quoteId" from-field="parameters.quoteId"/> + <entity-one entity-name="Quote" value-field="quote"/> + </actions> + <widgets> + <decorator-screen name="CommonQuoteDecorator"> + <decorator-section name="body"> + <include-form name="AddOrEditQuoteNote" location="component://order/widget/ordermgr/QuoteForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + <fail-widgets> + <label style="h3">${uiLabelMap.OrderViewPermissionError}</label> + </fail-widgets> + </section> + </screen> + <screen name="EditQuoteNote"> + <section> + <condition> + <and> + <not><if-empty field="parameters.noteId"/></not> + <not><if-empty field="parameters.quoteId"/></not> + </and> + </condition> + <actions> + <set field="titleProperty" value="QuoteEditNote"/> + <set field="tabButtonItem" value="QuoteNotes"/> + <set field="target" value="updateQuoteNote"/> + <set field="quoteId" from-field="parameters.quoteId"/> + <set field="noteId" from-field="parameters.noteId"/> + <entity-one entity-name="Quote" value-field="quote"/> + <entity-one entity-name="QuoteNoteView" value-field="quoteNoteData"/> + </actions> + <widgets> + <decorator-screen name="CommonQuoteDecorator"> + <decorator-section name="body"> + <include-form name="AddOrEditQuoteNote" location="component://order/widget/ordermgr/QuoteForms.xml"/> + </decorator-section> + </decorator-screen> + </widgets> + <fail-widgets> + <label style="h3">${uiLabelMap.OrderViewPermissionError}</label> + </fail-widgets> + </section> + </screen> + </screens> |
Free forum by Nabble | Edit this page |