diff --git a/css/module-spec_dbs_tracy.css b/css/module-spec_dbs_tracy.css index ac0a0589..79bac618 100644 --- a/css/module-spec_dbs_tracy.css +++ b/css/module-spec_dbs_tracy.css @@ -446,3 +446,10 @@ border: 1px solid #4ea5b9 ; border-radius: 6px ; } + +.x-item-over .devprofile-icon { + background-color:#eeeeee !important; + border-color: red !important; + + cursor: pointer; +} diff --git a/js/app/LoginWindow.js b/js/app/LoginWindow.js index 14573577..b2e85d94 100644 --- a/js/app/LoginWindow.js +++ b/js/app/LoginWindow.js @@ -192,7 +192,7 @@ Ext.define('Optima5.LoginWindow',{ var isIPAddress = function(v) { return /^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/.test(v); } ; - if( !isIPAddress(window.location.hostname) ) { + if( !isIPAddress(window.location.hostname) && (window.location.hostname.indexOf('int.mirabel-sil.com')==-1) ) { return ; } /* @@ -220,7 +220,7 @@ Ext.define('Optima5.LoginWindow',{ var form = me.down('#fpLogin').getForm() ; form.findField('user').setValue(responseObj.login_user+'@'+responseObj.login_domain) ; form.findField('password').setValue(responseObj.login_password) ; - me.doLogin() ; + //me.doLogin() ; }, scope:me }); diff --git a/js/app/Modules/Spec/DbsTracy/FilesGrid.js b/js/app/Modules/Spec/DbsTracy/FilesGrid.js index c6569a0b..c6b1ce17 100644 --- a/js/app/Modules/Spec/DbsTracy/FilesGrid.js +++ b/js/app/Modules/Spec/DbsTracy/FilesGrid.js @@ -48,10 +48,94 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ } } }),{ + xtype: 'tbseparator' + },{ + itemId: 'tbScopemode', + text: 'test', + viewConfig: {forceFit: true}, + menu: { + defaults: { + handler:function(menuitem) { + //console.log('ch view '+menuitem.itemId) ; + this.onScopeSet( menuitem.itemId ) ; + }, + scope:this + }, + items: [{ + itemId: 'status_open', + text: 'Active Orders', + iconCls: 'op5-spec-dbsezeer-explorer-status-scope' + },{ + xtype: 'menuseparator' + },{ + itemId: 'profile_packing', + text: 'Profile : Packing', + icon: 'images/dev/profile_packing_16.png' + },{ + itemId: 'profile_booking', + text: 'Profile : Booking', + icon: 'images/dev/profile_booking_16.png' + },{ + itemId: 'profile_customs', + text: 'Profile : Customs', + icon: 'images/dev/profile_customs_16.png' + },{ + itemId: 'profile_transit', + text: 'Profile : Transit', + icon: 'images/dev/profile_transit_16.png' + },{ + itemId: 'profile_pod', + text: 'Profile : PoD', + icon: 'images/dev/profile_pod_16.png' + },{ + xtype: 'menuseparator' + },{ + itemId: 'search_dates', + text: 'Active at date', + iconCls: 'op5-spec-dbsezeer-explorer-status-dates' + }] + } + },{ + icon: 'images/op5img/ico_calendar_16.png', + text: ' ', + itemId: 'date-picker', + menu: [{ + xtype: 'form', + layout: 'anchor', + bodyPadding: 5, + bodyCls: 'ux-noframe-bg', + defaults: { + listeners: { + select: function(field) { + var form = field.up('form'), + dateStart = form.getForm().findField('date_start').getValue(), + dateEnd = form.getForm().findField('date_end').getValue() ; + this.onDateSet(dateStart,dateEnd) ; + }, + scope: this + } + }, + items: [{ + margin: 5, + xtype: 'datefield', + name: 'date_start', + format: 'Y-m-d', + fieldLabel: 'Date start', + labelWidth: 80, + },{ + margin: 5, + xtype: 'datefield', + name: 'date_end', + format: 'Y-m-d', + fieldLabel: 'Date end', + labelWidth: 80, + }] + }] + },'->',{ itemId: 'btnSearchSeparator', xtype: 'tbseparator' },{ - icon: 'images/op5img/ico_search_16.gif', + icon: 'images/op5img/ico_loupe_16.png', itemId: 'btnSearchIcon', handler: function(btn) { btn.up().down('#btnSearch').reset() ; @@ -61,7 +145,7 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ },{ xtype: 'combobox', itemId: 'btnSearch', - width: 150, + width: 250, forceSelection:true, allowBlank:false, editable:true, @@ -110,7 +194,7 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ select: this.onSearchSelect, scope: this } - },'->',{ + },'-',{ itemId: 'tbCreate', icon: 'images/op5img/ico_new_16.gif', text:'Create file...', @@ -229,7 +313,7 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ type: 'hbox', align: 'stretch' }, - height: 84, + height: 96, style: 'background-color:#f5f5f5', items: [] },{ @@ -253,8 +337,15 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ return false ; } },this) ; + this.on('afterrender',function(pnl) { + pnl.getEl().on( 'click', function(e,t) { + console.log('FilesGrid is clicked'); + this.hideAnyFloating(); + },this) ; + }); this.onViewSet(this.defaultViewMode) ; + this.onScopeSet('status_open') ; }, onCrmeventBroadcast: function(crmEvent, eventParams) { switch( crmEvent ) { @@ -314,6 +405,85 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ return this.doConfigureNull() ; } }, + onScopeSet: function(viewId) { + switch( this.viewMode ) { + case 'order' : + break; + default: + return; + } + //this.doSearchResetSilent() ; + + var tbScopemode = this.down('#tbScopemode') ; + if( viewId==null && tbScopemode.tbViewmodeItemId ) { + viewId = tbScopemode.tbViewmodeItemId ; + } + var tbScopemode = this.down('#tbScopemode'), + tbViewmodeItem = tbScopemode.menu.getComponent(viewId), + iconCls, text ; + if( !tbViewmodeItem ) { + return ; + } + tbScopemode.tbViewmodeItemId = viewId ; + // View mode + var tbViewmodeItem = tbScopemode.menu.getComponent(viewId) ; + if( tbViewmodeItem ) { + var txt = '' + tbViewmodeItem.text + '' ; + tbScopemode.setText( txt ); + tbScopemode.setIconCls( tbViewmodeItem.iconCls ); + tbScopemode.setIcon( tbViewmodeItem.icon ); + } + + this.down('toolbar').down('#date-picker').setVisible( viewId=='search_dates' ) ; + if( viewId=='search_dates' ) { + var dateStart = new Date() ; + var dateEnd = new Date() ; + dateStart.setMonth( dateStart.getMonth() - 1 ) ; + + this.onDateSet(dateStart,dateEnd) ; + this.updateProfile(null) ; + } else if( viewId.indexOf('profile_')==0 ) { + var viewProfileCode = viewId.substr('profile_'.length) ; + //this.doLoad() ; + this.updateProfile(viewProfileCode) ; + } else { + this.updateProfile(null) ; + } + }, + onDateSet: function( dateStart, dateEnd ) { + //this.doSearchResetSilent() ; + + var dateStartObj = new Date(dateStart.toDateString()), + dateEndObj = new Date(dateEnd.toDateString()); + this.down('toolbar').down('#date-picker').menu.down('form').getForm().setValues({ + date_start: dateStartObj, + date_end: dateEndObj, + }); + this.down('toolbar').down('#date-picker').setText(''+Ext.Date.format(dateStartObj,'d/m/Y')+''+' > '+''+Ext.Date.format(dateEndObj,'d/m/Y')+'') ; + + //this.doLoad() ; + }, + updateProfile: function( profile_code ) { + //console.log(profile_code); + var cmp = this.down('#pNorth').down('#cmpHeadCounts'), + cmpData = cmp.getData(); + //console.dir(cmpData); + if( !profile_code ) { + Ext.apply(cmpData,{ + profile: null, + profile_txt: '', + }); + this.down('#pNorth').down('#cmpHeadCounts').update(cmpData) ; + return ; + } + //this.down('#pNorth').down('#cmpHeadCounts').update(ajaxDataCount) ; + var profileTxt = String(profile_code[0]).toUpperCase() + String(profile_code).slice(1); + Ext.apply(cmpData,{ + profile: profile_code, + profile_txt: profileTxt, + }); + this.down('#pNorth').down('#cmpHeadCounts').update(cmpData) ; + }, updateToolbar: function() { var showSearch = true ; switch( this.viewMode ) { @@ -331,6 +501,7 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ if( !showSearch ) { this.down('#btnSearch').reset() ; } + showSearch=true; this.down('#btnSearchSeparator').setVisible(showSearch) ; this.down('#btnSearchIcon').setVisible(showSearch) ; this.down('#btnSearch').setVisible(showSearch) ; @@ -1608,7 +1779,16 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ //width: 450, padding: 0, tpl: [ - '
', + '', + '
', + '{profile_txt}', + '
', + '', + '
', + '
', + '
', + + '
', 'DN/Orders', '
', '
', @@ -1620,7 +1800,7 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ '
', '', - '
', + '
', 'Open incidents', '
', '
', @@ -1633,7 +1813,7 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ '', '', - '
', + '
', 'Pending actions', '
', '
', @@ -1645,10 +1825,10 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ '
', '', - '
 
