Changeset 1970 for branches/2.1/expressoMail1_2/js/local_messages.js
- Timestamp:
- 02/03/10 18:48:58 (15 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.1/expressoMail1_2/js/local_messages.js
r1939 r1970 310 310 311 311 } 312 /** 313 * check if ID is no from main tab, if it's from main returns false, else 314 * returns an array with all string in position 0, the mail id in position 1 315 * and the part of string relative to tab in position 2 316 * @param {Object} id_mail 317 */ 318 local_messages.prototype.parse_id_mail = function(id_mail) { 319 if (this.isInt(id_mail)) 320 return false; 321 322 var matches = id_mail.match(/(.+)(_[a-zA-Z0-9]+)/); 323 return matches; 324 } 325 326 local_messages.prototype.isInt = function(x) { 327 var y=parseInt(x); 328 if (isNaN(y)) return false; 329 return x==y && x.toString()==y.toString(); 330 } 312 331 313 332 local_messages.prototype.get_local_mail = function(id_mail) { 314 333 this.init_local_messages(); 334 335 var plus_id = ''; 336 var matches = ''; 337 if(matches = this.parse_id_mail(id_mail)) { //Mails coming from other tab. 338 id_mail = matches[1]; 339 plus_id = matches[2]; 340 } 341 315 342 var rs = this.dbGears.execute("select mail.rowid,mail.mail,mail.ffrom,mail.subject,mail.body,mail.fto,mail.cc,folder.folder,mail.original_id from mail inner join folder on mail.id_folder=folder.rowid where mail.rowid="+id_mail); 316 343 var retorno = null; … … 324 351 if (typeof(retorno.source) == 'string') 325 352 { 326 retorno.msg_number=rs.field(0) ;353 retorno.msg_number=rs.field(0)+plus_id; 327 354 retorno.original_ID=rs.field(8); 328 355 retorno.msg_folder=rs.field(7); … … 367 394 retorno['local_message'] = true; 368 395 retorno['msg_folder'] = "local_"+rs.field(7); //Now it's a local folder 369 retorno['msg_number'] = rs.field(0) ; //the message number is the rowid396 retorno['msg_number'] = rs.field(0)+plus_id; //the message number is the rowid 370 397 371 398 } … … 490 517 local_messages.prototype.get_url_anexo = function(msg_number,pid) { 491 518 this.init_local_messages(); 492 519 var matches = ''; 520 if(matches = this.parse_id_mail(msg_number)) { 521 msg_number = matches[1]; 522 } 523 493 524 var retorno; 494 525 var rs = this.dbGears.execute("select url from anexo where id_mail="+msg_number+" and pid = '"+pid+"'"); … … 574 605 for (var i in msgs_to_set) { 575 606 607 var matches = '';//Messages comming from other tabs. 608 if(matches = this.parse_id_mail(msgs_to_set[i])) { 609 msgs_to_set[i] = matches[1]; 610 } 611 576 612 var rs = this.dbGears.execute("select header,unseen from mail where rowid=" + msgs_to_set[i]); 577 613 header = connector.unserialize(rs.field(0));
Note: See TracChangeset
for help on using the changeset viewer.