本文整理汇总了PHP中CRM_Case_BAO_Case::getNextScheduledActivity方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Case_BAO_Case::getNextScheduledActivity方法的具体用法?PHP CRM_Case_BAO_Case::getNextScheduledActivity怎么用?PHP CRM_Case_BAO_Case::getNextScheduledActivity使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Case_BAO_Case
的用法示例。
在下文中一共展示了CRM_Case_BAO_Case::getNextScheduledActivity方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: array
/**
* Returns all the rows in the given offset and rowCount.
*
* @param string $action
* The action being performed.
* @param int $offset
* The row number to start from.
* @param int $rowCount
* The number of rows to return.
* @param string $sort
* The sql string that describes the sort order.
* @param string $output
* What should the result set include (web/email/csv).
*
* @return int
* the total number of rows for this action
*/
public function &getRows($action, $offset, $rowCount, $sort, $output = NULL)
{
$result = $this->_query->searchQuery($offset, $rowCount, $sort, FALSE, FALSE, FALSE, FALSE, FALSE, $this->_additionalClause);
// process the result of the query
$rows = array();
//CRM-4418 check for view, edit, delete
$permissions = array(CRM_Core_Permission::VIEW);
if (CRM_Core_Permission::check('access all cases and activities') || CRM_Core_Permission::check('access my cases and activities')) {
$permissions[] = CRM_Core_Permission::EDIT;
}
if (CRM_Core_Permission::check('delete in CiviCase')) {
$permissions[] = CRM_Core_Permission::DELETE;
}
$mask = CRM_Core_Action::mask($permissions);
$caseStatus = CRM_Core_OptionGroup::values('case_status', FALSE, FALSE, FALSE, " AND v.name = 'Urgent' ");
$scheduledInfo = array();
while ($result->fetch()) {
$row = array();
// the columns we are interested in
foreach (self::$_properties as $property) {
if (isset($result->{$property})) {
$row[$property] = $result->{$property};
}
}
$isDeleted = FALSE;
if ($result->case_deleted) {
$isDeleted = TRUE;
$row['case_status_id'] = empty($row['case_status_id']) ? "" : $row['case_status_id'] . '<br />(deleted)';
}
$scheduledInfo['case_id'][] = $result->case_id;
$scheduledInfo['contact_id'][] = $result->contact_id;
$scheduledInfo['case_deleted'] = $result->case_deleted;
$row['checkbox'] = CRM_Core_Form::CB_PREFIX . $result->case_id;
$links = self::links($isDeleted, $this->_key);
$row['action'] = CRM_Core_Action::formLink($links['primaryActions'], $mask, array('id' => $result->case_id, 'cid' => $result->contact_id, 'cxt' => $this->_context), ts('more'), FALSE, 'case.selector.actions', 'Case', $result->case_id);
$row['moreActions'] = CRM_Core_Action::formLink(CRM_Utils_Array::value('moreActions', $links), $mask, array('id' => $result->case_id, 'cid' => $result->contact_id, 'cxt' => $this->_context), ts('more'), TRUE, 'case.selector.moreActions', 'Case', $result->case_id);
$row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type);
//adding case manager to case selector.CRM-4510.
$caseType = CRM_Case_BAO_Case::getCaseType($result->case_id, 'name');
$caseManagerContact = CRM_Case_BAO_Case::getCaseManagerContact($caseType, $result->case_id);
if (!empty($caseManagerContact)) {
$row['casemanager_id'] = CRM_Utils_Array::value('casemanager_id', $caseManagerContact);
$row['casemanager'] = CRM_Utils_Array::value('casemanager', $caseManagerContact);
}
if (isset($result->case_status_id) && array_key_exists($result->case_status_id, $caseStatus)) {
$row['class'] = "status-urgent";
} else {
$row['class'] = "status-normal";
}
$rows[$result->case_id] = $row;
}
//retrive the scheduled & recent Activity type and date for selector
if (!empty($scheduledInfo)) {
$schdeduledActivity = CRM_Case_BAO_Case::getNextScheduledActivity($scheduledInfo, 'upcoming');
foreach ($schdeduledActivity as $key => $value) {
$rows[$key]['case_scheduled_activity_date'] = $value['date'];
$rows[$key]['case_scheduled_activity_type'] = $value['type'];
}
$recentActivity = CRM_Case_BAO_Case::getNextScheduledActivity($scheduledInfo, 'recent');
foreach ($recentActivity as $key => $value) {
$rows[$key]['case_recent_activity_date'] = $value['date'];
$rows[$key]['case_recent_activity_type'] = $value['type'];
}
}
return $rows;
}
示例2: array
/**
* returns all the rows in the given offset and rowCount
*
* @param enum $action the action being performed
* @param int $offset the row number to start from
* @param int $rowCount the number of rows to return
* @param string $sort the sql string that describes the sort order
* @param enum $output what should the result set include (web/email/csv)
*
* @return int the total number of rows for this action
*/
function &getRows($action, $offset, $rowCount, $sort, $output = null)
{
$result = $this->_query->searchQuery($offset, $rowCount, $sort, false, false, false, false, false, $this->_additionalClause);
// process the result of the query
$rows = array();
//CRM-4418 check for view, edit, delete
$permissions = array(CRM_Core_Permission::VIEW);
if (CRM_Core_Permission::check('edit cases')) {
$permissions[] = CRM_Core_Permission::EDIT;
}
if (CRM_Core_Permission::check('delete in CiviCase')) {
$permissions[] = CRM_Core_Permission::DELETE;
}
$mask = CRM_Core_Action::mask($permissions);
require_once 'CRM/Core/OptionGroup.php';
$caseStatus = CRM_Core_OptionGroup::values('case_status', false, false, false, " AND v.name = 'Urgent' ");
require_once 'CRM/Case/BAO/Case.php';
$scheduledInfo = array();
while ($result->fetch()) {
$row = array();
// the columns we are interested in
foreach (self::$_properties as $property) {
if (isset($result->{$property})) {
$row[$property] = $result->{$property};
}
}
$isDeleted = false;
if ($result->case_deleted) {
$isDeleted = true;
$row['case_status_id'] = $row['case_status_id'] . '<br />(deleted)';
}
$scheduledInfo['case_id'][] = $result->case_id;
$scheduledInfo['contact_id'][] = $result->contact_id;
$scheduledInfo['case_deleted'] = $result->case_deleted;
$row['checkbox'] = CRM_Core_Form::CB_PREFIX . $result->case_id;
$row['action'] = CRM_Core_Action::formLink(self::links($isDeleted), $mask, array('id' => $result->case_id, 'cid' => $result->contact_id, 'cxt' => $this->_context));
require_once 'CRM/Contact/BAO/Contact/Utils.php';
$row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type);
//adding case manager to case selector.CRM-4510.
$caseType = CRM_Core_OptionGroup::getValue('case_type', $result->case_type_id, 'label', 'String', 'name');
$caseManagerContact = CRM_Case_BAO_Case::getCaseManagerContact($caseType, $result->case_id);
if (!empty($caseManagerContact)) {
$row['casemanager_id'] = CRM_Utils_Array::value('casemanager_id', $caseManagerContact);
$row['casemanager'] = CRM_Utils_Array::value('casemanager', $caseManagerContact);
}
if (in_array($result->case_status_id, $caseStatus)) {
$row['class'] = "status-urgent";
} else {
$row['class'] = "status-normal";
}
$rows[$result->case_id] = $row;
}
//retrive the scheduled & recent Activity type and date for selector
if (!empty($scheduledInfo)) {
$schdeduledActivity = CRM_Case_BAO_Case::getNextScheduledActivity($scheduledInfo, 'upcoming');
foreach ($schdeduledActivity as $key => $value) {
$rows[$key]['case_scheduled_activity_date'] = $value['date'];
$rows[$key]['case_scheduled_activity_type'] = $value['type'];
}
$recentActivity = CRM_Case_BAO_Case::getNextScheduledActivity($scheduledInfo, 'recent');
foreach ($recentActivity as $key => $value) {
$rows[$key]['case_recent_activity_date'] = $value['date'];
$rows[$key]['case_recent_activity_type'] = $value['type'];
}
}
return $rows;
}