fix typo
[Pman.Core] / Pman.Dialog.CoreEmail.js
1 //<script type="text/javascript">
2
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
4
5 Roo.namespace('Pman.Dialog');
6
7 Pman.Dialog.CoreEmail = {
8
9  _strings : {
10   'e44b145bd8b49b06e0ad2ced1ad56466' :"Plain Text",
11   '2f26e35d61be90501e099089dc533638' :"Select Images",
12   'f2a6c498fb90ee345d997f888fce3b18' :"Delete",
13   'b357b524e740bc85b9790a0712d84a30' :"Email address",
14   '962b90039a542a29cedd51d87a9f28a1' :"Html Editor",
15   '72d6d7a1885885bb55a565fd1070581a' :"Import",
16   '28690be026c0bb9003aa58e45e5662ca' :"Enabled - will be sent out",
17   'ea30b40c3caf28acb29198d20d243e54' :"Images / Attachments >>",
18   '31fde7b05ac8952dacf4af8a704074ec' :"Preview",
19   'b337c8a67244afb6551ee1f8f9717676' :"Test Class <BR/> (for system reference only)",
20   '884df8e413319ff51a3f5f528606238a' :"Use template",
21   'e6b391a8d2c4d45902a23a8b6585703d' :"URL",
22   '6f16a5f8ff5d75ab84c018adacdfcbb7' :"Field",
23   'ec211f7c20af43e742bf2570c3cb84f9' :"Add",
24   '2393ad754ba179442d85e415d1d5167c' :"Displayorder",
25   'e9968623956c15023d54335ea3699855' :"Convert Html to Text",
26   '1243daf593fa297e07ab03bf06d925af' :"Searching...",
27   '5b8ef4e762c00a15a41cfc26dc3ef99c' :"Send me a test copy",
28   'c7892ebbb139886662c6f2fc8c450710' :"Subject",
29   'dc0de523c25be298ba751c63c694109e' :"Responsive Email (1)",
30   '396ecabf0cd1f9503e591418851ef406' :"Edit / Create Message",
31   'b9c49611cfda3259a2b837b39489e650' :"Add Image",
32   'cafbb1cfc96d63acd85e7de928e1636b' :"To Group <BR/> (for system reference only)",
33   'ea4788705e6873b424c65e91c2846b19' :"Cancel",
34   '68b00d723d37122f64da8d9939f836f0' :"BCC Group",
35   'c4ca4238a0b923820dcc509a6f75849b' :"1",
36   'bd88a20b53a47f7b5704a83a15ff5506' :"Saved Version",
37   'b20a8b77b05d53b4e695738731400c85' :"Mailout Name",
38   '1bd18d39370b7f26c1c5e18067b74c6f' :"Html File",
39   '2c466a2c159463f1d9ef5a7b57b52827' :"Select BCC Group",
40   '5da618e8e4b89c66fe86e32cdafde142' :"From",
41   '31bb2f6e9b8fb11cbb7fb63c6025223f' :"Select Template",
42   'b78a3223503896721cca1303f776159b' :"Title",
43   '278c491bdd8a53618c149c4ac790da34' :"Template",
44   '308f2757bfc9ce92fb00ff93fdffd279' :"Images / Attachments",
45   '1351017ac6423911223bc19a8cb7c653' :"Filename",
46   'c9cc8cce247e49bae79f15173ce97354' :"Save",
47   '5feb9bf3c03b32635135006cbacb9542' :"Insert Field",
48   '4c2a8fe7eaf24721cc7a9f0175115bd4' :"Message",
49   'fff0d600f8a0b5e19e88bfb821dd1157' :"Images"
50  },
51  _named_strings : {
52   'active_boxLabel' : '28690be026c0bb9003aa58e45e5662ca' /* Enabled - will be sent out */ ,
53   'to_group_id_name_fieldLabel' : 'cafbb1cfc96d63acd85e7de928e1636b' /* To Group <BR/> (for system reference only) */ ,
54   'template_fieldLabel' : '278c491bdd8a53618c149c4ac790da34' /* Template */ ,
55   'name_fieldLabel' : 'b20a8b77b05d53b4e695738731400c85' /* Mailout Name */ ,
56   'bcc_group_id_name_qtip' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
57   'bcc_group_id_name_emptyText' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
58   'template_qtip' : '31bb2f6e9b8fb11cbb7fb63c6025223f' /* Select Template */ ,
59   'template_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
60   'from_email_fieldLabel' : 'b357b524e740bc85b9790a0712d84a30' /* Email address */ ,
61   'template_emptyText' : '31bb2f6e9b8fb11cbb7fb63c6025223f' /* Select Template */ ,
62   'active_value' : 'c4ca4238a0b923820dcc509a6f75849b' /* 1 */ ,
63   'from_name_fieldLabel' : '5da618e8e4b89c66fe86e32cdafde142' /* From */ ,
64   'bcc_group_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
65   'bcc_group_id_name_fieldLabel' : '68b00d723d37122f64da8d9939f836f0' /* BCC Group */ ,
66   'subject_fieldLabel' : 'c7892ebbb139886662c6f2fc8c450710' /* Subject */ ,
67   'test_class_fieldLabel' : 'b337c8a67244afb6551ee1f8f9717676' /* Test Class <BR/> (for system reference only) */ 
68  },
69
70  dialog : false,
71  callback:  false,
72
73  show : function(data, cb)
74  {
75   if (!this.dialog) {
76    this.create();
77   }
78
79   this.callback = cb;
80   this.data = data;
81   this.dialog.show(this.data._el);
82   if (this.form) {
83    this.form.reset();
84    this.form.setValues(data);
85    this.form.fireEvent('actioncomplete', this.form,  { type: 'setdata', data: data });
86   }
87
88  },
89
90  create : function()
91  {
92    var _this = this;
93    this.dialog = Roo.factory({
94     xtype : 'LayoutDialog',
95     closable : true,
96     collapsible : false,
97     height : 500,
98     modal : true,
99     resizable : true,
100     title : _this._strings['396ecabf0cd1f9503e591418851ef406'] /* Edit / Create Message */,
101     width : 800,
102     listeners : {
103      show : function (_self)
104       {
105           
106           _self.layout.getRegion('center').showPanel(0);
107           var w = Roo.lib.Dom.getViewWidth();\r
108           var h = Roo.lib.Dom.getViewHeight();    \r    this.resizeTo(w-50, h-50);\r
109           this.center();\r    
110           var ew = Math.max(250, w-320);\r
111           var eh = Math.max(250, h-350) ;\r
112           var e = _this.dialog.layout.getRegion('east');
113           if (e.visible) {
114               e.hide();
115           }
116           
117           var el = _self.getEl();
118           var elw = el.dom.clientWidth;
119           
120           var bdtext = _this.form.findField('bodytext');
121           var ptext = _this.form.findField('plaintext');
122           if(bdtext.resizeEl){
123               bdtext.width = elw-100;
124               bdtext.resizeEl.resizeTo.defer(110, bdtext.resizeEl,[ bdtext.width, bdtext.height  ] );
125               ptext.setSize(bdtext.width , bdtext.height);
126           }
127           
128       }
129     },
130     xns : Roo,
131     '|xns' : 'Roo',
132     center : {
133      xtype : 'LayoutRegion',
134      tabPosition : 'top',
135      xns : Roo,
136      '|xns' : 'Roo'
137     },
138     east : {
139      xtype : 'LayoutRegion',
140      hidden : true,
141      split : true,
142      title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
143      titlebar : true,
144      width : 500,
145      xns : Roo,
146      '|xns' : 'Roo'
147     },
148     buttons : [
149      {
150       xtype : 'Button',
151       text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
152       listeners : {
153        click : function (_self, e)
154         {
155             //_this.dialog.hide();
156             Roo.log(_this.data.module);
157             Pman.Dialog.CoreEmailPreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });
158         },
159        render : function (_self)
160         {
161             _this.preview_btn = _self;
162         }
163       },
164       xns : Roo,
165       '|xns' : 'Roo'
166      },
167      {
168       xtype : 'Button',
169       text : _this._strings['5b8ef4e762c00a15a41cfc26dc3ef99c'] /* Send me a test copy */,
170       listeners : {
171        click : function (_self, e)
172         {
173             //_this.dialog.hide();
174         
175             var id = _this.form.findField('id').getValue();
176             
177             if(id*1 < 1){
178                 Roo.MessageBox.alert('Error', 'Please save the message frist!');
179                 return;
180             }
181            
182             new Pman.Request({
183                 url : baseURL + '/Core/MessagePreview',
184                 method : 'POST',
185                 mask: 'Sending',
186                 params : {
187                     _id : id,
188                     _table : _this.data.module
189                 }, 
190                 success : function(res) { 
191                     if(res.data == 'SUCCESS'){
192                         Roo.MessageBox.alert("Email Sent", 'The report was sent to your email (HTML format).');
193                     }
194                 }
195             });
196         },
197        render : function (_self)
198         {
199             _this.html_preview = _self;
200         }
201       },
202       xns : Roo,
203       '|xns' : 'Roo'
204      },
205      {
206       xtype : 'Button',
207       text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
208       listeners : {
209        click : function (_self, e)
210         {
211             _this.dialog.hide();
212         }
213       },
214       xns : Roo,
215       '|xns' : 'Roo'
216      },
217      {
218       xtype : 'Button',
219       text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
220       listeners : {
221        click : function (_self, e)
222         {
223         
224             // do some checks?
225             _this.form.preValidate(function(res) {
226                 if (!res) {
227                     return; //failed.
228                 }
229                  _this.form.doAction("submit");
230             });
231         
232         }
233       },
234       xns : Roo,
235       '|xns' : 'Roo'
236      }
237     ],
238     items  : [
239      {
240       xtype : 'NestedLayoutPanel',
241       autoScroll : false,
242       fitContainer : true,
243       fitToFrame : true,
244       region : 'center',
245       xns : Roo,
246       '|xns' : 'Roo',
247       toolbar : {
248        xtype : 'Toolbar',
249        xns : Roo,
250        '|xns' : 'Roo',
251        items  : [
252         {
253          xtype : 'Button',
254          text : _this._strings['72d6d7a1885885bb55a565fd1070581a'] /* Import */,
255          xns : Roo.Toolbar,
256          '|xns' : 'Roo.Toolbar',
257          menu : {
258           xtype : 'Menu',
259           xns : Roo.menu,
260           '|xns' : 'Roo.menu',
261           items  : [
262            {
263             xtype : 'Item',
264             text : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
265             listeners : {
266              click : function (_self, e)
267               {
268                   Pman.Dialog.CoreImportUrl.show({
269                       target : '/Core/ImportMailMessage.php'
270                   }, function(data) {
271                       if  (data) {
272                         //  Roo.log(data);
273                           _this.form.findField('bodytext').setValue(data);
274                       }
275                   });
276               }
277             },
278             xns : Roo.menu,
279             '|xns' : 'Roo.menu'
280            },
281            {
282             xtype : 'Item',
283             text : _this._strings['1bd18d39370b7f26c1c5e18067b74c6f'] /* Html File */,
284             listeners : {
285              click : function (_self, e)
286               {
287                   Pman.Dialog.Image.show({
288                       _url : baseURL + '/Core/ImportMailMessage.php'
289                   }, function(data) {
290                       if  (data) {
291                           _this.form.findField('bodytext').setValue(data);
292                       }
293                   });
294               }
295             },
296             xns : Roo.menu,
297             '|xns' : 'Roo.menu'
298            }
299           ]
300          }
301         },
302         {
303          xtype : 'Button',
304          text : _this._strings['884df8e413319ff51a3f5f528606238a'] /* Use template */,
305          xns : Roo.Toolbar,
306          '|xns' : 'Roo.Toolbar',
307          menu : {
308           xtype : 'Menu',
309           xns : Roo.menu,
310           '|xns' : 'Roo.menu',
311           items  : [
312            {
313             xtype : 'Item',
314             text : _this._strings['dc0de523c25be298ba751c63c694109e'] /* Responsive Email (1) */,
315             listeners : {
316              click : function (_self, e)
317               {
318               
319                   var l = document.location;
320                   new Pman.Request({
321               
322                       url : baseURL + '/Core/ImportMailMessage.php',
323               
324                       method: 'POST',
325                       mask : "Loading",
326                       params : {
327                             importUrl : l.protocol +'//' + l.host +   rootURL + '/Pman/Crm/mail_templates/responsive1.html'
328                      },
329                       success : function (res) {
330               
331                        _this.form.findField('bodytext').setValue(res.data);
332                       }
333                 
334                   });
335               }
336             },
337             xns : Roo.menu,
338             '|xns' : 'Roo.menu'
339            }
340           ]
341          }
342         },
343         {
344          xtype : 'ComboBox',
345          allowBlank : true,
346          alwaysQuery : true,
347          displayField : 'file',
348          editable : false,
349          emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
350          fieldLabel : _this._strings['278c491bdd8a53618c149c4ac790da34'] /* Template */,
351          forceSelection : true,
352          hiddenName : 'template',
353          listWidth : 400,
354          loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
355          minChars : 2,
356          name : 'template',
357          pageSize : 20,
358          qtip : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
359          selectOnFocus : true,
360          tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{file}</b> </div>',
361          triggerAction : 'all',
362          typeAhead : true,
363          valueField : 'file',
364          width : 200,
365          listeners : {
366           select : function (combo, record, index)
367            {
368               
369            /*
370                (function() { 
371                    combo.setValue('');
372                }).defer(100);
373            */    
374                if(!record){
375                    return;
376                }
377                _this.form.findField('bodytext').setValue(record.data.content);
378            
379            }
380          },
381          xns : Roo.form,
382          '|xns' : 'Roo.form',
383          store : {
384           xtype : 'Store',
385           remoteSort : true,
386           sortInfo : { direction : 'DESC', field: 'file' },
387           listeners : {
388            beforeload : function (_self, o){
389                 o.params = o.params || {};
390                 // set more here
391                
392             }
393           },
394           xns : Roo.data,
395           '|xns' : 'Roo.data',
396           proxy : {
397            xtype : 'HttpProxy',
398            method : 'GET',
399            url : baseURL + '/Core/MailTemplateList.php',
400            xns : Roo.data,
401            '|xns' : 'Roo.data'
402           },
403           reader : {
404            xtype : 'JsonReader',
405            fields : [{"name":"file","type":"string"},{"name":"content","type":"string"}],
406            id : 'name',
407            root : 'data',
408            totalProperty : 'total',
409            xns : Roo.data,
410            '|xns' : 'Roo.data'
411           }
412          }
413         },
414         {
415          xtype : 'Fill',
416          xns : Roo.Toolbar,
417          '|xns' : 'Roo.Toolbar'
418         },
419         {
420          xtype : 'Button',
421          text : _this._strings['ea30b40c3caf28acb29198d20d243e54'] /* Images / Attachments >> */,
422          listeners : {
423           click : function (_self, e)
424            {
425                var el = _this.dialog.layout.getRegion('east');
426                if (el.visible) {
427                    el.hide();
428                } else {
429                    el.show();
430                    el.showPanel(0);
431                }
432                
433            }
434          },
435          xns : Roo.Toolbar,
436          '|xns' : 'Roo.Toolbar'
437         }
438        ]
439       },
440       layout : {
441        xtype : 'BorderLayout',
442        xns : Roo,
443        '|xns' : 'Roo',
444        center : {
445         xtype : 'LayoutRegion',
446         autoScroll : true,
447         xns : Roo,
448         '|xns' : 'Roo'
449        },
450        items  : [
451         {
452          xtype : 'ContentPanel',
453          autoScroll : false,
454          background : false,
455          fitContainer : true,
456          fitToFrame : true,
457          region : 'center',
458          title : _this._strings['4c2a8fe7eaf24721cc7a9f0175115bd4'] /* Message */,
459          listeners : {
460           render : function (_self, width, height)
461            {
462                
463                  Roo.log("RESIZE, " + width + ',' + height);
464                
465                var ew = Math.max(250, width-50);
466                var eh = Math.max(250,height-50) ;
467                
468               
469            
470            },
471           resize : function (_self, width, height)\r
472            {\r
473               var ew = Math.max(250, width-50);\r
474                var eh = Math.max(250,height-50) ;
475                
476                if (!_this.form) {\r
477                    return;\r
478                }\r
479                var bdtext = _this.form.findField('bodytext');\r
480                var ptext = _this.form.findField('plaintext');\r
481                if(bdtext.resizeEl){\r
482                    bdtext.width = ew-50;\r
483                    bdtext.resizeEl.resizeTo.defer(110, bdtext.resizeEl,[ bdtext.width, bdtext.height  ] );\r
484                    ptext.setSize(bdtext.width , bdtext.height);\r
485                }\r\r
486            \r
487            }
488          },
489          xns : Roo,
490          '|xns' : 'Roo',
491          items  : [
492           {
493            xtype : 'Form',
494            labelAlign : 'right',
495            labelWidth : 120,
496            method : 'POST',
497            preValidate : function(done_callback) {
498                
499                Roo.MessageBox.progress("Uploading Images", "Uploading");
500                
501                if(!_this.form.findField('bodytext').editorcore.sourceEditMode){
502                    _this.form.findField('bodytext').syncValue();
503                }else{
504                    _this.form.findField('bodytext').pushValue();
505                }
506                
507                var html = _this.form.findField('bodytext').getValue();
508                
509                var s = Roo.get(_this.form.findField('bodytext').editorcore.doc.documentElement);
510                
511                var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
512                
513                var nodes = [];
514                s.select('img[src]').each(function(i) {
515                    nodes.push(i.dom);
516                });
517                var total = nodes.length;
518                var mkimg = function() {
519                
520                    if (!nodes.length) {
521                          Roo.MessageBox.hide();
522                          _this.form.findField('bodytext').syncValue();
523                          done_callback(true);
524                       //    _this.form.doAction("submit");
525                          return;
526                    }
527                    var i = nodes.pop(); 
528                    
529                    var n = i.getAttribute('src').match(/(baseURL|server_baseurl)/);
530                    
531                    if(n){
532                        mkimg();
533                        return;
534                    }
535                    
536                    n = i.getAttribute('src').match(/^http(.*)/);
537                   
538                    if(!n ){
539                        mkimg();
540                        return;
541                    }
542                    
543                    new Pman.Request({
544                        url : baseURL + '/Roo/Images.php',
545                        method : 'POST',
546                        params : {
547                            onid : _this.form.findField('id').getValue(),
548                            ontable : ontable ,
549                            _remote_upload : i.src
550                        },
551                        success : function(res){
552                            if(res.success == true){      
553                                i.setAttribute('src', res.data);
554                                Roo.MessageBox.updateProgress( (total - nodes.length) / total , "Done " + (total - nodes.length) + '/' + total);
555                            }
556                            mkimg();
557                        }
558                    });
559                   
560                }
561                
562                if (!_this.form.findField('bodytext').getValue().match(/unsubscribe/i)) {
563                    Roo.MessageBox.confirm("Missing unusubscribe",
564                        "There is no unsubscribe link on the email  are you sure you want to save it",
565                        function(res) {
566                            if (res == 'no') {
567                                return;
568                            }
569                            mkimg();
570                        }
571                    );
572            
573                    return;
574                }
575                
576                mkimg();
577            },
578            style : 'margin:10px',
579            url : baseURL + '/Roo/crm_mailing_list_message.php',
580            listeners : {
581             actioncomplete : function(_self,action)
582              {
583                 
584                  if (action.type == 'setdata') {
585                  
586                      setInterval(_this.form.findField('bodytext').autosave, 5000);
587                      
588                      _this.data.module = _this.data.module || 'crm_mailing_list_message';
589                      
590                      _this.form.url = baseURL + '/Roo/' + _this.data.module;
591                      
592                      _this.html_preview.hide();
593                      _this.preview_btn.hide();
594                          
595                      if(_this.data.id*1 > 0){
596                          _this.dialog.el.mask("Loading");
597                          this.load({ method: 'GET', params: { '_id' : _this.data.id }});
598                          _this.html_preview.show();
599                          _this.preview_btn.show();
600                          
601                      } else {
602                          _this.form.setValues({
603                              'from_name' : Pman.Login.authUser.name,
604                              'from_email' : Pman.Login.authUser.email
605                          });
606                      }
607                     return;
608                  }
609                  if (action.type == 'load') {
610                      _this.dialog.el.unmask();
611                      
612                      _this.form.findField('bodytext').originalValue = _this.form.findField('bodytext').getValue();
613                      
614                      return;
615                  }
616                  if (action.type =='submit') {
617                  
618                      _this.dialog.el.unmask();
619                      _this.dialog.hide();
620                  
621                       if (_this.callback) {
622                          _this.callback.call(_this, action.result.data);
623                       }
624                       _this.form.reset();
625                       return;
626                  }
627              },
628             rendered : function (form)
629              {
630                  _this.form= form;
631              }
632            },
633            xns : Roo.form,
634            '|xns' : 'Roo.form',
635            items  : [
636             {
637              xtype : 'Row',
638              xns : Roo.form,
639              '|xns' : 'Roo.form',
640              items  : [
641               {
642                xtype : 'TextField',
643                allowBlank : false,
644                fieldLabel : _this._strings['b20a8b77b05d53b4e695738731400c85'] /* Mailout Name */,
645                name : 'name',
646                width : 400,
647                xns : Roo.form,
648                '|xns' : 'Roo.form'
649               },
650               {
651                xtype : 'Column',
652                hideLabels : true,
653                xns : Roo.form,
654                '|xns' : 'Roo.form',
655                items  : [
656                 {
657                  xtype : 'Checkbox',
658                  boxLabel : _this._strings['28690be026c0bb9003aa58e45e5662ca'] /* Enabled - will be sent out */,
659                  checked : true,
660                  name : 'active',
661                  value : 1,
662                  valueOff : 0,
663                  listeners : {
664                   check : function (_self, checked)
665                    {
666                        var boxLabel = 'Enabled - will be sent out';
667                        
668                        if(!checked){
669                            boxLabel = 'Disabled - will NOT be sent out';
670                        }
671                        
672                        this.setBoxLabel(boxLabel);
673                    }
674                  },
675                  xns : Roo.form,
676                  '|xns' : 'Roo.form'
677                 }
678                ]
679               }
680              ]
681             },
682             {
683              xtype : 'Row',
684              xns : Roo.form,
685              '|xns' : 'Roo.form',
686              items  : [
687               {
688                xtype : 'TextField',
689                allowBlank : false,
690                fieldLabel : _this._strings['5da618e8e4b89c66fe86e32cdafde142'] /* From */,
691                name : 'from_name',
692                width : 300,
693                xns : Roo.form,
694                '|xns' : 'Roo.form'
695               },
696               {
697                xtype : 'TextField',
698                allowBlank : false,
699                fieldLabel : _this._strings['b357b524e740bc85b9790a0712d84a30'] /* Email address */,
700                name : 'from_email',
701                width : 300,
702                xns : Roo.form,
703                '|xns' : 'Roo.form'
704               },
705               {
706                xtype : 'ComboBox',
707                allowBlank : true,
708                alwaysQuery : true,
709                displayField : 'name',
710                editable : false,
711                emptyText : _this._strings['2c466a2c159463f1d9ef5a7b57b52827'] /* Select BCC Group */,
712                fieldLabel : _this._strings['68b00d723d37122f64da8d9939f836f0'] /* BCC Group */,
713                forceSelection : true,
714                hiddenName : 'bcc_group_id',
715                loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
716                minChars : 2,
717                name : 'bcc_group_id_name',
718                pageSize : 25,
719                qtip : _this._strings['2c466a2c159463f1d9ef5a7b57b52827'] /* Select BCC Group */,
720                selectOnFocus : true,
721                tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
722                triggerAction : 'all',
723                typeAhead : true,
724                valueField : 'id',
725                width : 300,
726                xns : Roo.form,
727                '|xns' : 'Roo.form',
728                store : {
729                 xtype : 'Store',
730                 remoteSort : true,
731                 sortInfo : { direction : 'ASC', field: 'name' },
732                 listeners : {
733                  beforeload : function (_self, o){
734                       o.params = o.params || {};
735                       
736                       o.params._direct_return = 1;
737                   }
738                 },
739                 xns : Roo.data,
740                 '|xns' : 'Roo.data',
741                 proxy : {
742                  xtype : 'HttpProxy',
743                  method : 'GET',
744                  url : baseURL + '/Roo/Core_group',
745                  xns : Roo.data,
746                  '|xns' : 'Roo.data'
747                 },
748                 reader : {
749                  xtype : 'JsonReader',
750                  fields : [{"name":"name","type":"string"},{"name":"id","type":"int"}],
751                  id : 'name',
752                  root : 'data',
753                  totalProperty : 'total',
754                  xns : Roo.data,
755                  '|xns' : 'Roo.data'
756                 }
757                }
758               }
759              ]
760             },
761             {
762              xtype : 'TextField',
763              allowBlank : false,
764              fieldLabel : _this._strings['c7892ebbb139886662c6f2fc8c450710'] /* Subject */,
765              name : 'subject',
766              width : 600,
767              xns : Roo.form,
768              '|xns' : 'Roo.form'
769             },
770             {
771              xtype : 'Row',
772              hideLabels : true,
773              xns : Roo.form,
774              '|xns' : 'Roo.form',
775              items  : [
776               {
777                xtype : 'FieldSet',
778                hideLabels : true,
779                legend : _this._strings['962b90039a542a29cedd51d87a9f28a1'] /* Html Editor */,
780                style : 'text-align:center;',
781                xns : Roo.form,
782                '|xns' : 'Roo.form',
783                items  : [
784                 {
785                  xtype : 'HtmlEditor',
786                  allowComments : true,
787                  autoClean : false,
788                  autosave : function() {
789                      
790                      var body = _this.form.findField('bodytext');
791                      
792                      if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
793                          Roo.log('body not dirty');
794                          return;
795                      }
796                      
797                      Roo.log('body dirty, auto save!');
798                      
799                      body.fireEvent('autosave', body);
800                     
801                  },
802                  clearUp : false,
803                  cwhite : [ 
804                      'background',
805                      'background-color',
806                      'border',
807                      'border-radius',
808                      'border-bottom',
809                      'border-left',
810                      'border-right',
811                      'border-top',
812                      'border-collapse',
813                       'border-color',
814                       'border-style',
815                      'border-width',
816                  
817                      
818                      'box-shadow',
819                      'clear',
820                      'color',
821                      'cursor',
822                      'display',
823                      'float' ,
824                      'font-family',
825                      'font-size',
826                      'font-style',        
827                      'font-weight',
828                  
829                      'height',
830                      'left',
831                      'line-height',
832                      'list-style',
833                      'margin',
834                      'margin-bottom',
835                      'margin-left',
836                      'margin-right',
837                      'margin-top',
838                      'max-width',
839                      'min-height',
840                      '-ms-interpolation-mode',
841                      'mso-table-rspace',
842                      '-ms-text-size-adjust',
843                      'outline',
844                      'overflow',
845                      'padding',
846                      'padding-bottom',
847                      'padding-left',
848                      'padding-right',
849                      'padding-top',
850                      'position',
851                      'right',
852                      'text-align',
853                      'text-decoration',
854                      'top',
855                      'vertical-align',
856                      '-webkit-text-size-adjust',
857                      'width',
858                      'width',
859                      'z-index'
860                   ],
861                  enableBlocks : false,
862                  height : 250,
863                  name : 'bodytext',
864                  resizable : 's',
865                  listeners : {
866                   autosave : function (_self)
867                    {
868                        Roo.log('autosave');
869                        
870                        var id = _this.form.findField('id').getValue() * 1;
871                        
872                        /*
873                        if(!_self.editorcore.sourceEditMode){
874                            _self.syncValue();
875                        }else{
876                            _self.pushValue();
877                        }
878                        */
879                        
880                        new Pman.Request({
881                            url : baseURL + '/Roo/Events.php',
882                            method :'POST',
883                            params : {
884                                id : 0,
885                                action : 'AUTOSAVE',
886                                on_id : (id > 0) ? id : 0,
887                                on_table : 'crm_mailing_list_message',
888                                remarks : 'BODY',
889                                source: _self.getValue()
890                            },
891                            success : function() {
892                                _self.originalValue = _self.getValue();
893                                
894                            },
895                            failure : function() 
896                            {
897                                Roo.log('body autosave failed?!');
898                            }
899                        });
900                        
901                    },
902                   savedpreview : function (_self)
903                    {
904                        var id = _this.form.findField('id').getValue() * 1;
905                        
906                        var successFn = function(res){
907                            return res.data.POST.source;
908                        };
909                        
910                        var params = {
911                            action : 'AUTOSAVE',
912                            remarks : 'BODY',
913                            on_id : (id < 1) ? 0 : id,
914                            on_table : 'crm_mailing_list_message',
915                            successFn : successFn
916                        };
917                        
918                        
919                        Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
920                            _self.setValue(res);
921                            _self.originalValue = res;
922                        });
923                    }
924                  },
925                  xns : Roo.form,
926                  '|xns' : 'Roo.form',
927                  toolbars : [
928                   {
929                    xtype : 'ToolbarContext',
930                    xns : Roo.form.HtmlEditor,
931                    '|xns' : 'Roo.form.HtmlEditor'
932                   },
933                   {
934                    xtype : 'ToolbarStandard',
935                    xns : Roo.form.HtmlEditor,
936                    '|xns' : 'Roo.form.HtmlEditor',
937                    btns : [
938                     {
939                      xtype : 'ComboBox',
940                      alwaysQuery : true,
941                      displayField : 'name',
942                      editable : false,
943                      emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
944                      fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
945                      forceSelection : true,
946                      listWidth : 400,
947                      loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
948                      minChars : 2,
949                      pageSize : 20,
950                      qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
951                      selectOnFocus : true,
952                      tpl : '<div class=\"x-grid-cell-text x-btn button\"><img src=\"{public_baseURL}/Core/Images/Thumb/150x150/{id}.jpg\" height=\"150\" width=\"150\"><b>{filename}</b> </div>',
953                      triggerAction : 'all',
954                      typeAhead : true,
955                      valueField : 'id',
956                      width : 100,
957                      listeners : {
958                       beforequery : function (combo, query, forceAll, cancel, e)
959                        {
960                            var id = _this.form.findField('id').getValue() * 1;    
961                            if (!id) {
962                                Roo.MessageBox.alert("Error", "Save message first");
963                                return false;
964                            }
965                        },
966                       render : function (_self)
967                        {
968                            _this.extendimgselect = _self;
969                        },
970                       select : function (combo, record, index)
971                        {
972                            Roo.log(record);
973                            (function() { 
974                                combo.setValue('');
975                            }).defer(100);
976                            var editor = _this.form.findField('bodytext').editorcore;
977                            
978                            var curnode = editor.getSelectedNode();
979                            if (curnode && curnode.tagName == 'IMG') {
980                                curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
981                                        baseURL,  record.data.id, record.data.filename
982                                    );
983                                    // note -forces an update... hopefully...
984                                editor.owner.fireEvent('editorevent', editor, false);
985                            } else {
986                            
987                                editor.insertAtCursor(
988                                    String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
989                                    baseURL,  record.data.id, record.data.filename
990                                    )
991                                );
992                        
993                            }
994                            
995                         }
996                      },
997                      xns : Roo.form,
998                      '|xns' : 'Roo.form',
999                      store : {
1000                       xtype : 'Store',
1001                       remoteSort : true,
1002                       sortInfo : { direction : 'ASC', field: 'id' },
1003                       listeners : {
1004                        beforeload : function (_self, o){
1005                             o.params = o.params || {};
1006                         
1007                             var id = _this.form.findField('id').getValue() * 1;    
1008                             if (!id) {
1009                                 Roo.MessageBox.alert("Error", "Save email template first");
1010                                 return false;
1011                             }
1012                             o.params.onid = id;
1013                             o.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1014                             
1015                            // o.params.imgtype = 'PressRelease';
1016                             //o.params['query[imagesize]'] = '150x150';
1017                             // set more here
1018                         }
1019                       },
1020                       xns : Roo.data,
1021                       '|xns' : 'Roo.data',
1022                       proxy : {
1023                        xtype : 'HttpProxy',
1024                        method : 'GET',
1025                        url : baseURL + '/Roo/Images.php',
1026                        xns : Roo.data,
1027                        '|xns' : 'Roo.data'
1028                       },
1029                       reader : {
1030                        xtype : 'JsonReader',
1031                        fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1032                        id : 'id',
1033                        root : 'data',
1034                        totalProperty : 'total',
1035                        xns : Roo.data,
1036                        '|xns' : 'Roo.data'
1037                       }
1038                      }
1039                     },
1040                     {
1041                      xtype : 'ComboBox',
1042                      alwaysQuery : true,
1043                      displayField : 'name',
1044                      editable : false,
1045                      emptyText : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1046                      fieldLabel : _this._strings['6f16a5f8ff5d75ab84c018adacdfcbb7'] /* Field */,
1047                      forceSelection : true,
1048                      listWidth : 400,
1049                      loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1050                      minChars : 2,
1051                      pageSize : 20,
1052                      qtip : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1053                      selectOnFocus : true,
1054                      tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
1055                      triggerAction : 'all',
1056                      typeAhead : true,
1057                      valueField : 'type',
1058                      width : 100,
1059                      listeners : {
1060                       render : function (_self)
1061                        {
1062                            _this.unsubscribeselect = _self;
1063                        },
1064                       select : function (combo, record, index)
1065                        {
1066                            Roo.log(record);
1067                            (function() { 
1068                                combo.setValue('');
1069                            }).defer(100);
1070                            var editor = _this.form.findField('bodytext').editorcore;
1071                            
1072                            if(record.data.name == 'Unsubscribe'){
1073                                editor.insertAtCursor(
1074                                    String.format('<a href="{0}">{1}</a>',
1075                                        record.data.type,  record.data.name
1076                                    )
1077                                );
1078                                return;     
1079                            }
1080                            
1081                            editor.insertAtCursor(
1082                                String.format('{0}',
1083                                    record.data.type
1084                                )
1085                            );
1086                            
1087                         }
1088                      },
1089                      xns : Roo.form,
1090                      '|xns' : 'Roo.form',
1091                      store : {
1092                       xtype : 'SimpleStore',
1093                       data : [ 
1094                           [ '{person.firstname}', "First Name"],
1095                           [ '{person.lastname}' , "Last Name"],
1096                           [ '{person.name}', "Full Name"],
1097                           [ '#unsubscribe', "Unsubscribe"]
1098                       ],
1099                       fields : [  'type', 'name'],
1100                       xns : Roo.data,
1101                       '|xns' : 'Roo.data'
1102                      }
1103                     },
1104                     {
1105                      xtype : 'Separator',
1106                      xns : Roo.Toolbar,
1107                      '|xns' : 'Roo.Toolbar'
1108                     },
1109                     {
1110                      xtype : 'Button',
1111                      cls : 'x-init-enable',
1112                      text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1113                      listeners : {
1114                       click : function (_self, e)
1115                        {
1116                            this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1117                            
1118                        }
1119                      },
1120                      xns : Roo.Toolbar,
1121                      '|xns' : 'Roo.Toolbar'
1122                     }
1123                    ]
1124                   }
1125                  ]
1126                 }
1127                ]
1128               }
1129              ]
1130             },
1131             {
1132              xtype : 'Row',
1133              hideLabels : true,
1134              xns : Roo.form,
1135              '|xns' : 'Roo.form',
1136              items  : [
1137               {
1138                xtype : 'Button',
1139                text : _this._strings['e9968623956c15023d54335ea3699855'] /* Convert Html to Text */,
1140                listeners : {
1141                 click : function (_self, e)
1142                  {
1143                      var h = _this.form.findField('bodytext').getValue();
1144                      var p = _this.form.findField('plaintext');
1145                      
1146                      new Pman.Request({\r
1147                          url : baseURL + '/Core/ImportMailMessage.php',\r
1148                          method : 'POST',\r
1149                          params : {
1150                            bodytext : h,\r
1151                            _convertToPlain : true,
1152                            _check_unsubscribe : true\r
1153                          }, \r
1154                          success : function(res) {\r
1155                              if(res.success == true){
1156                                 p.setValue(res.data);
1157                              }\r
1158                          }\r
1159                      });
1160                      
1161                  }
1162                },
1163                xns : Roo,
1164                '|xns' : 'Roo'
1165               }
1166              ]
1167             },
1168             {
1169              xtype : 'Row',
1170              hideLabels : true,
1171              xns : Roo.form,
1172              '|xns' : 'Roo.form',
1173              items  : [
1174               {
1175                xtype : 'FieldSet',
1176                hideLabels : true,
1177                legend : _this._strings['e44b145bd8b49b06e0ad2ced1ad56466'] /* Plain Text */,
1178                style : 'text-align:center;',
1179                xns : Roo.form,
1180                '|xns' : 'Roo.form',
1181                items  : [
1182                 {
1183                  xtype : 'TextArea',
1184                  height : 50,
1185                  name : 'plaintext',
1186                  xns : Roo.form,
1187                  '|xns' : 'Roo.form'
1188                 }
1189                ]
1190               }
1191              ]
1192             },
1193             {
1194              xtype : 'Row',
1195              xns : Roo.form,
1196              '|xns' : 'Roo.form',
1197              items  : [
1198               {
1199                xtype : 'TextField',
1200                allowBlank : true,
1201                fieldLabel : _this._strings['b337c8a67244afb6551ee1f8f9717676'] /* Test Class <BR/> (for system reference only) */,
1202                name : 'test_class',
1203                readOnly : true,
1204                width : 300,
1205                xns : Roo.form,
1206                '|xns' : 'Roo.form'
1207               }
1208              ]
1209             },
1210             {
1211              xtype : 'Row',
1212              xns : Roo.form,
1213              '|xns' : 'Roo.form',
1214              items  : [
1215               {
1216                xtype : 'TextField',
1217                allowBlank : true,
1218                fieldLabel : _this._strings['cafbb1cfc96d63acd85e7de928e1636b'] /* To Group <BR/> (for system reference only) */,
1219                name : 'to_group_id_name',
1220                readOnly : true,
1221                width : 300,
1222                xns : Roo.form,
1223                '|xns' : 'Roo.form'
1224               }
1225              ]
1226             },
1227             {
1228              xtype : 'Hidden',
1229              name : 'id',
1230              xns : Roo.form,
1231              '|xns' : 'Roo.form'
1232             }
1233            ]
1234           }
1235          ]
1236         }
1237        ]
1238       }
1239      },
1240      {
1241       xtype : 'GridPanel',
1242       autoScroll : false,
1243       background : false,
1244       fitContainer : true,
1245       fitToframe : true,
1246       region : 'east',
1247       tableName : 'Images',
1248       title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
1249       listeners : {
1250        activate : function() {
1251             _this.ipanel = this;
1252             if (_this.igrid) {
1253                _this.igrid.ds.load({});
1254             }
1255         }
1256       },
1257       xns : Roo,
1258       '|xns' : 'Roo',
1259       grid : {
1260        xtype : 'Grid',
1261        autoExpandColumn : 'filename',
1262        loadMask : true,
1263        listeners : {
1264         render : function() 
1265          {
1266              _this.igrid = this; 
1267              //_this.dialog = Pman.Dialog.FILL_IN
1268              if (_this.ipanel.active) {
1269             //    _this.igrid.ds.load({});
1270              }
1271          }
1272        },
1273        xns : Roo.grid,
1274        '|xns' : 'Roo.grid',
1275        toolbar : {
1276         xtype : 'Toolbar',
1277         xns : Roo,
1278         '|xns' : 'Roo',
1279         items  : [
1280          {
1281           xtype : 'Button',
1282           cls : 'x-btn-text-icon',
1283           icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1284           text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1285           listeners : {
1286            click : function()
1287             {
1288                 var id = _this.form.findField('id').getValue();
1289                 
1290                 if(id*1 < 1){
1291                     Roo.MessageBox.alert('Error', 'Please save the email template first');
1292                     return;
1293                 }
1294                 
1295                 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1296                 
1297                 Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
1298                     _this.igrid.getDataSource().load({});
1299                 });
1300             }
1301           },
1302           xns : Roo.Toolbar,
1303           '|xns' : 'Roo.Toolbar'
1304          },
1305          {
1306           xtype : 'Button',
1307           cls : 'x-btn-text-icon',
1308           icon : rootURL + '/Pman/templates/images/trash.gif',
1309           text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1310           listeners : {
1311            click : function()
1312             {
1313                 var s = _this.igrid.getSelectionModel().getSelected();
1314                 if (!s || isNaN(s.id *1)) {
1315                     Roo.MessageBox.alert("Error", "Select a image"); 
1316                     return;
1317                 }
1318                 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
1319                     if (v != 'yes') {
1320                         return;
1321                     }
1322                     
1323                     new Pman.Request({
1324                         url : baseURL + '/Roo/Images.php',
1325                         method: 'POST',
1326                         params : {
1327                             _delete : s.id
1328                         },
1329                         success : function()
1330                         {
1331                             Roo.log('Got Success!!');
1332                            _this.igrid.ds.load({});
1333                         }
1334                     });
1335                 });
1336             }
1337           },
1338           xns : Roo.Toolbar,
1339           '|xns' : 'Roo.Toolbar'
1340          }
1341         ]
1342        },
1343        dataSource : {
1344         xtype : 'Store',
1345         remoteSort : true,
1346         sortInfo : { field : 'filename', direction: 'ASC' },
1347         listeners : {
1348          beforeload : function (_self, options)
1349           {
1350               options.params = options.params || {};
1351               if (typeof(_this.data) == 'undefined') {
1352                   return false;
1353               }
1354               if(_this.data.id * 1 >= 0)
1355               {
1356                   options.params.onid = _this.data.id;
1357           
1358                   options.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1359               }
1360           }
1361         },
1362         xns : Roo.data,
1363         '|xns' : 'Roo.data',
1364         proxy : {
1365          xtype : 'HttpProxy',
1366          method : 'GET',
1367          url : baseURL + '/Roo/Images.php',
1368          xns : Roo.data,
1369          '|xns' : 'Roo.data'
1370         },
1371         reader : {
1372          xtype : 'JsonReader',
1373          fields : [
1374              {
1375                  'name': 'id',
1376                  'type': 'int'
1377              },
1378              {
1379                  'name': 'filename',
1380                  'type': 'string'
1381              },
1382              {
1383                  'name': 'ontable',
1384                  'type': 'string'
1385              },
1386              {
1387                  'name': 'onid',
1388                  'type': 'int'
1389              },
1390              {
1391                  'name': 'mimetype',
1392                  'type': 'string'
1393              },
1394              {
1395                  'name': 'width',
1396                  'type': 'int'
1397              },
1398              {
1399                  'name': 'height',
1400                  'type': 'int'
1401              },
1402              {
1403                  'name': 'filesize',
1404                  'type': 'int'
1405              },
1406              {
1407                  'name': 'displayorder',
1408                  'type': 'int'
1409              },
1410              {
1411                  'name': 'language',
1412                  'type': 'string'
1413              },
1414              {
1415                  'name': 'parent_image_id',
1416                  'type': 'int'
1417              },
1418              {
1419                  'name': 'created',
1420                  'type': 'date',
1421                  'dateFormat': 'Y-m-d'
1422              },
1423              {
1424                  'name': 'imgtype',
1425                  'type': 'string'
1426              },
1427              {
1428                  'name': 'linkurl',
1429                  'type': 'string'
1430              },
1431              {
1432                  'name': 'descript',
1433                  'type': 'string'
1434              },
1435              {
1436                  'name': 'title',
1437                  'type': 'string'
1438              },
1439              {
1440                  'name': 'parent_image_id_id',
1441                  'type': 'int'
1442              },
1443              {
1444                  'name': 'parent_image_id_filename',
1445                  'type': 'string'
1446              },
1447              {
1448                  'name': 'parent_image_id_ontable',
1449                  'type': 'string'
1450              },
1451              {
1452                  'name': 'parent_image_id_onid',
1453                  'type': 'int'
1454              },
1455              {
1456                  'name': 'parent_image_id_mimetype',
1457                  'type': 'string'
1458              },
1459              {
1460                  'name': 'parent_image_id_width',
1461                  'type': 'int'
1462              },
1463              {
1464                  'name': 'parent_image_id_height',
1465                  'type': 'int'
1466              },
1467              {
1468                  'name': 'parent_image_id_filesize',
1469                  'type': 'int'
1470              },
1471              {
1472                  'name': 'parent_image_id_displayorder',
1473                  'type': 'int'
1474              },
1475              {
1476                  'name': 'parent_image_id_language',
1477                  'type': 'string'
1478              },
1479              {
1480                  'name': 'parent_image_id_parent_image_id',
1481                  'type': 'int'
1482              },
1483              {
1484                  'name': 'parent_image_id_created',
1485                  'type': 'date'
1486              },
1487              {
1488                  'name': 'parent_image_id_imgtype',
1489                  'type': 'string'
1490              },
1491              {
1492                  'name': 'parent_image_id_linkurl',
1493                  'type': 'string'
1494              },
1495              {
1496                  'name': 'parent_image_id_descript',
1497                  'type': 'string'
1498              },
1499              {
1500                  'name': 'parent_image_id_title',
1501                  'type': 'string'
1502              }
1503          ],
1504          id : 'id',
1505          root : 'data',
1506          totalProperty : 'total',
1507          xns : Roo.data,
1508          '|xns' : 'Roo.data'
1509         }
1510        },
1511        colModel : [
1512         {
1513          xtype : 'ColumnModel',
1514          dataIndex : 'filename',
1515          header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
1516          renderer : function(v,x,r)
1517          {
1518              var width = r.data.width;
1519              var height = r.data.height;
1520              
1521              if(width > 50){
1522                  height = Math.round(height * 50 / width);
1523                  width = 50;
1524              }
1525              
1526             return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';
1527          },
1528          width : 300,
1529          xns : Roo.grid,
1530          '|xns' : 'Roo.grid'
1531         },
1532         {
1533          xtype : 'ColumnModel',
1534          dataIndex : 'displayorder',
1535          header : _this._strings['2393ad754ba179442d85e415d1d5167c'] /* Displayorder */,
1536          renderer : function(v) { return String.format('{0}', v); },
1537          width : 75,
1538          xns : Roo.grid,
1539          '|xns' : 'Roo.grid'
1540         },
1541         {
1542          xtype : 'ColumnModel',
1543          dataIndex : 'title',
1544          header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1545          renderer : function(v) { return String.format('{0}', v); },
1546          width : 75,
1547          xns : Roo.grid,
1548          '|xns' : 'Roo.grid'
1549         }
1550        ]
1551       }
1552      }
1553     ]
1554    });
1555  }
1556 };