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             "background": true,
10             "fitContainer": true,
11             "fitToFrame": true,
12             "region": "center",
13             "title": "Projects",
14             "xtype": "NestedLayoutPanel",
15             "|xns": "Roo",
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                             "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)\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)\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)\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, pressed)\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": 200,
217                                             "xtype": "ColumnModel",
218                                             "|renderer": "function(v) { return _this.grid.typeToString(v);}",
219                                             "|xns": "Roo.grid"
220                                         },
221                                         {
222                                             "xtype": "ColumnModel",
223                                             "header": "Code",
224                                             "width": 200,
225                                             "dataIndex": "code",
226                                             "|renderer": "function(v) { return String.format('{0}', v); }",
227                                             "|xns": "Roo.grid",
228                                             "*prop": "colModel[]"
229                                         },
230                                         {
231                                             "xtype": "ColumnModel",
232                                             "header": "Name",
233                                             "width": 200,
234                                             "dataIndex": "name",
235                                             "|renderer": "function(v) { return String.format('{0}', v); }",
236                                             "|xns": "Roo.grid",
237                                             "*prop": "colModel[]"
238                                         },
239                                         {
240                                             "xtype": "ColumnModel",
241                                             "header": "Client",
242                                             "width": 75,
243                                             "dataIndex": "client_id",
244                                             "|renderer": "function(v) { return String.format('{0}', v); }",
245                                             "|xns": "Roo.grid",
246                                             "*prop": "colModel[]"
247                                         },
248                                         {
249                                             "listeners": {
250                                                 "afterselectionchange": "function (_self)\n{\n    // load project members.\n}"
251                                             },
252                                             "*prop": "sm",
253                                             "singleSelect": true,
254                                             "xtype": "RowSelectionModel",
255                                             "|xns": "Roo.grid"
256                                         }
257                                     ]
258                                 }
259                             ]
260                         }
261                     ]
262                 }
263             ]
264         }
265     ],
266     "permname": "Core.Projects_All",
267     "modOrder": "002"
268 }