escape double quotes in communication content, allow 0 as value in data/int field

This commit is contained in:
Anand Doshi 2012-06-07 14:39:42 +05:30
parent 91034af0dc
commit 4dbeae1eae
5 changed files with 12 additions and 12 deletions

View File

@ -38,9 +38,9 @@ cur_frm.cscript.render_communication_list = function(doc, dt, dn) {
this._super(data);
data.creation = wn.datetime.str_to_user(data.communication_date);
// replace double quote with blank string
data.content = cstr(data.subject).replace(/"/gi, '')
+ " | " + cstr(data.content).replace(/"/gi, '');
// escape double quote
data.content = cstr(data.subject).replace(/"/gi, '\"')
+ " | " + cstr(data.content).replace(/"/gi, '\"');
if(data.content && data.content.length > 50) {
data.content = '<span title="'+data.content+'">' +

View File

@ -15,9 +15,9 @@ wn.doclistviews['Communication'] = wn.views.ListView.extend({
this._super(data);
data.creation = wn.datetime.only_date(data.creation);
// replace double quote with blank string
data.content = cstr(data.subject).replace(/"/gi, '')
+ " | " + cstr(data.content).replace(/"/gi, '');
// escape double quote
data.content = cstr(data.subject).replace(/"/gi, '\"')
+ " | " + cstr(data.content).replace(/"/gi, '\"');
if(data.content && data.content.length > 50) {
data.content = '<span title="'+data.content+'">' +

View File

@ -33,9 +33,9 @@ wn.doclistviews['Support Ticket'] = wn.views.ListView.extend({
me.set_filter('status', $(this).text());
});
// replace double quote with blank string
data.description = cstr(data.subject).replace(/"/gi, '')
+ " | " + cstr(data.description).replace(/"/gi, '');
// escape double quotes
data.description = cstr(data.subject).replace(/"/gi, '\"')
+ " | " + cstr(data.description).replace(/"/gi, '\"');
// description
if(data.description && data.description.length > 50) {

View File

@ -700,7 +700,7 @@ if(this.txt){try{this.txt.focus();}catch(e){}
this.txt.field_object=this;}}
function DataField(){}DataField.prototype=new Field();DataField.prototype.make_input=function(){var me=this;this.input=$a_input(this.input_area,this.df.fieldtype=='Password'?'password':'text');this.get_value=function(){var v=this.input.value;if(this.validate)
v=this.validate(v);return v;}
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value&&me.get_value()||$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val==undefined?'':val;}
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value?me.get_value():$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val==undefined?'':val;}
me.set(val);if(me.format_input)
me.format_input();if(in_list(['Currency','Float','Int'],me.df.fieldtype)){if(flt(me.last_value)==flt(val)){me.last_value=val;return;}}
me.last_value=val;me.run_trigger();}
@ -1541,7 +1541,7 @@ if(this.txt){try{this.txt.focus();}catch(e){}
this.txt.field_object=this;}}
function DataField(){}DataField.prototype=new Field();DataField.prototype.make_input=function(){var me=this;this.input=$a_input(this.input_area,this.df.fieldtype=='Password'?'password':'text');this.get_value=function(){var v=this.input.value;if(this.validate)
v=this.validate(v);return v;}
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value&&me.get_value()||$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val==undefined?'':val;}
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value?me.get_value():$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val==undefined?'':val;}
me.set(val);if(me.format_input)
me.format_input();if(in_list(['Currency','Float','Int'],me.df.fieldtype)){if(flt(me.last_value)==flt(val)){me.last_value=val;return;}}
me.last_value=val;me.run_trigger();}

View File

@ -64,7 +64,7 @@ if(this.txt){try{this.txt.focus();}catch(e){}
this.txt.field_object=this;}}
function DataField(){}DataField.prototype=new Field();DataField.prototype.make_input=function(){var me=this;this.input=$a_input(this.input_area,this.df.fieldtype=='Password'?'password':'text');this.get_value=function(){var v=this.input.value;if(this.validate)
v=this.validate(v);return v;}
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value&&me.get_value()||$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val==undefined?'':val;}
this.input.name=this.df.fieldname;$(this.input).change(function(){me.set_value(me.get_value?me.get_value():$(this.input).val());});this.set_value=function(val){if(!me.last_value)me.last_value='';if(me.validate){val=me.validate(val);me.input.value=val==undefined?'':val;}
me.set(val);if(me.format_input)
me.format_input();if(in_list(['Currency','Float','Int'],me.df.fieldtype)){if(flt(me.last_value)==flt(val)){me.last_value=val;return;}}
me.last_value=val;me.run_trigger();}