Pman.Dialog.AdminWatch.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 28 Sep 2011 08:32:13 +0000 (16:32 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 28 Sep 2011 08:32:13 +0000 (16:32 +0800)
Pman.Dialog.AdminWatch.bjs
Pman.Dialog.AdminWatch.js
Pman.Dialog.AdminWatch.js

Pman.Dialog.AdminWatch.bjs
Pman.Dialog.AdminWatch.js

index 0f6df26..4677f38 100644 (file)
                                     "|xns": "Roo.form",
                                     "xtype": "TextField"
                                 },
+                                {
+                                    "listeners": {
+                                        "|select": "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}",
+                                        "|render": "function (_self)\n{\n  _this.actionSel = _self;\n}"
+                                    },
+                                    "allowBlank": true,
+                                    "displayField": "action",
+                                    "editable": false,
+                                    "emptyText": "Select Action",
+                                    "forceSelection": true,
+                                    "listWidth": 300,
+                                    "loadingText": "Searching...",
+                                    "minChars": 2,
+                                    "name": "action",
+                                    "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,
+                                    "xtype": "ComboBox",
+                                    "|xns": "Roo.form",
+                                    "items": [
+                                        {
+                                            "listeners": {
+                                                "|beforeload": "function (_self, o)\n{\n    o.params = o.params || {};\n    // staff can see all logs, other companies can only see their own.\n    if (Pman.Login.authUser.company_id_comptype != 'OWNER') {\n        o.params.company_id = Pman.Login.authUser.company_id;\n    }\n    o.params._distinct = 'action';\n    o.params._columns ='action';\n}"
+                                            },
+                                            "*prop": "store",
+                                            "remoteSort": true,
+                                            "xtype": "Store",
+                                            "|sortInfo": "{ field : 'action' , direction : 'ASC' }",
+                                            "|xns": "Roo.data",
+                                            "items": [
+                                                {
+                                                    "*prop": "proxy",
+                                                    "method": "GET",
+                                                    "xtype": "HttpProxy",
+                                                    "|url": "baseURL + '/Roo/Events.php'",
+                                                    "|xns": "Roo.data"
+                                                },
+                                                {
+                                                    "|xns": "Roo.data",
+                                                    "xtype": "JsonReader",
+                                                    "totalProperty": "total",
+                                                    "root": "data",
+                                                    "*prop": "reader",
+                                                    "id": "id",
+                                                    "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_name',\n        'type': 'string'\n    },\n    {\n        'name': 'event_when',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'action',\n        'type': 'string'\n    },\n    {\n        'name': 'ipaddr',\n        'type': 'string'\n    },\n    {\n        'name': 'on_id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'person_id_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_by',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id_deleted_dt',\n        'type': 'date'\n    }\n]"
+                                                }
+                                            ]
+                                        }
+                                    ]
+                                },
                                 {
                                     "fieldLabel": "Action",
                                     "name": "medium",
index 822d3b6..59a271f 100644 (file)
@@ -317,6 +317,180 @@ Pman.Dialog.AdminWatch = {
                                     name : 'event',
                                     width : 200
                                 },
+                                {
+                                    xtype: 'ComboBox',
+                                    xns: Roo.form,
+                                    listeners : {
+                                        select : function (combo, record, index)
+                                        {
+                                          _this.grid.footer.onClick('first');
+                                        },
+                                        render : function (_self)
+                                        {
+                                          _this.actionSel = _self;
+                                        }
+                                    },
+                                    allowBlank : true,
+                                    displayField : 'action',
+                                    editable : false,
+                                    emptyText : "Select Action",
+                                    forceSelection : true,
+                                    listWidth : 300,
+                                    loadingText : "Searching...",
+                                    minChars : 2,
+                                    name : 'action',
+                                    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 (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',
                                     xns: Roo.form,