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);
837 '-ms-interpolation-mode',
839 '-ms-text-size-adjust',
853 '-webkit-text-size-adjust',
862 autosave : function (_self)
866 var id = _this.form.findField('id').getValue() * 1;
869 if(!_self.editorcore.sourceEditMode){
877 url : baseURL + '/Roo/Events.php',
882 on_id : (id > 0) ? id : 0,
883 on_table : 'crm_mailing_list_message',
885 source: _self.getValue()
887 success : function() {
888 _self.originalValue = _self.getValue();
893 Roo.log('body autosave failed?!');
898 savedpreview : function (_self)
900 var id = _this.form.findField('id').getValue() * 1;
902 var successFn = function(res){
903 return res.data.POST.source;
909 on_id : (id < 1) ? 0 : id,
910 on_table : 'crm_mailing_list_message',
911 successFn : successFn
915 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
917 _self.originalValue = res;
925 xtype : 'ToolbarContext',
926 xns : Roo.form.HtmlEditor,
927 '|xns' : 'Roo.form.HtmlEditor'
930 xtype : 'ToolbarStandard',
931 xns : Roo.form.HtmlEditor,
932 '|xns' : 'Roo.form.HtmlEditor',
937 displayField : 'name',
939 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
940 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
941 forceSelection : true,
943 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
946 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
947 selectOnFocus : true,
948 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>',
949 triggerAction : 'all',
954 beforequery : function (combo, query, forceAll, cancel, e)
956 var id = _this.form.findField('id').getValue() * 1;
958 Roo.MessageBox.alert("Error", "Save message first");
962 render : function (_self)
964 _this.extendimgselect = _self;
966 select : function (combo, record, index)
972 var editor = _this.form.findField('bodytext').editorcore;
974 var curnode = editor.getSelectedNode();
975 if (curnode && curnode.tagName == 'IMG') {
976 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
977 baseURL, record.data.id, record.data.filename
979 // note -forces an update... hopefully...
980 editor.owner.fireEvent('editorevent', editor, false);
983 editor.insertAtCursor(
984 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
985 baseURL, record.data.id, record.data.filename
998 sortInfo : { direction : 'ASC', field: 'id' },
1000 beforeload : function (_self, o){
1001 o.params = o.params || {};
1003 var id = _this.form.findField('id').getValue() * 1;
1005 Roo.MessageBox.alert("Error", "Save email template first");
1009 o.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1011 // o.params.imgtype = 'PressRelease';
1012 //o.params['query[imagesize]'] = '150x150';
1017 '|xns' : 'Roo.data',
1019 xtype : 'HttpProxy',
1021 url : baseURL + '/Roo/Images.php',
1026 xtype : 'JsonReader',
1027 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1030 totalProperty : 'total',
1039 displayField : 'name',
1041 emptyText : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1042 fieldLabel : _this._strings['6f16a5f8ff5d75ab84c018adacdfcbb7'] /* Field */,
1043 forceSelection : true,
1045 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1048 qtip : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1049 selectOnFocus : true,
1050 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
1051 triggerAction : 'all',
1053 valueField : 'type',
1056 render : function (_self)
1058 _this.unsubscribeselect = _self;
1060 select : function (combo, record, index)
1066 var editor = _this.form.findField('bodytext').editorcore;
1068 if(record.data.name == 'Unsubscribe'){
1069 editor.insertAtCursor(
1070 String.format('<a href="{0}">{1}</a>',
1071 record.data.type, record.data.name
1077 editor.insertAtCursor(
1078 String.format('{0}',
1086 '|xns' : 'Roo.form',
1088 xtype : 'SimpleStore',
1090 [ '{person.firstname}', "First Name"],
1091 [ '{person.lastname}' , "Last Name"],
1092 [ '{person.name}', "Full Name"],
1093 [ '#unsubscribe', "Unsubscribe"]
1095 fields : [ 'type', 'name'],
1101 xtype : 'Separator',
1103 '|xns' : 'Roo.Toolbar'
1107 cls : 'x-init-enable',
1108 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1110 click : function (_self, e)
1112 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1117 '|xns' : 'Roo.Toolbar'
1131 '|xns' : 'Roo.form',
1135 text : _this._strings['e9968623956c15023d54335ea3699855'] /* Convert Html to Text */,
1137 click : function (_self, e)
1139 var h = _this.form.findField('bodytext').getValue();
1140 var p = _this.form.findField('plaintext');
1142 new Pman.Request({
\r
1143 url : baseURL + '/Core/ImportMailMessage.php',
\r
1147 _convertToPlain : true,
1148 _check_unsubscribe : true
\r
1150 success : function(res) {
\r
1151 if(res.success == true){
1152 p.setValue(res.data);
1168 '|xns' : 'Roo.form',
1173 legend : _this._strings['e44b145bd8b49b06e0ad2ced1ad56466'] /* Plain Text */,
1174 style : 'text-align:center;',
1176 '|xns' : 'Roo.form',
1192 '|xns' : 'Roo.form',
1195 xtype : 'TextField',
1197 fieldLabel : _this._strings['b337c8a67244afb6551ee1f8f9717676'] /* Test Class <BR/> (for system reference only) */,
1198 name : 'test_class',
1220 xtype : 'GridPanel',
1223 fitContainer : true,
1226 tableName : 'Images',
1227 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
1229 activate : function() {
1230 _this.ipanel = this;
1232 _this.igrid.ds.load({});
1240 autoExpandColumn : 'filename',
1246 //_this.dialog = Pman.Dialog.FILL_IN
1247 if (_this.ipanel.active) {
1248 // _this.igrid.ds.load({});
1253 '|xns' : 'Roo.grid',
1261 cls : 'x-btn-text-icon',
1262 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1263 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1267 var id = _this.form.findField('id').getValue();
1270 Roo.MessageBox.alert('Error', 'Please save the email template first');
1274 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1276 Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
1277 _this.igrid.getDataSource().load({});
1282 '|xns' : 'Roo.Toolbar'
1286 cls : 'x-btn-text-icon',
1287 icon : rootURL + '/Pman/templates/images/trash.gif',
1288 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1292 var s = _this.igrid.getSelectionModel().getSelected();
1293 if (!s || isNaN(s.id *1)) {
1294 Roo.MessageBox.alert("Error", "Select a image");
1297 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
1303 url : baseURL + '/Roo/Images.php',
1308 success : function()
1310 Roo.log('Got Success!!');
1311 _this.igrid.ds.load({});
1318 '|xns' : 'Roo.Toolbar'
1325 sortInfo : { field : 'filename', direction: 'ASC' },
1327 beforeload : function (_self, options)
1329 options.params = options.params || {};
1330 if (typeof(_this.data) == 'undefined') {
1333 if(_this.data.id * 1 >= 0)
1335 options.params.onid = _this.data.id;
1337 options.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1342 '|xns' : 'Roo.data',
1344 xtype : 'HttpProxy',
1346 url : baseURL + '/Roo/Images.php',
1351 xtype : 'JsonReader',
1386 'name': 'displayorder',
1394 'name': 'parent_image_id',
1400 'dateFormat': 'Y-m-d'
1419 'name': 'parent_image_id_id',
1423 'name': 'parent_image_id_filename',
1427 'name': 'parent_image_id_ontable',
1431 'name': 'parent_image_id_onid',
1435 'name': 'parent_image_id_mimetype',
1439 'name': 'parent_image_id_width',
1443 'name': 'parent_image_id_height',
1447 'name': 'parent_image_id_filesize',
1451 'name': 'parent_image_id_displayorder',
1455 'name': 'parent_image_id_language',
1459 'name': 'parent_image_id_parent_image_id',
1463 'name': 'parent_image_id_created',
1467 'name': 'parent_image_id_imgtype',
1471 'name': 'parent_image_id_linkurl',
1475 'name': 'parent_image_id_descript',
1479 'name': 'parent_image_id_title',
1485 totalProperty : 'total',
1492 xtype : 'ColumnModel',
1493 dataIndex : 'filename',
1494 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
1495 renderer : function(v,x,r)
1497 var width = r.data.width;
1498 var height = r.data.height;
1501 height = Math.round(height * 50 / width);
1505 return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';
1512 xtype : 'ColumnModel',
1513 dataIndex : 'displayorder',
1514 header : _this._strings['2393ad754ba179442d85e415d1d5167c'] /* Displayorder */,
1515 renderer : function(v) { return String.format('{0}', v); },
1521 xtype : 'ColumnModel',
1522 dataIndex : 'title',
1523 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1524 renderer : function(v) { return String.format('{0}', v); },