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 'bd88a20b53a47f7b5704a83a15ff5506' :"Saved Version",
36 'b20a8b77b05d53b4e695738731400c85' :"Mailout Name",
37 '1bd18d39370b7f26c1c5e18067b74c6f' :"Html File",
38 '2c466a2c159463f1d9ef5a7b57b52827' :"Select BCC Group",
39 '5da618e8e4b89c66fe86e32cdafde142' :"From",
40 '31bb2f6e9b8fb11cbb7fb63c6025223f' :"Select Template",
41 'b78a3223503896721cca1303f776159b' :"Title",
42 '278c491bdd8a53618c149c4ac790da34' :"Template",
43 '1351017ac6423911223bc19a8cb7c653' :"Filename",
44 '308f2757bfc9ce92fb00ff93fdffd279' :"Images / Attachments",
45 'c9cc8cce247e49bae79f15173ce97354' :"Save",
46 '5feb9bf3c03b32635135006cbacb9542' :"Insert Field",
47 '4c2a8fe7eaf24721cc7a9f0175115bd4' :"Message",
48 'fff0d600f8a0b5e19e88bfb821dd1157' :"Images"
51 'active_boxLabel' : '28690be026c0bb9003aa58e45e5662ca' /* Enabled - will be sent out */ ,
52 'template_fieldLabel' : '278c491bdd8a53618c149c4ac790da34' /* Template */ ,
53 'name_fieldLabel' : 'b20a8b77b05d53b4e695738731400c85' /* Mailout Name */ ,
54 'bcc_group_id_name_qtip' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
55 'bcc_group_id_name_emptyText' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
56 'template_qtip' : '31bb2f6e9b8fb11cbb7fb63c6025223f' /* Select Template */ ,
57 'template_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
58 'from_email_fieldLabel' : 'b357b524e740bc85b9790a0712d84a30' /* Email address */ ,
59 'template_emptyText' : '31bb2f6e9b8fb11cbb7fb63c6025223f' /* Select Template */ ,
60 'active_value' : 'c4ca4238a0b923820dcc509a6f75849b' /* 1 */ ,
61 'from_name_fieldLabel' : '5da618e8e4b89c66fe86e32cdafde142' /* From */ ,
62 'bcc_group_id_name_loadingText' : '1243daf593fa297e07ab03bf06d925af' /* Searching... */ ,
63 'bcc_group_id_name_fieldLabel' : '68b00d723d37122f64da8d9939f836f0' /* BCC Group */ ,
64 'subject_fieldLabel' : 'c7892ebbb139886662c6f2fc8c450710' /* Subject */ ,
65 'test_class_fieldLabel' : 'b337c8a67244afb6551ee1f8f9717676' /* Test Class <BR/> (for system reference only) */
71 show : function(data, cb)
79 this.dialog.show.apply(this.dialog, Array.prototype.slice.call(arguments).slice(2));
82 this.form.setValues(data);
83 this.form.fireEvent('actioncomplete', this.form, { type: 'setdata', data: data });
91 this.dialog = Roo.factory({
92 xtype : 'LayoutDialog',
98 title : _this._strings['396ecabf0cd1f9503e591418851ef406'] /* Edit / Create Message */,
101 show : function (_self)
104 _self.layout.getRegion('center').showPanel(0);
105 var w = Roo.lib.Dom.getViewWidth();
\r
106 var h = Roo.lib.Dom.getViewHeight();
\r this.resizeTo(w-50, h-50);
\r
108 var ew = Math.max(250, w-320);
\r
109 var eh = Math.max(250, h-350) ;
\r
110 var e = _this.dialog.layout.getRegion('east');
115 var el = _self.getEl();
116 var elw = el.dom.clientWidth;
118 var bdtext = _this.form.findField('bodytext');
119 var ptext = _this.form.findField('plaintext');
121 bdtext.width = elw-100;
122 bdtext.resizeEl.resizeTo.defer(110, bdtext.resizeEl,[ bdtext.width, bdtext.height ] );
123 ptext.setSize(bdtext.width , bdtext.height);
131 xtype : 'LayoutRegion',
137 xtype : 'LayoutRegion',
140 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
149 text : _this._strings['31fde7b05ac8952dacf4af8a704074ec'] /* Preview */,
151 click : function (_self, e)
153 //_this.dialog.hide();
154 Roo.log(_this.data.module);
155 Pman.Dialog.CoreEmailPreview.show({ id : _this.form.findField('id').getValue(), module : _this.data.module });
157 render : function (_self)
159 _this.preview_btn = _self;
167 text : _this._strings['5b8ef4e762c00a15a41cfc26dc3ef99c'] /* Send me a test copy */,
169 click : function (_self, e)
171 //_this.dialog.hide();
173 var id = _this.form.findField('id').getValue();
176 Roo.MessageBox.alert('Error', 'Please save the message frist!');
181 url : baseURL + '/Core/MessagePreview',
186 _table : _this.data.module
188 success : function(res) {
189 if(res.data == 'SUCCESS'){
190 Roo.MessageBox.alert("Email Sent", 'The report was sent to your email (HTML format).');
195 render : function (_self)
197 _this.html_preview = _self;
205 text : _this._strings['ea4788705e6873b424c65e91c2846b19'] /* Cancel */,
207 click : function (_self, e)
217 text : _this._strings['c9cc8cce247e49bae79f15173ce97354'] /* Save */,
219 click : function (_self, e)
223 _this.form.preValidate(function(res) {
227 _this.form.doAction("submit");
238 xtype : 'NestedLayoutPanel',
252 text : _this._strings['72d6d7a1885885bb55a565fd1070581a'] /* Import */,
254 '|xns' : 'Roo.Toolbar',
262 text : _this._strings['e6b391a8d2c4d45902a23a8b6585703d'] /* URL */,
264 click : function (_self, e)
266 Pman.Dialog.CoreImportUrl.show({
267 target : '/Core/ImportMailMessage.php'
271 _this.form.findField('bodytext').setValue(data);
281 text : _this._strings['1bd18d39370b7f26c1c5e18067b74c6f'] /* Html File */,
283 click : function (_self, e)
285 Pman.Dialog.Image.show({
286 _url : baseURL + '/Core/ImportMailMessage.php'
289 _this.form.findField('bodytext').setValue(data);
302 text : _this._strings['884df8e413319ff51a3f5f528606238a'] /* Use template */,
304 '|xns' : 'Roo.Toolbar',
312 text : _this._strings['dc0de523c25be298ba751c63c694109e'] /* Responsive Email (1) */,
314 click : function (_self, e)
317 var l = document.location;
320 url : baseURL + '/Core/ImportMailMessage.php',
325 importUrl : l.protocol +'//' + l.host + rootURL + '/Pman/Crm/mail_templates/responsive1.html'
327 success : function (res) {
329 _this.form.findField('bodytext').setValue(res.data);
345 displayField : 'file',
347 emptyText : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
348 fieldLabel : _this._strings['278c491bdd8a53618c149c4ac790da34'] /* Template */,
349 forceSelection : true,
350 hiddenName : 'template',
352 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
356 qtip : _this._strings['31bb2f6e9b8fb11cbb7fb63c6025223f'] /* Select Template */,
357 selectOnFocus : true,
358 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{file}</b> </div>',
359 triggerAction : 'all',
364 select : function (combo, record, index)
375 _this.form.findField('bodytext').setValue(record.data.content);
384 sortInfo : { direction : 'DESC', field: 'file' },
386 beforeload : function (_self, o){
387 o.params = o.params || {};
397 url : baseURL + '/Core/MailTemplateList.php',
402 xtype : 'JsonReader',
403 fields : [{"name":"file","type":"string"},{"name":"content","type":"string"}],
406 totalProperty : 'total',
415 '|xns' : 'Roo.Toolbar'
419 text : _this._strings['ea30b40c3caf28acb29198d20d243e54'] /* Images / Attachments >> */,
421 click : function (_self, e)
423 var el = _this.dialog.layout.getRegion('east');
434 '|xns' : 'Roo.Toolbar'
439 xtype : 'BorderLayout',
443 xtype : 'LayoutRegion',
450 xtype : 'ContentPanel',
456 title : _this._strings['4c2a8fe7eaf24721cc7a9f0175115bd4'] /* Message */,
458 render : function (_self, width, height)
461 Roo.log("RESIZE, " + width + ',' + height);
463 var ew = Math.max(250, width-50);
464 var eh = Math.max(250,height-50) ;
469 resize : function (_self, width, height)
\r
471 var ew = Math.max(250, width-50);
\r
472 var eh = Math.max(250,height-50) ;
477 var bdtext = _this.form.findField('bodytext');
\r
478 var ptext = _this.form.findField('plaintext');
\r
479 if(bdtext.resizeEl){
\r
480 bdtext.width = ew-50;
\r
481 bdtext.resizeEl.resizeTo.defer(110, bdtext.resizeEl,[ bdtext.width, bdtext.height ] );
\r
482 ptext.setSize(bdtext.width , bdtext.height);
\r
492 labelAlign : 'right',
495 preValidate : function(done_callback) {
497 Roo.MessageBox.progress("Uploading Images", "Uploading");
499 if(!_this.form.findField('bodytext').editorcore.sourceEditMode){
500 _this.form.findField('bodytext').syncValue();
502 _this.form.findField('bodytext').pushValue();
505 var html = _this.form.findField('bodytext').getValue();
507 var s = Roo.get(_this.form.findField('bodytext').editorcore.doc.documentElement);
509 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
512 s.select('img[src]').each(function(i) {
515 var total = nodes.length;
516 var mkimg = function() {
519 Roo.MessageBox.hide();
520 _this.form.findField('bodytext').syncValue();
522 // _this.form.doAction("submit");
527 var n = i.getAttribute('src').match(/(baseURL|server_baseurl)/);
534 n = i.getAttribute('src').match(/^http(.*)/);
542 url : baseURL + '/Roo/Images.php',
545 onid : _this.form.findField('id').getValue(),
547 _remote_upload : i.src
549 success : function(res){
550 if(res.success == true){
551 i.setAttribute('src', res.data);
552 Roo.MessageBox.updateProgress( (total - nodes.length) / total , "Done " + (total - nodes.length) + '/' + total);
560 if (!_this.form.findField('bodytext').getValue().match(/unsubscribe/i)) {
561 Roo.MessageBox.confirm("Missing unusubscribe",
562 "There is no unsubscribe link on the email are you sure you want to save it",
576 style : 'margin:10px',
577 url : baseURL + '/Roo/crm_mailing_list_message.php',
579 actioncomplete : function(_self,action)
582 if (action.type == 'setdata') {
584 setInterval(_this.form.findField('bodytext').autosave, 5000);
586 _this.data.module = _this.data.module || 'crm_mailing_list_message';
588 _this.form.url = baseURL + '/Roo/' + _this.data.module;
590 _this.html_preview.hide();
591 _this.preview_btn.hide();
593 if(_this.data.id*1 > 0){
594 _this.dialog.el.mask("Loading");
595 this.load({ method: 'GET', params: { '_id' : _this.data.id }});
596 _this.html_preview.show();
597 _this.preview_btn.show();
600 _this.form.setValues({
601 'from_name' : Pman.Login.authUser.name,
602 'from_email' : Pman.Login.authUser.email
607 if (action.type == 'load') {
608 _this.dialog.el.unmask();
610 _this.form.findField('bodytext').originalValue = _this.form.findField('bodytext').getValue();
614 if (action.type =='submit') {
616 _this.dialog.el.unmask();
619 if (_this.callback) {
620 _this.callback.call(_this, action.result.data);
626 rendered : function (form)
642 fieldLabel : _this._strings['b20a8b77b05d53b4e695738731400c85'] /* Mailout Name */,
656 boxLabel : _this._strings['28690be026c0bb9003aa58e45e5662ca'] /* Enabled - will be sent out */,
662 check : function (_self, checked)
664 var boxLabel = 'Enabled - will be sent out';
667 boxLabel = 'Disabled - will NOT be sent out';
670 this.setBoxLabel(boxLabel);
688 fieldLabel : _this._strings['5da618e8e4b89c66fe86e32cdafde142'] /* From */,
697 fieldLabel : _this._strings['b357b524e740bc85b9790a0712d84a30'] /* Email address */,
707 displayField : 'name',
709 emptyText : _this._strings['2c466a2c159463f1d9ef5a7b57b52827'] /* Select BCC Group */,
710 fieldLabel : _this._strings['68b00d723d37122f64da8d9939f836f0'] /* BCC Group */,
711 forceSelection : true,
712 hiddenName : 'bcc_group_id',
713 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
715 name : 'bcc_group_id_name',
717 qtip : _this._strings['2c466a2c159463f1d9ef5a7b57b52827'] /* Select BCC Group */,
718 selectOnFocus : true,
719 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
720 triggerAction : 'all',
729 sortInfo : { direction : 'ASC', field: 'name' },
731 beforeload : function (_self, o){
732 o.params = o.params || {};
734 o.params._direct_return = 1;
742 url : baseURL + '/Roo/Core_group',
747 xtype : 'JsonReader',
748 fields : [{"name":"name","type":"string"},{"name":"id","type":"int"}],
751 totalProperty : 'total',
762 fieldLabel : _this._strings['c7892ebbb139886662c6f2fc8c450710'] /* Subject */,
777 legend : _this._strings['962b90039a542a29cedd51d87a9f28a1'] /* Html Editor */,
778 style : 'text-align:center;',
783 xtype : 'HtmlEditor',
784 autosave : function() {
786 var body = _this.form.findField('bodytext');
788 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
789 Roo.log('body not dirty');
793 Roo.log('body dirty, auto save!');
795 body.fireEvent('autosave', body);
824 '-ms-interpolation-mode',
826 '-ms-text-size-adjust',
840 '-webkit-text-size-adjust',
849 autosave : function (_self)
853 var id = _this.form.findField('id').getValue() * 1;
856 if(!_self.editorcore.sourceEditMode){
864 url : baseURL + '/Roo/Events.php',
869 on_id : (id > 0) ? id : 0,
870 on_table : 'crm_mailing_list_message',
872 source: _self.getValue()
874 success : function() {
875 _self.originalValue = _self.getValue();
880 Roo.log('body autosave failed?!');
885 savedpreview : function (_self)
887 var id = _this.form.findField('id').getValue() * 1;
889 var successFn = function(res){
890 return res.data.POST.source;
896 on_id : (id < 1) ? 0 : id,
897 on_table : 'crm_mailing_list_message',
898 successFn : successFn
902 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
904 _self.originalValue = res;
912 xtype : 'ToolbarContext',
913 xns : Roo.form.HtmlEditor,
914 '|xns' : 'Roo.form.HtmlEditor'
917 xtype : 'ToolbarStandard',
918 xns : Roo.form.HtmlEditor,
919 '|xns' : 'Roo.form.HtmlEditor',
924 displayField : 'name',
926 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
927 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
928 forceSelection : true,
930 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
933 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
934 selectOnFocus : true,
935 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>',
936 triggerAction : 'all',
941 beforequery : function (combo, query, forceAll, cancel, e)
943 var id = _this.form.findField('id').getValue() * 1;
945 Roo.MessageBox.alert("Error", "Save message first");
949 render : function (_self)
951 _this.extendimgselect = _self;
953 select : function (combo, record, index)
959 var editor = _this.form.findField('bodytext').editorcore;
961 var curnode = editor.getSelectedNode();
962 if (curnode && curnode.tagName == 'IMG') {
963 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
964 baseURL, record.data.id, record.data.filename
966 // note -forces an update... hopefully...
967 editor.owner.fireEvent('editorevent', editor, false);
970 editor.insertAtCursor(
971 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
972 baseURL, record.data.id, record.data.filename
985 sortInfo : { direction : 'ASC', field: 'id' },
987 beforeload : function (_self, o){
988 o.params = o.params || {};
990 var id = _this.form.findField('id').getValue() * 1;
992 Roo.MessageBox.alert("Error", "Save email template first");
996 o.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
998 // o.params.imgtype = 'PressRelease';
999 //o.params['query[imagesize]'] = '150x150';
1004 '|xns' : 'Roo.data',
1006 xtype : 'HttpProxy',
1008 url : baseURL + '/Roo/Images.php',
1013 xtype : 'JsonReader',
1014 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1017 totalProperty : 'total',
1026 displayField : 'name',
1028 emptyText : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1029 fieldLabel : _this._strings['6f16a5f8ff5d75ab84c018adacdfcbb7'] /* Field */,
1030 forceSelection : true,
1032 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1035 qtip : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1036 selectOnFocus : true,
1037 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
1038 triggerAction : 'all',
1040 valueField : 'type',
1043 render : function (_self)
1045 _this.unsubscribeselect = _self;
1047 select : function (combo, record, index)
1053 var editor = _this.form.findField('bodytext').editorcore;
1055 if(record.data.name == 'Unsubscribe'){
1056 editor.insertAtCursor(
1057 String.format('<a href="{0}">{1}</a>',
1058 record.data.type, record.data.name
1064 editor.insertAtCursor(
1065 String.format('{0}',
1073 '|xns' : 'Roo.form',
1075 xtype : 'SimpleStore',
1077 [ '{person.firstname}', "First Name"],
1078 [ '{person.lastname}' , "Last Name"],
1079 [ '{person.name}', "Full Name"],
1080 [ '#unsubscribe', "Unsubscribe"]
1082 fields : [ 'type', 'name'],
1088 xtype : 'Separator',
1090 '|xns' : 'Roo.Toolbar'
1094 cls : 'x-init-enable',
1095 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1097 click : function (_self, e)
1099 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1104 '|xns' : 'Roo.Toolbar'
1118 '|xns' : 'Roo.form',
1122 text : _this._strings['e9968623956c15023d54335ea3699855'] /* Convert Html to Text */,
1124 click : function (_self, e)
1126 var h = _this.form.findField('bodytext').getValue();
1127 var p = _this.form.findField('plaintext');
1129 new Pman.Request({
\r
1130 url : baseURL + '/Core/ImportMailMessage.php',
\r
1134 _convertToPlain : true,
1135 _check_unsubscribe : true
\r
1137 success : function(res) {
\r
1138 if(res.success == true){
1139 p.setValue(res.data);
1155 '|xns' : 'Roo.form',
1160 legend : _this._strings['e44b145bd8b49b06e0ad2ced1ad56466'] /* Plain Text */,
1161 style : 'text-align:center;',
1163 '|xns' : 'Roo.form',
1179 '|xns' : 'Roo.form',
1182 xtype : 'TextField',
1184 fieldLabel : _this._strings['b337c8a67244afb6551ee1f8f9717676'] /* Test Class <BR/> (for system reference only) */,
1185 name : 'test_class',
1207 xtype : 'GridPanel',
1210 fitContainer : true,
1213 tableName : 'Images',
1214 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
1216 activate : function() {
1217 _this.ipanel = this;
1219 _this.igrid.ds.load({});
1227 autoExpandColumn : 'filename',
1233 //_this.dialog = Pman.Dialog.FILL_IN
1234 if (_this.ipanel.active) {
1235 // _this.igrid.ds.load({});
1240 '|xns' : 'Roo.grid',
1248 cls : 'x-btn-text-icon',
1249 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1250 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1254 var id = _this.form.findField('id').getValue();
1257 Roo.MessageBox.alert('Error', 'Please save the email template first');
1261 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1263 Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
1264 _this.igrid.getDataSource().load({});
1269 '|xns' : 'Roo.Toolbar'
1273 cls : 'x-btn-text-icon',
1274 icon : rootURL + '/Pman/templates/images/trash.gif',
1275 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1279 var s = _this.igrid.getSelectionModel().getSelected();
1280 if (!s || isNaN(s.id *1)) {
1281 Roo.MessageBox.alert("Error", "Select a image");
1284 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
1290 url : baseURL + '/Roo/Images.php',
1295 success : function()
1297 Roo.log('Got Success!!');
1298 _this.igrid.ds.load({});
1305 '|xns' : 'Roo.Toolbar'
1312 sortInfo : { field : 'filename', direction: 'ASC' },
1314 beforeload : function (_self, options)
1316 options.params = options.params || {};
1317 if (typeof(_this.data) == 'undefined') {
1320 if(_this.data.id * 1 >= 0)
1322 options.params.onid = _this.data.id;
1324 options.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1329 '|xns' : 'Roo.data',
1331 xtype : 'HttpProxy',
1333 url : baseURL + '/Roo/Images.php',
1338 xtype : 'JsonReader',
1373 'name': 'displayorder',
1381 'name': 'parent_image_id',
1387 'dateFormat': 'Y-m-d'
1406 'name': 'parent_image_id_id',
1410 'name': 'parent_image_id_filename',
1414 'name': 'parent_image_id_ontable',
1418 'name': 'parent_image_id_onid',
1422 'name': 'parent_image_id_mimetype',
1426 'name': 'parent_image_id_width',
1430 'name': 'parent_image_id_height',
1434 'name': 'parent_image_id_filesize',
1438 'name': 'parent_image_id_displayorder',
1442 'name': 'parent_image_id_language',
1446 'name': 'parent_image_id_parent_image_id',
1450 'name': 'parent_image_id_created',
1454 'name': 'parent_image_id_imgtype',
1458 'name': 'parent_image_id_linkurl',
1462 'name': 'parent_image_id_descript',
1466 'name': 'parent_image_id_title',
1472 totalProperty : 'total',
1479 xtype : 'ColumnModel',
1480 dataIndex : 'filename',
1481 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
1482 renderer : function(v,x,r)
1484 var width = r.data.width;
1485 var height = r.data.height;
1488 height = Math.round(height * 50 / width);
1492 return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';
1499 xtype : 'ColumnModel',
1500 dataIndex : 'displayorder',
1501 header : _this._strings['2393ad754ba179442d85e415d1d5167c'] /* Displayorder */,
1502 renderer : function(v) { return String.format('{0}', v); },
1508 xtype : 'ColumnModel',
1509 dataIndex : 'title',
1510 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1511 renderer : function(v) { return String.format('{0}', v); },