Pman.Tab.AdminEmailTemplates.bjs
[Pman.Admin] / Pman.Tab.AdminEmailTemplates.bjs
1 {
2     "id": "roo-file-219",
3     "name": "Pman.Tab.CoreEmail",
4     "parent": "Pman.Tab.Admin",
5     "title": "",
6     "path": "/home/edward/gitlive/Pman.Core/Pman.Tab.CoreEmail.bjs",
7     "items": [
8         {
9             "region": "center",
10             "title": "Email Template",
11             "xtype": "NestedLayoutPanel",
12             "|xns": "Roo",
13             "items": [
14                 {
15                     "|xns": "Roo",
16                     "xtype": "BorderLayout",
17                     "*prop": "layout",
18                     "items": [
19                         {
20                             "*prop": "center",
21                             "autoScroll": false,
22                             "split": true,
23                             "xtype": "LayoutRegion",
24                             "|xns": "Roo"
25                         },
26                         {
27                             "*prop": "south",
28                             "autoScroll": false,
29                             "height": 300,
30                             "split": true,
31                             "titlebar": true,
32                             "xtype": "LayoutRegion",
33                             "|xns": "Roo"
34                         },
35                         {
36                             "listeners": {
37                                 "|activate": "function() {\n    _this.panel = this;\n    if (_this.grid) {\n        _this.grid.footer.onClick('first');\n    }\n}"
38                             },
39                             "background": true,
40                             "fitContainer": true,
41                             "fitToframe": true,
42                             "region": "center",
43                             "tableName": "core_email",
44                             "title": "core_email",
45                             "xtype": "GridPanel",
46                             "|xns": "Roo",
47                             "items": [
48                                 {
49                                     "listeners": {
50                                         "|render": "function() \n{\n    _this.grid = this; \n    _this.dialog = Pman.Dialog.CoreEmail;\n    if (_this.panel.active) {\n       _this.grid.footer.onClick('first');\n    }\n}",
51                                         "|rowdblclick": "function (_self, rowIndex, e)\n{\n    if (!_this.dialog) return;\n    var data = this.getDataSource().getAt(rowIndex).data;\n    _this.dialog.show( {id : data.id, module : 'core_email'} , function() {\n        _this.grid.footer.onClick('first');\n    }); \n}\n",
52                                         "rowclick": "function (_self, rowIndex, e)\n{\n   // _this.grid.ds.load({});\n    _this.viewPanel.view.store.load({});\n}"
53                                     },
54                                     "*prop": "grid",
55                                     "autoExpandColumn": "subject",
56                                     "loadMask": true,
57                                     "xtype": "Grid",
58                                     "|xns": "Roo.grid",
59                                     "items": [
60                                         {
61                                             "*prop": "sm",
62                                             "singleSelect": true,
63                                             "xtype": "RowSelectionModel",
64                                             "|xns": "Roo.grid"
65                                         },
66                                         {
67                                             "listeners": {
68                                                 "beforeload": "function (_self, options)\n{\n    options.params = options.params || {};\n    \n    var s = _this.searchBox.getValue();\n    \n    if(s.length){\n        options.params['search[nameortitle]'] = s;\n    }\n\n}"
69                                             },
70                                             "*prop": "dataSource",
71                                             "remoteSort": true,
72                                             "xtype": "Store",
73                                             "|sortInfo": "{ field : 'id', direction: 'DESC' }",
74                                             "|xns": "Roo.data",
75                                             "items": [
76                                                 {
77                                                     "*prop": "proxy",
78                                                     "method": "GET",
79                                                     "xtype": "HttpProxy",
80                                                     "|url": "baseURL + '/Roo/Core_email.php'",
81                                                     "|xns": "Roo.data"
82                                                 },
83                                                 {
84                                                     "*prop": "reader",
85                                                     "id": "id",
86                                                     "root": "data",
87                                                     "totalProperty": "total",
88                                                     "xtype": "JsonReader",
89                                                     "|fields": "[\n    {\n        \"name\":\"name\",\n        \"type\":\"string\"\n    },\n    {\n        \"name\":\"subject\",\n        \"type\":\"string\"\n    }\n]",
90                                                     "|xns": "Roo.data"
91                                                 }
92                                             ]
93                                         },
94                                         {
95                                             "*prop": "footer",
96                                             "displayInfo": true,
97                                             "displayMsg": "Displaying Message{0} - {1} of {2}",
98                                             "emptyMsg": "Nothing found",
99                                             "pageSize": 25,
100                                             "xtype": "PagingToolbar",
101                                             "|xns": "Roo"
102                                         },
103                                         {
104                                             "*prop": "toolbar",
105                                             "xtype": "Toolbar",
106                                             "|xns": "Roo",
107                                             "items": [
108                                                 {
109                                                     "listeners": {
110                                                         "specialkey": "function (_self, e)\n{\n  _this.grid.footer.onClick('first');\n}",
111                                                         "render": "function (_self)\n{\n    _this.searchBox = _self;\n}"
112                                                     },
113                                                     "xtype": "TextField",
114                                                     "|xns": "Roo.form"
115                                                 },
116                                                 {
117                                                     "listeners": {
118                                                         "click": "function (_self, e)\n{\n    _this.grid.footer.onClick('first');\n}"
119                                                     },
120                                                     "cls": "x-btn-icon",
121                                                     "xtype": "Button",
122                                                     "|icon": "rootURL + '/Pman/templates/images/search.gif'",
123                                                     "|xns": "Roo.Toolbar"
124                                                 },
125                                                 {
126                                                     "listeners": {
127                                                         "click": "function (_self, e)\n{\n    _this.searchBox.setValue('');\r\n    _this.grid.footer.onClick('first');\r\n}"
128                                                     },
129                                                     "cls": "x-btn-icon",
130                                                     "xtype": "Button",
131                                                     "|icon": "rootURL + '/Pman/templates/images/edit-clear.gif'",
132                                                     "|xns": "Roo.Toolbar"
133                                                 },
134                                                 {
135                                                     "|xns": "Roo.Toolbar",
136                                                     "xtype": "Fill"
137                                                 },
138                                                 {
139                                                     "listeners": {
140                                                         "|click": "function()\n{\n  var sel = _this.grid.selModel.getSelected();\n  if (!sel) {\n        Roo.MessageBox.alert(\"Error\", \"Select a message to copy\");\n        return;\n    }\nnew Pman.Request({\n    url : baseURL + '/Roo/Core_email',\n    method : 'POST',\n    params : {\n        id : sel.data.id,\n        _make_copy : 1\n    },\n    success : function() {\n        _this.grid.footer.onClick('refresh');\n    }\n});\n  \n}\n"
141                                                     },
142                                                     "cls": "x-btn-text-icon",
143                                                     "text": "Copy",
144                                                     "xtype": "Button",
145                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
146                                                     "|xns": "Roo.Toolbar"
147                                                 },
148                                                 {
149                                                     "listeners": {
150                                                         "|click": "function()\n{\n    if (!_this.dialog) return;\n    _this.dialog.show( { id : 0, module : 'core_email' } , function() {\n        _this.grid.footer.onClick('first');\n   }); \n}\n"
151                                                     },
152                                                     "cls": "x-btn-text-icon",
153                                                     "text": "Add",
154                                                     "xtype": "Button",
155                                                     "|icon": "Roo.rootURL + 'images/default/dd/drop-add.gif'",
156                                                     "|xns": "Roo.Toolbar"
157                                                 },
158                                                 {
159                                                     "|xns": "Roo.Toolbar",
160                                                     "xtype": "Separator"
161                                                 },
162                                                 {
163                                                     "listeners": {
164                                                         "|click": "function()\n{\n    Pman.genericDelete(_this, 'core_email');\n    \n}\n"
165                                                     },
166                                                     "cls": "x-btn-text-icon",
167                                                     "text": "Delete",
168                                                     "xtype": "Button",
169                                                     "|icon": "rootURL + '/Pman/templates/images/trash.gif'",
170                                                     "|xns": "Roo.Toolbar"
171                                                 }
172                                             ]
173                                         },
174                                         {
175                                             "*prop": "colModel[]",
176                                             "dataIndex": "name",
177                                             "header": "Name",
178                                             "width": 250,
179                                             "xtype": "ColumnModel",
180                                             "|renderer": "function(v) { return String.format('{0}', v); }",
181                                             "|xns": "Roo.grid"
182                                         },
183                                         {
184                                             "*prop": "colModel[]",
185                                             "dataIndex": "subject",
186                                             "header": "Title",
187                                             "width": 300,
188                                             "xtype": "ColumnModel",
189                                             "|renderer": "function(v) { return String.format('{0}', v); }",
190                                             "|xns": "Roo.grid"
191                                         },
192                                         {
193                                             "*prop": "colModel[]",
194                                             "dataIndex": "from_name",
195                                             "header": "From Name",
196                                             "width": 400,
197                                             "xtype": "ColumnModel",
198                                             "|renderer": "function(v) { return String.format('{0}', v); }",
199                                             "|xns": "Roo.grid"
200                                         },
201                                         {
202                                             "*prop": "colModel[]",
203                                             "dataIndex": "from_email",
204                                             "header": "From Email",
205                                             "width": 400,
206                                             "xtype": "ColumnModel",
207                                             "|renderer": "function(v) { return String.format('{0}', v); }",
208                                             "|xns": "Roo.grid"
209                                         }
210                                     ]
211                                 }
212                             ]
213                         },
214                         {
215                             "listeners": {
216                                 "render": "function (_self)\n{\n    _this.viewPanel = _self;\n}"
217                             },
218                             "autoScroll": true,
219                             "background": false,
220                             "fitContainer": true,
221                             "fitToFrame": true,
222                             "region": "south",
223                             "title": "View Message",
224                             "xtype": "ContentPanel",
225                             "|xns": "Roo",
226                             "items": [
227                                 {
228                                     "listeners": {
229                                         "preparedata": "function (_self, data, i, rec)\n{\n   // Roo.log(data);\n    //Roo.apply(data, rec.json);\n}"
230                                     },
231                                     "*prop": "view",
232                                     "xtype": "View",
233                                     "|tpl": "new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_mail.html'})",
234                                     "|xns": "Roo",
235                                     "items": [
236                                         {
237                                             "listeners": {
238                                                 "beforeload": "function (_self, options)\n{\n    options.params = options.params || {};\n    var p = _this.grid.selModel.getSelected();\n    if (!p || !p.data.id) {\n        this.removeAll();\n        return false;\n    }\n   \n    options.params['id'] = p.data.id;\n \n}",
239                                                 "load": "function (_self, records, options)\n{\n    var p = _this.grid.selModel.getSelected();\n  //  Roo.log(p);\n    if (!p || !p.data.id) {\n        this.removeAll();\n        return false;\n    }\n  /*  \n    new Pman.Request({\n        url : baseURL + '/Roo/crm_action.php',\n        method : 'GET',\n        params : {\n            person_id : p.data.id,\n            sort : 'action_dt',\n            dir : 'DESC'\n        },\n        success : function(res) {\n            if(res.success){\n                var el = _this.cpanel.el.select('.crm-history-content').first();\n                _this.historyTemplate.overwrite(el, res);\n                el.select('.crm-history-log').on('click', Pman.Crm.auditToggle);\n                //Roo.log(res);\n            }\n        },\n        failure : function(e) {\n            //Roo.log(e);\n          _this.grid.ds.load({});\n        }\n        \n    });\n    */\n\n//_this.historyTemplate = new Roo.DomTemplate({url : rootURL+'/Pman/Crm/domtemplates/crm_history.html'})\n\n/*\n  new pman request ([\n  \n  } successs(data)\n       el = _this.elemmnt.select('.services')\n       _this.serviceTemplate.overwite(el, data)\n  */\n}"
240                                             },
241                                             "*prop": "store",
242                                             "xtype": "Store",
243                                             "|xns": "Roo.data",
244                                             "items": [
245                                                 {
246                                                     "*prop": "proxy",
247                                                     "method": "GET",
248                                                     "xtype": "HttpProxy",
249                                                     "|url": "baseURL+'/Roo/Core_email.php'",
250                                                     "|xns": "Roo.data"
251                                                 },
252                                                 {
253                                                     "*prop": "reader",
254                                                     "id": "id",
255                                                     "root": "data",
256                                                     "totalProperty": "total",
257                                                     "xtype": "JsonReader",
258                                                     "|xns": "Roo.data"
259                                                 }
260                                             ]
261                                         }
262                                     ]
263                                 }
264                             ]
265                         }
266                     ]
267                 }
268             ]
269         }
270     ],
271     "permname": "",
272     "modOrder": "999"
273 }