~eventum-developers/eventum/trunk

« back to all changes in this revision

Viewing changes to lib/eventum/class.mail_helper.php

  • Committer: Bryan Alsdorf
  • Date: 2013-08-23 03:50:34 UTC
  • mto: (4033.1.168 eventum-skysql)
  • mto: This revision was merged to the branch mainline in revision 4660.
  • Revision ID: bryan@montyprogram.com-20130823035034-7f5r3pt1xg0xnnhk
Initial commit of CRM migration

Show diffs side-by-side

added added

removed removed

Lines of Context:
762
762
                }
763
763
            }
764
764
 
765
 
            if (Customer::hasCustomerIntegration($prj_id)) {
766
 
                if (empty($support_levels)) {
767
 
                    $support_levels = Customer::getSupportLevelAssocList($prj_id);
768
 
                }
769
 
                $customer_id = Issue::getCustomerID($issue_id);
770
 
                $contract_id = Issue::getContractID($issue_id);
771
 
                if (!empty($customer_id)) {
772
 
                    $customer_details = Customer::getDetails($prj_id, $customer_id, false, $contract_id);
773
 
                    $new_headers['X-Eventum-Customer'] = $customer_details['customer_name'];
774
 
                }
775
 
                if (count($support_levels) > 0) {
776
 
                    $new_headers['X-Eventum-Level'] = @$support_levels[Customer::getSupportLevelID($prj_id, $customer_id, $contract_id)];
777
 
                }
 
765
            if (CRM::hasCustomerIntegration($prj_id)) {
 
766
                $crm = CRM::getInstance($prj_id);
 
767
                try {
 
768
                    $customer = $crm->getCustomer(Issue::getCustomerID($issue_id));
 
769
                    $new_headers['X-Eventum-Customer'] = $customer->getName();
 
770
                } catch (CustomerNotFoundException $e) { }
 
771
                try {
 
772
                    $contract = $crm->getContract(Issue::getContractID($issue_id));
 
773
                    $new_headers['X-Eventum-Level'] = $contract->getSupportLevel()->getName();
 
774
                } catch (ContractNotFoundException $e) {}
778
775
            }
779
776
 
780
777
            // add assignee header