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