$orderBy = " ORDER BY $sortBy ";
}
+ $page = CRM_Utils_Array::value('page', $params);
+ $rp = CRM_Utils_Array::value('rp', $params);
+
if (!$page) {
$page = 1;
}
$limit = " LIMIT $start, $rp";
$query = $select . $from . $where . $groupBy . $orderBy . $limit;
- $params = array(1 => array($caseID, 'Integer'));
+ $queryParams = array(1 => array($caseID, 'Integer'));
- $dao = CRM_Core_DAO::executeQuery($query, $params);
-
- $page = CRM_Utils_Array::value('page', $params);
- $rp = CRM_Utils_Array::value('rp', $params);
+ $dao = CRM_Core_DAO::executeQuery($query, $queryParams);
$activityTypes = CRM_Case_PseudoConstant::caseActivityType(FALSE, TRUE);
$activityStatuses = CRM_Core_PseudoConstant::activityStatus();
}
$caseActivities = array();
+ $caseCount = 0;
while ($dao->fetch()) {
+ $caseCount++;
$caseActivity = array();
$caseActivityId = $dao->id;
$url = "";
$css = 'class="action-item crm-hover-button"';
if ($allowView) {
- $url = CRM_Utils_System::url('civicrm/case/activity/view', array('cid' => $contactID, 'aid' => $caseActivityId));
- //$subject = '<a class="crm-popup medium-popup" href="' . $url . '" title="' . $viewTitle . '">' . $subject . '</a>';
+ $viewUrl = CRM_Utils_System::url('civicrm/case/activity/view', array('cid' => $contactID, 'aid' => $caseActivityId));
+ $url = '<a ' . str_replace('action-item', 'action-item medium-pop-up', $css) . 'href="' . $viewUrl . '" title="' . $viewTitle . '">' . ts('View') . '</a>';
}
$additionalUrl = "&id={$caseActivityId}";
if (!$dao->deleted) {
if (!in_array($dao->type, $emailActivityTypeIDs)) {
//hide Edit link if activity type is NOT editable (special case activities).CRM-5871
if ($allowEdit) {
- $url = '<a ' . $css . ' href="' . $editUrl . $additionalUrl . '">' . ts('Edit') . '</a> ';
+ $url .= '<a ' . $css . ' href="' . $editUrl . $additionalUrl . '">' . ts('Edit') . '</a> ';
}
}
if ($allowDelete) {
$caseActivitiesDT = array();
$caseActivitiesDT['data'] = $caseActivities;
- $caseActivitiesDT['recordsTotal'] = $params['total'];
- $caseActivitiesDT['recordsFiltered'] = $params['total'];
+ $caseActivitiesDT['recordsTotal'] = $caseCount;
+ $caseActivitiesDT['recordsFiltered'] = $caseCount;
return $caseActivitiesDT;
}
d.reporter_id = $("select#reporter_id_" + caseId).val(),
d.activity_type_id = $("select#activity_type_filter_id_" + caseId).val(),
d.activity_date_low = $("#activity_date_low_" + caseId).val(),
- d.activity_date_high = $("#activity_date_high_" + caseId).val()
+ d.activity_date_high = $("#activity_date_high_" + caseId).val(),
d.activity_deleted = ($("#activity_deleted_1").prop('checked')) ? 1 : 0;
}
}
"jQueryUI": true,
"language": {ldelim}
"emptyTable": "{ts escape='js'}None found.{/ts}",
- "info": "{ts escape='js' '1=_START_ 2=_END_ 3=_TOTAL_}Showing %1 to %2 of %3 entries{/ts}",
+ "info": "{ts escape='js' 1=_START_ 2=_END_ 3=_TOTAL_}Showing %1 to %2 of %3 entries{/ts}",
"infoEmpty": "{ts escape='js'}Showing 0 to 0 of 0 entries{/ts}",
"infoFiltered": "{ts escape='js' 1=_MAX_}(filtered from %1 total entries){/ts}",
"infoPostFix": "",