360
* Method used to get the details of a given issue.
363
* @param integer $issue_id The issue ID
364
* @return array The issue details
366
function getIssueDetails($issue_id)
371
iss_customer_contract_id,
374
iss_duplicated_iss_id,
387
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "issue,
388
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project,
389
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "user
392
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_priority
396
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_severity
400
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_category
404
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "project_release
408
" . APP_DEFAULT_DB . "." . APP_TABLE_PREFIX . "status
412
iss_id=" . Misc::escapeInteger($issue_id) . " AND
413
iss_prj_id=prj_id AND
415
$res = DB_Helper::getInstance()->getRow($stmt, DB_FETCHMODE_ASSOC);
416
if (PEAR::isError($res)) {
417
Error_Handler::logError(array($res->getMessage(), $res->getDebugInfo()), __FILE__, __LINE__);
420
$res['assigned_users'] = implode(", ", Issue::getAssignedUsers($issue_id));
421
// get customer information, if any
422
if ((!empty($res['iss_customer_id'])) && (Customer::hasCustomerIntegration($res['prj_id']))) {
423
$res['customer_info'] = Customer::getDetails($res['prj_id'], $res['iss_customer_id'], false, $res['iss_customer_contract_id']);
431
360
* Method used to get the details of a given note and issue.
701
630
// get additional email addresses to notify
702
631
$emails = array_merge($emails, Workflow::getAdditionalEmailAddresses($prj_id, $issue_id, 'issue_updated', array('old' => $old, 'new' => $new)));
704
$data = self::getIssueDetails($issue_id);
633
$data = Issue::getDetails($issue_id);
705
634
$data['diffs'] = implode("\n", $diffs);
706
635
$data['updated_by'] = User::getFullName(Auth::getUserID());
707
636
self::notifySubscribers($issue_id, $emails, 'updated', $data, ev_gettext('Updated'), FALSE);
817
746
// prevent the primary customer contact from receiving two emails about the issue being closed
818
747
if ($type == 'closed') {
819
if (Customer::hasCustomerIntegration($prj_id)) {
748
if (CRM::hasCustomerIntegration($prj_id)) {
749
$crm = CRM::getInstance($prj_id);
821
751
iss_customer_contact_id
825
755
iss_id=" . Misc::escapeInteger($issue_id);
826
756
$customer_contact_id = DB_Helper::getInstance()->getOne($stmt);
827
757
if (!empty($customer_contact_id)) {
828
list($contact_email,,) = Customer::getContactLoginDetails($prj_id, $customer_contact_id);
759
$contact = $crm->getContact($customer_contact_id);
760
$contact_email = $contact->getEmail();
761
} catch (CRMException $e) {
829
764
for ($i = 0; $i < count($emails); $i++) {
830
765
$email = Mail_Helper::getEmailAddress($emails[$i]);
831
766
if ($email == $contact_email) {
1159
1094
* @param string $sender The sender of the email message (and the recipient of this notification)
1160
1095
* @param string $date The arrival date of the email message
1161
1096
* @param string $subject The subject line of the email message
1162
* @param string $additional_recipient The user who should recieve this email who is not the sender of the original email.
1097
* @param bool|string $additional_recipient The user who should receive this email who is not the sender of the original email.
1165
1100
function notifyAutoCreatedIssue($prj_id, $issue_id, $sender, $date, $subject, $additional_recipient = false)
1167
if (Customer::hasCustomerIntegration($prj_id)) {
1168
Customer::notifyAutoCreatedIssue($prj_id, $issue_id, $sender, $date, $subject);
1102
if (CRM::hasCustomerIntegration($prj_id)) {
1103
$crm = CRM::getInstance($prj_id);
1104
$crm->notifyAutoCreatedIssue($issue_id, $sender, $date, $subject);
1170
1106
if ($additional_recipient != false) {
1171
1107
$recipient = $additional_recipient;
1241
1177
* @param integer $prj_id The project ID
1242
1178
* @param integer $issue_id The issue ID
1243
1179
* @param array $sup_ids The email IDs
1244
* @param integer $customer_id The customer ID
1180
* @param bool|int $customer_id The customer ID
1245
1181
* @return array The list of recipient emails
1247
1183
function notifyEmailConvertedIntoIssue($prj_id, $issue_id, $sup_ids, $customer_id = FALSE)
1249
if (Customer::hasCustomerIntegration($prj_id)) {
1250
return Customer::notifyEmailConvertedIntoIssue($prj_id, $issue_id, $sup_ids, $customer_id);
1185
if (CRM::hasCustomerIntegration($prj_id)) {
1186
$crm = CRM::getInstance($prj_id);
1187
return $crm->notifyEmailConvertedIntoIssue($issue_id, $sup_ids, $customer_id);
1252
1189
// build the list of recipients
1253
1190
$recipients = array();