1 //<script type="text/javascript">
3 // Auto generated file - created by app.Builder.js- do not edit directly (at present!)
5 Roo.namespace('Pman.Dialog');
7 Pman.Dialog.CoreEmail = {
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 '4994a8ffeba4ac3140beb89e8d41f174' :"Language",
37 'bd88a20b53a47f7b5704a83a15ff5506' :"Saved Version",
38 'b20a8b77b05d53b4e695738731400c85' :"Mailout Name",
39 '1bd18d39370b7f26c1c5e18067b74c6f' :"Html File",
40 '2c466a2c159463f1d9ef5a7b57b52827' :"Select BCC Group",
41 '5da618e8e4b89c66fe86e32cdafde142' :"From",
42 '31bb2f6e9b8fb11cbb7fb63c6025223f' :"Select Template",
43 'b78a3223503896721cca1303f776159b' :"Title",
44 '278c491bdd8a53618c149c4ac790da34' :"Template",
45 '308f2757bfc9ce92fb00ff93fdffd279' :"Images / Attachments",
46 '1351017ac6423911223bc19a8cb7c653' :"Filename",
47 'c9cc8cce247e49bae79f15173ce97354' :"Save",
48 '5feb9bf3c03b32635135006cbacb9542' :"Insert Field",
49 '4c2a8fe7eaf24721cc7a9f0175115bd4' :"Message",
50 'fff0d600f8a0b5e19e88bfb821dd1157' :"Images"
53 'active_boxLabel' : '28690be026c0bb9003aa58e45e5662ca' /* Enabled - will be sent out */ ,
54 'to_group_id_name_fieldLabel' : 'cafbb1cfc96d63acd85e7de928e1636b' /* To Group <BR/> (for system reference only) */ ,
55 'template_fieldLabel' : '278c491bdd8a53618c149c4ac790da34' /* Template */ ,
56 'name_fieldLabel' : 'b20a8b77b05d53b4e695738731400c85' /* Mailout Name */ ,
57 'bcc_group_id_name_qtip' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
58 'bcc_group_id_name_emptyText' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
59 'language_name_fieldLabel' : '4994a8ffeba4ac3140beb89e8d41f174' /* Language */ ,
60 'template_qtip' : '31bb2f6e9b8fb11cbb7fb63c6025223f' /* Select Template */ ,
61 'template_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
62 'from_email_fieldLabel' : 'b357b524e740bc85b9790a0712d84a30' /* Email address */ ,
63 'template_emptyText' : '31bb2f6e9b8fb11cbb7fb63c6025223f' /* Select Template */ ,
64 'active_value' : 'c4ca4238a0b923820dcc509a6f75849b' /* 1 */ ,
65 'from_name_fieldLabel' : '5da618e8e4b89c66fe86e32cdafde142' /* From */ ,
66 'bcc_group_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
67 'bcc_group_id_name_fieldLabel' : '68b00d723d37122f64da8d9939f836f0' /* BCC Group */ ,
68 'subject_fieldLabel' : 'c7892ebbb139886662c6f2fc8c450710' /* Subject */ ,
69 'test_class_fieldLabel' : 'b337c8a67244afb6551ee1f8f9717676' /* Test Class <BR/> (for system reference only) */
75 show : function(data, cb)
83 this.dialog.show(this.data._el);
86 this.form.setValues(data);
87 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
95 this.dialog = Roo.factory({
96 xtype : 'LayoutDialog',
102 title : _this._strings['396ecabf0cd1f9503e591418851ef406'] /* Edit / Create Message */,
105 show : function (_self)
108 _self.layout.getRegion('center').showPanel(0);
109 var w = Roo.lib.Dom.getViewWidth();
\r
110 var h = Roo.lib.Dom.getViewHeight();
\r this.resizeTo(w-50, h-50);
\r
112 var ew = Math.max(250, w-320);
\r
113 var eh = Math.max(250, h-350) ;
\r
114 var e = _this.dialog.layout.getRegion('east');
119 var el = _self.getEl();
120 var elw = el.dom.clientWidth;
122 var bdtext = _this.form.findField('bodytext');
123 var ptext = _this.form.findField('plaintext');
125 bdtext.width = elw-100;
126 bdtext.resizeEl.resizeTo.defer(110, bdtext.resizeEl,[ bdtext.width, bdtext.height ] );
127 ptext.setSize(bdtext.width , bdtext.height);
135 xtype : 'LayoutRegion',
141 xtype : 'LayoutRegion',
144 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
153 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
155 click : function (_self, e)
157 //_this.dialog.hide();
158 Roo.log(_this.data.module);
159 Pman.Dialog.CoreEmailPreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });
161 render : function (_self)
163 _this.preview_btn = _self;
171 text : _this._strings['5b8ef4e762c00a15a41cfc26dc3ef99c'] /* Send me a test copy */,
173 click : function (_self, e)
175 //_this.dialog.hide();
177 var id = _this.form.findField('id').getValue();
180 Roo.MessageBox.alert('Error', 'Please save the message frist!');
185 url : baseURL + '/Core/MessagePreview',
190 _table : _this.data.module
192 success : function(res) {
193 if(res.data == 'SUCCESS'){
194 Roo.MessageBox.alert("Email Sent", 'The report was sent to your email (HTML format).');
199 render : function (_self)
201 _this.html_preview = _self;
209 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
211 click : function (_self, e)
221 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
223 click : function (_self, e)
227 _this.form.preValidate(function(res) {
231 _this.form.doAction("submit");
242 xtype : 'NestedLayoutPanel',
256 text : _this._strings['72d6d7a1885885bb55a565fd1070581a'] /* Import */,
258 '|xns' : 'Roo.Toolbar',
266 text : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
268 click : function (_self, e)
270 Pman.Dialog.CoreImportUrl.show({
271 target : '/Core/ImportMailMessage.php'
275 _this.form.findField('bodytext').setValue(data);
285 text : _this._strings['1bd18d39370b7f26c1c5e18067b74c6f'] /* Html File */,
287 click : function (_self, e)
289 Pman.Dialog.Image.show({
290 _url : baseURL + '/Core/ImportMailMessage.php'
293 _this.form.findField('bodytext').setValue(data);
306 text : _this._strings['884df8e413319ff51a3f5f528606238a'] /* Use template */,
308 '|xns' : 'Roo.Toolbar',
316 text : _this._strings['dc0de523c25be298ba751c63c694109e'] /* Responsive Email (1) */,
318 click : function (_self, e)
321 var l = document.location;
324 url : baseURL + '/Core/ImportMailMessage.php',
329 importUrl : l.protocol +'//' + l.host + rootURL + '/Pman/Crm/mail_templates/responsive1.html'
331 success : function (res) {
333 _this.form.findField('bodytext').setValue(res.data);
349 displayField : 'file',
351 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
352 fieldLabel : _this._strings['278c491bdd8a53618c149c4ac790da34'] /* Template */,
353 forceSelection : true,
354 hiddenName : 'template',
356 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
360 qtip : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
361 selectOnFocus : true,
362 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{file}</b> </div>',
363 triggerAction : 'all',
368 select : function (combo, record, index)
379 _this.form.findField('bodytext').setValue(record.data.content);
388 sortInfo : { direction : 'DESC', field: 'file' },
390 beforeload : function (_self, o){
391 o.params = o.params || {};
401 url : baseURL + '/Core/MailTemplateList.php',
406 xtype : 'JsonReader',
407 fields : [{"name":"file","type":"string"},{"name":"content","type":"string"}],
410 totalProperty : 'total',
419 '|xns' : 'Roo.Toolbar'
423 text : _this._strings['ea30b40c3caf28acb29198d20d243e54'] /* Images / Attachments >> */,
425 click : function (_self, e)
427 var el = _this.dialog.layout.getRegion('east');
438 '|xns' : 'Roo.Toolbar'
443 xtype : 'BorderLayout',
447 xtype : 'LayoutRegion',
454 xtype : 'ContentPanel',
460 title : _this._strings['4c2a8fe7eaf24721cc7a9f0175115bd4'] /* Message */,
462 render : function (_self, width, height)
465 Roo.log("RESIZE, " + width + ',' + height);
467 var ew = Math.max(250, width-50);
468 var eh = Math.max(250,height-50) ;
473 resize : function (_self, width, height)
\r
475 var ew = Math.max(250, width-50);
\r
476 var eh = Math.max(250,height-50) ;
481 var bdtext = _this.form.findField('bodytext');
\r
482 var ptext = _this.form.findField('plaintext');
\r
483 if(bdtext.resizeEl){
\r
484 bdtext.width = ew-50;
\r
485 bdtext.resizeEl.resizeTo.defer(110, bdtext.resizeEl,[ bdtext.width, bdtext.height ] );
\r
486 ptext.setSize(bdtext.width , bdtext.height);
\r
496 labelAlign : 'right',
499 preValidate : function(done_callback) {
501 Roo.MessageBox.progress("Uploading Images", "Uploading");
503 if(!_this.form.findField('bodytext').editorcore.sourceEditMode){
504 _this.form.findField('bodytext').syncValue();
506 _this.form.findField('bodytext').pushValue();
509 var html = _this.form.findField('bodytext').getValue();
511 var s = Roo.get(_this.form.findField('bodytext').editorcore.doc.documentElement);
513 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
516 s.select('img[src]').each(function(i) {
519 var total = nodes.length;
520 var mkimg = function() {
523 Roo.MessageBox.hide();
524 _this.form.findField('bodytext').syncValue();
526 // _this.form.doAction("submit");
531 var n = i.getAttribute('src').match(/(baseURL|server_baseurl)/);
538 n = i.getAttribute('src').match(/^http(.*)/);
546 url : baseURL + '/Roo/Images.php',
549 onid : _this.form.findField('id').getValue(),
551 _remote_upload : i.src
553 success : function(res){
554 if(res.success == true){
555 i.setAttribute('src', res.data);
556 Roo.MessageBox.updateProgress( (total - nodes.length) / total , "Done " + (total - nodes.length) + '/' + total);
564 if (!_this.form.findField('bodytext').getValue().match(/unsubscribe/i)) {
565 Roo.MessageBox.confirm("Missing unusubscribe",
566 "There is no unsubscribe link on the email are you sure you want to save it",
580 style : 'margin:10px',
581 url : baseURL + '/Roo/crm_mailing_list_message.php',
583 actioncomplete : function(_self,action)
586 if (action.type == 'setdata') {
588 setInterval(_this.form.findField('bodytext').autosave, 5000);
590 _this.data.module = _this.data.module || 'crm_mailing_list_message';
592 _this.form.url = baseURL + '/Roo/' + _this.data.module;
594 _this.html_preview.hide();
595 _this.preview_btn.hide();
597 if(_this.data.id*1 > 0){
598 _this.dialog.el.mask("Loading");
599 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
600 _this.html_preview.show();
601 _this.preview_btn.show();
604 _this.form.setValues({
605 'from_name' : Pman.Login.authUser.name,
606 'from_email' : Pman.Login.authUser.email
611 if (action.type == 'load') {
612 _this.dialog.el.unmask();
614 _this.form.findField('bodytext').originalValue = _this.form.findField('bodytext').getValue();
618 if (action.type =='submit') {
620 _this.dialog.el.unmask();
623 if (_this.callback) {
624 _this.callback.call(_this, action.result.data);
630 rendered : function (form)
646 fieldLabel : _this._strings['b20a8b77b05d53b4e695738731400c85'] /* Mailout Name */,
654 labelSeparator : ' ',
661 boxLabel : _this._strings['28690be026c0bb9003aa58e45e5662ca'] /* Enabled - will be sent out */,
667 check : function (_self, checked)
669 var boxLabel = 'Enabled - will be sent out';
672 boxLabel = 'Disabled - will NOT be sent out';
675 this.setBoxLabel(boxLabel);
693 fieldLabel : _this._strings['5da618e8e4b89c66fe86e32cdafde142'] /* From */,
702 fieldLabel : _this._strings['b357b524e740bc85b9790a0712d84a30'] /* Email address */,
712 displayField : 'name',
714 emptyText : _this._strings['2c466a2c159463f1d9ef5a7b57b52827'] /* Select BCC Group */,
715 fieldLabel : _this._strings['68b00d723d37122f64da8d9939f836f0'] /* BCC Group */,
716 forceSelection : true,
717 hiddenName : 'bcc_group_id',
718 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
720 name : 'bcc_group_id_name',
722 qtip : _this._strings['2c466a2c159463f1d9ef5a7b57b52827'] /* Select BCC Group */,
723 selectOnFocus : true,
724 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
725 triggerAction : 'all',
734 sortInfo : { direction : 'ASC', field: 'name' },
736 beforeload : function (_self, o){
737 o.params = o.params || {};
739 o.params._direct_return = 1;
747 url : baseURL + '/Roo/Core_group',
752 xtype : 'JsonReader',
753 fields : [{"name":"name","type":"string"},{"name":"id","type":"int"}],
756 totalProperty : 'total',
772 fieldLabel : _this._strings['c7892ebbb139886662c6f2fc8c450710'] /* Subject */,
781 displayField : 'title',
783 fieldLabel : _this._strings['4994a8ffeba4ac3140beb89e8d41f174'] /* Language */,
784 hiddenName : 'language',
787 name : 'language_name',
788 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> </div>',
789 triggerAction : 'all',
795 xtype : 'SimpleStore',
796 data : (function() {return typeof(Pman) == 'object' ? Pman.I18n.simpleStoreData('l') : []})(),
797 fields : ['code', 'title'],
813 legend : _this._strings['962b90039a542a29cedd51d87a9f28a1'] /* Html Editor */,
814 style : 'text-align:center;',
819 xtype : 'HtmlEditor',
820 allowComments : true,
822 autosave : function() {
824 var body = _this.form.findField('bodytext');
826 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
827 Roo.log('body not dirty');
831 Roo.log('body dirty, auto save!');
833 body.fireEvent('autosave', body);
874 '-ms-interpolation-mode',
876 '-ms-text-size-adjust',
890 '-webkit-text-size-adjust',
895 enableBlocks : false,
900 autosave : function (_self)
904 var id = _this.form.findField('id').getValue() * 1;
907 if(!_self.editorcore.sourceEditMode){
915 url : baseURL + '/Roo/Events.php',
920 on_id : (id > 0) ? id : 0,
921 on_table : 'crm_mailing_list_message',
923 source: _self.getValue()
925 success : function() {
926 _self.originalValue = _self.getValue();
931 Roo.log('body autosave failed?!');
936 savedpreview : function (_self)
938 var id = _this.form.findField('id').getValue() * 1;
940 var successFn = function(res){
941 return res.data.POST.source;
947 on_id : (id < 1) ? 0 : id,
948 on_table : 'crm_mailing_list_message',
949 successFn : successFn
953 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
955 _self.originalValue = res;
963 xtype : 'ToolbarContext',
964 xns : Roo.form.HtmlEditor,
965 '|xns' : 'Roo.form.HtmlEditor'
968 xtype : 'ToolbarStandard',
969 xns : Roo.form.HtmlEditor,
970 '|xns' : 'Roo.form.HtmlEditor',
975 displayField : 'name',
977 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
978 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
979 forceSelection : true,
981 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
984 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
985 selectOnFocus : true,
986 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>',
987 triggerAction : 'all',
992 beforequery : function (combo, query, forceAll, cancel, e)
994 var id = _this.form.findField('id').getValue() * 1;
996 Roo.MessageBox.alert("Error", "Save message first");
1000 render : function (_self)
1002 _this.extendimgselect = _self;
1004 select : function (combo, record, index)
1010 var editor = _this.form.findField('bodytext').editorcore;
1012 var curnode = editor.getSelectedNode();
1013 if (curnode && curnode.tagName == 'IMG') {
1014 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
1015 baseURL, record.data.id, record.data.filename
1017 // note -forces an update... hopefully...
1018 editor.owner.fireEvent('editorevent', editor, false);
1021 editor.insertAtCursor(
1022 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
1023 baseURL, record.data.id, record.data.filename
1032 '|xns' : 'Roo.form',
1036 sortInfo : { direction : 'ASC', field: 'id' },
1038 beforeload : function (_self, o){
1039 o.params = o.params || {};
1041 var id = _this.form.findField('id').getValue() * 1;
1043 Roo.MessageBox.alert("Error", "Save email template first");
1047 o.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1049 // o.params.imgtype = 'PressRelease';
1050 //o.params['query[imagesize]'] = '150x150';
1055 '|xns' : 'Roo.data',
1057 xtype : 'HttpProxy',
1059 url : baseURL + '/Roo/Images.php',
1064 xtype : 'JsonReader',
1065 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1068 totalProperty : 'total',
1077 displayField : 'name',
1079 emptyText : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1080 fieldLabel : _this._strings['6f16a5f8ff5d75ab84c018adacdfcbb7'] /* Field */,
1081 forceSelection : true,
1083 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1086 qtip : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1087 selectOnFocus : true,
1088 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
1089 triggerAction : 'all',
1091 valueField : 'type',
1094 render : function (_self)
1096 _this.unsubscribeselect = _self;
1098 select : function (combo, record, index)
1104 var editor = _this.form.findField('bodytext').editorcore;
1106 if(record.data.name == 'Unsubscribe'){
1107 editor.insertAtCursor(
1108 String.format('<a href="{0}">{1}</a>',
1109 record.data.type, record.data.name
1115 editor.insertAtCursor(
1116 String.format('{0}',
1124 '|xns' : 'Roo.form',
1126 xtype : 'SimpleStore',
1128 [ '{person.firstname}', "First Name"],
1129 [ '{person.lastname}' , "Last Name"],
1130 [ '{person.name}', "Full Name"],
1131 [ '#unsubscribe', "Unsubscribe"]
1133 fields : [ 'type', 'name'],
1139 xtype : 'Separator',
1141 '|xns' : 'Roo.Toolbar'
1145 cls : 'x-init-enable',
1146 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1148 click : function (_self, e)
1150 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1155 '|xns' : 'Roo.Toolbar'
1169 '|xns' : 'Roo.form',
1173 text : _this._strings['e9968623956c15023d54335ea3699855'] /* Convert Html to Text */,
1175 click : function (_self, e)
1177 var h = _this.form.findField('bodytext').getValue();
1178 var p = _this.form.findField('plaintext');
1180 new Pman.Request({
\r
1181 url : baseURL + '/Core/ImportMailMessage.php',
\r
1185 _convertToPlain : true,
1186 _check_unsubscribe : true
\r
1188 success : function(res) {
\r
1189 if(res.success == true){
1190 p.setValue(res.data);
1206 '|xns' : 'Roo.form',
1211 legend : _this._strings['e44b145bd8b49b06e0ad2ced1ad56466'] /* Plain Text */,
1212 style : 'text-align:center;',
1214 '|xns' : 'Roo.form',
1230 '|xns' : 'Roo.form',
1233 xtype : 'TextField',
1235 fieldLabel : _this._strings['b337c8a67244afb6551ee1f8f9717676'] /* Test Class <BR/> (for system reference only) */,
1236 name : 'test_class',
1247 '|xns' : 'Roo.form',
1250 xtype : 'TextField',
1252 fieldLabel : _this._strings['cafbb1cfc96d63acd85e7de928e1636b'] /* To Group <BR/> (for system reference only) */,
1253 name : 'to_group_id_name',
1275 xtype : 'GridPanel',
1278 fitContainer : true,
1281 tableName : 'Images',
1282 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
1284 activate : function() {
1285 _this.ipanel = this;
1287 _this.igrid.ds.load({});
1295 autoExpandColumn : 'filename',
1301 //_this.dialog = Pman.Dialog.FILL_IN
1302 if (_this.ipanel.active) {
1303 // _this.igrid.ds.load({});
1308 '|xns' : 'Roo.grid',
1316 cls : 'x-btn-text-icon',
1317 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1318 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1322 var id = _this.form.findField('id').getValue();
1325 Roo.MessageBox.alert('Error', 'Please save the email template first');
1329 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1331 Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
1332 _this.igrid.getDataSource().load({});
1337 '|xns' : 'Roo.Toolbar'
1341 cls : 'x-btn-text-icon',
1342 icon : rootURL + '/Pman/templates/images/trash.gif',
1343 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1347 var s = _this.igrid.getSelectionModel().getSelected();
1348 if (!s || isNaN(s.id *1)) {
1349 Roo.MessageBox.alert("Error", "Select a image");
1352 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
1358 url : baseURL + '/Roo/Images.php',
1363 success : function()
1365 Roo.log('Got Success!!');
1366 _this.igrid.ds.load({});
1373 '|xns' : 'Roo.Toolbar'
1380 sortInfo : { field : 'filename', direction: 'ASC' },
1382 beforeload : function (_self, options)
1384 options.params = options.params || {};
1385 if (typeof(_this.data) == 'undefined') {
1388 if(_this.data.id * 1 >= 0)
1390 options.params.onid = _this.data.id;
1392 options.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1397 '|xns' : 'Roo.data',
1399 xtype : 'HttpProxy',
1401 url : baseURL + '/Roo/Images.php',
1406 xtype : 'JsonReader',
1441 'name': 'displayorder',
1449 'name': 'parent_image_id',
1455 'dateFormat': 'Y-m-d'
1474 'name': 'parent_image_id_id',
1478 'name': 'parent_image_id_filename',
1482 'name': 'parent_image_id_ontable',
1486 'name': 'parent_image_id_onid',
1490 'name': 'parent_image_id_mimetype',
1494 'name': 'parent_image_id_width',
1498 'name': 'parent_image_id_height',
1502 'name': 'parent_image_id_filesize',
1506 'name': 'parent_image_id_displayorder',
1510 'name': 'parent_image_id_language',
1514 'name': 'parent_image_id_parent_image_id',
1518 'name': 'parent_image_id_created',
1522 'name': 'parent_image_id_imgtype',
1526 'name': 'parent_image_id_linkurl',
1530 'name': 'parent_image_id_descript',
1534 'name': 'parent_image_id_title',
1540 totalProperty : 'total',
1547 xtype : 'ColumnModel',
1548 dataIndex : 'filename',
1549 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
1550 renderer : function(v,x,r)
1552 var width = r.data.width;
1553 var height = r.data.height;
1556 height = Math.round(height * 50 / width);
1560 return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';
1567 xtype : 'ColumnModel',
1568 dataIndex : 'displayorder',
1569 header : _this._strings['2393ad754ba179442d85e415d1d5167c'] /* Displayorder */,
1570 renderer : function(v) { return String.format('{0}', v); },
1576 xtype : 'ColumnModel',
1577 dataIndex : 'title',
1578 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1579 renderer : function(v) { return String.format('{0}', v); },