static function add(&$params, $ids = array()) {
$id = CRM_Utils_Array::value('mailing_id', $ids, CRM_Utils_Array::value('id', $params));
-
if ($id) {
CRM_Utils_Hook::pre('edit', 'Mailing', $id, $params);
}
// Populate the recipients.
$mailing->getRecipients($job->id, $mailing->id, NULL, NULL, TRUE, FALSE);
}
- //print_r($params);
- //exit;
+
return $mailing;
}
public static function &getRows($mailing_id, $job_id = NULL,
$is_distinct = FALSE, $offset = NULL, $rowCount = NULL, $sort = NULL, $contact_id= NULL
) {
- CRM_Core_Error::debug_var('3',$offset);
- CRM_Core_Error::debug_var('4',$rowCount);
-
$dao = new CRM_Core_Dao();
$open = self::getTableName();
$orderBy = "sort_name ASC, {$open}.time_stamp DESC";
if ($sort) {
if (is_string($sort)) {
-
$sort = CRM_Utils_Type::escape($sort, 'String');
- CRM_Core_Error::debug_var('2',$sort);
-
$orderBy = $sort;
}
else {
//Added "||$rowCount" to avoid displaying all records on first page
$query .= ' LIMIT ' . CRM_Utils_Type::escape($offset, 'Integer') . ', ' . CRM_Utils_Type::escape($rowCount, 'Integer');
}
- CRM_Core_Error::debug_var('1',$query);
$dao->query($query);
$results = array();