details: https://code.openbravo.com/erp/devel/pi/rev/892d969472df
changeset: 19632:892d969472df
user: David Baz Fayos <david.baz <at> openbravo.com>
date: Mon Feb 11 13:51:57 2013 +0100
summary: Fixed issue 23029: Added capabilities to set a 'Role' as 'Portal'
role
diffstat:
modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
| 11 +
modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/layout.js.ftl
| 19 +-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-manager.js
| 3 +-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js
| 4 +-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-help-about-widget.js
| 3 +-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-logout-widget.js
| 22 +-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js
| 3 +-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-user-profile-widget.js
| 164 ++++++---
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-application-styles.js
| 19 +-
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-navigation-bar-styles.js
| 14 +-
modules/org.openbravo.client.kernel/src/org/openbravo/client/kernel/templates/application-dynamic-js.ftl
| 7 +-
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-myopenbravo.js
| 24 +-
modules/org.openbravo.client.myob/web/org.openbravo.client.myob/js/ob-widget.js
| 8 +-
src-db/database/model/tables/AD_ROLE.xml
| 4 +
src-db/database/sourcedata/AD_COLUMN.xml
| 36 ++
src-db/database/sourcedata/AD_ELEMENT.xml
| 14 +
src-db/database/sourcedata/AD_FIELD.xml
| 29 +
17 files changed, 288 insertions(+), 96 deletions(-)
diffs (truncated from 817 to 300 lines):
diff -r 2b1ed45e9a0a -r 892d969472df
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
Mon Feb 11 12:43:15 2013 +0100
+++
b/modules/org.openbravo.client.application/src-db/database/sourcedata/AD_MESSAGE.xml
Mon Feb 11 13:51:57 2013 +0100
@@ -286,6 +286,17 @@
<!--20EBBDD0DE864992AD7B8090D1126A06-->
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
<!--20EBBDD0DE864992AD7B8090D1126A06--></AD_MESSAGE>
+<!--26DBE659B9B746CF996AC9F4A6475BC3--><AD_MESSAGE>
+<!--26DBE659B9B746CF996AC9F4A6475BC3-->
<AD_MESSAGE_ID><![CDATA[26DBE659B9B746CF996AC9F4A6475BC3]]></AD_MESSAGE_ID>
+<!--26DBE659B9B746CF996AC9F4A6475BC3-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
+<!--26DBE659B9B746CF996AC9F4A6475BC3--> <AD_ORG_ID><![CDATA[0]]></AD_ORG_ID>
+<!--26DBE659B9B746CF996AC9F4A6475BC3--> <ISACTIVE><![CDATA[Y]]></ISACTIVE>
+<!--26DBE659B9B746CF996AC9F4A6475BC3-->
<VALUE><![CDATA[UINAVBA_LogOut]]></VALUE>
+<!--26DBE659B9B746CF996AC9F4A6475BC3--> <MSGTEXT><![CDATA[Log Out]]></MSGTEXT>
+<!--26DBE659B9B746CF996AC9F4A6475BC3--> <MSGTYPE><![CDATA[I]]></MSGTYPE>
+<!--26DBE659B9B746CF996AC9F4A6475BC3-->
<AD_MODULE_ID><![CDATA[9BA0836A3CD74EE4AB48753A47211BCC]]></AD_MODULE_ID>
+<!--26DBE659B9B746CF996AC9F4A6475BC3--></AD_MESSAGE>
+
<!--2C8A8843F1E04317AD38623A3C52F978--><AD_MESSAGE>
<!--2C8A8843F1E04317AD38623A3C52F978-->
<AD_MESSAGE_ID><![CDATA[2C8A8843F1E04317AD38623A3C52F978]]></AD_MESSAGE_ID>
<!--2C8A8843F1E04317AD38623A3C52F978-->
<AD_CLIENT_ID><![CDATA[0]]></AD_CLIENT_ID>
diff -r 2b1ed45e9a0a -r 892d969472df
modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/layout.js.ftl
---
a/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/layout.js.ftl
Mon Feb 11 12:43:15 2013 +0100
+++
b/modules/org.openbravo.client.application/src/org/openbravo/client/application/templates/layout.js.ftl
Mon Feb 11 13:51:57 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) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -66,6 +66,9 @@
var newMembers = [], i;
for (i = 0; i < members.length; i++) {
// encapsulate in 2 hlayouts to handle correct mouse over/hover and
show of box
+ if (OB.User.isPortal && !members[i].showInPortal) {
+ continue;
+ }
var newMember = isc.HLayout.create({layoutLeftMargin: 0,
layoutRightMargin: 0, width: '100%', height: '100%', styleName:
'OBNavBarComponent', members:[members[i]]});
newMembers[i] = newMember;
}
@@ -116,12 +119,18 @@
if (OB.Styles && OB.Styles.hideOpenbravoLogo) {
OB.TopLayout.OpenbravoLogo.hide();
}
-
+
+ OB.TopLayout.addMember(
+ isc.HLayout.create({}, OB.Styles.TopLayout.LeftSpacer)
+ );
OB.TopLayout.addMember(OB.NavBar);
OB.TopLayout.addMember(
- isc.HLayout.create({
- members: [OB.TopLayout.CompanyImageLogo,
OB.TopLayout.OpenbravoLogo]
- }, OB.Styles.TopLayout.LogosContainer)
+ isc.HLayout.create({}, OB.Styles.TopLayout.MiddleSpacer)
+ );
+ OB.TopLayout.addMember(
+ isc.HLayout.create({
+ members: [OB.TopLayout.CompanyImageLogo, OB.TopLayout.OpenbravoLogo]
+ }, OB.Styles.TopLayout.LogosContainer)
);
// add the top part to the main layout
diff -r 2b1ed45e9a0a -r 892d969472df
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-manager.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-manager.js
Mon Feb 11 12:43:15 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/alert-management/ob-alert-manager.js
Mon Feb 11 13:51:57 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) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -108,6 +108,7 @@
// The OBAlertIcon extends from the Smartclient Button.
// The OBAlertIcon registers itself as a listener in the Alert Manager.
isc.OBAlertIcon.addProperties({
+ showInPortal: false,
initWidget: function () {
var instance = this,
diff -r 2b1ed45e9a0a -r 892d969472df
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js
Mon Feb 11 12:43:15 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-application-menu.js
Mon Feb 11 13:51:57 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): ______________________________________.
************************************************************************
@@ -203,6 +203,8 @@
isc.ClassFactory.defineClass('OBApplicationMenuButton', isc.MenuButton);
isc.OBApplicationMenuButton.addProperties({
+ showInPortal: false,
+
keyboardShortcutId: 'NavBar_MenuButton',
draw: function () {
diff -r 2b1ed45e9a0a -r 892d969472df
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-help-about-widget.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-help-about-widget.js
Mon Feb 11 12:43:15 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-help-about-widget.js
Mon Feb 11 13:51:57 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) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -26,6 +26,7 @@
// links: about and help. The help link will only be
// displayed if the current selected window has a help view.
isc.OBHelpAbout.addProperties({
+ showInPortal: false,
layoutProperties: {},
diff -r 2b1ed45e9a0a -r 892d969472df
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-logout-widget.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-logout-widget.js
Mon Feb 11 12:43:15 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-logout-widget.js
Mon Feb 11 13:51:57 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): ______________________________________.
************************************************************************
@@ -22,8 +22,24 @@
// = OBLogout =
// The OBLogout implements a widget to logout the application
isc.OBLogout.addProperties({
+ showInPortal: true,
+
keyboardShortcutId: 'NavBar_OBLogout',
+ showLogoutText: false,
+
+ initWidget: function () {
+ if (this.showLogoutText) {
+ this.baseStyle = isc.OBAlertIcon.getInstanceProperty('baseStyle');
+ this.height = '100%';
+ this.autoFit = true;
+ this.showTitle = true;
+ this.src = '';
+ this.title = OB.I18N.getLabel('UINAVBA_LogOut');
+ }
+ this.Super('initWidget', arguments);
+ },
+
draw: function () {
var me = this,
ksAction;
@@ -35,7 +51,9 @@
OB.KeyboardManager.Shortcuts.set(this.keyboardShortcutId, 'Canvas',
ksAction);
this.Super("draw", arguments);
- this.setPrompt(OB.I18N.getLabel('UINAVBA_EndSession'));
+ if (!this.showLogoutText) {
+ this.setPrompt(OB.I18N.getLabel('UINAVBA_EndSession'));
+ }
/* Avoid declare directly "prompt: " in this widget definition.
Declared as "setPrompt" inside "draw" function in order to solve issue
https://issues.openbravo.com/view.php?id=18192 in FF */
diff -r 2b1ed45e9a0a -r 892d969472df
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js
Mon Feb 11 12:43:15 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-quick-launch.js
Mon Feb 11 13:51:57 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): ______________________________________.
************************************************************************
@@ -59,6 +59,7 @@
isc.ClassFactory.defineClass('OBQuickLaunch', isc.OBQuickRun);
isc.OBQuickLaunch.addProperties({
+ showInPortal: false,
draw: function () {
this.Super("draw", arguments);
diff -r 2b1ed45e9a0a -r 892d969472df
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-user-profile-widget.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-user-profile-widget.js
Mon Feb 11 12:43:15 2013 +0100
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/navbar/ob-user-profile-widget.js
Mon Feb 11 13:51:57 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) 2010-2012 Openbravo SLU
+ * All portions are Copyright (C) 2010-2013 Openbravo SLU
* All Rights Reserved.
* Contributor(s): ______________________________________.
************************************************************************
@@ -23,6 +23,9 @@
// user. By clicking the widget a form is opened which allows to edit the
// user/role information and change the password.
isc.OBUserProfile.addProperties({
+ showInPortal: true,
+
+ showProfileFormInPortal: false,
layoutProperties: {
width: 280
@@ -38,10 +41,6 @@
// Set to empty to prevent an icon from being displayed on the button.
src: '',
- // ** {{{ prompt }}} **
- //
- // Shown on hover, shows some user information.
- prompt: '<b>' + OB.I18N.getLabel('UINAVBA_Role') + '</b>: ' +
OB.User.roleName + '<br/>' + '<b>' + OB.I18N.getLabel('UINAVBA_Client') +
'</b>: ' + OB.User.clientName + '<br/>' + '<b>' +
OB.I18N.getLabel('UINAVBA_Organization') + '</b>: ' + OB.User.organizationName,
hoverWidth: 200,
showTitle: true,
@@ -53,11 +52,15 @@
this.initialize();
// reset before showing
- this.roleForm.reset();
- this.roleForm.focusInItem('role');
+ if (this.profileForm) {
+ this.profileForm.reset();
+ this.profileForm.focusInItem('role');
+ }
this.tabSet.selectTab(0);
- this.passwordForm.reset();
- this.passwordForm.setFocusItem('currentPwd');
+ if (this.pwdForm) {
+ this.pwdForm.reset();
+ this.pwdForm.setFocusItem('currentPwd');
+ }
this.Super('doShow', arguments);
},
@@ -72,27 +75,24 @@
}, function (req, data, resp) {
me.formData = data;
});
+ // ** {{{ setPrompt }}} **
+ // Shown on hover, shows some user information.
+ if (!OB.User.isPortal) {
+ this.setPrompt('<b>' + OB.I18N.getLabel('UINAVBA_Role') + '</b>: ' +
OB.User.roleName + '<br/>' + '<b>' + OB.I18N.getLabel('UINAVBA_Client') +
'</b>: ' + OB.User.clientName + '<br/>' + '<b>' +
OB.I18N.getLabel('UINAVBA_Organization') + '</b>: ' + OB.User.organizationName);
+ }
this.Super('initWidget', arguments);
OB.TestRegistry.register('org.openbravo.client.application.navigationbarcomponents.UserProfileButton',
this);
},
- // ** {{{ initialize() }}} **
- //
- // Creates the forms, fields and buttons.
- initialize: function () {
- if (this.roleForm) {
- return;
+ createProfileForm: function () {
+ var me = this,
+ profileFormLayout, buttonLayout, profileForm, comboBoxFieldProperties,
roleField, orgField, warehouseField, languageField, checkboxFieldProperties,
defaultField, clientField, textFieldProperties;
+
+ if (OB.User.isPortal && !this.showProfileFormInPortal) {
+ return false;
}
- var me = this,
- formLayout, newPasswordField, passwordForm, confirmPasswordField,
buttonLayout, currentPasswordField, roleForm, widgetInstance,
comboBoxFieldProperties, roleField, orgField, warehouseField, languageField,
checkboxFieldProperties, defaultField, clientField, tabSet, pwdButtonLayout,
pwdFormLayout, pwdSaveButton, textFieldProperties, passwordFieldProperties,
dummyFirstField, dummyLastField;
-
- OB.Layout.userProfileWidget = this;
-
- // have a pointer to this instance
- widgetInstance = this;
-
// create a default form field types
comboBoxFieldProperties = {
errorOrientation: OB.Styles.OBFormField.DefaultComboBox.errorOrientation,
@@ -217,7 +217,7 @@
}, textFieldProperties);
// create the form for the role information
- roleForm = isc.DynamicForm.create({
+ profileForm = isc.DynamicForm.create({
autoFocus: true,
overflow: 'visible',
numCols: 1,
@@ -344,16 +344,13 @@
});
// create the form layout which contains both the form and the buttons
------------------------------------------------------------------------------
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