listeners : {
show : function (_self)
{
-
+
_self.layout.getRegion('center').showPanel(0);
var w = Roo.lib.Dom.getViewWidth();\r
var h = Roo.lib.Dom.getViewHeight(); \r this.resizeTo(w-50, h-50);\r
listeners : {
click : function (_self, e)
{
- Pman.Dialog.CrmImportURL.show({
+ Pman.Dialog.CoreImportUrl.show({
+ target : '/Crm/ImportHtml.php'
}, function(data) {
if (data) {
// Roo.log(data);
});
}
},
- text : "File"
+ text : "Html File"
}
]
}
]
}
},
+ {
+ xtype: 'ComboBox',
+ xns: Roo.form,
+ listeners : {
+ select : function (combo, record, index)
+ {
+ Roo.log(record);
+ /*
+ (function() {
+ combo.setValue('');
+ }).defer(100);
+ */
+ _this.form.findField('bodytext').setValue(record.data.content);
+
+ }
+ },
+ allowBlank : true,
+ alwaysQuery : true,
+ displayField : 'file',
+ editable : false,
+ emptyText : "Select Template",
+ fieldLabel : 'Template',
+ forceSelection : true,
+ hiddenName : 'template',
+ listWidth : 400,
+ loadingText : "Searching...",
+ minChars : 2,
+ name : 'template',
+ pageSize : 20,
+ qtip : "Select Template",
+ selectOnFocus : true,
+ tpl : '<div class="x-grid-cell-text x-btn button"><b>{file}</b> </div>',
+ triggerAction : 'all',
+ typeAhead : true,
+ valueField : 'file',
+ width : 200,
+ store : {
+ xtype: 'Store',
+ xns: Roo.data,
+ listeners : {
+ beforeload : function (_self, o){
+ o.params = o.params || {};
+ // set more here
+
+ }
+ },
+ remoteSort : true,
+ sortInfo : { direction : 'DESC', field: 'file' },
+ proxy : {
+ xtype: 'HttpProxy',
+ xns: Roo.data,
+ method : 'GET',
+ url : baseURL + '/Core/MailTemplateList.php'
+ },
+ reader : {
+ xtype: 'JsonReader',
+ xns: Roo.data,
+ id : 'name',
+ root : 'data',
+ totalProperty : 'total',
+ fields : [{"name":"file","type":"string"},{"name":"content","type":"string"}]
+ }
+ }
+ },
{
xtype: 'Fill',
xns: Roo.Toolbar
method : 'POST',
params : {
onid : _this.form.findField('id').getValue(),
- ontable : 'crm_mailing_list_message' ,
+ ontable : 'core_mailing_list_message' ,
_remote_upload : i.src
},
success : function(res){
var id = _this.form.findField('id').getValue() * 1;
if (!id) {
- Roo.MessageBox.alert("Error", "Save press release first");
+ Roo.MessageBox.alert("Error", "Save email template first");
return false;
}
o.params.onid = id
- o.params.ontable = 'crm_mailing_list_message';
+ o.params.ontable = 'core_mailing_list_message';
// o.params.imgtype = 'PressRelease';
//o.params['query[imagesize]'] = '150x150';
{
xtype: 'TextArea',
xns: Roo.form,
- height : 150,
+ height : 50,
name : 'plaintext'
}
]
if(_this.data.id * 1 >= 0)
{
options.params.onid = _this.data.id;
- options.params.ontable = 'Core_mailing_list_message';
+ options.params.ontable = 'core_mailing_list_message';
}
}
},
reader : {
xtype: 'JsonReader',
xns: Roo.data,
- totalProperty : 'total',
- root : 'data',
id : 'id',
+ root : 'data',
+ totalProperty : 'total',
fields : [
{
'name': 'id',
listeners : {
click : function()
{
- Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'crm_mailing_list_message' }, function() {
+ var id = _this.form.findField('id').getValue();
+
+ if(id*1 < 1){
+ Roo.MessageBox.alert('Error', 'Please save the email template first');
+ return;
+ }
+
+ Pman.Dialog.Image.show( { id : 0, onid: _this.data.id, ontable: 'core_mailing_list_message' }, function() {
_this.igrid.getDataSource().load({});
});
}