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             "region": "center",
10             "title": "Projects",
11             "xtype": "NestedLayoutPanel",
12             "|xns": "Roo",
13             "items": [
14                 {
15                     "|xns": "Roo",
16                     "xtype": "BorderLayout",
17                     "*prop": "layout",
18                     "items": [
19                         {
20                             "|xns": "Roo",
21                             "xtype": "LayoutRegion",
22                             "*prop": "center"
23                         },
24                         {
25                             "*prop": "east",
26                             "width": 300,
27                             "xtype": "LayoutRegion",
28                             "|xns": "Roo"
29                         },
30                         {
31                             "|xns": "Roo",
32                             "xtype": "GridPanel",
33                             "title": "Projects",
34                             "fitToframe": true,
35                             "fitContainer": true,
36                             "tableName": "Projects",
37                             "background": true,
38                             "region": "center",
39                             "listeners": {
40                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
41                             },
42                             "items": [
43                                 {
44                                     "listeners": {
45                                         "|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}",
46                                         "|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"
47                                     },
48                                     "*prop": "grid",
49                                     "autoExpandColumn": "name",
50                                     "loadMask": true,
51                                     "xtype": "Grid",
52                                     "|": "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",
53                                     "|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",
54                                     "|xns": "Roo.grid",
55                                     "items": [
56                                         {
57                                             "listeners": {
58                                                 "beforeload": "function (_self, options)\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.filter;\n}"
59                                             },
60                                             "*prop": "dataSource",
61                                             "remoteSort": true,
62                                             "xtype": "Store",
63                                             "|sortInfo": "{ field : 'code', direction: 'ASC' }",
64                                             "|xns": "Roo.data",
65                                             "items": [
66                                                 {
67                                                     "*prop": "proxy",
68                                                     "xtype": "HttpProxy",
69                                                     "method": "GET",
70                                                     "|url": "baseURL + '/Roo/Projects.php'",
71                                                     "|xns": "Roo.data"
72                                                 },
73                                                 {
74                                                     "|xns": "Roo.data",
75                                                     "xtype": "JsonReader",
76                                                     "totalProperty": "total",
77                                                     "root": "data",
78                                                     "*prop": "reader",
79                                                     "id": "id",
80                                                     "|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]"
81                                                 }
82                                             ]
83                                         },
84                                         {
85                                             "*prop": "footer",
86                                             "xtype": "PagingToolbar",
87                                             "pageSize": 25,
88                                             "displayInfo": true,
89                                             "displayMsg": "Displaying Projects{0} - {1} of {2}",
90                                             "emptyMsg": "No Projects found",
91                                             "|xns": "Roo"
92                                         },
93                                         {
94                                             "*prop": "toolbar",
95                                             "xtype": "Toolbar",
96                                             "|xns": "Roo",
97                                             "items": [
98                                                 {
99                                                     "text": "Add",
100                                                     "xtype": "Button",
101                                                     "cls": "x-btn-text-icon",
102                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
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                                                     "|xns": "Roo.Toolbar"
107                                                 },
108                                                 {
109                                                     "text": "Edit",
110                                                     "xtype": "Button",
111                                                     "cls": "x-btn-text-icon",
112                                                     "|icon": "Roo.rootURL + 'images/default/tree/leaf.gif'",
113                                                     "listeners": {
114                                                         "|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"
115                                                     },
116                                                     "|xns": "Roo.Toolbar"
117                                                 },
118                                                 {
119                                                     "text": "Delete",
120                                                     "cls": "x-btn-text-icon",
121                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
122                                                     "xtype": "Button",
123                                                     "listeners": {
124                                                         "|click": "function()\n{\n     Pman.genericDelete(_this, 'Projects'); \n}\n        "
125                                                     },
126                                                     "|xns": "Roo.Toolbar"
127                                                 }
128                                             ]
129                                         },
130                                         {
131                                             "xtype": "ColumnModel",
132                                             "header": "Type",
133                                             "width": 200,
134                                             "dataIndex": "type",
135                                             "|renderer": "function(v) { return String.format('{0}', v); }",
136                                             "|xns": "Roo.grid",
137                                             "*prop": "colModel[]"
138                                         },
139                                         {
140                                             "xtype": "ColumnModel",
141                                             "header": "Code",
142                                             "width": 200,
143                                             "dataIndex": "code",
144                                             "|renderer": "function(v) { return String.format('{0}', v); }",
145                                             "|xns": "Roo.grid",
146                                             "*prop": "colModel[]"
147                                         },
148                                         {
149                                             "xtype": "ColumnModel",
150                                             "header": "Name",
151                                             "width": 200,
152                                             "dataIndex": "name",
153                                             "|renderer": "function(v) { return String.format('{0}', v); }",
154                                             "|xns": "Roo.grid",
155                                             "*prop": "colModel[]"
156                                         },
157                                         {
158                                             "xtype": "ColumnModel",
159                                             "header": "Client",
160                                             "width": 75,
161                                             "dataIndex": "client_id",
162                                             "|renderer": "function(v) { return String.format('{0}', v); }",
163                                             "|xns": "Roo.grid",
164                                             "*prop": "colModel[]"
165                                         }
166                                     ]
167                                 }
168                             ]
169                         }
170                     ]
171                 }
172             ]
173         }
174     ],
175     "permname": "Core.Projects_All",
176     "modOrder": "002"
177 }