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 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
33 '68b00d723d37122f64da8d9939f836f0' :"BCC Group",
34 'c4ca4238a0b923820dcc509a6f75849b' :"1",
35 '4994a8ffeba4ac3140beb89e8d41f174' :"Language",
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"
52 'active_boxLabel' : '28690be026c0bb9003aa58e45e5662ca' /* Enabled - will be sent out */ ,
53 'template_fieldLabel' : '278c491bdd8a53618c149c4ac790da34' /* Template */ ,
54 'name_fieldLabel' : 'b20a8b77b05d53b4e695738731400c85' /* Mailout Name */ ,
55 'bcc_group_id_name_qtip' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
56 'bcc_group_id_name_emptyText' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
57 'language_name_fieldLabel' : '4994a8ffeba4ac3140beb89e8d41f174' /* Language */ ,
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) */
73 show : function(data, cb)
81 this.dialog.show(this.data._el);
84 this.form.setValues(data);
85 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
93 this.dialog = Roo.factory({
94 xtype : 'LayoutDialog',
100 title : _this._strings['396ecabf0cd1f9503e591418851ef406'] /* Edit / Create Message */,
103 show : function (_self)
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
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');
117 var el = _self.getEl();
118 var elw = el.dom.clientWidth;
120 var bdtext = _this.form.findField('bodytext');
121 var ptext = _this.form.findField('plaintext');
123 bdtext.width = elw-100;
124 bdtext.resizeEl.resizeTo.defer(110, bdtext.resizeEl,[ bdtext.width, bdtext.height ] );
125 ptext.setSize(bdtext.width , bdtext.height);
133 xtype : 'LayoutRegion',
139 xtype : 'LayoutRegion',
142 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
151 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
153 click : function (_self, e)
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 });
159 render : function (_self)
161 _this.preview_btn = _self;
169 text : _this._strings['5b8ef4e762c00a15a41cfc26dc3ef99c'] /* Send me a test copy */,
171 click : function (_self, e)
173 //_this.dialog.hide();
175 var id = _this.form.findField('id').getValue();
178 Roo.MessageBox.alert('Error', 'Please save the message frist!');
183 url : baseURL + '/Core/MessagePreview',
188 _table : _this.data.module
190 success : function(res) {
191 if(res.data == 'SUCCESS'){
192 Roo.MessageBox.alert("Email Sent", 'The report was sent to your email (HTML format).');
197 render : function (_self)
199 _this.html_preview = _self;
207 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
209 click : function (_self, e)
219 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
221 click : function (_self, e)
225 _this.form.preValidate(function(res) {
229 _this.form.doAction("submit");
240 xtype : 'NestedLayoutPanel',
254 text : _this._strings['72d6d7a1885885bb55a565fd1070581a'] /* Import */,
256 '|xns' : 'Roo.Toolbar',
264 text : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
266 click : function (_self, e)
268 Pman.Dialog.CoreImportUrl.show({
269 target : '/Core/ImportMailMessage.php'
273 _this.form.findField('bodytext').setValue(data);
283 text : _this._strings['1bd18d39370b7f26c1c5e18067b74c6f'] /* Html File */,
285 click : function (_self, e)
287 Pman.Dialog.Image.show({
288 _url : baseURL + '/Core/ImportMailMessage.php'
291 _this.form.findField('bodytext').setValue(data);
304 text : _this._strings['884df8e413319ff51a3f5f528606238a'] /* Use template */,
306 '|xns' : 'Roo.Toolbar',
314 text : _this._strings['dc0de523c25be298ba751c63c694109e'] /* Responsive Email (1) */,
316 click : function (_self, e)
319 var l = document.location;
322 url : baseURL + '/Core/ImportMailMessage.php',
327 importUrl : l.protocol +'//' + l.host + rootURL + '/Pman/Crm/mail_templates/responsive1.html'
329 success : function (res) {
331 _this.form.findField('bodytext').setValue(res.data);
347 displayField : 'file',
349 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
350 fieldLabel : _this._strings['278c491bdd8a53618c149c4ac790da34'] /* Template */,
351 forceSelection : true,
352 hiddenName : 'template',
354 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
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',
366 select : function (combo, record, index)
377 _this.form.findField('bodytext').setValue(record.data.content);
386 sortInfo : { direction : 'DESC', field: 'file' },
388 beforeload : function (_self, o){
389 o.params = o.params || {};
399 url : baseURL + '/Core/MailTemplateList.php',
404 xtype : 'JsonReader',
405 fields : [{"name":"file","type":"string"},{"name":"content","type":"string"}],
408 totalProperty : 'total',
417 '|xns' : 'Roo.Toolbar'
421 text : _this._strings['ea30b40c3caf28acb29198d20d243e54'] /* Images / Attachments >> */,
423 click : function (_self, e)
425 var el = _this.dialog.layout.getRegion('east');
436 '|xns' : 'Roo.Toolbar'
441 xtype : 'BorderLayout',
445 xtype : 'LayoutRegion',
452 xtype : 'ContentPanel',
458 title : _this._strings['4c2a8fe7eaf24721cc7a9f0175115bd4'] /* Message */,
460 render : function (_self, width, height)
463 Roo.log("RESIZE, " + width + ',' + height);
465 var ew = Math.max(250, width-50);
466 var eh = Math.max(250,height-50) ;
471 resize : function (_self, width, height)
\r
473 var ew = Math.max(250, width-50);
\r
474 var eh = Math.max(250,height-50) ;
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
494 labelAlign : 'right',
497 preValidate : function(done_callback) {
499 Roo.MessageBox.progress("Uploading Images", "Uploading");
501 if(!_this.form.findField('bodytext').editorcore.sourceEditMode){
502 _this.form.findField('bodytext').syncValue();
504 _this.form.findField('bodytext').pushValue();
507 var html = _this.form.findField('bodytext').getValue();
509 var s = Roo.get(_this.form.findField('bodytext').editorcore.doc.documentElement);
511 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
514 s.select('img[src]').each(function(i) {
517 var total = nodes.length;
518 var mkimg = function() {
521 Roo.MessageBox.hide();
522 _this.form.findField('bodytext').syncValue();
524 // _this.form.doAction("submit");
529 var n = i.getAttribute('src').match(/(baseURL|server_baseurl)/);
536 n = i.getAttribute('src').match(/^http(.*)/);
544 url : baseURL + '/Roo/Images.php',
547 onid : _this.form.findField('id').getValue(),
549 _remote_upload : i.src
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);
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",
578 style : 'margin:10px',
579 url : baseURL + '/Roo/crm_mailing_list_message.php',
581 actioncomplete : function(_self,action)
584 if (action.type == 'setdata') {
586 setInterval(_this.form.findField('bodytext').autosave, 5000);
588 _this.data.module = _this.data.module || 'crm_mailing_list_message';
590 _this.form.url = baseURL + '/Roo/' + _this.data.module;
592 _this.html_preview.hide();
593 _this.preview_btn.hide();
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();
602 _this.form.setValues({
603 'from_name' : Pman.Login.authUser.name,
604 'from_email' : Pman.Login.authUser.email
609 if (action.type == 'load') {
610 _this.dialog.el.unmask();
612 _this.form.findField('bodytext').originalValue = _this.form.findField('bodytext').getValue();
616 if (action.type =='submit') {
618 _this.dialog.el.unmask();
621 if (_this.callback) {
622 _this.callback.call(_this, action.result.data);
628 rendered : function (form)
644 fieldLabel : _this._strings['b20a8b77b05d53b4e695738731400c85'] /* Mailout Name */,
658 boxLabel : _this._strings['28690be026c0bb9003aa58e45e5662ca'] /* Enabled - will be sent out */,
664 check : function (_self, checked)
666 var boxLabel = 'Enabled - will be sent out';
669 boxLabel = 'Disabled - will NOT be sent out';
672 this.setBoxLabel(boxLabel);
690 fieldLabel : _this._strings['5da618e8e4b89c66fe86e32cdafde142'] /* From */,
699 fieldLabel : _this._strings['b357b524e740bc85b9790a0712d84a30'] /* Email address */,
709 displayField : 'name',
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... */,
717 name : 'bcc_group_id_name',
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',
731 sortInfo : { direction : 'ASC', field: 'name' },
733 beforeload : function (_self, o){
734 o.params = o.params || {};
736 o.params._direct_return = 1;
744 url : baseURL + '/Roo/Core_group',
749 xtype : 'JsonReader',
750 fields : [{"name":"name","type":"string"},{"name":"id","type":"int"}],
753 totalProperty : 'total',
764 fieldLabel : _this._strings['c7892ebbb139886662c6f2fc8c450710'] /* Subject */,
773 displayField : 'title',
775 fieldLabel : _this._strings['4994a8ffeba4ac3140beb89e8d41f174'] /* Language */,
776 hiddenName : 'language',
779 name : 'language_name',
780 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{title}</b> </div>',
781 triggerAction : 'all',
787 xtype : 'SimpleStore',
788 data : (function() {return typeof(Pman) == 'object' ? Pman.I18n.simpleStoreData('l') : []})(),
789 fields : ['code', 'title'],
803 legend : _this._strings['962b90039a542a29cedd51d87a9f28a1'] /* Html Editor */,
804 style : 'text-align:center;',
809 xtype : 'HtmlEditor',
810 allowComments : true,
812 autosave : function() {
814 var body = _this.form.findField('bodytext');
816 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
817 Roo.log('body not dirty');
821 Roo.log('body dirty, auto save!');
823 body.fireEvent('autosave', body);
864 '-ms-interpolation-mode',
866 '-ms-text-size-adjust',
880 '-webkit-text-size-adjust',
885 enableBlocks : false,
890 autosave : function (_self)
894 var id = _this.form.findField('id').getValue() * 1;
897 if(!_self.editorcore.sourceEditMode){
905 url : baseURL + '/Roo/Events.php',
910 on_id : (id > 0) ? id : 0,
911 on_table : 'crm_mailing_list_message',
913 source: _self.getValue()
915 success : function() {
916 _self.originalValue = _self.getValue();
921 Roo.log('body autosave failed?!');
926 savedpreview : function (_self)
928 var id = _this.form.findField('id').getValue() * 1;
930 var successFn = function(res){
931 return res.data.POST.source;
937 on_id : (id < 1) ? 0 : id,
938 on_table : 'crm_mailing_list_message',
939 successFn : successFn
943 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
945 _self.originalValue = res;
953 xtype : 'ToolbarContext',
954 xns : Roo.form.HtmlEditor,
955 '|xns' : 'Roo.form.HtmlEditor'
958 xtype : 'ToolbarStandard',
959 xns : Roo.form.HtmlEditor,
960 '|xns' : 'Roo.form.HtmlEditor',
965 displayField : 'name',
967 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
968 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
969 forceSelection : true,
971 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
974 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
975 selectOnFocus : true,
976 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>',
977 triggerAction : 'all',
982 beforequery : function (combo, query, forceAll, cancel, e)
984 var id = _this.form.findField('id').getValue() * 1;
986 Roo.MessageBox.alert("Error", "Save message first");
990 render : function (_self)
992 _this.extendimgselect = _self;
994 select : function (combo, record, index)
1000 var editor = _this.form.findField('bodytext').editorcore;
1002 var curnode = editor.getSelectedNode();
1003 if (curnode && curnode.tagName == 'IMG') {
1004 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
1005 baseURL, record.data.id, record.data.filename
1007 // note -forces an update... hopefully...
1008 editor.owner.fireEvent('editorevent', editor, false);
1011 editor.insertAtCursor(
1012 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
1013 baseURL, record.data.id, record.data.filename
1022 '|xns' : 'Roo.form',
1026 sortInfo : { direction : 'ASC', field: 'id' },
1028 beforeload : function (_self, o){
1029 o.params = o.params || {};
1031 var id = _this.form.findField('id').getValue() * 1;
1033 Roo.MessageBox.alert("Error", "Save email template first");
1037 o.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1039 // o.params.imgtype = 'PressRelease';
1040 //o.params['query[imagesize]'] = '150x150';
1045 '|xns' : 'Roo.data',
1047 xtype : 'HttpProxy',
1049 url : baseURL + '/Roo/Images.php',
1054 xtype : 'JsonReader',
1055 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1058 totalProperty : 'total',
1067 displayField : 'name',
1069 emptyText : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1070 fieldLabel : _this._strings['6f16a5f8ff5d75ab84c018adacdfcbb7'] /* Field */,
1071 forceSelection : true,
1073 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1076 qtip : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1077 selectOnFocus : true,
1078 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
1079 triggerAction : 'all',
1081 valueField : 'type',
1084 render : function (_self)
1086 _this.unsubscribeselect = _self;
1088 select : function (combo, record, index)
1094 var editor = _this.form.findField('bodytext').editorcore;
1096 if(record.data.name == 'Unsubscribe'){
1097 editor.insertAtCursor(
1098 String.format('<a href="{0}">{1}</a>',
1099 record.data.type, record.data.name
1105 editor.insertAtCursor(
1106 String.format('{0}',
1114 '|xns' : 'Roo.form',
1116 xtype : 'SimpleStore',
1118 [ '{person.firstname}', "First Name"],
1119 [ '{person.lastname}' , "Last Name"],
1120 [ '{person.name}', "Full Name"],
1121 [ '#unsubscribe', "Unsubscribe"]
1123 fields : [ 'type', 'name'],
1129 xtype : 'Separator',
1131 '|xns' : 'Roo.Toolbar'
1135 cls : 'x-init-enable',
1136 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1138 click : function (_self, e)
1140 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1145 '|xns' : 'Roo.Toolbar'
1159 '|xns' : 'Roo.form',
1163 text : _this._strings['e9968623956c15023d54335ea3699855'] /* Convert Html to Text */,
1165 click : function (_self, e)
1167 var h = _this.form.findField('bodytext').getValue();
1168 var p = _this.form.findField('plaintext');
1170 new Pman.Request({
\r
1171 url : baseURL + '/Core/ImportMailMessage.php',
\r
1175 _convertToPlain : true,
1176 _check_unsubscribe : true
\r
1178 success : function(res) {
\r
1179 if(res.success == true){
1180 p.setValue(res.data);
1196 '|xns' : 'Roo.form',
1201 legend : _this._strings['e44b145bd8b49b06e0ad2ced1ad56466'] /* Plain Text */,
1202 style : 'text-align:center;',
1204 '|xns' : 'Roo.form',
1220 '|xns' : 'Roo.form',
1223 xtype : 'TextField',
1225 fieldLabel : _this._strings['b337c8a67244afb6551ee1f8f9717676'] /* Test Class <BR/> (for system reference only) */,
1226 name : 'test_class',
1248 xtype : 'GridPanel',
1251 fitContainer : true,
1254 tableName : 'Images',
1255 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
1257 activate : function() {
1258 _this.ipanel = this;
1260 _this.igrid.ds.load({});
1268 autoExpandColumn : 'filename',
1274 //_this.dialog = Pman.Dialog.FILL_IN
1275 if (_this.ipanel.active) {
1276 // _this.igrid.ds.load({});
1281 '|xns' : 'Roo.grid',
1289 cls : 'x-btn-text-icon',
1290 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1291 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1295 var id = _this.form.findField('id').getValue();
1298 Roo.MessageBox.alert('Error', 'Please save the email template first');
1302 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1304 Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
1305 _this.igrid.getDataSource().load({});
1310 '|xns' : 'Roo.Toolbar'
1314 cls : 'x-btn-text-icon',
1315 icon : rootURL + '/Pman/templates/images/trash.gif',
1316 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1320 var s = _this.igrid.getSelectionModel().getSelected();
1321 if (!s || isNaN(s.id *1)) {
1322 Roo.MessageBox.alert("Error", "Select a image");
1325 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
1331 url : baseURL + '/Roo/Images.php',
1336 success : function()
1338 Roo.log('Got Success!!');
1339 _this.igrid.ds.load({});
1346 '|xns' : 'Roo.Toolbar'
1353 sortInfo : { field : 'filename', direction: 'ASC' },
1355 beforeload : function (_self, options)
1357 options.params = options.params || {};
1358 if (typeof(_this.data) == 'undefined') {
1361 if(_this.data.id * 1 >= 0)
1363 options.params.onid = _this.data.id;
1365 options.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1370 '|xns' : 'Roo.data',
1372 xtype : 'HttpProxy',
1374 url : baseURL + '/Roo/Images.php',
1379 xtype : 'JsonReader',
1414 'name': 'displayorder',
1422 'name': 'parent_image_id',
1428 'dateFormat': 'Y-m-d'
1447 'name': 'parent_image_id_id',
1451 'name': 'parent_image_id_filename',
1455 'name': 'parent_image_id_ontable',
1459 'name': 'parent_image_id_onid',
1463 'name': 'parent_image_id_mimetype',
1467 'name': 'parent_image_id_width',
1471 'name': 'parent_image_id_height',
1475 'name': 'parent_image_id_filesize',
1479 'name': 'parent_image_id_displayorder',
1483 'name': 'parent_image_id_language',
1487 'name': 'parent_image_id_parent_image_id',
1491 'name': 'parent_image_id_created',
1495 'name': 'parent_image_id_imgtype',
1499 'name': 'parent_image_id_linkurl',
1503 'name': 'parent_image_id_descript',
1507 'name': 'parent_image_id_title',
1513 totalProperty : 'total',
1520 xtype : 'ColumnModel',
1521 dataIndex : 'filename',
1522 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
1523 renderer : function(v,x,r)
1525 var width = r.data.width;
1526 var height = r.data.height;
1529 height = Math.round(height * 50 / width);
1533 return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';
1540 xtype : 'ColumnModel',
1541 dataIndex : 'displayorder',
1542 header : _this._strings['2393ad754ba179442d85e415d1d5167c'] /* Displayorder */,
1543 renderer : function(v) { return String.format('{0}', v); },
1549 xtype : 'ColumnModel',
1550 dataIndex : 'title',
1551 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1552 renderer : function(v) { return String.format('{0}', v); },