svn commit: r689816 - in /ofbiz/trunk: applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy specialpurpose/mypage/webapp/mypage/WEB-INF/actions/GetMyCompany.bsh specialpurpose/mypage/widget/MyPageScreens.xml

Previous Topic Next Topic
 
classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

svn commit: r689816 - in /ofbiz/trunk: applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy specialpurpose/mypage/webapp/mypage/WEB-INF/actions/GetMyCompany.bsh specialpurpose/mypage/widget/MyPageScreens.xml

hansbak-2
Author: hansbak
Date: Thu Aug 28 06:39:13 2008
New Revision: 689816

URL: http://svn.apache.org/viewvc?rev=689816&view=rev
Log:
convert and move from bsh to groovy..because also used in the accounting component (next commit)

Added:
    ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy   (with props)
Removed:
    ofbiz/trunk/specialpurpose/mypage/webapp/mypage/WEB-INF/actions/GetMyCompany.bsh
Modified:
    ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml

Added: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy?rev=689816&view=auto
==============================================================================
--- ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy (added)
+++ ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy Thu Aug 28 06:39:13 2008
@@ -0,0 +1,31 @@
+/*
+ * 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.
+ */
+
+if (userLogin) {
+ companies = delegator.findByAnd("PartyRelationship",
+ [partyIdTo: userLogin.partyId,
+         roleTypeIdTo: "CONTACT",
+         roleTypeIdFrom: "ACCOUNT"]);
+ if (companies) {
+ company = companies.get(0);
+ context.myCompanyId = company.partyIdFrom;
+ } else {
+ context.myCompanyId = userLogin.partyId;
+ }
+}
\ No newline at end of file

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy
------------------------------------------------------------------------------
    svn:keywords = "Date Rev Author URL Id"

Propchange: ofbiz/trunk/applications/party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy
------------------------------------------------------------------------------
    svn:mime-type = text/plain

Modified: ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml?rev=689816&r1=689815&r2=689816&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml (original)
+++ ofbiz/trunk/specialpurpose/mypage/widget/MyPageScreens.xml Thu Aug 28 06:39:13 2008
@@ -463,7 +463,7 @@
         <section>
             <actions>
                 <set field="headerItem" value="invoices"/>
-                <script location="component://mypage/webapp/mypage/WEB-INF/actions/GetMyCompany.bsh"/>
+                <script location="component://party/webapp/partymgr/WEB-INF/actions/party/GetMyCompany.groovy"/>                
                 <set field="parameters.partyId" from-field="myCompanyId"/>
             </actions>
             <widgets>