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 allowComments : true,
785 autosave : function() {
787 var body = _this.form.findField('bodytext');
789 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
790 Roo.log('body not dirty');
794 Roo.log('body dirty, auto save!');
796 body.fireEvent('autosave', body);
827 '-ms-interpolation-mode',
829 '-ms-text-size-adjust',
843 '-webkit-text-size-adjust',
852 autosave : function (_self)
856 var id = _this.form.findField('id').getValue() * 1;
859 if(!_self.editorcore.sourceEditMode){
867 url : baseURL + '/Roo/Events.php',
872 on_id : (id > 0) ? id : 0,
873 on_table : 'crm_mailing_list_message',
875 source: _self.getValue()
877 success : function() {
878 _self.originalValue = _self.getValue();
883 Roo.log('body autosave failed?!');
888 savedpreview : function (_self)
890 var id = _this.form.findField('id').getValue() * 1;
892 var successFn = function(res){
893 return res.data.POST.source;
899 on_id : (id < 1) ? 0 : id,
900 on_table : 'crm_mailing_list_message',
901 successFn : successFn
905 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
907 _self.originalValue = res;
915 xtype : 'ToolbarContext',
916 xns : Roo.form.HtmlEditor,
917 '|xns' : 'Roo.form.HtmlEditor'
920 xtype : 'ToolbarStandard',
921 xns : Roo.form.HtmlEditor,
922 '|xns' : 'Roo.form.HtmlEditor',
927 displayField : 'name',
929 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
930 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
931 forceSelection : true,
933 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
936 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
937 selectOnFocus : true,
938 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>',
939 triggerAction : 'all',
944 beforequery : function (combo, query, forceAll, cancel, e)
946 var id = _this.form.findField('id').getValue() * 1;
948 Roo.MessageBox.alert("Error", "Save message first");
952 render : function (_self)
954 _this.extendimgselect = _self;
956 select : function (combo, record, index)
962 var editor = _this.form.findField('bodytext').editorcore;
964 var curnode = editor.getSelectedNode();
965 if (curnode && curnode.tagName == 'IMG') {
966 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
967 baseURL, record.data.id, record.data.filename
969 // note -forces an update... hopefully...
970 editor.owner.fireEvent('editorevent', editor, false);
973 editor.insertAtCursor(
974 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
975 baseURL, record.data.id, record.data.filename
988 sortInfo : { direction : 'ASC', field: 'id' },
990 beforeload : function (_self, o){
991 o.params = o.params || {};
993 var id = _this.form.findField('id').getValue() * 1;
995 Roo.MessageBox.alert("Error", "Save email template first");
999 o.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1001 // o.params.imgtype = 'PressRelease';
1002 //o.params['query[imagesize]'] = '150x150';
1007 '|xns' : 'Roo.data',
1009 xtype : 'HttpProxy',
1011 url : baseURL + '/Roo/Images.php',
1016 xtype : 'JsonReader',
1017 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1020 totalProperty : 'total',
1029 displayField : 'name',
1031 emptyText : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1032 fieldLabel : _this._strings['6f16a5f8ff5d75ab84c018adacdfcbb7'] /* Field */,
1033 forceSelection : true,
1035 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1038 qtip : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1039 selectOnFocus : true,
1040 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
1041 triggerAction : 'all',
1043 valueField : 'type',
1046 render : function (_self)
1048 _this.unsubscribeselect = _self;
1050 select : function (combo, record, index)
1056 var editor = _this.form.findField('bodytext').editorcore;
1058 if(record.data.name == 'Unsubscribe'){
1059 editor.insertAtCursor(
1060 String.format('<a href="{0}">{1}</a>',
1061 record.data.type, record.data.name
1067 editor.insertAtCursor(
1068 String.format('{0}',
1076 '|xns' : 'Roo.form',
1078 xtype : 'SimpleStore',
1080 [ '{person.firstname}', "First Name"],
1081 [ '{person.lastname}' , "Last Name"],
1082 [ '{person.name}', "Full Name"],
1083 [ '#unsubscribe', "Unsubscribe"]
1085 fields : [ 'type', 'name'],
1091 xtype : 'Separator',
1093 '|xns' : 'Roo.Toolbar'
1097 cls : 'x-init-enable',
1098 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1100 click : function (_self, e)
1102 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1107 '|xns' : 'Roo.Toolbar'
1121 '|xns' : 'Roo.form',
1125 text : _this._strings['e9968623956c15023d54335ea3699855'] /* Convert Html to Text */,
1127 click : function (_self, e)
1129 var h = _this.form.findField('bodytext').getValue();
1130 var p = _this.form.findField('plaintext');
1132 new Pman.Request({
\r
1133 url : baseURL + '/Core/ImportMailMessage.php',
\r
1137 _convertToPlain : true,
1138 _check_unsubscribe : true
\r
1140 success : function(res) {
\r
1141 if(res.success == true){
1142 p.setValue(res.data);
1158 '|xns' : 'Roo.form',
1163 legend : _this._strings['e44b145bd8b49b06e0ad2ced1ad56466'] /* Plain Text */,
1164 style : 'text-align:center;',
1166 '|xns' : 'Roo.form',
1182 '|xns' : 'Roo.form',
1185 xtype : 'TextField',
1187 fieldLabel : _this._strings['b337c8a67244afb6551ee1f8f9717676'] /* Test Class <BR/> (for system reference only) */,
1188 name : 'test_class',
1210 xtype : 'GridPanel',
1213 fitContainer : true,
1216 tableName : 'Images',
1217 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
1219 activate : function() {
1220 _this.ipanel = this;
1222 _this.igrid.ds.load({});
1230 autoExpandColumn : 'filename',
1236 //_this.dialog = Pman.Dialog.FILL_IN
1237 if (_this.ipanel.active) {
1238 // _this.igrid.ds.load({});
1243 '|xns' : 'Roo.grid',
1251 cls : 'x-btn-text-icon',
1252 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1253 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1257 var id = _this.form.findField('id').getValue();
1260 Roo.MessageBox.alert('Error', 'Please save the email template first');
1264 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1266 Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
1267 _this.igrid.getDataSource().load({});
1272 '|xns' : 'Roo.Toolbar'
1276 cls : 'x-btn-text-icon',
1277 icon : rootURL + '/Pman/templates/images/trash.gif',
1278 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1282 var s = _this.igrid.getSelectionModel().getSelected();
1283 if (!s || isNaN(s.id *1)) {
1284 Roo.MessageBox.alert("Error", "Select a image");
1287 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
1293 url : baseURL + '/Roo/Images.php',
1298 success : function()
1300 Roo.log('Got Success!!');
1301 _this.igrid.ds.load({});
1308 '|xns' : 'Roo.Toolbar'
1315 sortInfo : { field : 'filename', direction: 'ASC' },
1317 beforeload : function (_self, options)
1319 options.params = options.params || {};
1320 if (typeof(_this.data) == 'undefined') {
1323 if(_this.data.id * 1 >= 0)
1325 options.params.onid = _this.data.id;
1327 options.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1332 '|xns' : 'Roo.data',
1334 xtype : 'HttpProxy',
1336 url : baseURL + '/Roo/Images.php',
1341 xtype : 'JsonReader',
1376 'name': 'displayorder',
1384 'name': 'parent_image_id',
1390 'dateFormat': 'Y-m-d'
1409 'name': 'parent_image_id_id',
1413 'name': 'parent_image_id_filename',
1417 'name': 'parent_image_id_ontable',
1421 'name': 'parent_image_id_onid',
1425 'name': 'parent_image_id_mimetype',
1429 'name': 'parent_image_id_width',
1433 'name': 'parent_image_id_height',
1437 'name': 'parent_image_id_filesize',
1441 'name': 'parent_image_id_displayorder',
1445 'name': 'parent_image_id_language',
1449 'name': 'parent_image_id_parent_image_id',
1453 'name': 'parent_image_id_created',
1457 'name': 'parent_image_id_imgtype',
1461 'name': 'parent_image_id_linkurl',
1465 'name': 'parent_image_id_descript',
1469 'name': 'parent_image_id_title',
1475 totalProperty : 'total',
1482 xtype : 'ColumnModel',
1483 dataIndex : 'filename',
1484 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
1485 renderer : function(v,x,r)
1487 var width = r.data.width;
1488 var height = r.data.height;
1491 height = Math.round(height * 50 / width);
1495 return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';
1502 xtype : 'ColumnModel',
1503 dataIndex : 'displayorder',
1504 header : _this._strings['2393ad754ba179442d85e415d1d5167c'] /* Displayorder */,
1505 renderer : function(v) { return String.format('{0}', v); },
1511 xtype : 'ColumnModel',
1512 dataIndex : 'title',
1513 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1514 renderer : function(v) { return String.format('{0}', v); },