details: https://code.openbravo.com/erp/devel/pi/rev/07a2abc3ffad
changeset: 14022:07a2abc3ffad
user: David Baz Fayos <david.baz <at> openbravo.com>
date: Wed Oct 19 00:39:08 2011 +0200
summary: Fixed issue 17781: [statusbar] added link-out capabilities to status
bar fields
diffstat:
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-statusbar.js
| 41
+++++++++-
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
| 29 ++++--
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.css
| 23 +++++
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.js
| 4 +
4 files changed, 85 insertions(+), 12 deletions(-)
diffs (171 lines):
diff -r 3bea3a10622a -r 07a2abc3ffad
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-statusbar.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-statusbar.js
Tue Oct 18 17:46:19 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-statusbar.js
Wed Oct 19 00:39:08 2011 +0200
@@ -331,6 +331,29 @@
},
updateContentTitle: function(arrayTitleField, message) {
+ var linkImageWidth = this.titleLinkImageWidth,
+ linkImageHeight = this.titleLinkImageHeight;
+
+ if (typeof linkImageWidth !== 'undefined') {
+ linkImageWidth = linkImageWidth.toString();
+ if (linkImageWidth.indexOf('px') === -1) {
+ linkImageWidth = linkImageWidth + 'px';
+ }
+ linkImageWidth = 'width: ' + linkImageWidth + ';';
+ } else {
+ linkImageWidth = '';
+ }
+
+ if (typeof linkImageHeight !== 'undefined') {
+ linkImageHeight = linkImageHeight.toString();
+ if (linkImageHeight.indexOf('px') === -1) {
+ linkImageHeight = linkImageHeight + 'px';
+ }
+ linkImageHeight = 'height: ' + linkImageHeight + ';';
+ } else {
+ linkImageHeight = '';
+ }
+
var msg = '', i, length;
if (!isc.Page.isRTL()) { // LTR mode
if (this.statusCode) {
@@ -342,7 +365,14 @@
if (i !== 0 || this.statusCode) {
msg += '<span class="' +
(this.separatorLabelStyle?this.separatorLabelStyle:'') + '">' +
' | ' + '</span>';
}
- msg += '<span class="' +
(this.titleLabelStyle?this.titleLabelStyle:'') + '">' + arrayTitleField[0][i] +
': ' + '</span>';
+ if (typeof arrayTitleField[2][i] !== 'undefined' && typeof
arrayTitleField[3][i] !== 'undefined' && typeof arrayTitleField[4][i] !==
'undefined' && typeof arrayTitleField[5][i] !== 'undefined') {
+ msg += '<span class="' +
(this.titleLinkStyle?this.titleLinkStyle:'') +
+ '" onclick="OB.Utilities.openDirectView(\'' +
arrayTitleField[2][i] + '\', \'' + arrayTitleField[3][i] + '\', \'' +
arrayTitleField[4][i] + '\', \'' + arrayTitleField[5][i] + '\')">' +
+ arrayTitleField[0][i] + ': <img src="' +
(this.titleLinkImageSrc?this.titleLinkImageSrc:'') + '" style="' +
linkImageWidth + linkImageHeight + '" /> ' +
+ '</span>';
+ } else {
+ msg += '<span class="' +
(this.titleLabelStyle?this.titleLabelStyle:'') + '">' + arrayTitleField[0][i] +
': ' + '</span>';
+ }
msg += '<span class="' +
(this.fieldLabelStyle?this.fieldLabelStyle:'') + '">' +
this.getValidValue(arrayTitleField[1][i]) + '</span>';
}
}
@@ -362,7 +392,14 @@
if (arrayTitleField) {
for (i = arrayTitleField[0].length-1; i >= 0; i--) {
msg += '<span class="' +
(this.fieldLabelStyle?this.fieldLabelStyle:'') + '">' +
this.getValidValue(arrayTitleField[1][i]) + '</span>';
- msg += '<span class="' +
(this.titleLabelStyle?this.titleLabelStyle:'') + '">' + ' :' +
arrayTitleField[0][i] + '</span>';
+ if (typeof arrayTitleField[2][i] !== 'undefined' && typeof
arrayTitleField[3][i] !== 'undefined' && typeof arrayTitleField[4][i] !==
'undefined' && typeof arrayTitleField[5][i] !== 'undefined') {
+ msg += '<span class="' +
(this.titleLinkStyle?this.titleLinkStyle:'') +
+ '" onclick="OB.Utilities.openDirectView(\'' +
arrayTitleField[2][i] + '\', \'' + arrayTitleField[3][i] + '\', \'' +
arrayTitleField[4][i] + '\', \'' + arrayTitleField[5][i] + '\')">' +
+ ' <img src="' +
(this.titleLinkImageSrc?this.titleLinkImageSrc:'') + '" style="' +
linkImageWidth + linkImageHeight + '"/> :' + arrayTitleField[0][i] +
+ '</span>';
+ } else {
+ msg += '<span class="' +
(this.titleLabelStyle?this.titleLabelStyle:'') + '">' + ' :' +
arrayTitleField[0][i] + '</span>';
+ }
if (i !== 0 || this.statusCode) {
msg += '<span class="' +
(this.separatorLabelStyle?this.separatorLabelStyle:'') + '">' +
' | ' + '</span>';
}
diff -r 3bea3a10622a -r 07a2abc3ffad
modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
Tue Oct 18 17:46:19 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.client.application/js/form/ob-view-form.js
Wed Oct 19 00:39:08 2011 +0200
@@ -96,22 +96,27 @@
},
getStatusBarFields: function() {
- var statusBarFields = [[],[]], i, item, value, tmpValue,
+ var statusBarFields = [[],[],[],[],[], []], i, item, title, refColumnName,
targetEntity, value, displayedValue,
length = this.statusBarFields.length;
for(i = 0; i < length; i++) {
item = this.getItem(this.statusBarFields[i]);
+ title = item.getTitle();
+ sourceWindowId = this.view.standardWindow.windowId;
+ refColumnName = item.refColumnName;
+ targetEntity = item.targetEntity;
value = item.getValue();
- if(value !== null && value !== '') {
+ displayedValue = item.getValue();
+ if(displayedValue !== null && displayedValue !== '') {
if (item.getDisplayValue()) {
- value = item.getDisplayValue();
+ displayedValue = item.getDisplayValue();
}
- if(value === item.getTitle() && typeof item.getValue() === 'boolean')
{ // Checkbox items return the title as display value
+ if(displayedValue === title && typeof item.getValue() === 'boolean') {
// Checkbox items return the title as display value
if (item.getValue()) {
- value = OB.I18N.getLabel('OBUIAPP_Yes');
+ displayedValue = OB.I18N.getLabel('OBUIAPP_Yes');
} else {
- value = OB.I18N.getLabel('OBUIAPP_No');
+ displayedValue = OB.I18N.getLabel('OBUIAPP_No');
}
}
@@ -119,13 +124,17 @@
// status bar field and it has a value then always use that
// one
if (item.displayField && this.getValue(item.displayField)) {
- value = this.getValue(item.displayField);
+ displayedValue = this.getValue(item.displayField);
} else if (this.getValue(item.name + '._identifier')) {
- value = this.getValue(item.name + '._identifier');
+ displayedValue = this.getValue(item.name + '._identifier');
}
- statusBarFields[0].push(item.getTitle());
- statusBarFields[1].push(value);
+ statusBarFields[0].push(title);
+ statusBarFields[1].push(displayedValue);
+ statusBarFields[2].push(sourceWindowId);
+ statusBarFields[3].push(refColumnName);
+ statusBarFields[4].push(targetEntity);
+ statusBarFields[5].push(value);
}
}
return statusBarFields;
diff -r 3bea3a10622a -r 07a2abc3ffad
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.css
---
a/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.css
Tue Oct 18 17:46:19 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.css
Wed Oct 19 00:39:08 2011 +0200
@@ -40,6 +40,29 @@
font-weight: bold;
}
+.OBStatusBarTextLink_Title {
+ text-decoration: none;
+ font-weight: bold;
+ cursor: pointer;
+}
+
+.OBStatusBarTextLink_TitleOver,
+.OBStatusBarTextLink_Title:hover {
+ color: #58A618;
+}
+
+.OBStatusBarTextLink_TitleDown,
+.OBStatusBarTextLink_Title:active {
+ color: #004E27;
+}
+
+.OBStatusBarTextLink_TitleFocused,
+.OBStatusBarTextLink_TitleFocusedOver,
+.OBStatusBarTextLink_TitleFocusedDown,
+.OBStatusBarTextLink_Title:focus {
+ color: #fa962f;
+}
+
.OBStatusBarTextLabel_Field {
font-weight: normal;
}
diff -r 3bea3a10622a -r 07a2abc3ffad
modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.js
---
a/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.js
Tue Oct 18 17:46:19 2011 +0200
+++
b/modules/org.openbravo.client.application/web/org.openbravo.userinterface.smartclient/openbravo/skins/Default/org.openbravo.client.application/ob-statusbar-styles.js
Wed Oct 19 00:39:08 2011 +0200
@@ -27,6 +27,10 @@
statusLabelStyle: 'OBStatusBarTextLabel_Status',
titleLabelStyle: 'OBStatusBarTextLabel_Title',
+ titleLinkStyle: 'OBStatusBarTextLink_Title',
+ titleLinkImageSrc: OB.Styles.skinsPath +
'Default/org.openbravo.client.application/images/form/ico-to-new-tab.png',
+ titleLinkImageWidth: 8,
+ titleLinkImageHeight: 8,
fieldLabelStyle: 'OBStatusBarTextLabel_Field',
separatorLabelStyle: 'OBStatusBarTextLabel_Separator',
labelOverflowHidden: true,
------------------------------------------------------------------------------
All the data continuously generated in your IT infrastructure contains a
definitive record of customers, application performance, security
threats, fraudulent activity and more. Splunk takes this data and makes
sense of it. Business sense. IT sense. Common sense.
http://p.sf.net/sfu/splunk-d2d-oct
_______________________________________________
Openbravo-commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openbravo-commits