closable : false,
collapsible : false,
height : 230,
+ modal : true,
resizable : false,
title : "Edit / Create core_watch",
width : 500,
{
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());
{
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';
fieldLabel : 'Notify Who',
forceSelection : true,
hiddenName : 'person_id',
- listWidth : 400,
+ listWidth : 500,
loadingText : "Searching...",
minChars : 2,
name : 'person_id_name',
qtip : "Select Person",
queryParam : 'query[name]',
selectOnFocus : true,
- tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> </div>',
+ tpl : '<div class="x-grid-cell-text x-btn button"><b>{name}</b> ({company_id_name}) <{email}></div>',
triggerAction : 'all',
typeAhead : true,
valueField : 'id',
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',
}
},
{
- xtype: 'TextField',
+ xtype: 'ComboBox',
xns: Roo.form,
- fieldLabel : 'Event',
+ listeners : {
+ select : function (combo, record, index)
+ {
+ _this.grid.footer.onClick('first');
+ },
+ render : function (_self)
+ {
+ _this.actionSel = _self;
+ }
+ },
+ allowBlank : true,
+ displayField : 'action',
+ editable : true,
+ fieldLabel : 'Match Event',
+ forceSelection : false,
+ listWidth : 300,
+ loadingText : "Searching...",
+ minChars : 2,
name : 'event',
- width : 200
+ pageSize : 20,
+ qtip : "Select Action",
+ queryParam : 'query[action]',
+ selectOnFocus : true,
+ tpl : '<div class="x-grid-cell-text x-btn button"><b>{action}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'action',
+ width : 150,
+ store : {
+ xtype: 'Store',
+ xns: Roo.data,
+ listeners : {
+ beforeload : function (_self, o)
+ {
+ o.params = o.params || {};
+ // staff can see all logs, other companies can only see their own.
+ 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';
+ o.params._columns ='action';
+ }
+ },
+ remoteSort : true,
+ sortInfo : { field : 'action' , direction : 'ASC' },
+ proxy : {
+ xtype: 'HttpProxy',
+ xns: Roo.data,
+ method : 'GET',
+ url : baseURL + '/Roo/Events.php'
+ },
+ reader : {
+ xtype: 'JsonReader',
+ xns: Roo.data,
+ totalProperty : 'total',
+ root : 'data',
+ id : 'id',
+ fields : [
+ {
+ 'name': 'id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'event_when',
+ 'type': 'date',
+ 'dateFormat': 'Y-m-d'
+ },
+ {
+ 'name': 'action',
+ 'type': 'string'
+ },
+ {
+ 'name': 'ipaddr',
+ 'type': 'string'
+ },
+ {
+ 'name': 'on_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'on_table',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_office_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_name',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_phone',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_fax',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_email',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_company_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_role',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_active',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_remarks',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_passwd',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_owner_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_lang',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_no_reset_sent',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_action_type',
+ 'type': 'string'
+ },
+ {
+ 'name': 'person_id_project_id',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_deleted_by',
+ 'type': 'int'
+ },
+ {
+ 'name': 'person_id_deleted_dt',
+ 'type': 'date'
+ }
+ ]
+ }
+ }
},
{
- xtype: 'TextField',
+ xtype: 'ComboBox',
xns: Roo.form,
+ allowBlank : true,
+ displayField : 'val',
+ editable : true,
fieldLabel : 'Action',
+ forceSelection : false,
+ listWidth : 200,
name : 'medium',
- width : 200
+ triggerAction : 'all',
+ valueField : 'val',
+ width : 200,
+ store : {
+ xtype: 'SimpleStore',
+ xns: Roo.data,
+ data : [ [ 'email' ], [ 'APPROVAL' ], ['ENDOFDAYMAIL'] ],
+ fields : [ 'val' ]
+ }
},
{
- xtype: 'TextField',
+ xtype: 'Checkbox',
xns: Roo.form,
- fieldLabel : 'Active',
- name : 'active',
- width : 75
+ fieldLabel : 'Active?',
+ name : 'active'
},
{
xtype: 'Hidden',
// do some checks?
- _this.dialog.el.mask("Saving");
+
_this.form.doAction("submit");
}