sync
[Pman.Admin] / Pman.Dialog.AdminPerson.bjs
1 {
2  "name" : "Pman.Dialog.AdminPerson",
3  "parent" : "",
4  "title" : "",
5  "path" : "/home/alan/gitlive/Pman.Admin/Pman.Dialog.AdminPerson.bjs",
6  "permname" : "",
7  "modOrder" : "001",
8  "strings" : {
9   "ce8ae9da5b7cd6c3df2929543a9af92d" : "Email",
10   "7573b7fd7836c9118dbfb69f3abf3858" : "Change / Set Password",
11   "abb1d799e06329cb0c38276ea918300b" : "Secure passwords",
12   "2b0d7f748b64304e6657207cb03cd8f2" : "Edit / Create Staff Details",
13   "7e17f8478e121357b78646ca5b5d5ac9" : "Displaying Settings  {0} - {1} of {2}",
14   "bcc254b55c4a1babdf1dcb82c207506b" : "Phone",
15   "1243daf593fa297e07ab03bf06d925af" : "Searching...",
16   "3544848f820b9d94a3f3871a382cf138" : "New password",
17   "689202409e48743b914713f96d93947c" : "Value",
18   "8a25a3ae30ab6e8ceb5b8c4009a3336f" : "Role / Position",
19   "be5f40c0d2692cf4e9f8be8d389737a5" : "Department / Office",
20   "315fce99b77b7f392bf68d5eb14f88c7" : "Password (type again to confirm)",
21   "ea4788705e6873b424c65e91c2846b19" : "Cancel",
22   "e4709a73a287a5f033f5b1b5142cb74d" : "System Settings",
23   "49ee3087348e8d44e1feda1917443987" : "Name",
24   "a5da1d5de4f3a80e2acf5227283c630d" : "Staff Details",
25   "c373dd4bd4ba0b5d3e0c7522c5629880" : "Select Office",
26   "662de0725ac8055bff7edae51fbf3c78" : "No Settings Found",
27   "f2a6c498fb90ee345d997f888fce3b18" : "Delete",
28   "e55f75a29310d7b60f7ac1d390c8ae42" : "Module",
29   "b5a7adde1af5c87d7fd797b6245c2a39" : "Description",
30   "c9cc8cce247e49bae79f15173ce97354" : "Save"
31  },
32  "named_strings" : {
33   "secure_password_fieldLabel" : "abb1d799e06329cb0c38276ea918300b",
34   "role_fieldLabel" : "8a25a3ae30ab6e8ceb5b8c4009a3336f",
35   "name_fieldLabel" : "49ee3087348e8d44e1feda1917443987",
36   "office_id_name_emptyText" : "be5f40c0d2692cf4e9f8be8d389737a5",
37   "passwd2_fieldLabel" : "315fce99b77b7f392bf68d5eb14f88c7",
38   "phone_fieldLabel" : "bcc254b55c4a1babdf1dcb82c207506b",
39   "passwd1_fieldLabel" : "3544848f820b9d94a3f3871a382cf138",
40   "office_id_name_fieldLabel" : "be5f40c0d2692cf4e9f8be8d389737a5",
41   "office_id_name_loadingText" : "1243daf593fa297e07ab03bf06d925af",
42   "email_fieldLabel" : "ce8ae9da5b7cd6c3df2929543a9af92d",
43   "office_id_name_qtip" : "c373dd4bd4ba0b5d3e0c7522c5629880"
44  },
45  "items" : [
46   {
47    "Boolean modal" : true,
48    "collapsible" : false,
49    "title" : "Edit / Create Staff Details",
50    "xtype" : "LayoutDialog",
51    "width" : 450,
52    "$ xns" : "Roo",
53    "closable" : false,
54    "resizable" : false,
55    "height" : 400,
56    "items" : [
57     {
58      "xtype" : "LayoutRegion",
59      "$ xns" : "Roo",
60      "* prop" : "center"
61     },
62     {
63      "region" : "center",
64      "xtype" : "ContentPanel",
65      "$ xns" : "Roo",
66      "String title" : "Staff Details",
67      "items" : [
68       {
69        "listeners" : {
70         "|actioncomplete" : "function(_self,action)\n{\n    if (action.type == 'setdata') {\n        _this.dialog.layout.getRegion('center').showPanel(0);\n       //_this.dialog.el.mask(\"Loading\");\n       if ( _this.data.id* 1 > 0) { \n            this.load({ method: 'GET', params: { '_id' : _this.data.id }});\n            return;\n        }\n        this.findField('company_id').setValue(Pman.Login.authUser.company_id);\n       return;\n    }\n    if (action.type == 'load') {\n        _this.dialog.el.unmask();\n        return;\n    }\n    if (action.type =='submit') {\n    \n        _this.dialog.el.unmask();\n        _this.dialog.hide();\n    \n         if (_this.callback) {\n            _this.callback.call(_this, _this.form.getValues());\n         }\n         _this.form.reset();\n         return;\n    }\n}\n",
71         "|rendered" : "function (form)\n{\n    _this.form= form;\n}\n"
72        },
73        "$ url" : "baseURL + '/Roo/core_person'",
74        "method" : "POST",
75        "xtype" : "Form",
76        "style" : "margin:10px;",
77        "$ xns" : "Roo.form",
78        "Number labelWidth" : 120,
79        "items" : [
80         {
81          "fieldLabel" : "Name",
82          "xtype" : "TextField",
83          "allowBlank" : true,
84          "width" : 250,
85          "$ xns" : "Roo.form",
86          "name" : "name"
87         },
88         {
89          "fieldLabel" : "Email",
90          "xtype" : "TextField",
91          "allowBlank" : false,
92          "width" : 250,
93          "$ xns" : "Roo.form",
94          "name" : "email"
95         },
96         {
97          "fieldLabel" : "Role / Position",
98          "xtype" : "TextField",
99          "width" : 250,
100          "$ xns" : "Roo.form",
101          "name" : "role"
102         },
103         {
104          "fieldLabel" : "Phone",
105          "xtype" : "TextField",
106          "width" : 150,
107          "$ xns" : "Roo.form",
108          "name" : "phone"
109         },
110         {
111          "xtype" : "Hidden",
112          "$ xns" : "Roo.form",
113          "name" : "company_id"
114         },
115         {
116          "listeners" : {
117           "beforequery" : "function (combo, query, forceAll, cancel, e)\n{\n        var coid = _this.form.findField('company_id').getValue();\n        if (coid < 1 ) {\n            Ext.MessageBox.alert(\"Error\", \"Select An Company First\");\n            return false;\n        }\n}"
118          },
119          "listWidth" : 400,
120          "triggerAction" : "all",
121          "fieldLabel" : "Department / Office",
122          "forceSelection" : true,
123          "selectOnFocus" : true,
124          "pageSize" : 20,
125          "displayField" : "name",
126          "emptyText" : "Department / Office",
127          "hiddenName" : "office_id",
128          "minChars" : 2,
129          "valueField" : "id",
130          "xtype" : "ComboBox",
131          "allowBlank" : true,
132          "typeAhead" : true,
133          "editable" : false,
134          "width" : 250,
135          "$ xns" : "Roo.form",
136          "name" : "office_id_name",
137          "qtip" : "Select Office",
138          "queryParam" : "query[name]",
139          "tpl" : "<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>",
140          "loadingText" : "Searching...",
141          "items" : [
142           {
143            "listeners" : {
144             "|beforeload" : "function (_self, o){\n    o.params = o.params || {};\n    var coid = _this.form.findField('company_id').getValue();\n    o.params.company_id = coid;\n}\n"
145            },
146            "xtype" : "Store",
147            "remoteSort" : true,
148            "$ sortInfo" : "{ direction : 'ASC', field: 'id' }",
149            "$ xns" : "Roo.data",
150            "* prop" : "store",
151            "items" : [
152             {
153              "$ url" : "baseURL + '/Roo/core_office'",
154              "method" : "GET",
155              "xtype" : "HttpProxy",
156              "$ xns" : "Roo.data",
157              "* prop" : "proxy"
158             },
159             {
160              "id" : "id",
161              "root" : "data",
162              "xtype" : "JsonReader",
163              "$ xns" : "Roo.data",
164              "$ fields" : "[{\"name\":\"id\",\"type\":\"int\"},{\"name\":\"name\",\"type\":\"string\"}]",
165              "* prop" : "reader",
166              "totalProperty" : "total"
167             }
168            ]
169           }
170          ]
171         },
172         {
173          "xtype" : "Hidden",
174          "$ xns" : "Roo.form",
175          "name" : "id"
176         },
177         {
178          "xtype" : "FieldSet",
179          "$ xns" : "Roo.form",
180          "String legend" : "Change / Set Password",
181          "String/Object/Function style" : "width:370px",
182          "Number labelWidth" : 200,
183          "items" : [
184           {
185            "fieldLabel" : "New password",
186            "xtype" : "SecurePass",
187            "string inputType" : "password",
188            "width" : 150,
189            "$ xns" : "Roo.form",
190            "name" : "passwd1"
191           },
192           {
193            "fieldLabel" : "Password (type again to confirm)",
194            "xtype" : "TextField",
195            "allowBlank" : true,
196            "String inputType" : "password",
197            "width" : 150,
198            "$ xns" : "Roo.form",
199            "name" : "passwd2"
200           },
201           {
202            "listeners" : {
203             "check" : "function (_self, checked)\n{\n    this.form.findField('passwd1').insecure = false;\n        \n    if(!checked){\n        this.form.findField('passwd1').insecure = true;\n    }\n}"
204            },
205            "String name" : "secure_password",
206            "Boolean checked" : true,
207            "xtype" : "Checkbox",
208            "String valueOff" : 0,
209            "$ xns" : "Roo.form",
210            "String fieldLabel" : "Secure passwords",
211            "String inputValue" : 1
212           }
213          ]
214         }
215        ]
216       }
217      ]
218     },
219     {
220      "listeners" : {
221       "|activate" : "function() {\n    _this.panel = this;\n \n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
222      },
223      "background" : true,
224      "region" : "center",
225      "fitToframe" : true,
226      "title" : "System Settings",
227      "xtype" : "GridPanel",
228      "fitContainer" : true,
229      "$ xns" : "Roo",
230      "items" : [
231       {
232        "listeners" : {
233         "|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",
234         "|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}"
235        },
236        "autoExpandColumn" : "data",
237        "xtype" : "Grid",
238        "loadMask" : true,
239        "$ xns" : "Roo.grid",
240        "* prop" : "grid",
241        "items" : [
242         {
243          "listeners" : {
244           "beforeload" : "function (_self, o)\n{\n  \n    o.params = o.params ? o.params : {};\n    o.params.person_id =  _this.form.findField('id').getValue();\n    \n   \n}"
245          },
246          "xtype" : "Store",
247          "remoteSort" : true,
248          "$ sortInfo" : "{ field : 'name', direction: 'ASC' }",
249          "$ xns" : "Roo.data",
250          "* prop" : "dataSource",
251          "items" : [
252           {
253            "$ url" : "baseURL + '/Roo/core_person_settings'",
254            "xtype" : "HttpProxy",
255            "method" : "GET",
256            "$ xns" : "Roo.data",
257            "* prop" : "proxy"
258           },
259           {
260            "id" : "id",
261            "root" : "data",
262            "xtype" : "JsonReader",
263            "$ xns" : "Roo.data",
264            "* prop" : "reader",
265            "totalProperty" : "total"
266           }
267          ]
268         },
269         {
270          "pageSize" : 25,
271          "xtype" : "PagingToolbar",
272          "emptyMsg" : "No Settings Found",
273          "$ xns" : "Roo",
274          "displayMsg" : "Displaying Settings  {0} - {1} of {2}",
275          "displayInfo" : true,
276          "* prop" : "footer"
277         },
278         {
279          "xtype" : "Toolbar",
280          "$ xns" : "Roo",
281          "* prop" : "toolbar",
282          "items" : [
283           {
284            "xtype" : "Fill",
285            "$ xns" : "Roo.Toolbar"
286           },
287           {
288            "listeners" : {
289             "|click" : "function()\n{\n     Pman.genericDelete(_this, 'core_person_settings'); \n}\n        "
290            },
291            "text" : "Delete",
292            "xtype" : "Button",
293            "cls" : "x-btn-text-icon",
294            "$ icon" : "rootURL + '/Pman/templates/images/trash.gif'",
295            "$ xns" : "Roo.Toolbar"
296           }
297          ]
298         },
299         {
300          "xtype" : "ColumnModel",
301          "sortable" : true,
302          "header" : "Module",
303          "width" : 120,
304          "$ xns" : "Roo.grid",
305          "* prop" : "colModel[]",
306          "dataIndex" : "scope"
307         },
308         {
309          "xtype" : "ColumnModel",
310          "sortable" : true,
311          "header" : "Description",
312          "width" : 150,
313          "$ renderer" : "function(v) { return String.format('{0}', v); }",
314          "$ xns" : "Roo.grid",
315          "* prop" : "colModel[]",
316          "dataIndex" : "description"
317         },
318         {
319          "xtype" : "ColumnModel",
320          "sortable" : true,
321          "header" : "Value",
322          "width" : 200,
323          "$ renderer" : "function(v) { return String.format('{0}', v); }",
324          "$ xns" : "Roo.grid",
325          "* prop" : "colModel[]",
326          "dataIndex" : "data"
327         },
328         {
329          "listeners" : {
330           "afterselectionchange" : "function (_self)\n{\n    // load project members.\n}"
331          },
332          "xtype" : "RowSelectionModel",
333          "singleSelect" : true,
334          "$ xns" : "Roo.grid",
335          "* prop" : "sm"
336         }
337        ]
338       }
339      ]
340     },
341     {
342      "listeners" : {
343       "click" : "function (_self, e)\n{\n    _this.dialog.hide();\n}"
344      },
345      "text" : "Cancel",
346      "xtype" : "Button",
347      "$ xns" : "Roo",
348      "* prop" : "buttons[]"
349     },
350     {
351      "listeners" : {
352       "click" : "function (_self, e)\n{\n    // do some checks?\n     if (_this.form.findField('passwd1')) {\n        \n        var p1 = _this.form.findField('passwd1').getValue();\n        var p2 = _this.form.findField('passwd2').getValue();\n        \n        if (_this.sendAfterSave && !p1.length) {\n            Roo.MessageBox.alert(\"Error\", \"You must create a password to send introduction mail\");\n            return;\n        }\n        \n        if (Pman.Login.authUser.id < 0 && !p1.length) {\n            Roo.MessageBox.alert(\"Error\", \"You must create a password for the admin account\");\n            return;\n        }\n        \n        \n        if (p1.length || p2.length) {\n            if (p1 != p2) {\n                Roo.MessageBox.alert(\"Error\", \"Passwords do not match\");\n                return;\n            }\n        }\n        \n    \n    }\n    \n \n    _this.form.doAction(\"submit\");\n\n}"
353      },
354      "text" : "Save",
355      "xtype" : "Button",
356      "$ xns" : "Roo",
357      "* prop" : "buttons[]"
358     }
359    ]
360   }
361  ]
362 }