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             "fitContainer": true,
10             "fitToFrame": true,
11             "region": "center",
12             "title": "Projects",
13             "xtype": "NestedLayoutPanel",
14             "|xns": "Roo",
15             "listeners": {},
16             "items": [
17                 {
18                     "|xns": "Roo",
19                     "xtype": "BorderLayout",
20                     "*prop": "layout",
21                     "items": [
22                         {
23                             "|xns": "Roo",
24                             "xtype": "LayoutRegion",
25                             "*prop": "center"
26                         },
27                         {
28                             "*prop": "east",
29                             "split": true,
30                             "width": 300,
31                             "xtype": "LayoutRegion",
32                             "|xns": "Roo"
33                         },
34                         {
35                             "listeners": {
36                                 "|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}"
37                             },
38                             "background": true,
39                             "fitContainer": true,
40                             "fitToframe": true,
41                             "region": "center",
42                             "tableName": "Projects",
43                             "title": "Projects",
44                             "xtype": "GridPanel",
45                             "|xns": "Roo",
46                             "items": [
47                                 {
48                                     "listeners": {
49                                         "|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}",
50                                         "|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"
51                                     },
52                                     "filter": "P,U",
53                                     "*prop": "grid",
54                                     "autoExpandColumn": "name",
55                                     "loadMask": true,
56                                     "xtype": "Grid",
57                                     "|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",
58                                     "|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",
59                                     "|xns": "Roo.grid",
60                                     "items": [
61                                         {
62                                             "listeners": {
63                                                 "beforeload": "function (_self, o)\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}"
64                                             },
65                                             "*prop": "dataSource",
66                                             "remoteSort": true,
67                                             "xtype": "Store",
68                                             "|sortInfo": "{ field : 'code', direction: 'ASC' }",
69                                             "|xns": "Roo.data",
70                                             "items": [
71                                                 {
72                                                     "*prop": "proxy",
73                                                     "xtype": "HttpProxy",
74                                                     "method": "GET",
75                                                     "|url": "baseURL + '/Roo/Projects.php'",
76                                                     "|xns": "Roo.data"
77                                                 },
78                                                 {
79                                                     "|xns": "Roo.data",
80                                                     "xtype": "JsonReader",
81                                                     "totalProperty": "total",
82                                                     "root": "data",
83                                                     "*prop": "reader",
84                                                     "id": "id",
85                                                     "|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]"
86                                                 }
87                                             ]
88                                         },
89                                         {
90                                             "*prop": "footer",
91                                             "displayInfo": true,
92                                             "displayMsg": "Displaying Projects {0} - {1} of {2}",
93                                             "emptyMsg": "No Projects found",
94                                             "pageSize": 25,
95                                             "xtype": "PagingToolbar",
96                                             "|xns": "Roo"
97                                         },
98                                         {
99                                             "*prop": "toolbar",
100                                             "xtype": "Toolbar",
101                                             "|xns": "Roo",
102                                             "items": [
103                                                 {
104                                                     "listeners": {
105                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
106                                                     },
107                                                     "cls": "x-btn-text-icon",
108                                                     "text": "Add",
109                                                     "xtype": "Button",
110                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
111                                                     "|xns": "Roo.Toolbar"
112                                                 },
113                                                 {
114                                                     "text": "Edit",
115                                                     "xtype": "Button",
116                                                     "cls": "x-btn-text-icon",
117                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
118                                                     "listeners": {
119                                                         "|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"
120                                                     },
121                                                     "|xns": "Roo.Toolbar"
122                                                 },
123                                                 {
124                                                     "|xns": "Roo.Toolbar",
125                                                     "xtype": "Separator"
126                                                 },
127                                                 {
128                                                     "text": "Search",
129                                                     "xtype": "TextItem",
130                                                     "|xns": "Roo.Toolbar"
131                                                 },
132                                                 {
133                                                     "listeners": {
134                                                         "render": "function (_self)\n{\n    _this.searchBox = _self;\n}",
135                                                         "specialkey": "function (_self, e)\n{\n    if(e.getKey() == 13) {\n          _this.grid.footer.onClick('first');\n    }\n}"
136                                                     },
137                                                     "xtype": "TextField",
138                                                     "|xns": "Roo.form"
139                                                 },
140                                                 {
141                                                     "listeners": {
142                                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
143                                                     },
144                                                     "cls": "x-btn-icon",
145                                                     "xtype": "Button",
146                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
147                                                     "|xns": "Roo.Toolbar"
148                                                 },
149                                                 {
150                                                     "listeners": {
151                                                         "|click": "function (_self, e)\n{\n_this.searchBox.setValue('');\n    _this.grid.footer.onClick('first');\n}"
152                                                     },
153                                                     "cls": "x-btn-icon",
154                                                     "xtype": "Button",
155                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
156                                                     "|xns": "Roo.Toolbar"
157                                                 },
158                                                 {
159                                                     "|xns": "Roo.Toolbar",
160                                                     "xtype": "Separator"
161                                                 },
162                                                 {
163                                                     "text": "Show:",
164                                                     "xtype": "TextItem",
165                                                     "|xns": "Roo.Toolbar"
166                                                 },
167                                                 {
168                                                     "listeners": {
169                                                         "toggle": "function (_self,st)\n{\n    if (st) { _this.grid.filter = 'P,N,U'; } \n    _this.grid.footer.onClick('first');\n     \n}"
170                                                     },
171                                                     "enableToggle": true,
172                                                     "pressed": false,
173                                                     "text": "All",
174                                                     "toggleGroup": "pgrp",
175                                                     "xtype": "Button",
176                                                     "|xns": "Roo.Toolbar"
177                                                 },
178                                                 {
179                                                     "listeners": {
180                                                         "toggle": "function (_self,st)\n{\n    if (st) { _this.grid.filter = 'P,U'; } \n    _this.grid.footer.onClick('first');\n     \n}"
181                                                     },
182                                                     "enableToggle": true,
183                                                     "pressed": true,
184                                                     "text": "Projects",
185                                                     "toggleGroup": "pgrp",
186                                                     "xtype": "Button",
187                                                     "|xns": "Roo.Toolbar"
188                                                 },
189                                                 {
190                                                     "listeners": {
191                                                         "toggle": "function (_self,st)\n{\n    if (st) { _this.grid.filter = 'N'; } \n    _this.grid.footer.onClick('first');\n     \n}"
192                                                     },
193                                                     "enableToggle": true,
194                                                     "pressed": false,
195                                                     "text": "Non-Projects",
196                                                     "toggleGroup": "pgrp",
197                                                     "xtype": "Button",
198                                                     "|xns": "Roo.Toolbar"
199                                                 },
200                                                 {
201                                                     "listeners": {
202                                                         "toggle": "function (_self, st)\n{\n        if (st) { _this.grid.filter = 'X,C'; } \n                _this.grid.footer.onClick('first');\n        \n}"
203                                                     },
204                                                     "enableToggle": true,
205                                                     "pressed": false,
206                                                     "text": "Closed",
207                                                     "toggleGroup": "pgrp",
208                                                     "xtype": "Button",
209                                                     "|xns": "Roo.Toolbar"
210                                                 }
211                                             ]
212                                         },
213                                         {
214                                             "*prop": "colModel[]",
215                                             "dataIndex": "type",
216                                             "header": "Type",
217                                             "width": 70,
218                                             "xtype": "ColumnModel",
219                                             "|renderer": "function(v) { return _this.grid.typeToString(v);}",
220                                             "|xns": "Roo.grid",
221                                             "sortable": true,
222                                             "listeners": {}
223                                         },
224                                         {
225                                             "*prop": "colModel[]",
226                                             "dataIndex": "client_id_name",
227                                             "header": "Client",
228                                             "width": 75,
229                                             "xtype": "ColumnModel",
230                                             "|renderer": "function(v) { return String.format('{0}', v); }",
231                                             "|xns": "Roo.grid"
232                                         },
233                                         {
234                                             "*prop": "colModel[]",
235                                             "dataIndex": "code",
236                                             "header": "Code",
237                                             "width": 120,
238                                             "xtype": "ColumnModel",
239                                             "|renderer": "function(v) { return String.format('{0}', v); }",
240                                             "|xns": "Roo.grid",
241                                             "sortable": true,
242                                             "listeners": {}
243                                         },
244                                         {
245                                             "*prop": "colModel[]",
246                                             "dataIndex": "name",
247                                             "header": "Name",
248                                             "width": 200,
249                                             "xtype": "ColumnModel",
250                                             "|renderer": "function(v) { return String.format('{0}', v); }",
251                                             "|xns": "Roo.grid",
252                                             "sortable": true,
253                                             "listeners": {}
254                                         },
255                                         {
256                                             "listeners": {
257                                                 "afterselectionchange": "function (_self)\n{\n    // load project members.\n}"
258                                             },
259                                             "*prop": "sm",
260                                             "singleSelect": true,
261                                             "xtype": "RowSelectionModel",
262                                             "|xns": "Roo.grid"
263                                         }
264                                     ]
265                                 }
266                             ]
267                         }
268                     ]
269                 }
270             ]
271         }
272     ],
273     "permname": "Core.Projects_All",
274     "modOrder": "002"
275 }