Pman.Tab.AdminProjectManager.bjs
[Pman.Admin] / Pman.Tab.AdminProjectManager.bjs
1 {
2     "id": "roo-file-10",
3     "name": "Pman.Tab.AdminProjectManager",
4     "parent": "Pman.Tab.Admin",
5     "title": "Pman.Tab.AdminProjectManager",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminProjectManager.bjs",
7     "items": [
8         {
9             "region": "center",
10             "title": "Projects",
11             "xtype": "NestedLayoutPanel",
12             "|xns": "Roo",
13             "fitContainer": true,
14             "listeners": {},
15             "items": [
16                 {
17                     "|xns": "Roo",
18                     "xtype": "BorderLayout",
19                     "*prop": "layout",
20                     "items": [
21                         {
22                             "|xns": "Roo",
23                             "xtype": "LayoutRegion",
24                             "*prop": "center"
25                         },
26                         {
27                             "*prop": "east",
28                             "width": 300,
29                             "xtype": "LayoutRegion",
30                             "|xns": "Roo"
31                         },
32                         {
33                             "listeners": {
34                                 "|activate": "function() {\n    _this.panel = this;\n    try {\n        _this.dialog =  Pman.Dialog.CoreProject ; \n    } catch(e) {}\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
35                             },
36                             "background": true,
37                             "fitContainer": true,
38                             "fitToframe": true,
39                             "region": "center",
40                             "tableName": "Projects",
41                             "title": "Projects",
42                             "xtype": "GridPanel",
43                             "|xns": "Roo",
44                             "items": [
45                                 {
46                                     "listeners": {
47                                         "|render": "function() \n{\n    _this.grid = this; \n    //_this.dialog = Pman.Dialog.FILL_IN\n    if (_this.panel.active) {\n       this.footer.onClick('first');\n    }\n}",
48                                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n"
49                                     },
50                                     "filter": "P,U",
51                                     "*prop": "grid",
52                                     "autoExpandColumn": "name",
53                                     "loadMask": true,
54                                     "xtype": "Grid",
55                                     "|getTypes": "function() {\n    return [\n        [  'U' , \"Project (Unconfirmed)\" ],\n        [  'P' , \"Project\" ],\n        [  'C' , \"Project (Closed)\" ],\n        [  'N' , \"Non-Project\" ],\n        [  'X' , \"Non-Project (Closed)\" ]\n\n    ];\n}\n",
56                                     "|typeToString": "function(v)\n{\n    var ar = this.getTypes();\n    var ret = '';\n    Roo.each(ar, function(a) {\n        if (a[0] == v) {\n            ret = a[1];\n            return false;\n        }\n    });\n    return ret;\n}\n",
57                                     "|xns": "Roo.grid",
58                                     "items": [
59                                         {
60                                             "listeners": {
61                                                 "beforeload": "function (_self, options)\n{\n    if (!_this.searchBox) {\n        return false;\n    }  \n    o.params = o.params ? o.params : {};\n    o.params['query[project_search]'] = _this.searchBox.getValue();\n    o.params['query[project_filter]'] = _this.grid.filter;\n}"
62                                             },
63                                             "*prop": "dataSource",
64                                             "remoteSort": true,
65                                             "xtype": "Store",
66                                             "|sortInfo": "{ field : 'code', direction: 'ASC' }",
67                                             "|xns": "Roo.data",
68                                             "items": [
69                                                 {
70                                                     "*prop": "proxy",
71                                                     "xtype": "HttpProxy",
72                                                     "method": "GET",
73                                                     "|url": "baseURL + '/Roo/Projects.php'",
74                                                     "|xns": "Roo.data"
75                                                 },
76                                                 {
77                                                     "|xns": "Roo.data",
78                                                     "xtype": "JsonReader",
79                                                     "totalProperty": "total",
80                                                     "root": "data",
81                                                     "*prop": "reader",
82                                                     "id": "id",
83                                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'code',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\n    },\n    {\n        'name': 'type',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id',\n        'type': 'int'\n    },\n    {\n        'name': 'team_id',\n        'type': 'int'\n    },\n    {\n        'name': 'file_location',\n        'type': 'string'\n    },\n    {\n        'name': 'open_date',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'open_by',\n        'type': 'int'\n    },\n    {\n        'name': 'close_date',\n        'type': 'date',\n        'dateFormat': 'Y-m-d'\n    },\n    {\n        'name': 'countries',\n        'type': 'string'\n    },\n    {\n        'name': 'languages',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id_code',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id_address',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_tel',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id_isOwner',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id_logo_id',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id_background_color',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_comptype',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_url',\n        'type': 'string'\n    },\n    {\n        'name': 'client_id_main_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id_created_by',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id_created_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'client_id_updated_by',\n        'type': 'int'\n    },\n    {\n        'name': 'client_id_updated_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'client_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_code',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'agency_id_address',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_tel',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'agency_id_isOwner',\n        'type': 'int'\n    },\n    {\n        'name': 'agency_id_logo_id',\n        'type': 'int'\n    },\n    {\n        'name': 'agency_id_background_color',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_comptype',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_url',\n        'type': 'string'\n    },\n    {\n        'name': 'agency_id_main_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'agency_id_created_by',\n        'type': 'int'\n    },\n    {\n        'name': 'agency_id_created_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'agency_id_updated_by',\n        'type': 'int'\n    },\n    {\n        'name': 'agency_id_updated_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'agency_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'team_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'team_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'team_id_type',\n        'type': 'int'\n    },\n    {\n        'name': 'team_id_leader',\n        'type': 'int'\n    },\n    {\n        'name': 'open_by_id',\n        'type': 'int'\n    },\n    {\n        'name': 'open_by_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'open_by_name',\n        'type': 'string'\n    },\n    {\n        'name': 'open_by_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'open_by_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'open_by_email',\n        'type': 'string'\n    },\n    {\n        'name': 'open_by_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'open_by_role',\n        'type': 'string'\n    },\n    {\n        'name': 'open_by_active',\n        'type': 'int'\n    },\n    {\n        'name': 'open_by_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'open_by_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'open_by_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'open_by_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'open_by_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'open_by_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'open_by_project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_lang',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'owner_id_action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id_project_id',\n        'type': 'int'\n    }\n]"
84                                                 }
85                                             ]
86                                         },
87                                         {
88                                             "*prop": "footer",
89                                             "displayInfo": true,
90                                             "displayMsg": "Displaying Projects {0} - {1} of {2}",
91                                             "emptyMsg": "No Projects found",
92                                             "pageSize": 25,
93                                             "xtype": "PagingToolbar",
94                                             "|xns": "Roo"
95                                         },
96                                         {
97                                             "*prop": "toolbar",
98                                             "xtype": "Toolbar",
99                                             "|xns": "Roo",
100                                             "items": [
101                                                 {
102                                                     "listeners": {
103                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
104                                                     },
105                                                     "cls": "x-btn-text-icon",
106                                                     "text": "Add",
107                                                     "xtype": "Button",
108                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
109                                                     "|xns": "Roo.Toolbar"
110                                                 },
111                                                 {
112                                                     "text": "Edit",
113                                                     "xtype": "Button",
114                                                     "cls": "x-btn-text-icon",
115                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
116                                                     "listeners": {
117                                                         "|click": "function()\n{\n    var s = _this.grid.getSelectionModel().getSelections();\n    if (!s.length || (s.length > 1))  {\n        Roo.MessageBox.alert(\"Error\", s.length ? \"Select only one Row\" : \"Select a Row\");\n        return;\n    }\n    if (!_this.dialog) return;\n    _this.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
118                                                     },
119                                                     "|xns": "Roo.Toolbar"
120                                                 },
121                                                 {
122                                                     "|xns": "Roo.Toolbar",
123                                                     "xtype": "Separator"
124                                                 },
125                                                 {
126                                                     "text": "Search",
127                                                     "xtype": "TextItem",
128                                                     "|xns": "Roo.Toolbar"
129                                                 },
130                                                 {
131                                                     "listeners": {
132                                                         "render": "function (_self)\n{\n    _this.searchBox = _self;\n}",
133                                                         "specialkey": "function (_self, e)\n{\n    if(e.getKey() == 13) {\n          _this.grid.footer.onClick('first');\n    }\n}"
134                                                     },
135                                                     "xtype": "TextField",
136                                                     "|xns": "Roo.form"
137                                                 },
138                                                 {
139                                                     "listeners": {
140                                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
141                                                     },
142                                                     "cls": "x-btn-icon",
143                                                     "xtype": "Button",
144                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
145                                                     "|xns": "Roo.Toolbar"
146                                                 },
147                                                 {
148                                                     "listeners": {
149                                                         "|click": "function (_self, e)\n{\n_this.searchBox.setValue('');\n    _this.grid.footer.onClick('first');\n}"
150                                                     },
151                                                     "cls": "x-btn-icon",
152                                                     "xtype": "Button",
153                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
154                                                     "|xns": "Roo.Toolbar"
155                                                 },
156                                                 {
157                                                     "|xns": "Roo.Toolbar",
158                                                     "xtype": "Separator"
159                                                 },
160                                                 {
161                                                     "text": "Show:",
162                                                     "xtype": "TextItem",
163                                                     "|xns": "Roo.Toolbar"
164                                                 },
165                                                 {
166                                                     "listeners": {
167                                                         "toggle": "function (_self)\n{\n    if (st) { _this.grid.filter = 'P,N,U'; } \n    _this.grid.footer.onClick('first');\n     \n}"
168                                                     },
169                                                     "enableToggle": true,
170                                                     "pressed": false,
171                                                     "text": "All",
172                                                     "toggleGroup": "pgrp",
173                                                     "xtype": "Button",
174                                                     "|xns": "Roo.Toolbar"
175                                                 },
176                                                 {
177                                                     "listeners": {
178                                                         "toggle": "function (_self)\n{\n    if (st) { _this.grid.filter = 'P,U'; } \n    _this.grid.footer.onClick('first');\n     \n}"
179                                                     },
180                                                     "enableToggle": true,
181                                                     "pressed": true,
182                                                     "text": "Projects",
183                                                     "toggleGroup": "pgrp",
184                                                     "xtype": "Button",
185                                                     "|xns": "Roo.Toolbar"
186                                                 },
187                                                 {
188                                                     "listeners": {
189                                                         "toggle": "function (_self)\n{\n    if (st) { _this.grid.filter = 'N'; } \n    _this.grid.footer.onClick('first');\n     \n}"
190                                                     },
191                                                     "enableToggle": true,
192                                                     "pressed": false,
193                                                     "text": "Non-Projects",
194                                                     "toggleGroup": "pgrp",
195                                                     "xtype": "Button",
196                                                     "|xns": "Roo.Toolbar"
197                                                 },
198                                                 {
199                                                     "listeners": {
200                                                         "toggle": "function (_self, pressed)\n{\n        if (st) { _this.grid.filter = 'X,C'; } \n                _this.grid.footer.onClick('first');\n        \n}"
201                                                     },
202                                                     "enableToggle": true,
203                                                     "pressed": false,
204                                                     "text": "Closed",
205                                                     "toggleGroup": "pgrp",
206                                                     "xtype": "Button",
207                                                     "|xns": "Roo.Toolbar"
208                                                 }
209                                             ]
210                                         },
211                                         {
212                                             "*prop": "colModel[]",
213                                             "dataIndex": "type",
214                                             "header": "Type",
215                                             "width": 200,
216                                             "xtype": "ColumnModel",
217                                             "|renderer": "function(v) { return _this.grid.typeToString(v);}",
218                                             "|xns": "Roo.grid"
219                                         },
220                                         {
221                                             "xtype": "ColumnModel",
222                                             "header": "Code",
223                                             "width": 200,
224                                             "dataIndex": "code",
225                                             "|renderer": "function(v) { return String.format('{0}', v); }",
226                                             "|xns": "Roo.grid",
227                                             "*prop": "colModel[]"
228                                         },
229                                         {
230                                             "xtype": "ColumnModel",
231                                             "header": "Name",
232                                             "width": 200,
233                                             "dataIndex": "name",
234                                             "|renderer": "function(v) { return String.format('{0}', v); }",
235                                             "|xns": "Roo.grid",
236                                             "*prop": "colModel[]"
237                                         },
238                                         {
239                                             "xtype": "ColumnModel",
240                                             "header": "Client",
241                                             "width": 75,
242                                             "dataIndex": "client_id",
243                                             "|renderer": "function(v) { return String.format('{0}', v); }",
244                                             "|xns": "Roo.grid",
245                                             "*prop": "colModel[]"
246                                         },
247                                         {
248                                             "listeners": {
249                                                 "afterselectionchange": "function (_self)\n{\n    // load project members.\n}"
250                                             },
251                                             "*prop": "sm",
252                                             "singleSelect": true,
253                                             "xtype": "RowSelectionModel",
254                                             "|xns": "Roo.grid"
255                                         }
256                                     ]
257                                 }
258                             ]
259                         }
260                     ]
261                 }
262             ]
263         }
264     ],
265     "permname": "Core.Projects_All",
266     "modOrder": "002"
267 }