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(this.data._el);
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 allowComments : true,
786 autosave : function() {
788 var body = _this.form.findField('bodytext');
790 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
791 Roo.log('body not dirty');
795 Roo.log('body dirty, auto save!');
797 body.fireEvent('autosave', body);
838 '-ms-interpolation-mode',
840 '-ms-text-size-adjust',
854 '-webkit-text-size-adjust',
859 enableBlocks : false,
864 autosave : function (_self)
868 var id = _this.form.findField('id').getValue() * 1;
871 if(!_self.editorcore.sourceEditMode){
879 url : baseURL + '/Roo/Events.php',
884 on_id : (id > 0) ? id : 0,
885 on_table : 'crm_mailing_list_message',
887 source: _self.getValue()
889 success : function() {
890 _self.originalValue = _self.getValue();
895 Roo.log('body autosave failed?!');
900 savedpreview : function (_self)
902 var id = _this.form.findField('id').getValue() * 1;
904 var successFn = function(res){
905 return res.data.POST.source;
911 on_id : (id < 1) ? 0 : id,
912 on_table : 'crm_mailing_list_message',
913 successFn : successFn
917 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
919 _self.originalValue = res;
927 xtype : 'ToolbarContext',
928 xns : Roo.form.HtmlEditor,
929 '|xns' : 'Roo.form.HtmlEditor'
932 xtype : 'ToolbarStandard',
933 xns : Roo.form.HtmlEditor,
934 '|xns' : 'Roo.form.HtmlEditor',
939 displayField : 'name',
941 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
942 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
943 forceSelection : true,
945 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
948 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
949 selectOnFocus : true,
950 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>',
951 triggerAction : 'all',
956 beforequery : function (combo, query, forceAll, cancel, e)
958 var id = _this.form.findField('id').getValue() * 1;
960 Roo.MessageBox.alert("Error", "Save message first");
964 render : function (_self)
966 _this.extendimgselect = _self;
968 select : function (combo, record, index)
974 var editor = _this.form.findField('bodytext').editorcore;
976 var curnode = editor.getSelectedNode();
977 if (curnode && curnode.tagName == 'IMG') {
978 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
979 baseURL, record.data.id, record.data.filename
981 // note -forces an update... hopefully...
982 editor.owner.fireEvent('editorevent', editor, false);
985 editor.insertAtCursor(
986 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
987 baseURL, record.data.id, record.data.filename
1000 sortInfo : { direction : 'ASC', field: 'id' },
1002 beforeload : function (_self, o){
1003 o.params = o.params || {};
1005 var id = _this.form.findField('id').getValue() * 1;
1007 Roo.MessageBox.alert("Error", "Save email template first");
1011 o.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1013 // o.params.imgtype = 'PressRelease';
1014 //o.params['query[imagesize]'] = '150x150';
1019 '|xns' : 'Roo.data',
1021 xtype : 'HttpProxy',
1023 url : baseURL + '/Roo/Images.php',
1028 xtype : 'JsonReader',
1029 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1032 totalProperty : 'total',
1041 displayField : 'name',
1043 emptyText : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1044 fieldLabel : _this._strings['6f16a5f8ff5d75ab84c018adacdfcbb7'] /* Field */,
1045 forceSelection : true,
1047 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1050 qtip : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1051 selectOnFocus : true,
1052 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
1053 triggerAction : 'all',
1055 valueField : 'type',
1058 render : function (_self)
1060 _this.unsubscribeselect = _self;
1062 select : function (combo, record, index)
1068 var editor = _this.form.findField('bodytext').editorcore;
1070 if(record.data.name == 'Unsubscribe'){
1071 editor.insertAtCursor(
1072 String.format('<a href="{0}">{1}</a>',
1073 record.data.type, record.data.name
1079 editor.insertAtCursor(
1080 String.format('{0}',
1088 '|xns' : 'Roo.form',
1090 xtype : 'SimpleStore',
1092 [ '{person.firstname}', "First Name"],
1093 [ '{person.lastname}' , "Last Name"],
1094 [ '{person.name}', "Full Name"],
1095 [ '#unsubscribe', "Unsubscribe"]
1097 fields : [ 'type', 'name'],
1103 xtype : 'Separator',
1105 '|xns' : 'Roo.Toolbar'
1109 cls : 'x-init-enable',
1110 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1112 click : function (_self, e)
1114 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1119 '|xns' : 'Roo.Toolbar'
1133 '|xns' : 'Roo.form',
1137 text : _this._strings['e9968623956c15023d54335ea3699855'] /* Convert Html to Text */,
1139 click : function (_self, e)
1141 var h = _this.form.findField('bodytext').getValue();
1142 var p = _this.form.findField('plaintext');
1144 new Pman.Request({
\r
1145 url : baseURL + '/Core/ImportMailMessage.php',
\r
1149 _convertToPlain : true,
1150 _check_unsubscribe : true
\r
1152 success : function(res) {
\r
1153 if(res.success == true){
1154 p.setValue(res.data);
1170 '|xns' : 'Roo.form',
1175 legend : _this._strings['e44b145bd8b49b06e0ad2ced1ad56466'] /* Plain Text */,
1176 style : 'text-align:center;',
1178 '|xns' : 'Roo.form',
1194 '|xns' : 'Roo.form',
1197 xtype : 'TextField',
1199 fieldLabel : _this._strings['b337c8a67244afb6551ee1f8f9717676'] /* Test Class <BR/> (for system reference only) */,
1200 name : 'test_class',
1222 xtype : 'GridPanel',
1225 fitContainer : true,
1228 tableName : 'Images',
1229 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
1231 activate : function() {
1232 _this.ipanel = this;
1234 _this.igrid.ds.load({});
1242 autoExpandColumn : 'filename',
1248 //_this.dialog = Pman.Dialog.FILL_IN
1249 if (_this.ipanel.active) {
1250 // _this.igrid.ds.load({});
1255 '|xns' : 'Roo.grid',
1263 cls : 'x-btn-text-icon',
1264 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1265 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1269 var id = _this.form.findField('id').getValue();
1272 Roo.MessageBox.alert('Error', 'Please save the email template first');
1276 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1278 Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
1279 _this.igrid.getDataSource().load({});
1284 '|xns' : 'Roo.Toolbar'
1288 cls : 'x-btn-text-icon',
1289 icon : rootURL + '/Pman/templates/images/trash.gif',
1290 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1294 var s = _this.igrid.getSelectionModel().getSelected();
1295 if (!s || isNaN(s.id *1)) {
1296 Roo.MessageBox.alert("Error", "Select a image");
1299 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
1305 url : baseURL + '/Roo/Images.php',
1310 success : function()
1312 Roo.log('Got Success!!');
1313 _this.igrid.ds.load({});
1320 '|xns' : 'Roo.Toolbar'
1327 sortInfo : { field : 'filename', direction: 'ASC' },
1329 beforeload : function (_self, options)
1331 options.params = options.params || {};
1332 if (typeof(_this.data) == 'undefined') {
1335 if(_this.data.id * 1 >= 0)
1337 options.params.onid = _this.data.id;
1339 options.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1344 '|xns' : 'Roo.data',
1346 xtype : 'HttpProxy',
1348 url : baseURL + '/Roo/Images.php',
1353 xtype : 'JsonReader',
1388 'name': 'displayorder',
1396 'name': 'parent_image_id',
1402 'dateFormat': 'Y-m-d'
1421 'name': 'parent_image_id_id',
1425 'name': 'parent_image_id_filename',
1429 'name': 'parent_image_id_ontable',
1433 'name': 'parent_image_id_onid',
1437 'name': 'parent_image_id_mimetype',
1441 'name': 'parent_image_id_width',
1445 'name': 'parent_image_id_height',
1449 'name': 'parent_image_id_filesize',
1453 'name': 'parent_image_id_displayorder',
1457 'name': 'parent_image_id_language',
1461 'name': 'parent_image_id_parent_image_id',
1465 'name': 'parent_image_id_created',
1469 'name': 'parent_image_id_imgtype',
1473 'name': 'parent_image_id_linkurl',
1477 'name': 'parent_image_id_descript',
1481 'name': 'parent_image_id_title',
1487 totalProperty : 'total',
1494 xtype : 'ColumnModel',
1495 dataIndex : 'filename',
1496 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
1497 renderer : function(v,x,r)
1499 var width = r.data.width;
1500 var height = r.data.height;
1503 height = Math.round(height * 50 / width);
1507 return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';
1514 xtype : 'ColumnModel',
1515 dataIndex : 'displayorder',
1516 header : _this._strings['2393ad754ba179442d85e415d1d5167c'] /* Displayorder */,
1517 renderer : function(v) { return String.format('{0}', v); },
1523 xtype : 'ColumnModel',
1524 dataIndex : 'title',
1525 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1526 renderer : function(v) { return String.format('{0}', v); },