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: [ - '