details:   https://code.openbravo.com/erp/devel/pi/rev/9ca29f4331b0
changeset: 19659:9ca29f4331b0
user:      David Baz Fayos <david.baz <at> openbravo.com>
date:      Tue Feb 12 15:51:34 2013 +0100
summary:   Related to issue 23029: Added license restrictions

diffstat:

 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
                         |  11 ++
 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
 |  12 ++-
 
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js
                       |  42 ++++++++-
 src-db/database/sourcedata/AD_FIELD.xml                                        
                            |   1 +
 4 files changed, 59 insertions(+), 7 deletions(-)

diffs (129 lines):

diff -r 0a282c496f47 -r 9ca29f4331b0 
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
--- 
a/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
        Tue Feb 12 14:07:20 2013 +0100
+++ 
b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
        Tue Feb 12 15:51:34 2013 +0100
@@ -685,6 +685,17 @@
 <!--7410A9E707384D369419188644A31430-->  
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
 <!--7410A9E707384D369419188644A31430--></AD_MESSAGE>
 
+<!--75E47FA30B8D438E9569B4C688E863EB--><AD_MESSAGE>
+<!--75E47FA30B8D438E9569B4C688E863EB-->  
<AD_MESSAGE_ID><![CDATA[75E47FA30B8D438E9569B4C688E863EB]]></AD_MESSAGE_ID>
+<!--75E47FA30B8D438E9569B4C688E863EB-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--75E47FA30B8D438E9569B4C688E863EB-->  <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--75E47FA30B8D438E9569B4C688E863EB-->  <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--75E47FA30B8D438E9569B4C688E863EB-->  
<VALUE><![CDATA[OBUIAPP_ActivateMessagePortal]]></VALUE>
+<!--75E47FA30B8D438E9569B4C688E863EB-->  <MSGTEXT><![CDATA[Portal is a Premium 
Feature]]></MSGTEXT>
+<!--75E47FA30B8D438E9569B4C688E863EB-->  <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--75E47FA30B8D438E9569B4C688E863EB-->  
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--75E47FA30B8D438E9569B4C688E863EB--></AD_MESSAGE>
+
 <!--787E5B6A41DB42B7A79F9789C696FE79--><AD_MESSAGE>
 <!--787E5B6A41DB42B7A79F9789C696FE79-->  
<AD_MESSAGE_ID><![CDATA[787E5B6A41DB42B7A79F9789C696FE79]]></AD_MESSAGE_ID>
 <!--787E5B6A41DB42B7A79F9789C696FE79-->  
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 0a282c496f47 -r 9ca29f4331b0 
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
--- 
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
        Tue Feb 12 14:07:20 2013 +0100
+++ 
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/utilities/ob-utilities.js
        Tue Feb 12 15:51:34 2013 +0100
@@ -11,7 +11,7 @@
  * under the License.
  * The Original Code is Openbravo ERP.
  * The Initial Developer of the Original Code is Openbravo SLU
- * All portions are Copyright (C) 2011-2012 Openbravo SLU
+ * All portions are Copyright (C) 2011-2013 Openbravo SLU
  * All Rights Reserved.
  * Contributor(s):  ______________________________________.
  ************************************************************************
@@ -49,6 +49,16 @@
   return true;
 };
 
