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