本文整理汇总了PHP中CRM_Mailing_BAO_Mailing::getContactMailingSelector方法的典型用法代码示例。如果您正苦于以下问题:PHP CRM_Mailing_BAO_Mailing::getContactMailingSelector方法的具体用法?PHP CRM_Mailing_BAO_Mailing::getContactMailingSelector怎么用?PHP CRM_Mailing_BAO_Mailing::getContactMailingSelector使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CRM_Mailing_BAO_Mailing
的用法示例。
在下文中一共展示了CRM_Mailing_BAO_Mailing::getContactMailingSelector方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getContactMailings
/**
* Function to retrieve contact mailings
*/
public static function getContactMailings()
{
$contactID = CRM_Utils_Type::escape($_GET['contact_id'], 'Integer');
$sortMapper = array(0 => 'subject', 1 => 'creator_name', 2 => '', 3 => 'start_date', 4 => '', 5 => 'links');
$sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
$offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
$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;
if ($sort && $sortOrder) {
$params['sortBy'] = $sort . ' ' . $sortOrder;
}
$params['page'] = $offset / $rowCount + 1;
$params['rp'] = $rowCount;
$params['contact_id'] = $contactID;
$params['context'] = $context;
// get the contact mailings
$mailings = CRM_Mailing_BAO_Mailing::getContactMailingSelector($params);
$iFilteredTotal = $iTotal = $params['total'];
$selectorElements = array('subject', 'mailing_creator', 'recipients', 'start_date', 'openstats', 'links');
header('Content-Type: application/json');
echo CRM_Utils_JSON::encodeDataTableSelector($mailings, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
CRM_Utils_System::civiExit();
}
示例2: getContactMailings
/**
* Retrieve contact mailings.
*/
public static function getContactMailings()
{
$params = CRM_Core_Page_AJAX::defaultSortAndPagerParams();
$params += CRM_Core_Page_AJAX::validateParams(array('contact_id' => 'Integer'));
// get the contact mailings
$mailings = CRM_Mailing_BAO_Mailing::getContactMailingSelector($params);
CRM_Utils_JSON::output($mailings);
}
示例3: getContactMailings
/**
* Retrieve contact mailings.
*/
public static function getContactMailings()
{
$contactID = CRM_Utils_Type::escape($_GET['contact_id'], 'Integer');
$sortMapper = array();
foreach ($_GET['columns'] as $key => $value) {
$sortMapper[$key] = $value['data'];
}
$offset = isset($_GET['start']) ? CRM_Utils_Type::escape($_GET['start'], 'Integer') : 0;
$rowCount = isset($_GET['length']) ? CRM_Utils_Type::escape($_GET['length'], 'Integer') : 25;
$sort = isset($_GET['order'][0]['column']) ? CRM_Utils_Array::value(CRM_Utils_Type::escape($_GET['order'][0]['column'], 'Integer'), $sortMapper) : NULL;
$sortOrder = isset($_GET['order'][0]['dir']) ? CRM_Utils_Type::escape($_GET['order'][0]['dir'], 'String') : 'asc';
$params = $_GET;
if ($sort && $sortOrder) {
$params['sortBy'] = $sort . ' ' . $sortOrder;
}
$params['page'] = $offset / $rowCount + 1;
$params['rp'] = $rowCount;
$params['contact_id'] = $contactID;
$params['context'] = $context;
// get the contact mailings
$mailings = CRM_Mailing_BAO_Mailing::getContactMailingSelector($params);
CRM_Utils_JSON::output($mailings);
}