~eventum-developers/eventum/trunk

« back to all changes in this revision

Viewing changes to lib/eventum/class.reminder.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:
918
918
        if ($requirement['type'] == 'issue') {
919
919
            $stmt .= ' AND iss_id IN (' . implode(', ', $requirement['values']) . ")\n";
920
920
        } else {
921
 
            if (Customer::hasCustomerIntegration($reminder['rem_prj_id'])) {
 
921
            if (CRM::hasCustomerIntegration($reminder['rem_prj_id'])) {
 
922
                $crm = CRM::getInstance($reminder['rem_prj_id']);
922
923
                if ($requirement['type'] == 'customer') {
923
924
                    $stmt .= ' AND iss_customer_id IN (' . implode(', ', $requirement['values']) . ")\n";
924
925
                } elseif ($requirement['type'] == 'support_level') {
925
 
                    if (Customer::doesBackendUseSupportLevels($reminder['rem_prj_id'])) {
926
 
                        $customer_ids = Customer::getListBySupportLevel($reminder['rem_prj_id'], $requirement['values'], CUSTOMER_EXCLUDE_EXPIRED);
927
 
                        // break the query on purpose if no customers could be found
928
 
                        if (count($customer_ids) == 0) {
929
 
                            $customer_ids = array(-1);
930
 
                        }
931
 
                        $stmt .= ' AND iss_customer_id IN (' . implode(', ', $customer_ids) . ")\n";
 
926
                    $customer_ids = $crm->getCustomerIDsBySupportLevel($requirement['values'], array(CRM_EXCLUDE_EXPIRED));
 
927
                    // break the query on purpose if no customers could be found
 
928
                    if (count($customer_ids) == 0) {
 
929
                        $customer_ids = array(-1);
932
930
                    }
 
931
                    $stmt .= ' AND iss_customer_id IN (' . implode(', ', $customer_ids) . ")\n";
933
932
                }
934
933
            }
935
934
        }