From 5b6db2c7c7e1755858425468ff66ed6778c09e1a Mon Sep 17 00:00:00 2001 From: Tyrell Cook Date: Wed, 30 Apr 2014 19:08:35 -0400 Subject: [PATCH] CRM-14466 found better way to intialize variables to avoid php notice --- CRM/Activity/Page/AJAX.php | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/CRM/Activity/Page/AJAX.php b/CRM/Activity/Page/AJAX.php index 0174074371..df58c97c96 100644 --- a/CRM/Activity/Page/AJAX.php +++ b/CRM/Activity/Page/AJAX.php @@ -81,7 +81,9 @@ class CRM_Activity_Page_AJAX { $rowCount = isset($_REQUEST['iDisplayLength']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayLength'], 'Integer') : 25; $sort = isset($_REQUEST['iSortCol_0']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_REQUEST['iSortCol_0'], 'Integer'), $sortMapper) : NULL; $sortOrder = isset($_REQUEST['sSortDir_0']) ? CRM_Utils_Type::escape($_REQUEST['sSortDir_0'], 'String') : 'asc'; + $params = $_POST; + //CRM-14466 initialize variable to avoid php notice $sortSQL = ""; if ($sort && $sortOrder) { $sortSQL = $sort .' '.$sortOrder; @@ -209,7 +211,7 @@ class CRM_Activity_Page_AJAX { // move/transform caseRoles array data to caseRelationships // for sorting and display - // + // CRM-14466 added cid to the non-client array to avoid php notice foreach($caseRoles as $id => $value) { if ($id != "client") { $rel = array(); @@ -218,7 +220,7 @@ class CRM_Activity_Page_AJAX { $rel['name'] = '(not assigned)'; $rel['phone'] = ''; $rel['email'] = ''; - $rel['cid'] = ''; + $rel['cid'] = ''; $rel['source'] = 'caseRoles'; $caseRelationships[] = $rel; } else { @@ -246,9 +248,7 @@ class CRM_Activity_Page_AJAX { //limit rows display $allCaseRelationships = $caseRelationships; $caseRelationships = array_slice($allCaseRelationships, $offset, $rowCount, TRUE); - echo json_encode($caseRelationships); - echo "

end

"; - CRM_Utils_System::civiExit(); + // set user name, email and edit columns links // idx will count number of current row / needed by edit links $idx = 1; @@ -256,11 +256,10 @@ class CRM_Activity_Page_AJAX { // Get rid of the "
(Case Manager)" from label list($typeLabel) = explode('<', $row['relation']); // view user links - //CRM-14466 use array_key_exists to make sure $row[cid] exists if ($row['cid']) { $row['name'] = ''.$row['name'].''; - } + } // email column links/icon if ($row['email']) { $row['email'] = ''; -- 2.25.1