svn commit: r540917 - in /ofbiz/trunk/applications/ecommerce: config/ webapp/ecommerce/WEB-INF/ webapp/ecommerce/WEB-INF/actions/customer/ webapp/ecommerce/customer/ widget/

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

svn commit: r540917 - in /ofbiz/trunk/applications/ecommerce: config/ webapp/ecommerce/WEB-INF/ webapp/ecommerce/WEB-INF/actions/customer/ webapp/ecommerce/customer/ widget/

rayb-2
Author: rayb
Date: Wed May 23 03:18:42 2007
New Revision: 540917

URL: http://svn.apache.org/viewvc?view=rev&rev=540917
Log:
New UI to offer sign-up to email contact lists in ecommerce.

Added:
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/contactlist.bsh
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/miniSignUpForContactList.ftl
Modified:
    ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties
    ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
    ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml
    ofbiz/trunk/applications/ecommerce/widget/EmailContactListScreens.xml

Modified: ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties?view=diff&rev=540917&r1=540916&r2=540917
==============================================================================
--- ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties (original)
+++ ofbiz/trunk/applications/ecommerce/config/EcommerceUiLabels.properties Wed May 23 03:18:42 2007
@@ -195,7 +195,7 @@
 EcommerceListItemsTotalPrice=This List Items Total Price
 EcommerceListName=List Name
 EcommerceListNewSubscription=New List Subscription:
-EcommerceListNote=NOTE: When you subscribe to an email contact list you will receive an email with an opt-in verification code and a link to verify your subscription. As an alternative to the link you can enter you opt-in verify code here.
+EcommerceListNote=NOTE: When you subscribe to an email contact list you will receive an email with an opt-in verification code and a link to verify your subscription. As an alternative to the link you can enter your opt-in verify code here.
 EcommerceListType=List Type
 EcommerceListView=List View
 EcommerceLoggedToPost=(You must be logged in to post)
@@ -295,6 +295,9 @@
 EcommerceShoppingListReorder=Shopping List Re-Order Info
 EcommerceShoppingLists=Shopping Lists
 EcommerceShortSubject=Short Subject
+EcommerceSignUpForContactList=Newsletter
+EcommerceSignUpForContactListComments=If you're interested in a newsletter enter your email address below and sign up:
+EcommerceSignUpForContactListLogIn=If you're interested in a newsletter then please log in and sign up:
 EcommerceSilver=Silver
 EcommerceSpecialOffers=Special Offers
 EcommerceStartDate=Start</br>Date

Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/contactlist.bsh
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/contactlist.bsh?view=auto&rev=540917
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/contactlist.bsh (added)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/actions/customer/contactlist.bsh Wed May 23 03:18:42 2007
@@ -0,0 +1,39 @@
+/*
+ * 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.
+ */
+
+import java.lang.*;
+import java.util.*;
+import org.ofbiz.base.util.*;
+import org.ofbiz.entity.*;
+import org.ofbiz.entity.util.*;
+import org.ofbiz.entity.condition.*;
+import org.ofbiz.party.contact.ContactMechWorker;
+import org.ofbiz.product.store.ProductStoreWorker;
+import org.ofbiz.accounting.payment.PaymentWorker;
+
+publicEmailContactLists = delegator.findByAnd("ContactList", UtilMisc.toMap("isPublic", "Y", "contactMechTypeId", "EMAIL_ADDRESS"), UtilMisc.toList("contactListName"));
+context.put("publicEmailContactLists", publicEmailContactLists);
+
+if (userLogin != null) {
+    partyAndContactMechList = delegator.findByAnd("PartyAndContactMech", UtilMisc.toMap("partyId", partyId, "contactMechTypeId", "EMAIL_ADDRESS"), UtilMisc.toList("-fromDate"));
+    partyAndContactMechList = EntityUtil.filterByDate(partyAndContactMechList, true);
+    context.put("partyAndContactMechList", partyAndContactMechList);
+}
+
+

Modified: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml?view=diff&rev=540917&r1=540916&r2=540917
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml (original)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/WEB-INF/controller.xml Wed May 23 03:18:42 2007
@@ -1220,6 +1220,13 @@
         <response name="error" type="view" value="contactus"/>
     </request-map>
 
+    <request-map uri="signUpForContactList">
+        <security https="false" auth="false"/>
+        <event type="service" invoke="signUpForContactList"/>
+        <response name="success" type="view" value="main"/>
+        <response name="error" type="view" value="main"/>
+    </request-map>
+
     <!-- ======================= Content Requests: Forums/Content/Articles ======================= -->
     
     <!-- used in new forum -->

