X-Git-Url: http://git.roojs.org/?p=Pman.Admin;a=blobdiff_plain;f=Pman.Dialog.AdminWatch.js;h=f98c5c395546b35a2859f9af1d76ed60b5808c35;hp=6d24a28e1afdf39b3fd51ae9736f3d7032644c43;hb=HEAD;hpb=9b3c4f4795b340bc5e6acc69d691e78c4007ebe5 diff --git a/Pman.Dialog.AdminWatch.js b/Pman.Dialog.AdminWatch.js index 6d24a28..f98c5c3 100644 --- a/Pman.Dialog.AdminWatch.js +++ b/Pman.Dialog.AdminWatch.js @@ -33,6 +33,7 @@ Pman.Dialog.AdminWatch = { closable : false, collapsible : false, height : 230, + modal : true, resizable : false, title : "Edit / Create core_watch", width : 500, @@ -50,17 +51,17 @@ Pman.Dialog.AdminWatch = { { if (action.type == 'setdata') { //_this.dialog.el.mask("Loading"); - //this.load({ method: 'GET', params: { '_id' : _this.data.id }}); + if (_this.data.id) { + this.load({ method: 'GET', params: { '_id' : _this.data.id }}); + } return; } if (action.type == 'load') { - _this.dialog.el.unmask(); - return; + return; } if (action.type =='submit') { - _this.dialog.el.unmask(); - _this.dialog.hide(); + _this.dialog.hide(); if (_this.callback) { _this.callback.call(_this, _this.form.getValues()); @@ -118,7 +119,7 @@ Pman.Dialog.AdminWatch = { { o.params = o.params || {}; // staff can see all logs, other companies can only see their own. - if (Pman.Login.authUser.company_id_comptype != 'OWNER') { + if ((typeof(Pman.Login) != 'undefined') && Pman.Login.authUser.company_id_comptype != 'OWNER') { o.params.company_id = Pman.Login.authUser.company_id; } o.params._distinct = 'on_table'; @@ -270,7 +271,7 @@ Pman.Dialog.AdminWatch = { fieldLabel : 'Notify Who', forceSelection : true, hiddenName : 'person_id', - listWidth : 400, + listWidth : 500, loadingText : "Searching...", minChars : 2, name : 'person_id_name', @@ -278,7 +279,7 @@ Pman.Dialog.AdminWatch = { qtip : "Select Person", queryParam : 'query[name]', selectOnFocus : true, - tpl : '
{name}
', + tpl : '
{name} ({company_id_name}) <{email}>
', triggerAction : 'all', typeAhead : true, valueField : 'id', @@ -286,19 +287,19 @@ Pman.Dialog.AdminWatch = { store : { xtype: 'Store', xns: Roo.data, - remoteSort : true, - sortInfo : { direction : 'ASC', field: 'id' }, listeners : { beforeload : function (_self, o){ o.params = o.params || {}; // set more here } }, + remoteSort : true, + sortInfo : { direction : 'ASC', field: 'name' }, proxy : { xtype: 'HttpProxy', xns: Roo.data, method : 'GET', - url : baseURL + '/Roo/Person.php' + url : baseURL + '/Roo/core_person' }, reader : { xtype: 'JsonReader', @@ -326,7 +327,6 @@ Pman.Dialog.AdminWatch = { allowBlank : true, displayField : 'action', editable : true, - emptyText : "Select Action", fieldLabel : 'Match Event', forceSelection : false, listWidth : 300, @@ -350,7 +350,7 @@ Pman.Dialog.AdminWatch = { { o.params = o.params || {}; // staff can see all logs, other companies can only see their own. - if (Pman.Login.authUser.company_id_comptype != 'OWNER') { + if (typeof(Pman.Login) !='undefined' && Pman.Login.authUser.company_id_comptype != 'OWNER') { o.params.company_id = Pman.Login.authUser.company_id; } o.params._distinct = 'action'; @@ -488,52 +488,23 @@ Pman.Dialog.AdminWatch = { { xtype: 'ComboBox', xns: Roo.form, - allowBlank : false, - alwaysQuery : true, - displayField : 'title', - editable : false, - fieldLabel : 'Country', - hiddenName : 'country', + allowBlank : true, + displayField : 'val', + editable : true, + fieldLabel : 'Action', + forceSelection : false, listWidth : 200, - name : 'country_name', + name : 'medium', triggerAction : 'all', - valueField : 'code', + valueField : 'val', width : 200, store : { - xtype: 'Store', + xtype: 'SimpleStore', xns: Roo.data, - proxy : { - xtype: 'HttpProxy', - xns: Roo.data, - method : 'GET', - url : baseURL + '/I18N/Country.php' - }, - reader : { - xtype: 'JsonReader', - xns: Roo.data, - id : 'code', - root : 'data', - totalProperty : 'total', - fields : [ - { - 'name': 'code', - 'type': 'string' - }, - { - 'name': 'title', - 'type': 'string' - } - ] - } + data : [ [ 'email' ], [ 'APPROVAL' ], ['ENDOFDAYMAIL'] ], + fields : [ 'val' ] } }, - { - xtype: 'TextField', - xns: Roo.form, - fieldLabel : 'Action', - name : 'medium', - width : 200 - }, { xtype: 'Checkbox', xns: Roo.form, @@ -575,7 +546,7 @@ Pman.Dialog.AdminWatch = { // do some checks? - _this.dialog.el.mask("Saving"); + _this.form.doAction("submit"); }