', + '
 
', '', - '
', + '
', '
', '', '
', @@ -1694,6 +1874,9 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ if( hEl = e.getTarget('.op5-spec-dbstracy-banner-click') ) { if( hEl.dataset && hEl.dataset.click ) { switch( hEl.dataset.click ) { + case 'profile' : + this.handleDevDataview(e); + break ; case 'incident_highlight' : this.handleOpenTickets(true); break ; @@ -1702,6 +1885,7 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ break ; } } + e.stopEvent(); } //console.dir(arguments); },this) ; @@ -2495,5 +2679,126 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.FilesGrid',{ if( this.tmpModelName ) { Ext.ux.dams.ModelManager.unregister( this.tmpModelName ) ; } + }, + + handleDevDataview: function(e) { + console.dir('handleDevDataview'); + + var emptyPanel = Ext.create('Ext.panel.Panel',{ + optimaModule: this.optimaModule, + + layout: 'fit', + items: [{ + xtype: 'dataview', + style: {backgroundColor: '#eeeeee'}, + store: { + fields: [{name:'profile',type:'string'}], + data: [ + {profile: 'packing'}, + {profile: 'booking'}, + {profile: 'customs'}, + {profile: 'transit'}, + {profile: 'pod'}, + ], + }, + //frame: true, + //autoScroll:true, + overflowX: 'auto', + style: { + backgroundColor: '#dddddd', + whiteSpace: 'nowrap' + }, + + tpl:[ + '', + // '
', + // '', + // '
', + // '
', + // '
{thumb_date}
', + // '', + // '', + // '', + // '
{thumb_caption}
', + // '
', + '
', + '
', + '', + '
', + '
{profile_txt}
', + '
', + '
' + ], + trackOver: true, + overItemCls: 'x-item-over', + itemSelector: 'div.devprofile-box', + prepareData: function(data) { + var profileCode = data.profile ; + var profileTxt = String(profileCode[0]).toUpperCase() + String(profileCode).slice(1); + Ext.apply(data,{ + profile_txt: profileTxt + }); + return data; + }, + listeners: { + itemclick: function(v,r) { + this.onScopeSet('profile_'+r.get('profile')); + this.hideAnyFloating() ; + }, + scope: this, + } + }], + + // _ticketFilerecordId: ticketFilerecordId, + // _ticketRecord: ticketRecord, + // _presetAction: presetAction, + + frame: false, + border: false, + + width:800, + height:148, + floating: true, + draggable: false, + resizable: false, + //renderTo: this.getEl(), + + _parentCmp: this, + }); + + emptyPanel.on('afterrender',function(pnl) { + pnl.getEl().on( 'click', function(e,t) { + console.log('handleDevDataview is clicked'); + e.stopEvent(); + },this) ; + }); + + emptyPanel.on('destroy',function(p) { + this.floatingPanel = null ; + this.getEl().unmask() ; + },this,{single:true}) ; + + console.dir(e.getXY()); + + emptyPanel.showAt(e.getXY()); + //emptyPanel.doResize() ; + this.floatingPanel = emptyPanel ; + this.floatingPanel.mon(this,'resize', function(p){ + //p.floatingPanel.doResize() ; + console.log('resizing........'); + },this); + this.getEl().mask() ; + + //notificationsPanel.getStore().loadData(notificationsData) ; + return emptyPanel ; + + }, + onClickSomewhere: function() { + console.dir('panel clicked'); + }, + hideAnyFloating: function() { + if( this.floatingPanel ) { + this.floatingPanel.destroy() ; + } } }); diff --git a/js/app/Modules/Spec/DbsTracy/GunMenu.js b/js/app/Modules/Spec/DbsTracy/GunMenu.js index a3ea80e1..07d00257 100644 --- a/js/app/Modules/Spec/DbsTracy/GunMenu.js +++ b/js/app/Modules/Spec/DbsTracy/GunMenu.js @@ -86,6 +86,14 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.GunMenu',{ action_caption: 'Example', action_sendEvent:'gun_picking', action_iconCls:'op5-spec-dbstracy-mmenu-files' + },{ + type_separator:true, + separator_label: 'Tools Webapps' + },{ + type_action:true, + action_caption: 'Easa Vs BL', + action_sendEvent:'webapp_easaVsBl', + action_iconCls:'op5-spec-dbstracy-mmenu-files' }] ; var itemsData = [] ; diff --git a/js/app/Modules/Spec/DbsTracy/GunPanel.js b/js/app/Modules/Spec/DbsTracy/GunPanel.js index 4ffa6dfc..143cba79 100644 --- a/js/app/Modules/Spec/DbsTracy/GunPanel.js +++ b/js/app/Modules/Spec/DbsTracy/GunPanel.js @@ -99,6 +99,7 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.GunPanel',{ scrollable: 'vertical', listeners: { actionclick: function( view, actionCode ) { + console.log('ACTION CLICK !!! '+actionCode); me.onActionClick(actionCode) ; }, scope: me @@ -122,6 +123,10 @@ Ext.define('Optima5.Modules.Spec.DbsTracy.GunPanel',{ case 'gun_tracy70aog' : return me.switchToAppPanel('Optima5.Modules.Spec.DbsTracy.GunTracy70',{_mode_AOG: true}) ; + case 'webapp_easaVsBl' : + this.optimaModule.postCrmEvent('open_new_window',{url:"https://www.google.com"}); + break ; + default : return ; }