Commit ffbd2b35 authored by Christian Wach's avatar Christian Wach
Browse files

Prevent undefined variable warnings

parent 551680bd
......@@ -159,7 +159,6 @@ class CRM_CallNextDashlet_Page_CallNextDashlet extends CRM_Core_Page {
// Do something if API call fails.
error_log(print_r([
'method' => __METHOD__,
'activities_me' => $activities_me,
'message' => $e->getMessage(),
], TRUE));
......@@ -187,7 +186,6 @@ class CRM_CallNextDashlet_Page_CallNextDashlet extends CRM_Core_Page {
// Do something if API call fails.
error_log(print_r([
'method' => __METHOD__,
'activities_none' => $activities_none,
'message' => $e->getMessage(),
], TRUE));
......@@ -198,15 +196,19 @@ class CRM_CallNextDashlet_Page_CallNextDashlet extends CRM_Core_Page {
// Merge the arrays.
$activities = [];
foreach ($activities_me['values'] as $activity) {
$activities[] = $activity;
if (!empty($activities_me['values'])) {
foreach ($activities_me['values'] as $activity) {
$activities[] = $activity;
}
}
foreach ($activities_none['values'] as $activity) {
if (empty($activity['assignee_contact_id'])) {
foreach ($activity['target_contact_id'] as $contactID) {
if (self::can_view_contact($contactID)) {
$activities[] = $activity;
break;
if (!empty($activities_none['values'])) {
foreach ($activities_none['values'] as $activity) {
if (empty($activity['assignee_contact_id'])) {
foreach ($activity['target_contact_id'] as $contactID) {
if (self::can_view_contact($contactID)) {
$activities[] = $activity;
break;
}
}
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment