sync
[Pman.Admin] / Pman.Dialog.AdminWatch.bjs
index 83e6bfe..0a8a13f 100644 (file)
@@ -1,5 +1,5 @@
 {
-    "id": "roo-file-170",
+    "id": "roo-file-220",
     "name": "Pman.Dialog.AdminWatch",
     "parent": "",
     "title": "",
@@ -9,6 +9,7 @@
             "closable": false,
             "collapsible": false,
             "height": 230,
+            "modal": true,
             "resizable": false,
             "title": "Edit / Create core_watch",
             "width": 500,
                     "|xns": "Roo",
                     "items": [
                         {
-                            "|xns": "Roo.form",
-                            "xtype": "Form",
                             "listeners": {
-                                "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       //this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
+                                "|actioncomplete": "function(_self,action)\n{\n    if (action.type == 'setdata') {\n       //_this.dialog.el.mask(\"Loading\");\n       if (_this.data.id) {\n           this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n       }\n       return;\n    }\n    if (action.type == 'load') {\n         return;\n    }\n    if (action.type =='submit') {\n    \n            _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
                                 "|rendered": "function (form)\n{\n    _this.form= form;\n}\n"
                             },
                             "method": "POST",
                             "style": "margin:10px;",
+                            "xtype": "Form",
                             "|url": "baseURL + '/Roo/core_watch.php'",
+                            "|xns": "Roo.form",
                             "items": [
                                 {
                                     "listeners": {
@@ -65,7 +66,7 @@
                                     "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 = 'on_table';\n    o.params._columns ='on_table';\n}"
+                                                "|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 ((typeof(Pman.Login) != 'undefined') && Pman.Login.authUser.company_id_comptype != 'OWNER') {\n        o.params.company_id = Pman.Login.authUser.company_id;\n    }\n    o.params._distinct = 'on_table';\n    o.params._columns ='on_table';\n}"
                                             },
                                             "*prop": "store",
                                             "remoteSort": true,
                                     "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}) &lt;{email}&gt;</div>",
                                     "triggerAction": "all",
                                     "typeAhead": true,
                                     "valueField": "id",
                                     "|xns": "Roo.form",
                                     "items": [
                                         {
-                                            "*prop": "store",
-                                            "xtype": "Store",
-                                            "|xns": "Roo.data",
-                                            "remoteSort": true,
-                                            "|sortInfo": "{ direction : 'ASC', field: 'id' }",
                                             "listeners": {
                                                 "|beforeload": "function (_self, o){\n    o.params = o.params || {};\n    // set more here\n}\n"
                                             },
+                                            "*prop": "store",
+                                            "remoteSort": true,
+                                            "xtype": "Store",
+                                            "|sortInfo": "{ direction : 'ASC', field: 'name' }",
+                                            "|xns": "Roo.data",
                                             "items": [
                                                 {
                                                     "*prop": "proxy",
                                                     "xtype": "HttpProxy",
                                                     "method": "GET",
                                                     "|xns": "Roo.data",
-                                                    "|url": "baseURL + '/Roo/Person.php'"
+                                                    "|url": "baseURL + '/Roo/core_person'"
                                                 },
                                                 {
                                                     "*prop": "reader",
                                     "allowBlank": true,
                                     "displayField": "action",
                                     "editable": true,
-                                    "emptyText": "Select Action",
                                     "fieldLabel": "Match Event",
                                     "forceSelection": false,
                                     "listWidth": 300,
                                     "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}"
+                                                "|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 (typeof(Pman.Login) !='undefined' && 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,
                                     ]
                                 },
                                 {
-                                    "allowBlank": false,
-                                    "alwaysQuery": true,
-                                    "displayField": "title",
-                                    "editable": false,
+                                    "allowBlank": true,
+                                    "displayField": "val",
+                                    "editable": true,
                                     "fieldLabel": "Action",
+                                    "forceSelection": false,
                                     "listWidth": 200,
                                     "name": "medium",
                                     "triggerAction": "all",
                                         {
                                             "*prop": "store",
                                             "xtype": "SimpleStore",
-                                            "|data": "[ [ 'email' ], [ 'APPROVAL' ] ]",
+                                            "|data": "[ [ 'email' ], [ 'APPROVAL' ], ['ENDOFDAYMAIL'] ]",
                                             "|fields": "[ 'val' ]",
                                             "|xns": "Roo.data"
                                         }
                                     ]
                                 },
-                                {
-                                    "fieldLabel": "Action",
-                                    "name": "medium",
-                                    "width": 200,
-                                    "xtype": "TextField",
-                                    "|xns": "Roo.form"
-                                },
                                 {
                                     "fieldLabel": "Active?",
                                     "name": "active",
                 },
                 {
                     "listeners": {
-                        "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n    _this.dialog.el.mask(\"Saving\");\n    _this.form.doAction(\"submit\");\n\n}"
+                        "click": "function (_self, e)\n{\n    // do some checks?\n     \n    \n \n    _this.form.doAction(\"submit\");\n\n}"
                     },
                     "*prop": "buttons[]",
                     "text": "Save",