|
Author: jleroux
Date: Fri Aug 13 11:54:59 2010 New Revision: 985166 URL: http://svn.apache.org/viewvc?rev=985166&view=rev Log: "Applied fix from trunk for revision: 985163" ------------------------------------------------------------------------ r985163 | jleroux | 2010-08-13 13:43:38 +0200 (ven. 13 ao–t 2010) | 26 lignes A patch from Karl Pitrich "When editing Portal Pages, Drag & Drop for Portlets does not work" (https://issues.apache.org/jira/browse/OFBIZ-3889) - OFBIZ-3889 When editing Portlet Pages, either in MyPortal or PortalAdm, Drag & Drop of Portlets does not work. Where are several Issues in the MyPortal, some have fixes, none is commited to trunk. Problems: * in myportal.js, function getDestinationInformationPortlets(): DOM ID's are not handled correctly * in framework/webtools/widget/PortalAdmScreens.xml: required javascript + css files are not included JLR: While working on this I have found other issues: the login.ftl files used in hhfacility and myportal were not tenant enabled. They are different but by chance in myportal very close to common so I was finally able to do both at along with Karl's changes. Actually I wanted to do 2 commits but forget to uncheck the files while doing a second attempt to commit. MyPortal * 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? hhfacility 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/branches/release10.04/ (props changed) ofbiz/branches/release10.04/framework/common/webcommon/portal/editPortalPage.ftl ofbiz/branches/release10.04/framework/images/webapp/images/myportal.css ofbiz/branches/release10.04/framework/images/webapp/images/myportal.js ofbiz/branches/release10.04/framework/webtools/widget/PortalAdmScreens.xml ofbiz/branches/release10.04/specialpurpose/hhfacility/webapp/hhfacility/login.ftl ofbiz/branches/release10.04/specialpurpose/myportal/widget/login.ftl Propchange: ofbiz/branches/release10.04/ ------------------------------------------------------------------------------ --- svn:mergeinfo (original) +++ svn:mergeinfo Fri Aug 13 11:54:59 2010 @@ -1,3 +1,3 @@ /ofbiz/branches/addbirt:831210-885099,885686-886087 /ofbiz/branches/multitenant20100310:921280-927264 -/ofbiz/trunk:939988,939990,939999,940025,940053,940234,940248,940309,940401,940410,940425,940779,940815,940849,941007,941047,941109,941177,941199,941261,941440,941600,941999,942084,942406,942414,942671,942883-942884,943168,943271-943272,944614,944621,944623,944647,944669,944797,944895,945010,945018,945026,945118,945573,945578,945580,945582,945610,945619,945848,945852,945857,946061,946066,946073,946075,946080,946309,946313,946320,946322,946596,947004-947005,947392,947424,947679,947988,948017,948694,949174,949710,949844,950866,950870,950893,951005,951062,951098,951251,951367,951381,951672,952232,952249,952270,953294,953671,954135,954583,954733,954956,955568,956022,956206,956340,957160,958343,958514,958521,958752,958758,958769,958953,959456,960491,960997,963610,964558,965470,965916,966525,966785,967098,978806,978893,978939,979104,980641-980642,980935,981051,981104,981123,981288,983920,983930 +/ofbiz/trunk:939988,939990,939999,940025,940053,940234,940248,940309,940401,940410,940425,940779,940815,940849,941007,941047,941109,941177,941199,941261,941440,941600,941999,942084,942406,942414,942671,942883-942884,943168,943271-943272,944614,944621,944623,944647,944669,944797,944895,945010,945018,945026,945118,945573,945578,945580,945582,945610,945619,945848,945852,945857,946061,946066,946073,946075,946080,946309,946313,946320,946322,946596,947004-947005,947392,947424,947679,947988,948017,948694,949174,949710,949844,950866,950870,950893,951005,951062,951098,951251,951367,951381,951672,952232,952249,952270,953294,953671,954135,954583,954733,954956,955568,956022,956206,956340,957160,958343,958514,958521,958752,958758,958769,958953,959456,960491,960997,963610,964558,965470,965916,966525,966785,967098,978806,978893,978939,979104,980641-980642,980935,981051,981104,981123,981288,983920,983930,985163 Modified: ofbiz/branches/release10.04/framework/common/webcommon/portal/editPortalPage.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/common/webcommon/portal/editPortalPage.ftl?rev=985166&r1=985165&r2=985166&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/common/webcommon/portal/editPortalPage.ftl (original) +++ ofbiz/branches/release10.04/framework/common/webcommon/portal/editPortalPage.ftl Fri Aug 13 11:54:59 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/branches/release10.04/framework/images/webapp/images/myportal.css URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/images/webapp/images/myportal.css?rev=985166&r1=985165&r2=985166&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/images/webapp/images/myportal.css (original) +++ ofbiz/branches/release10.04/framework/images/webapp/images/myportal.css Fri Aug 13 11:54:59 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/branches/release10.04/framework/images/webapp/images/myportal.js URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/images/webapp/images/myportal.js?rev=985166&r1=985165&r2=985166&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/images/webapp/images/myportal.js (original) +++ ofbiz/branches/release10.04/framework/images/webapp/images/myportal.js Fri Aug 13 11:54:59 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/branches/release10.04/framework/webtools/widget/PortalAdmScreens.xml URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/framework/webtools/widget/PortalAdmScreens.xml?rev=985166&r1=985165&r2=985166&view=diff ============================================================================== --- ofbiz/branches/release10.04/framework/webtools/widget/PortalAdmScreens.xml (original) +++ ofbiz/branches/release10.04/framework/webtools/widget/PortalAdmScreens.xml Fri Aug 13 11:54:59 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/branches/release10.04/specialpurpose/hhfacility/webapp/hhfacility/login.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/specialpurpose/hhfacility/webapp/hhfacility/login.ftl?rev=985166&r1=985165&r2=985166&view=diff ============================================================================== --- ofbiz/branches/release10.04/specialpurpose/hhfacility/webapp/hhfacility/login.ftl (original) +++ ofbiz/branches/release10.04/specialpurpose/hhfacility/webapp/hhfacility/login.ftl Fri Aug 13 11:54:59 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/branches/release10.04/specialpurpose/myportal/widget/login.ftl URL: http://svn.apache.org/viewvc/ofbiz/branches/release10.04/specialpurpose/myportal/widget/login.ftl?rev=985166&r1=985165&r2=985166&view=diff ============================================================================== --- ofbiz/branches/release10.04/specialpurpose/myportal/widget/login.ftl (original) +++ ofbiz/branches/release10.04/specialpurpose/myportal/widget/login.ftl Fri Aug 13 11:54:59 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}"/> |
| Free forum by Nabble | Edit this page |
