sync
[Pman.Admin] / Pman.Tab.AdminProjectMembers.bjs
1 {
2  "name" : "Pman.Tab.AdminProjectMembers",
3  "parent" : "Pman.Tab.AdminProjectManager",
4  "title" : "Pman.Tab.AdminProjectMembers",
5  "path" : "/home/alan/gitlive/Pman.Admin/Pman.Tab.AdminProjectMembers.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "858ba4765e53c712ef672a9570474b1d" : "Member",
10   "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
11   "1c76cbfe21c6f44c1d1e59d54f3e4420" : "Company",
12   "7cdc93ea9b163a546146172299bb0b38" : "Owners",
13   "ef53538ae41a651c7f72ab6cb1135d8c" : "Members",
14   "8f7f93630c366dc55aec88eb8e9640d0" : "Staff",
15   "6311ae17c1ee52b36e68aaf4ad066387" : "Other",
16   "40bed7cf9b3d4bb3a3d7a7e3eb18c5eb" : "Person",
17   "f1174ecbbc232f948717979daf04cf08" : "No Person found",
18   "49ee3087348e8d44e1feda1917443987" : "Name",
19   "d41d8cd98f00b204e9800998ecf8427e" : " "
20  },
21  "items" : [
22   {
23    "listeners" : {
24     "|activate" : "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
25    },
26    "fitToframe" : true,
27    "background" : true,
28    "region" : "east",
29    "title" : "Person",
30    "xtype" : "GridPanel",
31    "fitContainer" : true,
32    "$ xns" : "Roo",
33    "tableName" : "Person",
34    "items" : [
35     {
36      "listeners" : {
37       "|rowdblclick" : "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) {\n        return;\n        }\n    _this.dialog.show( this.getDataSource().getAt(rowIndex), function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
38       "|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}"
39      },
40      "filter" : "S",
41      "autoExpandColumn" : "name",
42      "xtype" : "Grid",
43      "loadMask" : true,
44      "$ xns" : "Roo.grid",
45      "* prop" : "grid",
46      "items" : [
47       {
48        "listeners" : {
49         "beforeload" : "function (_self, options)\n{\n    if (!_this.memberBtn) {\n        return false;\n    }\n    options.params['query[project_member_filter]'] = _this.memberBtn.pressed ? 1 :0;\n    var pm = Pman ? Pman.Tab.AdminProjectManager :false;\n    if (!pm || !pm.grid || !pm.grid.getSelectionModel().getSelected()) {\n        return false;\n    }\n    var sel = pm.grid.getSelectionModel().getSelected();\n    options.params['query[project_member_of]'] = sel.data.id;    \n    switch(_this.grid.filter) {\n        case 'S': // staff\n            options.params.company_id_comptype='OWNER';\n\n            break;\n        case 'O': // owner..\n            options.params.company_id = sel.data.client_id;\n            break;\n        case 'A': // not owner or staff..\n            options.params['!company_id'] = sel.data.client_id;\n            options.params['!company_id_comptype'] ='OWNER';\n            break;      \n    }\n    \n}"
50        },
51        "xtype" : "Store",
52        "remoteSort" : true,
53        "$ sortInfo" : "{ field : 'name', direction: 'ASC' }",
54        "$ xns" : "Roo.data",
55        "* prop" : "dataSource",
56        "items" : [
57         {
58          "$ url" : "baseURL + '/Roo/core_person'",
59          "method" : "GET",
60          "xtype" : "HttpProxy",
61          "$ xns" : "Roo.data",
62          "* prop" : "proxy"
63         },
64         {
65          "id" : "id",
66          "root" : "data",
67          "xtype" : "JsonReader",
68          "$ xns" : "Roo.data",
69          "$ 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]",
70          "* prop" : "reader",
71          "totalProperty" : "total"
72         }
73        ]
74       },
75       {
76        "pageSize" : 25,
77        "xtype" : "PagingToolbar",
78        "emptyMsg" : "No Person found",
79        "$ xns" : "Roo",
80        "displayMsg" : " ",
81        "displayInfo" : true,
82        "* prop" : "footer"
83       },
84       {
85        "xtype" : "Toolbar",
86        "$ xns" : "Roo",
87        "* prop" : "toolbar",
88        "items" : [
89         {
90          "listeners" : {
91           "toggle" : "function (_self, pressed)\n{\n    if (pressed) {\n        _this.grid.filter = 'S';\n    }\n    _this.grid.footer.onClick('first');\n}"
92          },
93          "text" : "Staff",
94          "enableToggle" : true,
95          "toggleGroup" : "appm",
96          "pressed" : true,
97          "xtype" : "Button",
98          "$ xns" : "Roo.Toolbar"
99         },
100         {
101          "listeners" : {
102           "toggle" : "function (_self, pressed)\n{\n    if (pressed) {\n        _this.grid.filter = 'O';\n    }\n    _this.grid.footer.onClick('first');\n}"
103          },
104          "text" : "Owners",
105          "toggleGroup" : "appm",
106          "enableToggle" : true,
107          "xtype" : "Button",
108          "$ xns" : "Roo.Toolbar"
109         },
110         {
111          "listeners" : {
112           "toggle" : "function (_self, pressed)\n{\n    if (pressed) {\n        _this.grid.filter = 'A';\n    }\n    _this.grid.footer.onClick('first');\n}"
113          },
114          "text" : "Other",
115          "toggleGroup" : "appm",
116          "enableToggle" : true,
117          "xtype" : "Button",
118          "$ xns" : "Roo.Toolbar"
119         },
120         {
121          "xtype" : "Fill",
122          "$ xns" : "Roo.Toolbar"
123         },
124         {
125          "listeners" : {
126           "toggle" : "function (_self, pressed)\n{\n   \n    _this.grid.footer.onClick('first');\n}",
127           "render" : "function (_self)\n{\n    _this.memberBtn = _self;\n}"
128          },
129          "text" : "Members",
130          "enableToggle" : true,
131          "xtype" : "Button",
132          "$ xns" : "Roo.Toolbar"
133         }
134        ]
135       },
136       {
137        "xtype" : "ColumnModel",
138        "header" : "Member",
139        "width" : 60,
140        "$ renderer" : "function(v) { return String.format('{0}', v); }",
141        "$ xns" : "Roo.grid",
142        "* prop" : "colModel[]",
143        "dataIndex" : "is_member"
144       },
145       {
146        "xtype" : "ColumnModel",
147        "sortable" : true,
148        "header" : "Name",
149        "width" : 200,
150        "$ renderer" : "function(v) { return String.format('{0}', v); }",
151        "$ xns" : "Roo.grid",
152        "* prop" : "colModel[]",
153        "dataIndex" : "name"
154       },
155       {
156        "xtype" : "ColumnModel",
157        "sortable" : true,
158        "header" : "Email",
159        "width" : 100,
160        "$ renderer" : "function(v) { return String.format('{0}', v); }",
161        "$ xns" : "Roo.grid",
162        "* prop" : "colModel[]",
163        "dataIndex" : "email"
164       },
165       {
166        "xtype" : "ColumnModel",
167        "sortable" : true,
168        "header" : "Company",
169        "width" : 120,
170        "$ renderer" : "function(v) { return String.format('{0}', v); }",
171        "$ xns" : "Roo.grid",
172        "* prop" : "colModel[]",
173        "dataIndex" : "company_id_name"
174       }
175      ]
176     }
177    ]
178   }
179  ]
180 }