- Timestamp:
- 11/10/10 16:07:09 (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/2.2/expressoMail1_2/inc/class.imap_functions.inc.php
r3427 r3493 109 109 $search_box_type = $params['search_box_type'] != "ALL" && $params['search_box_type'] != "" ? $params['search_box_type'] : false; 110 110 111 111 if(!$this->mbox || !is_resource($this->mbox)) 112 112 $this->mbox = $this->open_mbox($folder); 113 113 114 114 $return = array(); 115 // Para enviar o offset entre o timezone definido pelo usuário e GMT 116 $return['offsetToGMT'] = $this->functions->CalculateDateOffset(); 115 117 116 118 if(!$search_box_type || $search_box_type=="UNSEEN" || $search_box_type=="SEEN") { … … 531 533 //return $return; 532 534 }else{ 533 $return['body'] = $body;534 $return['attachments'] = $return_get_body['attachments'];535 $return['thumbs'] = $return_get_body['thumbs'];536 $return['signature'] = $return_get_body['signature'];535 $return['body'] = $body; 536 $return['attachments'] = $return_get_body['attachments']; 537 $return['thumbs'] = $return_get_body['thumbs']; 538 $return['signature'] = $return_get_body['signature']; 537 539 } 538 540 … … 562 564 $return['msg_folder'] = $msg_folder; 563 565 564 $date_msg = gmdate("d/m/Y",$header->udate); 566 $offset = $this->functions->CalculateDateOffset(); 567 $msgTimestamp = $header->udate + $offset; 568 569 $date_msg = gmdate("d/m/Y",$msgTimestamp); 565 570 if (date("d/m/Y") == $date_msg) 566 $return['udate'] = gmdate("H:i",$ header->udate);571 $return['udate'] = gmdate("H:i",$msgTimestamp); 567 572 else 568 573 $return['udate'] = $date_msg; 569 574 570 575 $return['msg_day'] = $date_msg; 571 $return['msg_hour'] = gmdate("H:i",$ header->udate);576 $return['msg_hour'] = gmdate("H:i",$msgTimestamp); 572 577 573 578 if (date("d/m/Y") == $date_msg) //no dia 574 579 { 575 $return['fulldate'] = gmdate("d/m/Y H:i",$ header->udate);576 $return['smalldate'] = gmdate("H:i",$ header->udate);580 $return['fulldate'] = gmdate("d/m/Y H:i",$msgTimestamp); 581 $return['smalldate'] = gmdate("H:i",$msgTimestamp); 577 582 578 583 $timestamp_now = strtotime("now"); 579 $timestamp_msg_time = $ header->udate;580 // $timestamp_now is GMT and $timestamp_msg_time is MailDate TZ.584 $timestamp_msg_time = $msgTimestamp; 585 // $timestamp_now and $timestamp_msg_time are GMT. 581 586 // The variable $timestamp_diff is calculated without MailDate TZ. 582 $pdate = date_parse($header->MailDate); 583 $timestamp_diff = $timestamp_now - $timestamp_msg_time + ($pdate['zone']*(-60)); 587 $timestamp_diff = $timestamp_now - $timestamp_msg_time; 584 588 585 589 if (gmdate("H",$timestamp_diff) > 0) … … 601 605 } 602 606 else{ 603 $return['fulldate'] = gmdate("d/m/Y H:i",$ header->udate);604 $return['smalldate'] = gmdate("d/m/Y",$ header->udate);607 $return['fulldate'] = gmdate("d/m/Y H:i",$msgTimestamp); 608 $return['smalldate'] = gmdate("d/m/Y",$msgTimestamp); 605 609 } 606 610 … … 1620 1624 $return['new_msgs'] = imap_num_recent($this->mbox); 1621 1625 $return['msgs_to_delete'] = $msg_to_delete; 1626 $return['offsetToGMT'] = $this->functions->CalculateDateOffset(); 1622 1627 if($this->mbox && is_resource($this->mbox)) 1623 1628 imap_close($this->mbox); … … 3293 3298 } 3294 3299 3300 $offsetToGMT = $this->functions->CalculateDateOffset(); 3301 3295 3302 if($search){ 3296 3303 $search_criteria = ''; … … 3459 3466 if($header->from[0]->personal != "") 3460 3467 $from = $header->from[0]->personal; 3461 $ret_msg = $this->decode_string($from) . "--" . $subject . "--". gmdate("d/m/Y",$header ->udate )."--". $this->size_msg($header->Size) ."--". $flag;3468 $ret_msg = $this->decode_string($from) . "--" . $subject . "--". gmdate("d/m/Y",$header ->udate + $this->functions->CalculateDateOffset())."--". $this->size_msg($header->Size) ."--". $flag; 3462 3469 return $ret_msg; 3463 3470 } … … 3706 3713 } 3707 3714 function get_header($msg_number){ 3708 3715 $header = @imap_headerinfo($this->mbox, imap_msgno($this->mbox, $msg_number), 80, 255); 3709 3716 if (!is_object($header)) 3710 3717 return false; 3711 // Prepare udate from mailDate (DateTime arrived with TZ) for fixing summertime problem.3712 $header->udate_original = $header->udate;3713 $pdate = date_parse($header->MailDate);3714 $header->udate += $pdate['zone']*(-60);3715 3718 3716 3719 if($header->Flagged != "F" && $_SESSION['phpgw_info']['user']['preferences']['expressoMail']['use_important_flag']) {
Note: See TracChangeset
for help on using the changeset viewer.