// INSERT'ing INTO a table with a primary id so that last record
// over writes any previous record.
switch($email_selection_method) {
- case 'location-exclude':
- $location_filter = "($email.location_type_id != $location_type_id)";
- // If there is more than one email that doesn't match the location,
- // prefer the one marked is_bulkmail, followed by is_primary.
- $order_by = "ORDER BY $email.is_bulkmail, $email.is_primary";
- break;
- case 'location-only':
- $location_filter = "($email.location_type_id = $location_type_id)";
- // If there is more than one email of the desired location, prefer
- // the one marked is_bulkmail, followed by is_primary.
- $order_by = "ORDER BY $email.is_bulkmail, $email.is_primary";
- break;
- case 'location-prefer':
- $location_filter = "($email.is_bulkmail = 1 OR $email.is_primary = 1 OR $email.location_type_id = $location_type_id)";
-
- // ORDER BY is more complicated because we have to set an arbitrary
- // order that prefers the location that we want. We do that using
- // the FIELD function. For more info, see:
- // https://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_field
- // We assign the location type we want the value "1" by putting it
- // in the first position after we name the field. All other location
- // types are left out, so they will be assigned the value 0. That
- // means, they will all be equally tied for first place, with our
- // location being last.
- $order_by = "ORDER BY FIELD($email.location_type_id, $location_type_id), $email.is_bulkmail, $email.is_primary";
- break;
- case 'automatic':
- // fall through to default
- default:
- $location_filter = "($email.is_bulkmail = 1 OR $email.is_primary = 1)";
- $order_by = "ORDER BY $email.is_bulkmail";
+ case 'location-exclude':
+ $location_filter = "($email.location_type_id != $location_type_id)";
+ // If there is more than one email that doesn't match the location,
+ // prefer the one marked is_bulkmail, followed by is_primary.
+ $order_by = "ORDER BY $email.is_bulkmail, $email.is_primary";
+ break;
+
+ case 'location-only':
+ $location_filter = "($email.location_type_id = $location_type_id)";
+ // If there is more than one email of the desired location, prefer
+ // the one marked is_bulkmail, followed by is_primary.
+ $order_by = "ORDER BY $email.is_bulkmail, $email.is_primary";
+ break;
+
+ case 'location-prefer':
+ $location_filter = "($email.is_bulkmail = 1 OR $email.is_primary = 1 OR $email.location_type_id = $location_type_id)";
+
+ // ORDER BY is more complicated because we have to set an arbitrary
+ // order that prefers the location that we want. We do that using
+ // the FIELD function. For more info, see:
+ // https://dev.mysql.com/doc/refman/5.5/en/string-functions.html#function_field
+ // We assign the location type we want the value "1" by putting it
+ // in the first position after we name the field. All other location
+ // types are left out, so they will be assigned the value 0. That
+ // means, they will all be equally tied for first place, with our
+ // location being last.
+ $order_by = "ORDER BY FIELD($email.location_type_id, $location_type_id), $email.is_bulkmail, $email.is_primary";
+ break;
+
+ case 'automatic':
+ // fall through to default
+ default:
+ $location_filter = "($email.is_bulkmail = 1 OR $email.is_primary = 1)";
+ $order_by = "ORDER BY $email.is_bulkmail";
}
/* Create a temp table for contact exclusion */
* returns an array that denotes the type of token that we are dealing with
* we use the type later on when we are doing a token replcement lookup
*
- * @param string $token The token for which we will be doing adata lookup
+ * @param string $token The token for which we will be doing adata lookup
*
- * @return array $funcStruct An array that holds the token itself and the type.
+ * @return array $funcStruct An array that holds the token itself and the type.
* the type will tell us which function to use for the data lookup
* if we need to do a lookup at all
*/
* structures to represent the order in which tokens were found from left to right, top to bottom.
*
*
- * @param str $prop
+ * @param string $propName of the property that holds the text that we want to scan for tokens (html, text).
* Name of the property that holds the text that we want to scan for tokens (html, text).
*
* @return void
*/
public function getTestRecipients($testParams) {
if (array_key_exists($testParams['test_group'], CRM_Core_PseudoConstant::group())) {
- $contacts = civicrm_api('contact','get', array(
- 'version' =>3,
+ $contacts = civicrm_api('contact', 'get', array(
+ 'version' => 3,
'group' => $testParams['test_group'],
'return' => 'id',
'options' => array('limit' => 100000000000,
$values[] = array('entity_id' => $entityId);
}
civicrm_api3('mailing_group', 'replace', array(
- 'mailing_id' => $mailingId,
+ 'mailing_id' => $mailingId,
'group_type' => $type,
'entity_table' => ($entity == 'groups') ? CRM_Contact_BAO_Group::getTableName() : CRM_Mailing_BAO_Mailing::getTableName(),
'values' => $values,
'spool' => CRM_Mailing_BAO_Spool::getTableName(),
);
-
$report = array();
$additionalWhereClause = " AND ";
if (!$isSMS) {
),
);
-
$actionLinks = array(CRM_Core_Action::VIEW => array('name' => ts('Report')));
if (CRM_Core_Permission::check('view all contacts')) {
$actionLinks[CRM_Core_Action::ADVANCED] =
$form->addWysiwyg('html_message',
ts('HTML Format'),
array(
- 'cols' => '80', 'rows' => '8',
+ 'cols' => '80',
+ 'rows' => '8',
'onkeyup' => "return verify(this)",
)
);
}
$form->add('textarea', $id, $label,
array(
- 'cols' => '80', 'rows' => '8',
+ 'cols' => '80',
+ 'rows' => '8',
'onkeyup' => "return verify(this, '{$prefix}')",
)
);
);
$form->add('text', 'saveTemplateName', ts('Template Title'));
-
$form->addWysiwyg('html_message',
ts('Your Letter'),
array(
- 'cols' => '80', 'rows' => '8',
+ 'cols' => '80',
+ 'rows' => '8',
'onkeyup' => "return verify(this)",
)
);
$contactMailings[$mailingId]['links'] = CRM_Core_Action::formLink(
$actionLinks,
- null,
+ NULL,
array(
'mid' => $values['mailing_id'],
'cid' => $params['contact_id'],
$job->query($query);
}
-
while ($job->fetch()) {
// still use job level lock for each child job
$lockName = "civimail.job.{$job->id}";
$currentTime = date('YmdHis');
$mailingACL = CRM_Mailing_BAO_Mailing::mailingACL('m');
-
$workflowClause = CRM_Mailing_BAO_MailingJob::workflowClause();
$domainID = CRM_Core_Config::domainID();
ORDER BY j.scheduled_date,
j.start_date";
-
$job->query($query);
-
// For each of the "Parent Jobs" we find, we split them into
// X Number of child jobs
while ($job->fetch()) {
$jobTable = CRM_Mailing_DAO_MailingJob::getTableName();
-
$dao = new CRM_Core_DAO();
$sql = "
(`mailing_id`, `scheduled_date`, `status`, `job_type`, `parent_id`, `job_offset`, `job_limit`)
VALUES (%1, %2, %3, %4, %5, %6, %7)
";
- $params = array(1 => array($this->mailing_id, 'Integer'),
+ $params = array(
+ 1 => array($this->mailing_id, 'Integer'),
2 => array($this->scheduled_date, 'String'),
3 => array('Scheduled', 'String'),
4 => array('child', 'String'),
* CRM-15702: Sending bulk sms to contacts without e-mail addres fails.
* Solution is to skip checking for on hold
*/
- $skipOnHold = true; //do include a statement to check wether e-mail address is on hold
+ $skipOnHold = TRUE; //do include a statement to check wether e-mail address is on hold
if ($mailing->sms_provider_id) {
- $skipOnHold = false; //do not include a statement to check wether e-mail address is on hold
+ $skipOnHold = FALSE; //do not include a statement to check wether e-mail address is on hold
}
foreach ($fields as $key => $field) {
AND job_type = 'child'
AND status IN ( 'Scheduled', 'Running', 'Paused' )
";
- $params = array(1 => array($job->id, 'Integer'),
+ $params = array(
+ 1 => array($job->id, 'Integer'),
2 => array(date('YmdHis'), 'Timestamp'),
);
CRM_Core_DAO::executeQuery($sql, $params);
* @param $row
* @param int $id
*/
- public static function searchAction(&$row, $id) {}
+ public static function searchAction(&$row, $id) {
+ }
/**
* @param $tables
* containing a descriptive error message on
* failure.
*/
- public function send($recipient, $headers, $body, $job_id = null) {
+ public function send($recipient, $headers, $body, $job_id = NULL) {
$headerStr = array();
foreach ($headers as $name => $value) {
$headerStr[] = "$name: $value";
'email' => $dao->email,
// FIXME: translate this
'type' => (empty($dao->bounce_type)
- ? ts('Unknown') : $dao->bounce_type
+ ? ts('Unknown') : $dao->bounce_type
),
'reason' => $dao->reason,
'date' => CRM_Utils_Date::customFormat($dao->date),
$text = CRM_Utils_Token::replaceWelcomeTokens($text, $group->title, FALSE);
$mailParams = array(
- 'groupName' => 'Mailing Event ' . $component->component_type, 'subject' => $component->subject,
+ 'groupName' => 'Mailing Event ' . $component->component_type,
+ 'subject' => $component->subject,
'from' => "\"$domainEmailName\" <do-not-reply@$emailDomain>",
'toEmail' => $email,
'toName' => $display_name,
* @static
*/
public static function &getRows($mailing_id, $job_id = NULL,
- $is_distinct = FALSE, $offset = NULL, $rowCount = NULL, $sort = NULL, $contact_id= NULL
+ $is_distinct = FALSE, $offset = NULL, $rowCount = NULL, $sort = NULL, $contact_id = NULL
) {
$dao = new CRM_Core_Dao();
/* Make a list of groups and a list of prior mailings that received
* this mailing */
-
$groups = array();
$mailings = array();
return $success;
}
-
/* Get the primary email id from the contact to use as a hash input */
$dao = new CRM_Core_DAO();
FROM civicrm_email
WHERE civicrm_email.email = %1
AND civicrm_email.contact_id = %2";
- $params = array(1 => array($email, 'String'),
+ $params = array(
+ 1 => array($email, 'String'),
2 => array($contact_id, 'Integer'),
);
$dao = CRM_Core_DAO::executeQuery($query, $params);
/* To find the url, we also join on the queue and job tables. This
* prevents foreign key violations. */
-
$job = CRM_Mailing_BAO_MailingJob::getTableName();
$eq = CRM_Mailing_Event_BAO_Queue::getTableName();
$turl = CRM_Mailing_BAO_TrackableURL::getTableName();
hold_date = %1
WHERE email = %2
";
- $sqlParams = array(1 => array($now, 'Timestamp'),
+ $sqlParams = array(
+ 1 => array($now, 'Timestamp'),
2 => array($email->email, 'String'),
);
CRM_Core_DAO::executeQuery($sql, $sqlParams);
/* Make a list of groups and a list of prior mailings that received
* this mailing */
-
$groups = array();
$base_groups = array();
$mailings = array();
$this->redirectToListing();
}
-
// when user come from search context.
$this->_searchBasedMailing = CRM_Contact_Form_Search::isSearchContext($this->get('context'));
$this->addRadio('approval_status_id', ts('Approval Status'), $mailApprovalStatus, TRUE, NULL, TRUE);
$buttons = array(
- array('type' => 'next',
+ array(
+ 'type' => 'next',
'name' => ts('Save'),
'spacing' => ' ',
'isDefault' => TRUE,
CRM_Mailing_BAO_Mailing::create($params, $ids);
-
//when user perform mailing from search context
//redirect it to search result CRM-3711
$ssID = $this->get('ssID');
if ($params['body_' . $type]) {
if (preg_match('/' . preg_quote('{' . $token . '}') . '/', $params['body_' . $type])) {
$dataErrors[] = '<li>' . ts('This message is having a invalid token - %1: %2', array(
- 1 => $token, 2 => $desc)) . '</li>';
+ 1 => $token,
+ 2 => $desc)) . '</li>';
}
}
}
$dao = new CRM_Mailing_DAO_MailingGroup();
$mailingGroups = array(
- 'civicrm_group' => array( ),
- 'civicrm_mailing' => array( )
+ 'civicrm_group' => array(),
+ 'civicrm_mailing' => array()
);
$dao->mailing_id = $this->_mailingID;
$dao->find();
$this->addFormRule(array('CRM_Mailing_Form_Group', 'formRule'));
$buttons = array(
- array('type' => 'next',
+ array(
+ 'type' => 'next',
'name' => ts('Next >>'),
'spacing' => ' ',
'isDefault' => TRUE,
else {
//get the hidden smart group id.
$ssId = $this->get('ssID');
- $hiddenSmartParams = array('group_type' => array('2' => 1),
+ $hiddenSmartParams = array(
+ 'group_type' => array('2' => 1),
'form_values' => $this->get('formValues'),
'saved_search_id' => $ssId,
'search_custom_id' => $this->get('customSearchID'),
}
}
-
$qf_Group_submit = $this->controller->exportValue($this->_name, '_qf_Group_submit');
$this->set('name', $params['name']);
//when user come from search context.
$ssID = $this->get('ssID');
- $this->assign('ssid',$ssID);
+ $this->assign('ssid', $ssID);
$this->_searchBasedMailing = CRM_Contact_Form_Search::isSearchContext($this->get('context'));
if(CRM_Contact_Form_Search::isSearchContext($this->get('context')) && !$ssID){
$params = array();
else {
$count = $this->get('count');
}
- $this->assign('count', $count);
+ $this->assign('count', $count);
$defaults['now'] = 1;
return $defaults;
}
);
CRM_Utils_System::setTitle($title);
$buttons = array(
- array('type' => 'next',
+ array(
+ 'type' => 'next',
'name' => ts('Submit Mailing'),
'spacing' => ' ',
'isDefault' => TRUE,
//search base mailing, we should handle it when we fix CRM-3876
if ($this->_searchBasedMailing) {
$buttons = array(
- array('type' => 'back',
+ array(
+ 'type' => 'back',
'name' => ts('<< Previous'),
),
array(
}
else {
$buttons = array(
- array('type' => 'back',
+ array(
+ 'type' => 'back',
'name' => ts('<< Previous'),
),
array(
$params[$parameter] = $this->controller->exportValue($this->_name, $parameter);
}
-
// Previously, we checked if $mailing->is_template, and did *not*
// schedule if it was set. Discussed with Lobo, removed that check
// as it appeared to prevent mails being scheduled if they were
public function preProcess() {
//when user come from search context.
$ssID = $this->get('ssID');
- $this->assign('ssid',$ssID);
+ $this->assign('ssid', $ssID);
$this->_searchBasedMailing = CRM_Contact_Form_Search::isSearchContext($this->get('context'));
if(CRM_Contact_Form_Search::isSearchContext($this->get('context')) && !$ssID){
- $params = array();
- $result = CRM_Core_BAO_PrevNextCache::getSelectedContacts();
- $this->assign("value", $result);
+ $params = array();
+ $result = CRM_Core_BAO_PrevNextCache::getSelectedContacts();
+ $this->assign("value", $result);
}
}
);
$buttons = array(
- array('type' => 'back',
+ array(
+ 'type' => 'back',
'name' => ts('<< Previous'),
),
array(
$this->controller->setDestination(NULL, TRUE);
}
-
if ($this->_groupID) {
$groupTypeCondition = CRM_Contact_BAO_Group::groupTypeCondition('Mailing');
}
else {
$queryParams = $form->get('queryParams');
- $sortOrder = null;
+ $sortOrder = NULL;
if ( $form->get( CRM_Utils_Sort::SORT_ORDER ) ) {
$sortOrder = $form->get( CRM_Utils_Sort::SORT_ORDER );
}
}
if (!empty($ids)) {
- $form->_componentClause = ' civicrm_mailing_recipients.id IN ( ' . implode(',', $ids) . ' ) ';
+ $form->_componentClause = ' civicrm_mailing_recipients.id IN ( ' . implode(',', $ids) . ' ) ';
}
//set the context for redirection for any task actions
public function preProcess() {
//when user come from search context.
$ssID = $this->get('ssID');
- $this->assign('ssid',$ssID);
+ $this->assign('ssid', $ssID);
$this->_searchBasedMailing = CRM_Contact_Form_Search::isSearchContext($this->get('context'));
if(CRM_Contact_Form_Search::isSearchContext($this->get('context')) && !$ssID){
$params = array();
}
$buttons = array(
- array('type' => 'back',
+ array(
+ 'type' => 'back',
'name' => ts('<< Previous'),
),
array(
$params = array(
'contact_type' => 'Individual',
'email' => array(
- 1 => array('email' => $email,
+ 1 => array(
+ 'email' => $email,
'is_primary' => 1,
'location_type_id' => 1,
)),
//when user come from search context.
$ssID = $this->get('ssID');
- $this->assign('ssid',$ssID);
+ $this->assign('ssid', $ssID);
$this->_searchBasedMailing = CRM_Contact_Form_Search::isSearchContext($this->get('context'));
if(CRM_Contact_Form_Search::isSearchContext($this->get('context')) && !$ssID){
$params = array();
$this->addFormRule(array('CRM_Mailing_Form_Upload', 'formRule'), $this);
$buttons = array(
- array('type' => 'back',
+ array(
+ 'type' => 'back',
'name' => ts('<< Previous'),
),
array(
$errors = array();
$template = CRM_Core_Smarty::singleton();
-
if (isset($params['html_message'])) {
$htmlMessage = str_replace(array("\n", "\r"), ' ', $params['html_message']);
$htmlMessage = str_replace("'", "\'", $htmlMessage);
$mailing->find(TRUE);
$session = CRM_Core_Session::singleton();
- $values = array('contact_id' => $session->get('userID'),
+ $values = array(
+ 'contact_id' => $session->get('userID'),
'version' => 3,
);
require_once 'api/api.php';
$urls[$key]++;
}
-
// set $header and $footer
foreach (array(
'header', 'footer') as $part) {
}
}
-
$skipTextFile = $self->get('skipTextFile');
$skipHtmlFile = $self->get('skipHtmlFile');
/* Do a full token replacement on a dummy verp, the current
* contact and domain, and the first organization. */
-
// here we make a dummy mailing object so that we
// can retrieve the tokens that we need to replace
// so that we do get an invalid token error
$contactID = $session->get('userID');
$civiMails = civicrm_api3('Mailing', 'get', array());
$campNames = civicrm_api3('Campaign', 'get', array());
- $mailingabNames = civicrm_api3('MailingAB','get',array());
+ $mailingabNames = civicrm_api3('MailingAB', 'get', array());
$mailStatus = civicrm_api3('MailingJob', 'get', array());
$groupNames = civicrm_api3('Group', 'get', array());
$headerfooterList = civicrm_api3('MailingComponent', 'get', array());
$emailAdd = civicrm_api3('Email', 'get', array());
$mesTemplate = civicrm_api3('MessageTemplate', 'get', array(
'sequential' => 1,
- 'return' => array("msg_html", "id", "msg_title","msg_subject"),
+ 'return' => array("msg_html", "id", "msg_title", "msg_subject"),
'id' => array('>' => 58),
));
} else {
'return' => "email",
'contact_id' => $contactID,
));
- $mesTemplate = civicrm_api3('MessageTemplate', 'get', array( 'sequential' => 1,
+ $mesTemplate = civicrm_api3('MessageTemplate', 'get', array(
+ 'sequential' => 1,
'return' => array("msg_html", "id", "msg_title", "msg_subject", "msg_text"),
'workflow_id' => array('IS NULL' => ""),
));
}
- $mailGrp = civicrm_api3('MailingGroup','get', array());
+ $mailGrp = civicrm_api3('MailingGroup', 'get', array());
$mailTokens = civicrm_api3('Mailing', 'get_token', array( 'usage' => 'Mailing'));
$fromAddress = civicrm_api3('OptionGroup', 'get', array(
'sequential' => 1,
));
CRM_Core_Resources::singleton()->addSetting(array(
'crmMailing' => array(
- 'mailingabNames'=>array_values($mailingabNames['values']),
+ 'mailingabNames' => array_values($mailingabNames['values']),
'civiMails' => array_values($civiMails['values']),
'campNames' => array_values($campNames['values']),
'mailStatus' => array_values($mailStatus['values']),
* @return array
*/
public function registerAdvancedSearchPane() {
- return array('title' => ts('Mailings'),
+ return array(
+ 'title' => ts('Mailings'),
'weight' => 20,
);
}
/**
* @param $shortCuts
*/
- public function creatNewShortcut(&$shortCuts) {}
+ public function creatNewShortcut(&$shortCuts) {
+ }
}
/**
* Expunge the messages marked for deletion; stub function to be redefined by IMAP store
*/
- public function expunge() {}
+ public function expunge() {
+ }
/**
* Return the next X messages from the mail store
if ($entry->isDot()) {
continue;
}
- if (count($mails) >= $count)
- break;
+ if (count($mails) >= $count) {
+ break;
+ }
$file = $path . DIRECTORY_SEPARATOR . $entry->getFilename();
if ($this->_debug) {
$contactID = CRM_Utils_Type::escape($_GET['contact_id'], 'Integer');
$sortMapper = array(
- 0 => 'subject', 1 => 'creator_name', 2 => '', 3 => 'start_date', 4 => '', 5 => 'links',
+ 0 => 'subject',
+ 1 => 'creator_name',
+ 2 => '',
+ 3 => 'start_date',
+ 4 => '',
+ 5 => 'links',
);
$sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
$this->_sortByCharacter =
CRM_Utils_Request::retrieve('sortByCharacter', 'String', $this);
-
// CRM-11920 all should set sortByCharacter to null, not empty string
if (strtolower($this->_sortByCharacter) == 'all' || !empty($_POST)) {
- $this->_sortByCharacter = null;
- $this->set('sortByCharacter', null);
+ $this->_sortByCharacter = NULL;
+ $this->set('sortByCharacter', NULL);
}
if (CRM_Utils_Array::value(3, $newArgs) == 'unscheduled') {
CRM_Core_Selector_Controller::TEMPLATE
);
-
$controller->setEmbedded(TRUE);
$controller->run();
}
public function search() {
- if ($this->_action &
- (CRM_Core_Action::ADD |
+ if ($this->_action & (CRM_Core_Action::ADD |
CRM_Core_Action::UPDATE
)
) {
CRM_Core_Error::fatal(ts("Missing input parameters"));
}
-
// verify that the three numbers above match
$q = CRM_Mailing_Event_BAO_Queue::verify($job_id, $queue_id, $hash);
if (!$q) {
*/
public function run() {
CRM_Utils_System::addHTMLHead('<META NAME="ROBOTS" CONTENT="NOINDEX, NOFOLLOW">');
-
+
$contact_id = CRM_Utils_Request::retrieve('cid', 'Integer', CRM_Core_DAO::$_nullObject);
$subscribe_id = CRM_Utils_Request::retrieve('sid', 'Integer', CRM_Core_DAO::$_nullObject);
$hash = CRM_Utils_Request::retrieve('h', 'String', CRM_Core_DAO::$_nullObject);
// we need to add an additional filter for $type
self::$component[$name] = array();
-
$object = new CRM_Mailing_DAO_Component();
$object->component_type = $type;
$object->selectAdd();
if (!$options) {
$options = array(
'bounce' => array(
- 'N' => ts('Successful '), 'Y' => ts('Bounced '),
+ 'N' => ts('Successful '),
+ 'Y' => ts('Bounced '),
),
'delivered' => array(
- 'Y' => ts('Successful '), 'N' => ts('Bounced '),
+ 'Y' => ts('Successful '),
+ 'N' => ts('Bounced '),
),
'open' => array(
- 'Y' => ts('Opened '), 'N' => ts('Unopened/Hidden '),
+ 'Y' => ts('Opened '),
+ 'N' => ts('Unopened/Hidden '),
),
'click' => array(
- 'Y' => ts('Clicked '), 'N' => ts('Not Clicked '),
+ 'Y' => ts('Clicked '),
+ 'N' => ts('Not Clicked '),
),
'reply' => array(
- 'Y' => ts('Replied '), 'N' => ts('No Reply '),
+ 'Y' => ts('Replied '),
+ 'N' => ts('No Reply '),
),
);
}
* @param bool|string $name pseudoconstant to be flushed
*/
public static function flush($name = 'template') {
- if (isset(self::$$name)) {
+ if (isset(self::$$name)) {
self::$$name = NULL;
}
}
);
if (CRM_Campaign_BAO_Campaign::isCampaignEnable()) {
- self::$_columnHeaders[] = array('name' => ts('Campaign'),
+ self::$_columnHeaders[] = array(
+ 'name' => ts('Campaign'),
'sort' => 'campaign_id',
'direction' => CRM_Utils_Sort::DONTCARE,
);
*/
public static function &links() {
if (!(self::$_links)) {
- list($context, $key) = func_get_args();
- $extraParams = ($key) ? "&key={$key}" : NULL;
- $searchContext = ($context) ? "&context=$context" : NULL;
+ list($context, $key) = func_get_args();
+ $extraParams = ($key) ? "&key={$key}" : NULL;
+ $searchContext = ($context) ? "&context=$context" : NULL;
- self::$_links = array(
+ self::$_links = array(
CRM_Core_Action::VIEW => array(
'name' => ts('View'),
'url' => 'civicrm/contact/view',
'qs' => "reset=1&delete=1&cid=%%cid%%{$searchContext}{$extraParams}",
'title' => ts('Delete Contact'),
),
- );
+ );
}
return self::$_links;
}
$mask = CRM_Core_Action::mask($permissions);
$qfKey = $this->_key;
- While ($result->fetch()) {
+ while ($result->fetch()) {
$row = array();
// the columns we are interested in
foreach (self::$_properties as $property) {
'Contact',
$result->contact_id
);
- $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ?
- $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
+ $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type, FALSE, $result->contact_id
);
$rows[] = $row;