+//** {{{OB.Utilities.notifyIfPortalIsNotAllowed}}} **
+// Used in the 'Role' window, in the 'For Portal Users' onchange field
+// It shows a warning dialog, if Portal is not available due to license 
restrictions
+OB.Utilities.notifyIfPortalIsNotAllowed = function (item, view, form, grid) {
+  if (item.getValue()) {
+    
OB.Utilities.checkProfessionalLicense(OB.I18N.getLabel('OBUIAPP_ActivateMessagePortal'));
+    item.setValue(false);
+  }
+};
+
 //** {{{OB.Utilities.encodeSearchOperator}}} **
 //Encodes and and or in a string with a forward slash
 OB.Utilities.encodeSearchOperator = function (value) {
diff -r 0a282c496f47 -r 9ca29f4331b0 
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js
--- 
a/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js
      Tue Feb 12 14:07:20 2013 +0100
+++ 
b/modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js
      Tue Feb 12 15:51:34 2013 +0100
@@ -95,6 +95,30 @@
     var me = this,
         i, recentViewsLayout, recentViewsLinksLayout, recentDocumentsLayout, 
recentDocumentsLinksLayout, addWidgetLayout, adminOtherMyOBLayout, 
refreshLayout;
 
+    if (OB.User.isPortal && OB.Application.licenseType === 'C') {
+      this.addMember(isc.HLayout.create({
+        width: '100%',
+        align: 'center',
+        layoutTopMargin: '30%',
+        members: [isc.Dialog.create({
+          width: 350,
+          height: 150,
+          canDragReposition: false,
+          canDragResize: false,
+          showCloseButton: false,
+          showMaximizeButton: false,
+          showMinimizeButton: false,
+          title: OB.I18N.getLabel('OBUIAPP_AlertGrid_Note'),
+          initWidget: function () {
+            this.icon = this.warnIcon;
+            this.Super('initWidget', arguments);
+          },
+          message: OB.I18N.getLabel('OBUIAPP_ActivateMessage', 
[OB.I18N.getLabel('OBUIAPP_ActivateMessagePortal')])
+        })]
+      }));
+      return false;
+    }
+
     if (OB.User.isPortal && !this.showLeftColumnInPortal) {
       this.addMember(isc.VLayout.create({
         width: 14
@@ -275,6 +299,10 @@
   },
 
   createPortalLayout: function () {
+    if (OB.User.isPortal && OB.Application.licenseType === 'C') {
+      return false;
+    }
+
     // the portallayout containing the widgets
     this.portalLayout = isc.PortalLayout.create({
       styleName: OB.Styles.OBMyOpenbravo.portalLayout.styleName,
@@ -394,14 +422,16 @@
 
     this.Super('initWidget', args);
 
+    OB.MyOB = this;
+
     // tell each column their index number
     // is used when dragging/dropping 
-    this.portalLayout.members[0].colNum = 0;
-    this.portalLayout.members[1].colNum = 1;
-    this.portalLayout.sendEvents = true;
-    OB.MyOB = this;
-
-    this.reloadWidgets();
+    if (this.portalLayout) {
+      this.portalLayout.members[0].colNum = 0;
+      this.portalLayout.members[1].colNum = 1;
+      this.portalLayout.sendEvents = true;
+      this.reloadWidgets();
+    }
   },
 
   setRecentList: function (layout) {
diff -r 0a282c496f47 -r 9ca29f4331b0 src-db/database/sourcedata/AD_FIELD.xml
--- a/src-db/database/sourcedata/AD_FIELD.xml   Tue Feb 12 14:07:20 2013 +0100
+++ b/src-db/database/sourcedata/AD_FIELD.xml   Tue Feb 12 15:51:34 2013 +0100
@@ -215974,6 +215974,7 @@
 <!--7497D8AC79D74DDCBA1DBAF07ED9D5D1-->  
<STARTINODDCOLUMN><![CDATA[N]]></STARTINODDCOLUMN>
 <!--7497D8AC79D74DDCBA1DBAF07ED9D5D1-->  
<STARTNEWLINE><![CDATA[N]]></STARTNEWLINE>
 <!--7497D8AC79D74DDCBA1DBAF07ED9D5D1-->  
<ISSHOWNINSTATUSBAR><![CDATA[N]]></ISSHOWNINSTATUSBAR>
+<!--7497D8AC79D74DDCBA1DBAF07ED9D5D1-->  
<ONCHANGEFUNCTION><![CDATA[OB.Utilities.notifyIfPortalIsNotAllowed]]></ONCHANGEFUNCTION>
 <!--7497D8AC79D74DDCBA1DBAF07ED9D5D1-->  
<EM_OBUIAPP_SHOWSUMMARY><![CDATA[N]]></EM_OBUIAPP_SHOWSUMMARY>
 <!--7497D8AC79D74DDCBA1DBAF07ED9D5D1--></AD_FIELD>
 

------------------------------------------------------------------------------
Free Next-Gen Firewall Hardware Offer
Buy your Sophos next-gen firewall before the end March 2013 
and get the hardware for free! Learn more.
http://p.sf.net/sfu/sophos-d2d-feb
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits

Reply via email to