svn commit: r985163 - in /ofbiz/trunk: framework/common/webcommon/portal/ framework/images/webapp/images/ framework/webtools/widget/ specialpurpose/hhfacility/webapp/hhfacility/ specialpurpose/myportal/widget/

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

svn commit: r985163 - in /ofbiz/trunk: framework/common/webcommon/portal/ framework/images/webapp/images/ framework/webtools/widget/ specialpurpose/hhfacility/webapp/hhfacility/ specialpurpose/myportal/widget/

jleroux@apache.org
Author: jleroux
Date: Fri Aug 13 11:43:38 2010
New Revision: 985163

URL: http://svn.apache.org/viewvc?rev=985163&view=rev
Log:
The login process in MyPortal was not tenant enabled, it's done in this commit.
I kept its specificity : newRegisterLogin and wonder why it has not been extended to common?

The login process in hhfacility was not tenant enabled, it's done in this commit. Doing so, I saw there i18n is not done, not an issue for me...

Modified:
    ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl
    ofbiz/trunk/framework/images/webapp/images/myportal.css
    ofbiz/trunk/framework/images/webapp/images/myportal.js
    ofbiz/trunk/framework/webtools/widget/PortalAdmScreens.xml
    ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/login.ftl
    ofbiz/trunk/specialpurpose/myportal/widget/login.ftl

Modified: ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl?rev=985163&r1=985162&r2=985163&view=diff
==============================================================================
--- ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl (original)
+++ ofbiz/trunk/framework/common/webcommon/portal/editPortalPage.ftl Fri Aug 13 11:43:38 2010
@@ -57,8 +57,8 @@ under the License.
               <#assign portletFields = '<input name="portalPageId" value="' + portlet.portalPageId + '" type="hidden"/><input name="portalPortletId" value="' + portlet.portalPortletId + '" type="hidden"/><input name="portletSeqId" value="' + portlet.portletSeqId  + '" type="hidden"/>'>
               <div class="portlet-config" id="portalPortlet_${portlet_index}" onmouseover="javascript:this.style.cursor='move';">
               <div class="portlet-config-title-bar">
-                  <script type="text/javascript">makeDragable("${portlet_index}");</script>
-                  <script type="text/javascript">makeDroppable("${portlet_index}");</script>
+                  <script type="text/javascript">makeDragable("portalPortlet_${portlet_index}");</script>
+                  <script type="text/javascript">makeDroppable("portalPortlet_${portlet_index}");</script>
                   <form method="post" action="<@ofbizUrl>updatePortalPagePortletAjax</@ofbizUrl>" name="freeMove_${portlet_index}">${portletFields}<input name="columnSeqId" value="${portalPageColumnList[portalPageColumn_index].columnSeqId}" type="hidden"/><input name="mode" value="RIGHT" type="hidden"/></form>
                 <#list portalPages as portalPageList>
                   <#if portalPage.portalPageId != portalPageList.portalPageId>

Modified: ofbiz/trunk/framework/images/webapp/images/myportal.css
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/myportal.css?rev=985163&r1=985162&r2=985163&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/myportal.css (original)
+++ ofbiz/trunk/framework/images/webapp/images/myportal.css Fri Aug 13 11:43:38 2010
@@ -17,21 +17,24 @@
  * under the License.
  */
 
+html,body {
+height:100%;
+margin:0;
+}
+
 #loading {
+background-color: rgba(0, 0, 0, 0.496094);
 position: absolute;
-background-image: url(/images/myportal_load_bg.png);
-background-repeat:repeat;
-background-position:top center;
-z-index: 100;
 top: 0px;
-left: 10px;
-border: 0px !important;
-width: 99%;
+left: 0px;
+width: 100%;
 height: 100%;
+z-index: 9999;
 }
 
 #loaderImg {
 position: absolute;
-top: 200px;
+top: 250px;
 left: 50%;
 }
+

