コード例 #1
0
 private function processResult(&$data, $date_field, $issue_field)
 {
     $timezone = Date_Helper::getPreferredTimezone($this->usr_id);
     foreach ($data as &$res) {
         if (!Issue::canAccess($res[$issue_field], $this->usr_id)) {
             continue;
         }
         $res['customer'] = null;
         if ($this->crm) {
             try {
                 $customer = $this->crm->getCustomer(Issue::getCustomerID($res[$issue_field]));
                 $res['customer'] = $customer->getName();
             } catch (CRMException $e) {
             }
         }
         $res['date'] = Date_Helper::getFormattedDate($res[$date_field], $timezone);
         // need to decode From:, To: mail headers
         if (isset($res['sup_from'])) {
             $res['sup_from'] = Mime_Helper::fixEncoding($res['sup_from']);
         }
         if (isset($res['sup_to'])) {
             $res['sup_to'] = Mime_Helper::fixEncoding($res['sup_to']);
         }
     }
 }