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 'cafbb1cfc96d63acd85e7de928e1636b' :"To Group <BR/> (for system reference only)",
33 'ea4788705e6873b424c65e91c2846b19' :"Cancel",
34 '68b00d723d37122f64da8d9939f836f0' :"BCC Group",
35 'c4ca4238a0b923820dcc509a6f75849b' :"1",
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 'to_group_id_name_fieldLabel' : 'cafbb1cfc96d63acd85e7de928e1636b' /* To Group <BR/> (for system reference only) */ ,
54 'template_fieldLabel' : '278c491bdd8a53618c149c4ac790da34' /* Template */ ,
55 'name_fieldLabel' : 'b20a8b77b05d53b4e695738731400c85' /* Mailout Name */ ,
56 'bcc_group_id_name_qtip' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
57 'bcc_group_id_name_emptyText' : '2c466a2c159463f1d9ef5a7b57b52827' /* Select BCC Group */ ,
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 */,
779 legend : _this._strings['962b90039a542a29cedd51d87a9f28a1'] /* Html Editor */,
780 style : 'text-align:center;',
785 xtype : 'HtmlEditor',
786 allowComments : true,
788 autosave : function() {
790 var body = _this.form.findField('bodytext');
792 if(!body.wrap.isVisible(true) || body.getValue() == '' || !body.isDirty()){
793 Roo.log('body not dirty');
797 Roo.log('body dirty, auto save!');
799 body.fireEvent('autosave', body);
840 '-ms-interpolation-mode',
842 '-ms-text-size-adjust',
856 '-webkit-text-size-adjust',
861 enableBlocks : false,
866 autosave : function (_self)
870 var id = _this.form.findField('id').getValue() * 1;
873 if(!_self.editorcore.sourceEditMode){
881 url : baseURL + '/Roo/Events.php',
886 on_id : (id > 0) ? id : 0,
887 on_table : 'crm_mailing_list_message',
889 source: _self.getValue()
891 success : function() {
892 _self.originalValue = _self.getValue();
897 Roo.log('body autosave failed?!');
902 savedpreview : function (_self)
904 var id = _this.form.findField('id').getValue() * 1;
906 var successFn = function(res){
907 return res.data.POST.source;
913 on_id : (id < 1) ? 0 : id,
914 on_table : 'crm_mailing_list_message',
915 successFn : successFn
919 Pman.Dialog.CoreAutoSavePreview.show(params, function(res){
921 _self.originalValue = res;
929 xtype : 'ToolbarContext',
930 xns : Roo.form.HtmlEditor,
931 '|xns' : 'Roo.form.HtmlEditor'
934 xtype : 'ToolbarStandard',
935 xns : Roo.form.HtmlEditor,
936 '|xns' : 'Roo.form.HtmlEditor',
941 displayField : 'name',
943 emptyText : _this._strings['b9c49611cfda3259a2b837b39489e650'] /* Add Image */,
944 fieldLabel : _this._strings['fff0d600f8a0b5e19e88bfb821dd1157'] /* Images */,
945 forceSelection : true,
947 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
950 qtip : _this._strings['2f26e35d61be90501e099089dc533638'] /* Select Images */,
951 selectOnFocus : true,
952 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>',
953 triggerAction : 'all',
958 beforequery : function (combo, query, forceAll, cancel, e)
960 var id = _this.form.findField('id').getValue() * 1;
962 Roo.MessageBox.alert("Error", "Save message first");
966 render : function (_self)
968 _this.extendimgselect = _self;
970 select : function (combo, record, index)
976 var editor = _this.form.findField('bodytext').editorcore;
978 var curnode = editor.getSelectedNode();
979 if (curnode && curnode.tagName == 'IMG') {
980 curnode.src= String.format('{0}/Images/{1}/{2}#image-{1}',
981 baseURL, record.data.id, record.data.filename
983 // note -forces an update... hopefully...
984 editor.owner.fireEvent('editorevent', editor, false);
987 editor.insertAtCursor(
988 String.format('<img src="{0}/Images/{1}/{2}#image-{1}">',
989 baseURL, record.data.id, record.data.filename
1002 sortInfo : { direction : 'ASC', field: 'id' },
1004 beforeload : function (_self, o){
1005 o.params = o.params || {};
1007 var id = _this.form.findField('id').getValue() * 1;
1009 Roo.MessageBox.alert("Error", "Save email template first");
1013 o.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1015 // o.params.imgtype = 'PressRelease';
1016 //o.params['query[imagesize]'] = '150x150';
1021 '|xns' : 'Roo.data',
1023 xtype : 'HttpProxy',
1025 url : baseURL + '/Roo/Images.php',
1030 xtype : 'JsonReader',
1031 fields : [{"name":"id","type":"int"},{"name":"filename","type":"string"},{"name":"url_thumb","type":"string"}],
1034 totalProperty : 'total',
1043 displayField : 'name',
1045 emptyText : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1046 fieldLabel : _this._strings['6f16a5f8ff5d75ab84c018adacdfcbb7'] /* Field */,
1047 forceSelection : true,
1049 loadingText : _this._strings['1243daf593fa297e07ab03bf06d925af'] /* Searching... */,
1052 qtip : _this._strings['5feb9bf3c03b32635135006cbacb9542'] /* Insert Field */,
1053 selectOnFocus : true,
1054 tpl : '<div class=\"x-grid-cell-text x-btn button\"><b>{name}</b> </div>',
1055 triggerAction : 'all',
1057 valueField : 'type',
1060 render : function (_self)
1062 _this.unsubscribeselect = _self;
1064 select : function (combo, record, index)
1070 var editor = _this.form.findField('bodytext').editorcore;
1072 if(record.data.name == 'Unsubscribe'){
1073 editor.insertAtCursor(
1074 String.format('<a href="{0}">{1}</a>',
1075 record.data.type, record.data.name
1081 editor.insertAtCursor(
1082 String.format('{0}',
1090 '|xns' : 'Roo.form',
1092 xtype : 'SimpleStore',
1094 [ '{person.firstname}', "First Name"],
1095 [ '{person.lastname}' , "Last Name"],
1096 [ '{person.name}', "Full Name"],
1097 [ '#unsubscribe', "Unsubscribe"]
1099 fields : [ 'type', 'name'],
1105 xtype : 'Separator',
1107 '|xns' : 'Roo.Toolbar'
1111 cls : 'x-init-enable',
1112 text : _this._strings['bd88a20b53a47f7b5704a83a15ff5506'] /* Saved Version */,
1114 click : function (_self, e)
1116 this.scope.owner.fireEvent('savedpreview', this.scope.owner);
1121 '|xns' : 'Roo.Toolbar'
1135 '|xns' : 'Roo.form',
1139 text : _this._strings['e9968623956c15023d54335ea3699855'] /* Convert Html to Text */,
1141 click : function (_self, e)
1143 var h = _this.form.findField('bodytext').getValue();
1144 var p = _this.form.findField('plaintext');
1146 new Pman.Request({
\r
1147 url : baseURL + '/Core/ImportMailMessage.php',
\r
1151 _convertToPlain : true,
1152 _check_unsubscribe : true
\r
1154 success : function(res) {
\r
1155 if(res.success == true){
1156 p.setValue(res.data);
1172 '|xns' : 'Roo.form',
1177 legend : _this._strings['e44b145bd8b49b06e0ad2ced1ad56466'] /* Plain Text */,
1178 style : 'text-align:center;',
1180 '|xns' : 'Roo.form',
1196 '|xns' : 'Roo.form',
1199 xtype : 'TextField',
1201 fieldLabel : _this._strings['b337c8a67244afb6551ee1f8f9717676'] /* Test Class <BR/> (for system reference only) */,
1202 name : 'test_class',
1213 '|xns' : 'Roo.form',
1216 xtype : 'TextField',
1218 fieldLabel : _this._strings['cafbb1cfc96d63acd85e7de928e1636b'] /* To Group <BR/> (for system reference only) */,
1219 name : 'to_group_id_name',
1241 xtype : 'GridPanel',
1244 fitContainer : true,
1247 tableName : 'Images',
1248 title : _this._strings['308f2757bfc9ce92fb00ff93fdffd279'] /* Images / Attachments */,
1250 activate : function() {
1251 _this.ipanel = this;
1253 _this.igrid.ds.load({});
1261 autoExpandColumn : 'filename',
1267 //_this.dialog = Pman.Dialog.FILL_IN
1268 if (_this.ipanel.active) {
1269 // _this.igrid.ds.load({});
1274 '|xns' : 'Roo.grid',
1282 cls : 'x-btn-text-icon',
1283 icon : Roo.rootURL + 'images/default/dd/drop-add.gif',
1284 text : _this._strings['ec211f7c20af43e742bf2570c3cb84f9'] /* Add */,
1288 var id = _this.form.findField('id').getValue();
1291 Roo.MessageBox.alert('Error', 'Please save the email template first');
1295 var ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1297 Pman.Dialog.Image.show( { id : 0, onid: id, ontable: ontable }, function() {
1298 _this.igrid.getDataSource().load({});
1303 '|xns' : 'Roo.Toolbar'
1307 cls : 'x-btn-text-icon',
1308 icon : rootURL + '/Pman/templates/images/trash.gif',
1309 text : _this._strings['f2a6c498fb90ee345d997f888fce3b18'] /* Delete */,
1313 var s = _this.igrid.getSelectionModel().getSelected();
1314 if (!s || isNaN(s.id *1)) {
1315 Roo.MessageBox.alert("Error", "Select a image");
1318 Roo.MessageBox.confirm("Confirm", "Are sure you want to delete this image?", function (v){
1324 url : baseURL + '/Roo/Images.php',
1329 success : function()
1331 Roo.log('Got Success!!');
1332 _this.igrid.ds.load({});
1339 '|xns' : 'Roo.Toolbar'
1346 sortInfo : { field : 'filename', direction: 'ASC' },
1348 beforeload : function (_self, options)
1350 options.params = options.params || {};
1351 if (typeof(_this.data) == 'undefined') {
1354 if(_this.data.id * 1 >= 0)
1356 options.params.onid = _this.data.id;
1358 options.params.ontable = (_this.data.module) ? _this.data.module : 'crm_mailing_list_message';
1363 '|xns' : 'Roo.data',
1365 xtype : 'HttpProxy',
1367 url : baseURL + '/Roo/Images.php',
1372 xtype : 'JsonReader',
1407 'name': 'displayorder',
1415 'name': 'parent_image_id',
1421 'dateFormat': 'Y-m-d'
1440 'name': 'parent_image_id_id',
1444 'name': 'parent_image_id_filename',
1448 'name': 'parent_image_id_ontable',
1452 'name': 'parent_image_id_onid',
1456 'name': 'parent_image_id_mimetype',
1460 'name': 'parent_image_id_width',
1464 'name': 'parent_image_id_height',
1468 'name': 'parent_image_id_filesize',
1472 'name': 'parent_image_id_displayorder',
1476 'name': 'parent_image_id_language',
1480 'name': 'parent_image_id_parent_image_id',
1484 'name': 'parent_image_id_created',
1488 'name': 'parent_image_id_imgtype',
1492 'name': 'parent_image_id_linkurl',
1496 'name': 'parent_image_id_descript',
1500 'name': 'parent_image_id_title',
1506 totalProperty : 'total',
1513 xtype : 'ColumnModel',
1514 dataIndex : 'filename',
1515 header : _this._strings['1351017ac6423911223bc19a8cb7c653'] /* Filename */,
1516 renderer : function(v,x,r)
1518 var width = r.data.width;
1519 var height = r.data.height;
1522 height = Math.round(height * 50 / width);
1526 return '<img src="' + baseURL + '/Images/' + r.data.id + '/' + r.data.filename + '" width="' + width + '" height="' + height + '" />';
1533 xtype : 'ColumnModel',
1534 dataIndex : 'displayorder',
1535 header : _this._strings['2393ad754ba179442d85e415d1d5167c'] /* Displayorder */,
1536 renderer : function(v) { return String.format('{0}', v); },
1542 xtype : 'ColumnModel',
1543 dataIndex : 'title',
1544 header : _this._strings['b78a3223503896721cca1303f776159b'] /* Title */,
1545 renderer : function(v) { return String.format('{0}', v); },