Added: ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/miniSignUpForContactList.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/miniSignUpForContactList.ftl?view=auto&rev=540917
==============================================================================
--- ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/miniSignUpForContactList.ftl (added)
+++ ofbiz/trunk/applications/ecommerce/webapp/ecommerce/customer/miniSignUpForContactList.ftl Wed May 23 03:18:42 2007
@@ -0,0 +1,70 @@
+<#--
+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.
+-->
+
+<#-- A simple macro that builds the contact list -->
+<#macro contactList publicEmailContactLists>
+    <select name="contactListId" class="selectBox" style="width:134px">
+        <#list publicEmailContactLists as publicEmailContactList>
+            <#assign publicContactMechType = publicEmailContactList.getRelatedOneCache("ContactMechType")?if_exists>
+            <option value="${publicEmailContactList.contactListId}">${publicEmailContactList.contactListName?if_exists}</option>
+        </#list>
+    </select>
+</#macro>
+
+<div class="screenlet">
+    <div class="screenlet-header">
+        <div class="boxhead">${uiLabelMap.EcommerceSignUpForContactList}</div>
+    </div>
+    <div class="screenlet-body" style="text-align: center;">
+        <#if sessionAttributes.autoName?has_content>
+            <#-- The visitor potentially has an account and party id -->
+            <#if userLogin?has_content && userLogin.userLoginId != "anonymous">
+                <#-- They are logged in so lets present the form to sign up with their email address -->
+                <form method="post" action="<@ofbizUrl>createContactListParty</@ofbizUrl>" name="signUpForContactListForm">
+                    <input type="hidden" name="partyId" value="${partyId}"/>
+                    <input type="hidden" name="statusId" value="CLPT_PENDING"/>
+                    <span class="tabletext">${uiLabelMap.EcommerceSignUpForContactListComments}</span>
+                    <@contactList publicEmailContactLists=publicEmailContactLists/>
+
+                    <select name="preferredContactMechId" class="selectBox" style="width:134px">
+                        <#list partyAndContactMechList as partyAndContactMech>
+                            <option value="${partyAndContactMech.contactMechId}"><#if partyAndContactMech.infoString?has_content>${partyAndContactMech.infoString}<#elseif partyAndContactMech.tnContactNumber?has_content>${partyAndContactMech.tnCountryCode?if_exists}-${partyAndContactMech.tnAreaCode?if_exists}-${partyAndContactMech.tnContactNumber}<#elseif partyAndContactMech.paAddress1?has_content>${partyAndContactMech.paAddress1}, ${partyAndContactMech.paAddress2?if_exists}, ${partyAndContactMech.paCity?if_exists}, ${partyAndContactMech.paStateProvinceGeoId?if_exists}, ${partyAndContactMech.paPostalCode?if_exists}, ${partyAndContactMech.paPostalCodeExt?if_exists} ${partyAndContactMech.paCountryGeoId?if_exists}</#if></option>
+                        </#list>
+                    </select>
+
+                    <input type="submit" value="${uiLabelMap.CommonSubscribe}" class="smallSubmit"/>
+                </form>
+            <#else>
+                <#-- Not logged in so ask them to log in and then sign up or clear the user association -->
+                <div class="tabletext">${uiLabelMap.EcommerceSignUpForContactListLogIn}</div>
+                <div class="tabletext"><a href="<@ofbizUrl>${checkLoginUrl}</@ofbizUrl>" class="linktext">${uiLabelMap.CommonLogin}</a> ${sessionAttributes.autoName}</div>
+                <div class="tabletext">(${uiLabelMap.CommonNotYou}?&nbsp;<a href="<@ofbizUrl>autoLogout</@ofbizUrl>" class="buttontext">${uiLabelMap.CommonClickHere}</a>)</div>
+            </#if>
+        <#else>
+            <#-- There is no party info so just offer an anonymous (non-partyId) related newsletter sign up -->
+            <form method="post" action="<@ofbizUrl>signUpForContactList</@ofbizUrl>" name="signUpForContactListForm">
+                <span class="tabletext">${uiLabelMap.EcommerceSignUpForContactListComments}</span>
+                <@contactList publicEmailContactLists=publicEmailContactLists/>
+                <input size="20" maxlength="255" name="email" class="inputBox" value="" type="text">
+                <input type="submit" value="${uiLabelMap.CommonSubscribe}" class="smallSubmit"/>
+            </form>
+        </#if>
+    </div>
+</div>
+

Modified: ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml?view=diff&rev=540917&r1=540916&r2=540917
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/CommonScreens.xml Wed May 23 03:18:42 2007
@@ -83,6 +83,7 @@
                     <include-screen name="keywordsearchbox" location="component://ecommerce/widget/CatalogScreens.xml"/>
                     <include-screen name="sidedeepcategory" location="component://ecommerce/widget/CatalogScreens.xml"/>
                     <include-screen name="minireorderprods" location="component://ecommerce/widget/CatalogScreens.xml"/>
+                    <include-screen name="signupforcontactlist" location="component://ecommerce/widget/EmailContactListScreens.xml"/>
                     <include-screen name="minipoll" location="component://ecommerce/widget/ContentScreens.xml"/>
                     <include-screen name="forums" location="component://ecommerce/widget/ForumScreens.xml"/>
                     <include-screen name="content_categories" location="component://ecommerce/widget/ContentScreens.xml"/>

Modified: ofbiz/trunk/applications/ecommerce/widget/EmailContactListScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/applications/ecommerce/widget/EmailContactListScreens.xml?view=diff&rev=540917&r1=540916&r2=540917
==============================================================================
--- ofbiz/trunk/applications/ecommerce/widget/EmailContactListScreens.xml (original)
+++ ofbiz/trunk/applications/ecommerce/widget/EmailContactListScreens.xml Wed May 23 03:18:42 2007
@@ -36,4 +36,18 @@
             </widgets>
         </section>
     </screen>
+
+    <screen name="signupforcontactlist">
+        <section>
+            <actions>
+                <set field="partyId" from-field="userLogin.partyId"/>
+                <script location="component://ecommerce/webapp/ecommerce/WEB-INF/actions/customer/contactlist.bsh"/>
+                <property-map resource="ProductUiLabels" map-name="uiLabelMap" global="true"/>
+            </actions>
+            <widgets>
+                <platform-specific><html><html-template location="component://ecommerce/webapp/ecommerce/customer/miniSignUpForContactList.ftl"/></html></platform-specific>
+            </widgets>
+        </section>
+    </screen>
+
 </screens>