Modified: ofbiz/trunk/framework/images/webapp/images/myportal.js
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/images/webapp/images/myportal.js?rev=985163&r1=985162&r2=985163&view=diff
==============================================================================
--- ofbiz/trunk/framework/images/webapp/images/myportal.js (original)
+++ ofbiz/trunk/framework/images/webapp/images/myportal.js Fri Aug 13 11:43:38 2010
@@ -193,13 +193,17 @@ function makeDroppable(id){
 //calls ajax request for dropping container on a portlet
 function getDestinationInformationPortlets(originId, destinationId, mode){
     loadingImage();
-
-    var move = document.forms['freeMove_' + destinationId];
+
+    // extract integer part of arguments for freeMove_<id>
+    var destId = destinationId.replace(/.*_([0-9]+)/, "\$1");
+    var origId = originId.replace(/.*_([0-9]+)/, "\$1");
+    
+    var move = document.forms['freeMove_' + destId];
     var d_portalPageId = move.elements['portalPageId'].value;
     var d_portalPortletId = move.elements['portalPortletId'].value;
     var d_portletSeqId =  move.elements['portletSeqId'].value;
 
-    var move = document.forms['freeMove_' + originId];
+    var move = document.forms['freeMove_' + origId];
     var o_portalPageId = move.elements['portalPageId'].value;
     var o_portalPortletId = move.elements['portalPortletId'].value;
     var o_portletSeqId =  move.elements['portletSeqId'].value;
@@ -287,15 +291,32 @@ function onCompleteRequest() {
     }
 }
 
+//safely get height of whole document
+function getDocHeight() {
+    var D = document;
+    return Math.max(
+        Math.max(D.body.scrollHeight, D.documentElement.scrollHeight),
+        Math.max(D.body.offsetHeight, D.documentElement.offsetHeight),
+        Math.max(D.body.clientHeight, D.documentElement.clientHeight)
+    );
+}
+
 //displays the loading image
-function loadingImage() {
-    var container = document.getElementById("portalContainerId");
+function loadingImage() {
     var p = document.createElement("div");
-    p.setAttribute("id", "loading");
+    p.setAttribute("id", "loading");    
+    p.setAttribute("style", "height: " + getDocHeight() + "px;" )
+    
     var img = document.createElement("img");
     img.setAttribute("src", "/images/loader.gif");
     img.setAttribute("id", "loaderImg");
+
+    //place loader image somwhere in the middle of the viewport
+    img.setAttribute("style", "top: " + (document.viewport.getHeight() / 2 + document.viewport.getScrollOffsets().top - 50) + "px;");    
+    
     p.appendChild(img);
+    
+    var container = document.getElementById("portalContainerId");
     container.appendChild(p);
 }
 

Modified: ofbiz/trunk/framework/webtools/widget/PortalAdmScreens.xml
URL: http://svn.apache.org/viewvc/ofbiz/trunk/framework/webtools/widget/PortalAdmScreens.xml?rev=985163&r1=985162&r2=985163&view=diff
==============================================================================
--- ofbiz/trunk/framework/webtools/widget/PortalAdmScreens.xml (original)
+++ ofbiz/trunk/framework/webtools/widget/PortalAdmScreens.xml Fri Aug 13 11:43:38 2010
@@ -93,6 +93,8 @@ under the License.
         <section>
             <actions>
                 <set field="headerItem" value="PortalPageAdminItem"/>
+                <set field="layoutSettings.javaScripts[]" value="/images/myportal.js" global="true"/>
+                <set field="layoutSettings.styleSheets[+0]" value="/images/myportal.css" global="true"/>
                 <entity-one entity-name="PortalPage" value-field="portalPage"/>
                 <set field="Adm" value="Adm"/>
             </actions>

Modified: ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/login.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/login.ftl?rev=985163&r1=985162&r2=985163&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/login.ftl (original)
+++ ofbiz/trunk/specialpurpose/hhfacility/webapp/hhfacility/login.ftl Fri Aug 13 11:43:38 2010
@@ -16,7 +16,7 @@ KIND, either express or implied.  See th
 specific language governing permissions and limitations
 under the License.
 -->
-
+<#assign useMultitenant = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "multitenant")>
 <#assign username = requestParameters.USERNAME?default((sessionAttributes.autoUserLogin.userLoginId)?default(""))>
 <#if username != "">
   <#assign focusName = false>
@@ -62,6 +62,12 @@ under the License.
                           <input type="password" name="PASSWORD" value="" size="20" />
                         </td>
                       </tr>
+          <#if ("Y" == useMultitenant)>
+            <tr>
+              <td class="label">TenantId</td>
+              <td><input type="text" name="tenantId" value="${parameters.tenantId?if_exists}" size="20"/></td>
+            </tr>
+          </#if>
                       <tr>
                         <td colspan="2" align="center">
                           <!--<a href="javascript:document.loginform.submit()" class="buttontext">[Login]</a>-->

Modified: ofbiz/trunk/specialpurpose/myportal/widget/login.ftl
URL: http://svn.apache.org/viewvc/ofbiz/trunk/specialpurpose/myportal/widget/login.ftl?rev=985163&r1=985162&r2=985163&view=diff
==============================================================================
--- ofbiz/trunk/specialpurpose/myportal/widget/login.ftl (original)
+++ ofbiz/trunk/specialpurpose/myportal/widget/login.ftl Fri Aug 13 11:43:38 2010
@@ -18,6 +18,7 @@ under the License.
 -->
 
 <#if requestAttributes.uiLabelMap?exists><#assign uiLabelMap = requestAttributes.uiLabelMap></#if>
+<#assign useMultitenant = Static["org.ofbiz.base.util.UtilProperties"].getPropertyValue("general.properties", "multitenant")>
 
 <#assign username = requestParameters.USERNAME?default((sessionAttributes.autoUserLogin.userLoginId)?default(""))>
 <#if username != "">
@@ -41,6 +42,12 @@ under the License.
             <td class="label">${uiLabelMap.CommonPassword}</td>
             <td><input type="password" name="PASSWORD" value="" size="20"/></td>
           </tr>
+          <#if ("Y" == useMultitenant)>
+            <tr>
+              <td class="label">${uiLabelMap.CommonTenantId}</td>
+              <td><input type="text" name="tenantId" value="${parameters.tenantId?if_exists}" size="20"/></td>
+            </tr>
+          </#if>
           <tr>
             <td colspan="2" align="center">
               <input type="submit" value="${uiLabelMap.CommonLogin}"/>