sync
[Pman.Admin] / Pman.Tab.AdminWatches.bjs
1 {
2  "name" : "Pman.Tab.AdminWatches",
3  "parent" : "Pman.Tab.AdminWatchNotify",
4  "title" : "Pman.Tab.AdminWatches",
5  "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminWatches.bjs",
6  "permname" : "",
7  "modOrder" : "860",
8  "strings" : {
9   "ec211f7c20af43e742bf2570c3cb84f9" : "Add",
10   "1a86349be7851cf03d6fe959b94ed6fb" : "Watch ID",
11   "1243daf593fa297e07ab03bf06d925af" : "Searching...",
12   "c4523f19258f444b936df7f96f57c7b9" : "Watch Table",
13   "498f79c4c5bbde77f1bceb6c86fd0f6d" : "Show",
14   "56abc507eda6d3226af192bf9b0e5d1f" : "What happens",
15   "5e97bbccf01aa772225ef15435177395" : "(function() {Roo.log('title') ;Roo.log(_this); return _this.title || \"Watches\"; })()",
16   "a4e70e911022ccc98ab8055a09222cf2" : "No core_watch found",
17   "a8929eb5c1553d3f70497f862d25d0ce" : "Select Action",
18   "b548a2ee926c118cc3211c5d8bb92a40" : "Who get's notified",
19   "6ceb94ff48a58bd6d612b1f031d2c2ca" : "Displaying core_watch{0} - {1} of {2}",
20   "c122d95a9c28f9a54baef2c7784bb038" : "Watch Event",
21   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
22   "4d3d769b812b6faa6b76e1a8abaece2d" : "Active",
23   "314b26dabb519a609db698728284683f" : "Select Table"
24  },
25  "items" : [
26   {
27    "listeners" : {
28     "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
29    },
30    "autoScroll" : false,
31    "background" : true,
32    "fitToframe" : true,
33    "region" : "center",
34    "xtype" : "GridPanel",
35    "| title" : "(function() {Roo.log('title') ;Roo.log(_this); return _this.title || \"Watches\"; })()",
36    "fitContainer" : true,
37    "$ xns" : "Roo",
38    "tableName" : "core_watch",
39    "items" : [
40     {
41      "listeners" : {
42       "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) {\n        return;\n    }\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
43       "|render" : "function() \n{\n    _this.grid = this; \n    _this.dialog = Pman.Dialog.AdminWatch;\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}"
44      },
45      "autoExpandColumn" : "person_id_name",
46      "xtype" : "Grid",
47      "loadMask" : true,
48      "$ xns" : "Roo.grid",
49      "* prop" : "grid",
50      "items" : [
51       {
52        "listeners" : {
53         "beforeload" : "function (_self, options)\n{\n        var val = _this.affectSel.getValue();\n        if (val.length) {\n            options.params.ontable = val;\n        }\n        if (_this.requestArgs) { \n            Roo.apply(options.params, _this.requestArgs);\n        }\n        \n}"
54        },
55        "xtype" : "Store",
56        "remoteSort" : true,
57        "$ sortInfo" : "{ field : 'ontable', direction: 'ASC' }",
58        "$ xns" : "Roo.data",
59        "* prop" : "dataSource",
60        "items" : [
61         {
62          "$ url" : "baseURL + '/Roo/core_watch.php'",
63          "method" : "GET",
64          "xtype" : "HttpProxy",
65          "$ xns" : "Roo.data",
66          "* prop" : "proxy"
67         },
68         {
69          "id" : "id",
70          "root" : "data",
71          "xtype" : "JsonReader",
72          "$ xns" : "Roo.data",
73          "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'ontable',\n        'type': 'string'\n    },\n    {\n        'name': 'onid',\n        'type': 'int'\n    },\n    {\n        'name': 'person_id',\n        'type': 'int'\n    },\n    {\n        'name': 'event',\n        'type': 'string'\n    },\n    {\n        'name': 'medium',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\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]",
74          "* prop" : "reader",
75          "totalProperty" : "total"
76         }
77        ]
78       },
79       {
80        "pageSize" : 25,
81        "xtype" : "PagingToolbar",
82        "emptyMsg" : "No core_watch found",
83        "$ xns" : "Roo",
84        "displayInfo" : true,
85        "displayMsg" : "Displaying core_watch{0} - {1} of {2}",
86        "* prop" : "footer"
87       },
88       {
89        "xtype" : "Toolbar",
90        "$ xns" : "Roo",
91        "* prop" : "toolbar",
92        "items" : [
93         {
94          "text" : "Show",
95          "xtype" : "TextItem",
96          "$ xns" : "Roo.Toolbar"
97         },
98         {
99          "listeners" : {
100           "|render" : "function (_self)\n{\n  _this.affectSel = _self;\n}",
101           "|select" : "function (combo, record, index)\n{\n  _this.grid.footer.onClick('first');\n}"
102          },
103          "listWidth" : 300,
104          "triggerAction" : "all",
105          "forceSelection" : true,
106          "selectOnFocus" : true,
107          "pageSize" : 20,
108          "displayField" : "on_table",
109          "emptyText" : "Select Table",
110          "minChars" : 2,
111          "valueField" : "on_table",
112          "xtype" : "ComboBox",
113          "allowBlank" : true,
114          "typeAhead" : true,
115          "editable" : false,
116          "width" : 150,
117          "$ xns" : "Roo.form",
118          "name" : "ontable",
119          "qtip" : "Select Action",
120          "queryParam" : "query[ontable]",
121          "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{on_table}</b> </div>",
122          "loadingText" : "Searching...",
123          "items" : [
124           {
125            "listeners" : {
126             "|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}"
127            },
128            "xtype" : "Store",
129            "remoteSort" : true,
130            "$ sortInfo" : "{ field : 'on_table' , direction : 'ASC' }",
131            "$ xns" : "Roo.data",
132            "* prop" : "store",
133            "items" : [
134             {
135              "$ url" : "baseURL + '/Roo/Events.php'",
136              "xtype" : "HttpProxy",
137              "method" : "GET",
138              "$ xns" : "Roo.data",
139              "* prop" : "proxy"
140             },
141             {
142              "id" : "id",
143              "root" : "data",
144              "xtype" : "JsonReader",
145              "$ fields" : "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'on_table',\n        'type': 'string'\n    }\n     \n]",
146              "$ xns" : "Roo.data",
147              "* prop" : "reader",
148              "totalProperty" : "total"
149             }
150            ]
151           }
152          ]
153         },
154         {
155          "xtype" : "Fill",
156          "$ xns" : "Roo.Toolbar"
157         },
158         {
159          "listeners" : {
160           "|click" : "function()\n{\n    if (!_this.dialog) {\n         return;\n     }\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
161          },
162          "text" : "Add",
163          "xtype" : "Button",
164          "cls" : "x-btn-text-icon",
165          "$ icon" : "Roo.rootURL + 'images/default/dd/drop-add.gif'",
166          "$ xns" : "Roo.Toolbar"
167         },
168         {
169          "listeners" : {
170           "|click" : "function()\n{\n     Pman.genericDelete(_this, 'core_watch'); \n}\n        "
171          },
172          "text" : "Delete",
173          "xtype" : "Button",
174          "cls" : "x-btn-text-icon",
175          "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
176          "$ xns" : "Roo.Toolbar"
177         }
178        ]
179       },
180       {
181        "xtype" : "ColumnModel",
182        "header" : "Watch Event",
183        "width" : 150,
184        "$ renderer" : "function(v,x,r) { \n    if (typeof(r.data.event_right_display_name) != 'undefined') {\n        return String.format('{0}: {1}', r.data.event_left, r.data.event_right_display_name);     \n    }\n    return String.format('{0}', v); \n    \n}",
185        "$ xns" : "Roo.grid",
186        "* prop" : "colModel[]",
187        "dataIndex" : "event"
188       },
189       {
190        "xtype" : "ColumnModel",
191        "header" : "Watch Table",
192        "width" : 150,
193        "$ renderer" : "function(v) { return String.format('{0}', v); }",
194        "$ xns" : "Roo.grid",
195        "* prop" : "colModel[]",
196        "dataIndex" : "ontable"
197       },
198       {
199        "xtype" : "ColumnModel",
200        "header" : "Watch ID",
201        "width" : 75,
202        "$ renderer" : "function(v) { return String.format('{0}', v); }",
203        "$ xns" : "Roo.grid",
204        "* prop" : "colModel[]",
205        "dataIndex" : "onid"
206       },
207       {
208        "xtype" : "ColumnModel",
209        "header" : "Who get's notified",
210        "width" : 150,
211        "$ renderer" : "function(v) { return String.format('{0}', v); }",
212        "$ xns" : "Roo.grid",
213        "* prop" : "colModel[]",
214        "dataIndex" : "person_id_name"
215       },
216       {
217        "xtype" : "ColumnModel",
218        "header" : "What happens",
219        "width" : 300,
220        "$ renderer" : "function(v) {\n    var ar = v.split(':');\n    if (ar.length > 1) {\n        var act = ar[1].replace(/^notify/,'');\n\n        return String.format('<span qtip=\"{0}\">{1}<span>', v, act);\n    }\n\n    return String.format('{0}', v);\n }",
221        "$ xns" : "Roo.grid",
222        "* prop" : "colModel[]",
223        "dataIndex" : "medium"
224       },
225       {
226        "xtype" : "ColumnModel",
227        "width" : 75,
228        "header" : "Active",
229        "$ renderer" : "function(v) { return String.format('{0}', v); }",
230        "$ xns" : "Roo.grid",
231        "* prop" : "colModel[]",
232        "dataIndex" : "active"
233       }
234      ]
235     }
236    ]
237   }
238  ]
239 }