Pman.Tab.AdminContacts.bjs
[Pman.Admin] / Pman.Tab.AdminContacts.bjs
1 {
2     "id": "roo-file-170",
3     "name": "Pman.Tab.AdminContacts",
4     "parent": "Pman.Tab.AdminContacsManager",
5     "title": "Pman.Tab.AdminContacts",
6     "path": "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminContacts.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": "center",
16             "tableName": "Person",
17             "title": "Person",
18             "xtype": "GridPanel",
19             "|xns": "Roo",
20             "items": [
21                 {
22                     "*prop": "grid",
23                     "xtype": "Grid",
24                     "autoExpandColumn": "name",
25                     "loadMask": true,
26                     "listeners": {
27                         "|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}",
28                         "|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"
29                     },
30                     "|xns": "Roo.grid",
31                     "items": [
32                         {
33                             "listeners": {
34                                 "beforeload": "function (_self, o)\n{\n  \n    o.params['!company_id_comptype'] = 'OWNER';\n    o.params['query[search]'] = _this.searchBox.getValue();\n    if (Pman.Tab.ContactsGroup.grid) {\n        var tms = Pman.Tab.ContactsGroup.grid.getLeftSelections();\n    \n        if (tms.length) {\n            o.params['query[in_group]'] = tms[0].data.id;\n            o.params['query[type]'] = 2; // group type..\n        }\n    }\n    //o.params['query[name]'] = _this.searchBox.getValue();\n  \n    \n}"
35                             },
36                             "*prop": "dataSource",
37                             "remoteSort": true,
38                             "xtype": "Store",
39                             "|sortInfo": "{ field : 'name', direction: 'ASC' }",
40                             "|xns": "Roo.data",
41                             "items": [
42                                 {
43                                     "*prop": "proxy",
44                                     "xtype": "HttpProxy",
45                                     "method": "GET",
46                                     "|url": "baseURL + '/Roo/Person.php'",
47                                     "|xns": "Roo.data"
48                                 },
49                                 {
50                                     "|xns": "Roo.data",
51                                     "xtype": "JsonReader",
52                                     "totalProperty": "total",
53                                     "root": "data",
54                                     "*prop": "reader",
55                                     "id": "id",
56                                     "|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]"
57                                 }
58                             ]
59                         },
60                         {
61                             "*prop": "footer",
62                             "xtype": "PagingToolbar",
63                             "pageSize": 25,
64                             "displayInfo": true,
65                             "displayMsg": "Displaying Person{0} - {1} of {2}",
66                             "emptyMsg": "No Person found",
67                             "|xns": "Roo",
68                             "items": [
69                                 {
70                                     "enableToggle": true,
71                                     "text": "Show Removed",
72                                     "xtype": "Button",
73                                     "|xns": "Roo.Toolbar"
74                                 }
75                             ]
76                         },
77                         {
78                             "*prop": "toolbar",
79                             "xtype": "Toolbar",
80                             "|xns": "Roo",
81                             "items": [
82                                 {
83                                     "listeners": {
84                                         "|click": "function()\n{\n    \n    Pman.Dialog.PersonEdit.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
85                                     },
86                                     "cls": "x-btn-text-icon",
87                                     "text": "Add",
88                                     "xtype": "Button",
89                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
90                                     "|xns": "Roo.Toolbar"
91                                 },
92                                 {
93                                     "listeners": {
94                                         "|click": "function()\n{\n    \n    Pman.Dialog.PersonBulkAdd.dialog.show( { id : 0 } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
95                                     },
96                                     "cls": "x-btn-text-icon",
97                                     "text": "Bulk Add",
98                                     "xtype": "Button",
99                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
100                                     "|xns": "Roo.Toolbar"
101                                 },
102                                 {
103                                     "listeners": {
104                                         "|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  \n    Pman.Dialog.PersonEdit.dialog.show(s[0].data, function() {\n        _this.grid.footer.onClick('first');\n    }); \n    \n}\n"
105                                     },
106                                     "cls": "x-btn-text-icon",
107                                     "text": "Edit",
108                                     "xtype": "Button",
109                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
110                                     "|xns": "Roo.Toolbar"
111                                 },
112                                 {
113                                     "|xns": "Roo.Toolbar",
114                                     "xtype": "Separator"
115                                 },
116                                 {
117                                     "text": "Search",
118                                     "xtype": "TextItem",
119                                     "|xns": "Roo.Toolbar"
120                                 },
121                                 {
122                                     "|xns": "Roo.form",
123                                     "xtype": "TextField"
124                                 },
125                                 {
126                                     "listeners": {
127                                         "|click": "function (_self, e)\n{\n_this.grid.footer.onClick('first');\n}"
128                                     },
129                                     "cls": "x-btn-icon",
130                                     "xtype": "Button",
131                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
132                                     "|xns": "Roo.Toolbar"
133                                 },
134                                 {
135                                     "|xns": "Roo.Toolbar",
136                                     "xtype": "Fill"
137                                 },
138                                 {
139                                     "listeners": {
140                                         "|click": "function()\n{\n    // Pman.genericDelete(_this, 'Person'); \n}\n        "
141                                     },
142                                     "cls": "x-btn-text-icon",
143                                     "text": "Remove",
144                                     "xtype": "Button",
145                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
146                                     "|xns": "Roo.Toolbar"
147                                 }
148                             ]
149                         },
150                         {
151                             "*prop": "colModel[]",
152                             "dataIndex": "project_id_code",
153                             "header": "Project",
154                             "width": 75,
155                             "xtype": "ColumnModel",
156                             "|renderer": "function(v) { return String.format('{0}', v); }",
157                             "|xns": "Roo.grid"
158                         },
159                         {
160                             "*prop": "colModel[]",
161                             "dataIndex": "company_id_comptype",
162                             "header": "Type",
163                             "width": 50,
164                             "xtype": "ColumnModel",
165                             "|renderer": "function(v,x,r) {\n    if (r.data.office_id) {\n        return String.format('{0} - {1}', v, r.data.office_id_name); \n    } \n    return String.format('{0}', v); \n}",
166                             "|xns": "Roo.grid"
167                         },
168                         {
169                             "*prop": "colModel[]",
170                             "dataIndex": "company_id_name",
171                             "header": "Company",
172                             "width": 75,
173                             "xtype": "ColumnModel",
174                             "|renderer": "function(v,x,r) {\n    if (r.data.office_id) {\n        return String.format('{0} - {1}', v, r.data.office_id_name); \n    } \n    return String.format('{0}', v); \n}",
175                             "|xns": "Roo.grid"
176                         },
177                         {
178                             "xtype": "ColumnModel",
179                             "header": "Name",
180                             "width": 200,
181                             "dataIndex": "name",
182                             "|renderer": "function(v) { return String.format('{0}', v); }",
183                             "|xns": "Roo.grid",
184                             "*prop": "colModel[]"
185                         },
186                         {
187                             "*prop": "colModel[]",
188                             "dataIndex": "role",
189                             "header": "Role",
190                             "width": 100,
191                             "xtype": "ColumnModel",
192                             "|renderer": "function(v) { return String.format('{0}', v); }",
193                             "|xns": "Roo.grid"
194                         },
195                         {
196                             "*prop": "colModel[]",
197                             "dataIndex": "phone",
198                             "header": "Phone",
199                             "width": 100,
200                             "xtype": "ColumnModel",
201                             "|renderer": "function(v) { return String.format('{0}', v); }",
202                             "|xns": "Roo.grid"
203                         },
204                         {
205                             "*prop": "colModel[]",
206                             "dataIndex": "fax",
207                             "header": "Fax",
208                             "width": 100,
209                             "xtype": "ColumnModel",
210                             "|renderer": "function(v) { return String.format('{0}', v); }",
211                             "|xns": "Roo.grid"
212                         },
213                         {
214                             "xtype": "ColumnModel",
215                             "header": "Email",
216                             "width": 200,
217                             "dataIndex": "email",
218                             "|renderer": "function(v) { return String.format('{0}', v); }",
219                             "|xns": "Roo.grid",
220                             "*prop": "colModel[]"
221                         },
222                         {
223                             "xtype": "ColumnModel",
224                             "header": "Active",
225                             "width": 75,
226                             "dataIndex": "active",
227                             "|renderer": "function(v) { return String.format('{0}', v); }",
228                             "|xns": "Roo.grid",
229                             "*prop": "colModel[]"
230                         }
231                     ]
232                 }
233             ]
234         }
235     ],
236     "permname": "Core.Person",
237     "modOrder": "001"
238 }