Pman.Tab.AdminProjectMembers.bjs
[Pman.Admin] / Pman.Tab.AdminProjectMembers.bjs
1 {
2     "id": "roo-file-189",
3     "name": "Pman.Tab.AdminProjectMembers",
4     "parent": "Pman.Tab.AdminProjectManager",
5     "title": "Pman.Tab.AdminProjectMembers",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminProjectMembers.bjs",
7     "items": [
8         {
9             "listeners": {
10                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
11             },
12             "background": true,
13             "fitContainer": true,
14             "fitToframe": true,
15             "region": "east",
16             "tableName": "Person",
17             "title": "Person",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "listeners": {
23                         "|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}",
24                         "|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"
25                     },
26                     "filter": "S",
27                     "*prop": "grid",
28                     "autoExpandColumn": "name",
29                     "loadMask": true,
30                     "xtype": "Grid",
31                     "|xns": "Roo.grid",
32                     "items": [
33                         {
34                             "listeners": {
35                                 "beforeload": "function (_self, options)\n{\n    if (!_this.memberBtn) {\n        return false;\n    }\n    options.params.project_member_filter = _this.memberBtn.pressed;\n    var pm = Pman.Tab.AdminProjectManager;\n    if (!pm || !pm.grid || !pm.grid.getSelectionModel().getSelected()) {\n        return false;\n    }\n    var sel = pm.grid.getSelectionModel().getSelected();\n    switch(_this.grid.filter) {\n        case 'S': // staff\n            options.params.company_id_comptype='OWNER';\n            options.params.project_member_of = sel.data.id;\n            break;\n        case 'O': // owner..\n            options.params.company_id = sel.data.owner_id;\n            options.params.project_member_of = sel.data.id;\n        case 'A': // not owner or staff..\n            options.params['!company_id'] = sel.data.owner_id;\n            options.params['!company_id_comptype'] ='OWNER';\n            options.params.project_member_of = sel.data.id;        \n    }\n    \n}"
36                             },
37                             "*prop": "dataSource",
38                             "filter": "S",
39                             "remoteSort": true,
40                             "xtype": "Store",
41                             "|sortInfo": "{ field : 'name', direction: 'ASC' }",
42                             "|xns": "Roo.data",
43                             "items": [
44                                 {
45                                     "*prop": "proxy",
46                                     "xtype": "HttpProxy",
47                                     "method": "GET",
48                                     "|url": "baseURL + '/Roo/Person.php'",
49                                     "|xns": "Roo.data"
50                                 },
51                                 {
52                                     "|xns": "Roo.data",
53                                     "xtype": "JsonReader",
54                                     "totalProperty": "total",
55                                     "root": "data",
56                                     "*prop": "reader",
57                                     "id": "id",
58                                     "|fields": "[\n    {\n        'name': 'id',\n        'type': 'int'\n    },\n    {\n        'name': 'office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'name',\n        'type': 'string'\n    },\n    {\n        'name': 'phone',\n        'type': 'string'\n    },\n    {\n        'name': 'fax',\n        'type': 'string'\n    },\n    {\n        'name': 'email',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'role',\n        'type': 'string'\n    },\n    {\n        'name': 'active',\n        'type': 'int'\n    },\n    {\n        'name': 'remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'lang',\n        'type': 'string'\n    },\n    {\n        'name': 'no_reset_sent',\n        'type': 'int'\n    },\n    {\n        'name': 'action_type',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id',\n        'type': 'int'\n    },\n    {\n        'name': 'office_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'office_id_company_id',\n        'type': 'int'\n    },\n    {\n        'name': 'office_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_address',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_phone',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'office_id_role',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_code',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_address',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_tel',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_fax',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_email',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_isOwner',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_logo_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_background_color',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_comptype',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_url',\n        'type': 'string'\n    },\n    {\n        'name': 'company_id_main_office_id',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_created_by',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_created_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'company_id_updated_by',\n        'type': 'int'\n    },\n    {\n        'name': 'company_id_updated_dt',\n        'type': 'date'\n    },\n    {\n        'name': 'company_id_passwd',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_id',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_name',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_remarks',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_owner_id',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_code',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_active',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_type',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_client_id',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_team_id',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_file_location',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_open_date',\n        'type': 'date'\n    },\n    {\n        'name': 'project_id_open_by',\n        'type': 'int'\n    },\n    {\n        'name': 'project_id_close_date',\n        'type': 'date'\n    },\n    {\n        'name': 'project_id_countries',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_languages',\n        'type': 'string'\n    },\n    {\n        'name': 'project_id_agency_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]"
59                                 }
60                             ]
61                         },
62                         {
63                             "*prop": "footer",
64                             "displayInfo": true,
65                             "displayMsg": " ",
66                             "emptyMsg": "No Person found",
67                             "pageSize": 25,
68                             "xtype": "PagingToolbar",
69                             "|xns": "Roo"
70                         },
71                         {
72                             "*prop": "toolbar",
73                             "xtype": "Toolbar",
74                             "|xns": "Roo",
75                             "items": [
76                                 {
77                                     "listeners": {
78                                         "toggle": "function (_self, pressed)\n{\n    if (pressed) {\n        _this.grid.filter = 'S';\n    }\n    _this.grid.footer.onClick('first');\n}"
79                                     },
80                                     "enableToggle": true,
81                                     "pressed": true,
82                                     "text": "Staff",
83                                     "toggleGroup": "appm",
84                                     "xtype": "Button",
85                                     "|xns": "Roo.Toolbar"
86                                 },
87                                 {
88                                     "listeners": {
89                                         "toggle": "function (_self, pressed)\n{\n    if (pressed) {\n        _this.grid.filter = 'O';\n    }\n    _this.grid.footer.onClick('first');\n}"
90                                     },
91                                     "enableToggle": true,
92                                     "text": "Owners",
93                                     "toggleGroup": "appm",
94                                     "xtype": "Button",
95                                     "|xns": "Roo.Toolbar"
96                                 },
97                                 {
98                                     "listeners": {
99                                         "toggle": "function (_self, pressed)\n{\n    if (pressed) {\n        _this.grid.filter = 'A';\n    }\n    _this.grid.footer.onClick('first');\n}"
100                                     },
101                                     "enableToggle": true,
102                                     "text": "Other",
103                                     "toggleGroup": "appm",
104                                     "xtype": "Button",
105                                     "|xns": "Roo.Toolbar"
106                                 },
107                                 {
108                                     "|xns": "Roo.Toolbar",
109                                     "xtype": "Fill"
110                                 },
111                                 {
112                                     "listeners": {
113                                         "toggle": "function (_self, pressed)\n{\n   \n    _this.grid.footer.onClick('first');\n}",
114                                         "render": "function (_self)\n{\n    _this.memberBtn = _self;\n}"
115                                     },
116                                     "enableToggle": true,
117                                     "text": "Members",
118                                     "xtype": "Button",
119                                     "|xns": "Roo.Toolbar"
120                                 }
121                             ]
122                         },
123                         {
124                             "*prop": "colModel[]",
125                             "dataIndex": "is_member",
126                             "header": "Member",
127                             "width": 60,
128                             "xtype": "ColumnModel",
129                             "|renderer": "function(v) { return String.format('{0}', v); }",
130                             "|xns": "Roo.grid"
131                         },
132                         {
133                             "*prop": "colModel[]",
134                             "dataIndex": "name",
135                             "header": "Name",
136                             "sortable": true,
137                             "width": 200,
138                             "xtype": "ColumnModel",
139                             "|renderer": "function(v) { return String.format('{0}', v); }",
140                             "|xns": "Roo.grid"
141                         },
142                         {
143                             "*prop": "colModel[]",
144                             "dataIndex": "email",
145                             "header": "Email",
146                             "width": 100,
147                             "xtype": "ColumnModel",
148                             "|renderer": "function(v) { return String.format('{0}', v); }",
149                             "|xns": "Roo.grid",
150                             "sortable": true,
151                             "listeners": {}
152                         },
153                         {
154                             "*prop": "colModel[]",
155                             "dataIndex": "company_id_name",
156                             "header": "Company",
157                             "sortable": true,
158                             "width": 120,
159                             "xtype": "ColumnModel",
160                             "|renderer": "function(v) { return String.format('{0}', v); }",
161                             "|xns": "Roo.grid"
162                         }
163                     ]
164                 }
165             ]
166         }
167     ],
168     "permname": "",
169     "modOrder": "001"
170 }