'url' => CRM_Utils_System::url('civicrm/admin/access',
'reset=1'
),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
CRM_Utils_System::setTitle(ts('Assign Users to Roles'));
);
$this->addRule('name', ts('Name already exists in Database.'), 'objectExists', array(
'CRM_Core_DAO_Tag',
- $this->_id
+ $this->_id,
));
$this->add('text', 'description', ts('Description'),
*
* @return string
*/
- function all(
+ public function all(
$offset = 0, $rowcount = 0, $sort = NULL,
$includeContactIDs = FALSE, $justIDs = FALSE
) {
if ($result) {
CRM_Core_Session::setStatus(ts('%count email was found on hold and updated.', array(
'count' => $result,
- 'plural' => '%count emails were found on hold and updated.'
+ 'plural' => '%count emails were found on hold and updated.',
)), ts('Emails Restored'), 'success');
}
else {
CRM_Core_Session::setStatus(ts('The selected contact does not have an email on hold.', array(
'count' => $result,
- 'plural' => 'None of the selected contacts have an email on hold.'
+ 'plural' => 'None of the selected contacts have an email on hold.',
)), ts('No Emails to Restore'), 'info');
}
}
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
parent::preProcess();
/**
* called when action is browse
- *
- * @return null
*/
public function listContribution() {
$controller = new CRM_Core_Controller_Simple(
/**
* the main function that is called when the page
* loads, it decides the which action has to be taken for the page.
- *
- * @return null
*/
public function run() {
$invoiceSettings = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::CONTRIBUTE_PREFERENCES_NAME, 'contribution_invoice_settings');
);
foreach ($transactionPages as $trPage) {
$params[] = array("%${trPage}%", 'String');
- $where[] = 'path LIKE %' . sizeof($params);
+ $where[] = 'path LIKE %' . count($params);
}
$sql = "
$required = TRUE;
}
if (!$required && $dbName != 'contact_id') {
- $fkDAO = new $FKClassName;
+ $fkDAO = new $FKClassName();
if ($fkDAO->find(TRUE)) {
$this->$dbName = $fkDAO->id;
}
case CRM_Utils_Type::T_TIME:
CRM_Core_Error::fatal('T_TIME shouldnt be used.');
- //$object->$dbName='000000';
- //break;
+ //$object->$dbName='000000';
+ //break;
case CRM_Utils_Type::T_CCNUM:
$this->$dbName = '4111 1111 1111 1111';
break;
*
* @return array
*/
- static function &fields() {
+ public static function &fields() {
$result = NULL;
return $result;
}
/**
* Get/set an associative array of table columns
*
- * @param array key=>type array
* @return array
* (associative)
*/
* @param array $params
* (reference ) associative array of name/value pairs.
*
- * @return boolean
- * did we copy all null values into the object
+ * @return bool
+ * Did we copy all null values into the object
*/
public function copyValues(&$params) {
$fields = &$this->fields();
* @param string $fieldName
* The name of the field in the DAO.
*
- * @return boolean
+ * @return bool
* true if object exists
*/
public static function objectExists($value, $daoName, $daoID, $fieldName = 'name') {
* @param bool $i18nRewrite
* Whether to rewrite the query on multilingual setups.
*
- * @return boolean
+ * @return bool
* true if exists, else false
*/
public static function checkFieldExists($tableName, $columnName, $i18nRewrite = TRUE) {
* @param string $tableName
* @param string $constraint
*
- * @return boolean
+ * @return bool
* true if constraint exists, false otherwise
*/
public static function checkConstraintExists($tableName, $constraint) {
*
* @throws Exception
*
- * @return boolean
+ * @return bool
* true if CONSTRAINT keyword exists, false otherwise
*/
public static function schemaRequiresRebuilding($tables = array("civicrm_contact")) {
* @param string $tableName
* @param string $columnName
*
- * @return boolean
+ * @return bool
* true if in format, false otherwise
*/
public static function checkFKConstraintInFormat($tableName, $columnName) {
* @param string $columnName
* @param string $columnValue
*
- * @return boolean
+ * @return bool
* true if the value is always $columnValue, false otherwise
*/
public static function checkFieldHasAlwaysValue($tableName, $columnName, $columnValue) {
* @param string $tableName
* @param string $columnName
*
- * @return boolean
+ * @return bool
* true if if the value is always NULL, false otherwise
*/
public static function checkFieldIsAlwaysNull($tableName, $columnName) {
*
* @param string $tableName
*
- * @return boolean
+ * @return bool
* true if exists, else false
*/
public static function checkTableExists($tableName) {
* @param string $searchColumn
* Name of the column you want to search by.
*
- * @return boolean
+ * @return bool
* true if we found and updated the object, else false
*/
public static function setFieldValue($daoName, $searchValue, $setColumn, $setValue, $searchColumn = 'id') {
* @return CRM_Core_DAO
* object that holds the results of the query
*/
- static function &executeQuery(
+ public static function &executeQuery(
$query,
$params = array(),
$abort = TRUE,
* the result of the query if any
*
*/
- static function &singleValueQuery(
+ public static function &singleValueQuery(
$query,
$params = array(),
$abort = TRUE,
* @return CRM_Core_DAO
* the newly created copy of the object
*/
- static function ©Generic($daoName, $criteria, $newData = NULL, $fieldsFix = NULL, $blockCopyOfDependencies = NULL) {
+ public static function ©Generic($daoName, $criteria, $newData = NULL, $fieldsFix = NULL, $blockCopyOfDependencies = NULL) {
$object = new $daoName();
if (!$newData) {
$object->id = $criteria['id'];
* an object of type referenced by daoName
*/
public static function commonRetrieveAll($daoName, $fieldIdName = 'id', $fieldId, &$details, $returnProperities = NULL) {
- require_once(str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php");
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $daoName) . ".php";
$object = new $daoName();
$object->$fieldIdName = $fieldId;
* @param int $numObjects
* @param bool $createOnly
*
- * @return
+ * @return object|array|NULL
+ * NULL if $createOnly. A single object if $numObjects==1. Otherwise, an array of multiple objects.
*/
- static function createTestObject(
+ public static function createTestObject(
$daoName,
$params = array(),
$numObjects = 1,
'CRM_Core_DAO_StateProvince',
'CRM_Core_DAO_Country',
'CRM_Core_DAO_Domain',
- 'CRM_Financial_DAO_FinancialType'
+ 'CRM_Financial_DAO_FinancialType',
//because valid ones exist & we use pick them due to pseudoconstant can't reliably create & delete these
);
}
if ($createOnly) {
- return;
+ return NULL;
}
elseif ($numObjects == 1) {
return $objects[0];
public static function triggerRebuild($tableName = NULL, $force = FALSE) {
$info = array();
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
$logging->triggerInfo($info, $tableName, $force);
CRM_Core_I18n_Schema::triggerInfo($info, $tableName);
public static function dropTriggers($tableName = NULL) {
$info = array();
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
$logging->triggerInfo($info, $tableName);
// drop all existing triggers on all tables
*
* @param string $fieldName
* @param string $context
- * @see CRM_Core_DAO::buildOptionsContext.
+ * @see CRM_Core_DAO::buildOptionsContext
* @param array $props
* whatever is known about this bao object.
*
- * @return Array|bool
+ * @return array|bool
*/
public static function buildOptions($fieldName, $context = NULL, $props = array()) {
// If a given bao does not override this function
public function getOptionLabels() {
$fields = $this->fields();
if ($fields === NULL) {
- throw new Exception ('Cannot call getOptionLabels on CRM_Core_DAO');
+ throw new Exception('Cannot call getOptionLabels on CRM_Core_DAO');
}
foreach ($fields as $field) {
$name = CRM_Utils_Array::value('name', $field);
}
$escapedCriteria = array_map(array(
'CRM_Core_DAO',
- 'escapeString'
+ 'escapeString',
), $criteria);
if (!$returnSanitisedArray) {
return (sprintf('%s %s ("%s")', $fieldName, $operator, implode('", "', $escapedCriteria)));
}
return $escapedCriteria;
- break;
// binary operators
'BETWEEN',
'NOT BETWEEN',
'IS NOT NULL',
- 'IS NULL'
+ 'IS NULL',
);
}
* @throws PEAR_Error
* @see loadArray()
*/
- function load(
+ public function load(
&$options, $param1 = NULL, $param2 = NULL,
$param3 = NULL, $param4 = NULL
) {
return array("civicrm_contact.{$rg->name}.{$rg->threshold}" => $query);
}
}
-
-;
$statusOptions = CRM_Event_PseudoConstant::participantStatus(NULL, NULL, 'label');
$this->add('select', 'status_id', ts('Participant Status'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $statusOptions,
TRUE
);
*
* @return CRM_Mailing_Event_BAO_Queue|string
*/
- static function &getRecipients(
+ public static function &getRecipients(
$job_id,
$mailing_id = NULL,
$offset = NULL,
}
/**
- *
- * Returns the regex patterns that are used for preparing the text and html templates
- *
- *
- **/
+ * Returns the regex patterns that are used for preparing the text and html templates.
+ */
private function &getPatterns($onlyHrefs = FALSE) {
$patterns = array();
$patterns[] = '\\\\\{\w+\.\w+\\\\\}|\{\{\w+\.\w+\}\}';
$patterns[] = '\{\w+\.\w+\}';
- $patterns = '{' . join('|', $patterns) . '}im';
+ $patterns = '{' . implode('|', $patterns) . '}im';
return $patterns;
}
/**
- * 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
+ * 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 replacement 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
* An array that holds the token itself and the type.
* Prepares the text and html templates
* for generating the emails and returns a copy of the
* prepared templates
- *
- *
- **/
+ */
private function getPreparedTemplates() {
if (!$this->preparedTemplates) {
$patterns['html'] = $this->getPatterns(TRUE);
foreach (array(
'html',
'text',
- 'subject'
+ 'subject',
) as $key) {
if (!isset($templates[$key])) {
continue;
}
/**
- *
- * Retrieve a ref to an array that holds the email and text templates for this email
- * assembles the complete template including the header and footer
- * that the user has uploaded or declared (if they have dome that)
- *
+ * Retrieve a ref to an array that holds the email and text templates for this email
+ * assembles the complete template including the header and footer
+ * that the user has uploaded or declared (if they have dome that)
*
* @return array
* reference to an assoc array
- *
- **/
+ */
private function &getTemplates() {
if (!$this->templates) {
$this->getHeaderFooter();
$template[] = $this->footer->body_text;
}
- $this->templates['text'] = join("\n", $template);
+ $this->templates['text'] = implode("\n", $template);
}
if ($this->body_html) {
$template[] = $this->footer->body_html;
}
- $this->templates['html'] = join("\n", $template);
+ $this->templates['html'] = implode("\n", $template);
// this is where we create a text template from the html template if the text template did not exist
// this way we ensure that every recipient will receive an email even if the pref is set to text and the
if ($this->subject) {
$template = array();
$template[] = $this->subject;
- $this->templates['subject'] = join("\n", $template);
+ $this->templates['subject'] = implode("\n", $template);
}
}
return $this->templates;
*
* @return array
* reference to an assoc array
- *
- **/
+ */
public function &getTokens() {
if (!$this->tokens) {
*
* @return array
* reference to an assoc array
- *
- **/
+ */
public function &getFlattenedTokens() {
if (!$this->flattenedTokens) {
$tokens = $this->getTokens();
'return' => 'id',
'options' => array(
'limit' => 100000000000,
- )
+ ),
)
);
}
/**
- * Retrieve the header and footer for this mailing
- *
- * @param void
- *
- * @return void
+ * Load this->header and this->footer.
*/
private function getHeaderFooter() {
if (!$this->header and $this->header_id) {
($contact['preferred_mail_format'] == 'HTML' && !array_key_exists('html', $pEmails))
)
) {
- $textBody = join('', $text);
+ $textBody = implode('', $text);
if ($useSmarty) {
$textBody = $smarty->fetch("string:$textBody");
}
$contact['preferred_mail_format'] == 'Both'
))
) {
- $htmlBody = join('', $html);
+ $htmlBody = implode('', $html);
if ($useSmarty) {
$htmlBody = $smarty->fetch("string:$htmlBody");
}
$mailingSubject = CRM_Utils_Array::value('subject', $pEmails);
if (is_array($mailingSubject)) {
- $mailingSubject = join('', $mailingSubject);
+ $mailingSubject = implode('', $mailingSubject);
}
$mailParams['Subject'] = $mailingSubject;
'html',
'attachments',
'toName',
- 'toEmail'
+ 'toEmail',
))
) {
$headers[$paramKey] = $paramValue;
'bounce' => CRM_Mailing_Event_BAO_Bounce::getTableName(),
'forward' => CRM_Mailing_Event_BAO_Forward::getTableName(),
'url' => CRM_Mailing_BAO_TrackableURL::getTableName(),
- 'urlopen' =>
- CRM_Mailing_Event_BAO_TrackableURLOpen::getTableName(),
+ 'urlopen' => CRM_Mailing_Event_BAO_TrackableURLOpen::getTableName(),
'component' => CRM_Mailing_BAO_Component::getTableName(),
'spool' => CRM_Mailing_BAO_Spool::getTableName(),
);
$report['component'][] = array(
'type' => $components[$mailing->type],
'name' => $mailing->name,
- 'link' =>
- CRM_Utils_System::url('civicrm/mailing/component',
- "reset=1&action=update&id={$mailing->id}"
- ),
+ 'link' => CRM_Utils_System::url('civicrm/mailing/component',
+ "reset=1&action=update&id={$mailing->id}"
+ ),
);
}
foreach (array(
'scheduled_date',
'start_date',
- 'end_date'
+ 'end_date',
) as $key) {
$row[$key] = CRM_Utils_Date::customFormat($row[$key]);
}
while ($mailing->fetch()) {
$report['click_through'][] = array(
'url' => $mailing->url,
- 'link' =>
- CRM_Utils_System::url(
- 'civicrm/mailing/report/event',
- "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}"
- ),
- 'link_unique' =>
- CRM_Utils_System::url(
- 'civicrm/mailing/report/event',
- "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}&distinct=1"
- ),
+ 'link' => CRM_Utils_System::url(
+ 'civicrm/mailing/report/event',
+ "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}"
+ ),
+ 'link_unique' => CRM_Utils_System::url(
+ 'civicrm/mailing/report/event',
+ "reset=1&event=click&mid=$mailing_id&uid={$mailing->id}&distinct=1"
+ ),
'clicks' => $mailing->clicks,
'unique' => $mailing->unique_clicks,
'rate' => CRM_Utils_Array::value('delivered', $report['event_totals']) ? (100.0 * $mailing->unique_clicks) / $report['event_totals']['delivered'] : 0,
$actionLinks = array(CRM_Core_Action::VIEW => array('name' => ts('Report')));
if (CRM_Core_Permission::check('view all contacts')) {
- $actionLinks[CRM_Core_Action::ADVANCED] =
- array(
- 'name' => ts('Advanced Search'),
- 'url' => 'civicrm/contact/search/advanced',
- );
+ $actionLinks[CRM_Core_Action::ADVANCED] = array(
+ 'name' => ts('Advanced Search'),
+ 'url' => 'civicrm/contact/search/advanced',
+ );
}
$action = array_sum(array_keys($actionLinks));
if (!in_array($id, $mailingIDs)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this mailing report'));
}
- return;
}
/**
* where the user has access to ALL groups, and hence ALL mailings and return a
* value of TRUE (to avoid the downstream where clause with a list of mailing list IDs
*
- * @return boolean
- * | array - TRUE if the user has access to all mailings, else array of mailing IDs (possibly empty)
+ * @return bool|array
+ * TRUE if the user has access to all mailings, else array of mailing IDs (possibly empty).
*/
public static function mailingACLIDs() {
// CRM-11633
$form->assign('templates', TRUE);
$form->add('select', 'template', ts('Select Template'),
array(
- '' => ts('- select -')
+ '' => ts('- select -'),
) + $form->_templates, FALSE,
array('onChange' => "selectValue( this.value,'' );")
);
if ($mode == NULL && CRM_Core_BAO_MailSettings::defaultDomain() == "EXAMPLE.ORG") {
throw new CRM_Core_Exception(ts('The <a href="%1">default mailbox</a> has not been configured. You will find <a href="%2">more info in the online user and administrator guide</a>', array(
1 => CRM_Utils_System::url('civicrm/admin/mailSettings', 'reset=1'),
- 2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/"
+ 2 => "http://book.civicrm.org/user/advanced-configuration/email-system-configuration/",
)));
}
* @param string $hash
* The hash.
*
- * @return boolean
+ * @return bool
* True on success
*/
public static function confirm($contact_id, $subscribe_id, $hash) {
'sms',
'status_unscheduled',
'is_archived',
- 'hidden_find_mailings'
+ 'hidden_find_mailings',
);
foreach ($fields as $field) {
if (isset($params[$field]) &&
) {
if (in_array($field, array(
'mailing_from',
- 'mailing_to'
+ 'mailing_to',
)) && !$params["mailing_relative"]
) {
$time = ($field == 'mailing_to') ? '235959' : NULL;
switch ($this->_event_type) {
case 'queue':
$event = new CRM_Mailing_Event_BAO_Queue();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id
);
+ return $result;
case 'delivered':
$event = new CRM_Mailing_Event_BAO_Delivered();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'opened':
$event = new CRM_Mailing_Event_BAO_Opened();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'bounce':
$event = new CRM_Mailing_Event_BAO_Bounce();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'forward':
$event = new CRM_Mailing_Event_BAO_Forward();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'reply':
$event = new CRM_Mailing_Event_BAO_Reply();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'unsubscribe':
$event = new CRM_Mailing_Event_BAO_Unsubscribe();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct
);
+ return $result;
case 'optout':
$event = new CRM_Mailing_Event_BAO_Unsubscribe();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct,
FALSE
);
+ return $result;
case 'click':
$event = new CRM_Mailing_Event_BAO_TrackableURLOpen();
- return $event->getTotalCount($this->_mailing_id,
+ $result = $event->getTotalCount($this->_mailing_id,
$this->_job_id,
$this->_is_distinct,
$this->_url_id
);
+ return $result;
default:
return 0;
public function &getRows($action, $offset, $rowCount, $sort, $output = NULL) {
switch ($this->_event_type) {
case 'queue':
- return CRM_Mailing_Event_BAO_Queue::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Queue::getRows($this->_mailing_id,
$this->_job_id, $offset, $rowCount, $sort
);
- break;
+ return $rows;
case 'delivered':
- return CRM_Mailing_Event_BAO_Delivered::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Delivered::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'opened':
- return CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Opened::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'bounce':
- return CRM_Mailing_Event_BAO_Bounce::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Bounce::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'forward':
- return CRM_Mailing_Event_BAO_Forward::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Forward::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'reply':
- return CRM_Mailing_Event_BAO_Reply::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Reply::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort
);
+ return $rows;
case 'unsubscribe':
- return CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort, TRUE
);
+ return $rows;
case 'optout':
- return CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
+ $rows = CRM_Mailing_Event_BAO_Unsubscribe::getRows($this->_mailing_id,
$this->_job_id, $this->_is_distinct,
$offset, $rowCount, $sort, FALSE
);
+ return $rows;
case 'click':
- return CRM_Mailing_Event_BAO_TrackableURLOpen::getRows(
+ $rows = CRM_Mailing_Event_BAO_TrackableURLOpen::getRows(
$this->_mailing_id, $this->_job_id,
$this->_is_distinct, $this->_url_id,
$offset, $rowCount, $sort
);
+ return $rows;
default:
return NULL;
* @param string $output
* Type of output.
*
- * @return string
+ * @return string|NULL
* name of the file
*/
public function getExportFileName($output = 'csv') {
+ return NULL;
}
public function eventToTitle() {
'delivered' => ts('Successful Deliveries'),
'bounce' => ts('Bounces'),
'forward' => ts('Forwards'),
- 'reply' => $this->_is_distinct
- ? ts('Unique Replies')
- : ts('Replies'),
+ 'reply' => $this->_is_distinct ? ts('Unique Replies') : ts('Replies'),
'unsubscribe' => ts('Unsubscribe Requests'),
'optout' => ts('Opt-out Requests'),
- 'click' => $this->_is_distinct
- ? ts('Unique Click-throughs')
- : ts('Click-throughs'),
- 'opened' => $this->_is_distinct
- ? ts('Unique Tracked Opens')
- : ts('Tracked Opens'),
+ 'click' => $this->_is_distinct ? ts('Unique Click-throughs') : ts('Click-throughs'),
+ 'opened' => $this->_is_distinct ? ts('Unique Tracked Opens') : ts('Tracked Opens'),
);
}
return $events[$this->_event_type];
LEFT JOIN civicrm_activity civireport_activity_all_{$activityType} ON ( civireport_activity_all_{$activityType}.id = civireport_case_activity_all_{$activityType}.activity_id AND civireport_activity_all_{$activityType}.activity_type_id = {$activityType})";
$this->_columnHeaders['case_activity_all_dates'] = array(
- 'title' => $this->_caseDetailExtra['case_activity_all_dates']['title'] .
- ": {$this->caseActivityTypes[$activityType]}",
+ 'title' => $this->_caseDetailExtra['case_activity_all_dates']['title'] . ": {$this->caseActivityTypes[$activityType]}",
'type' => CRM_Utils_Array::value('type', $this->_caseDetailExtra['case_activity_all_dates']),
);
}
foreach ($rows as $key => $value) {
if ($value['civicrm_event_id']) {
$graphRows['totalParticipants'][] = ($rows[$key]['civicrm_line_item_participant_count_count']);
- $graphRows[$this->_interval][] =
- substr($rows[$key]['civicrm_event_title'], 0, 12) . "..(" .
+ $graphRows[$this->_interval][] = substr($rows[$key]['civicrm_event_title'], 0, 12) . "..(" .
$rows[$key]['civicrm_event_id'] . ") ";
$graphRows['value'][] = ($rows[$key]['civicrm_line_item_participant_count_count']);
}
return $participant_info;
}
- //build header for table
+ /**
+ * Build header for table.
+ */
public function buildColumnHeaders() {
-
$this->_columnHeaders = array();
foreach ($this->_columns as $tableName => $table) {
if (array_key_exists('fields', $table)) {
if (!empty($this->_params['charts'])) {
foreach ($rows as $key => $value) {
$graphRows['totalAmount'][] = $graphRows['value'][] = CRM_Utils_Array::value('totalAmount', $rows[$key]);
- $graphRows[$this->_interval][] =
- substr($rows[$key]['civicrm_event_title'], 0, 12) . "..(" .
+ $graphRows[$this->_interval][] = substr($rows[$key]['civicrm_event_title'], 0, 12) . "..(" .
$rows[$key]['civicrm_event_id'] . ") ";
}
* @param array $errors
* Collect validation errors.
*
- * @return array
+ * @return array|NULL
* Validation errors
* @todo remove this function - not in use but need to review functionality before
* removing as it might be useful in wrapper layer
*/
function _civicrm_api3_custom_field_validate_field($fieldName, $value, $fieldDetails, &$errors = array()) {
- return;
+ return NULL;
//see comment block
if (!$value) {
return $errors;
* Array of one or more valid.
*
* @return array
- * API return Array of matching mailing jobs
- * {@getfields mailing_job_get}
+ * API return Array of matching mailing jobs.
+ * {@getfields mailing_job_get}
*/
function civicrm_api3_mailing_job_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
}
}
-
- return;
}
run();
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
parent::setUp();
}
- /* check function add()
- *
- */
+ /**
+ * Check function add()
+ */
public function testAdd() {
$params = array(
'name' => 'pending',
var $abc;
/**
- * @param null $name
+ * @param string|null $name
*/
public function __construct($name = NULL) {
parent::__construct($name);
}
- // called before the test functions will be executed
- // this function is defined in PHPUnit_TestCase and overwritten
- // here
+ /**
+ * Called before the test functions will be executed
+ * this function is defined in PHPUnit_TestCase and overwritten
+ * here
+ */
public function setUp() {
// create a new instance of String with the
// string 'abc'
$this->abc = "hello";
}
- // called after the test functions are executed
- // this function is defined in PHPUnit_TestCase and overwritten
- // here
+ /**
+ * Called after the test functions are executed
+ * this function is defined in PHPUnit_TestCase and overwritten
+ * here.
+ */
public function tearDown() {
// delete your instance
unset($this->abc);
'edit-1-profile-listings-and-forms',
'edit-1-access-all-custom-data',
'edit-1-register-for-events',
- 'edit-1-make-online-contributions'
+ 'edit-1-make-online-contributions',
);
$this->changePermissions($permission);
// build forward url
$forwardUrl = array(
"mailing/forward",
- "reset=1&jid={$eventQueue->job_id}&qid={$eventQueue->id}&h={$eventQueue->hash}"
+ "reset=1&jid={$eventQueue->job_id}&qid={$eventQueue->id}&h={$eventQueue->hash}",
);
$this->openCiviPage($forwardUrl[0], $forwardUrl[1], NULL);
'Replies',
'Bounces',
'Unsubscribe Requests',
- 'Opt-out Requests'
+ 'Opt-out Requests',
);
//check for report and adv search links
$this->verifyText("xpath=//table//tr[td[1]/text()='Subject']/descendant::td[2]", preg_quote("Test subject $mailingName for Webtest"));
// after asserts do clicks and confirm filters
- $criteriaCheck =
- array(
- 'Intended Recipients' =>
- array(
- 'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest"),
- 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest"),
- ),
- 'Successful Deliveries' =>
- array(
- 'report' => array(
- 'report_name' => 'Mailing Details',
- 'Mailing' => "Mailing $mailingName Webtest",
- "Delivery Status" => " Successful"
- ),
- 'search' => array(
- 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
- 'Mailing Delivery -' => "Successful"
- ),
- ),
- 'Tracked Opens' =>
- array(
- 'report' => array('report_name' => 'Mail Opened', 'Mailing' => "Mailing $mailingName Webtest"),
- 'search' => array(
- 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
- 'Mailing: Trackable Opens -' => "Opened"
- ),
- ),
- 'Click-throughs' =>
- array(
- 'report' => array('report_name' => 'Mail Clickthroughs', 'Mailing' => "Mailing $mailingName Webtest"),
- 'search' => array(
- 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
- 'Mailing: Trackable URL Clicks -' => "Clicked"
- ),
- ),
- 'Forwards' =>
- array(
- 'report' => array(
- 'report_name' => 'Mailing Details',
- 'Mailing' => "Mailing $mailingName Webtest",
- 'Forwarded' => 'Is equal to Yes'
- ),
- 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Forwards"),
- ),
- 'Replies' =>
- array(
- 'report' => array(
- 'report_name' => 'Mailing Details',
- 'Mailing' => "Mailing $mailingName Webtest",
- 'Replied' => 'Is equal to Yes'
- ),
- 'search' => array(
- 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
- 'Mailing: Trackable Replies -' => "Replied"
- ),
- ),
- 'Bounces' =>
- array(
- 'report' => array('report_name' => 'Mail Bounces', 'Mailing' => "Mailing $mailingName Webtest"),
- 'search' => array(
- 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
- 'Mailing Delivery -' => "Bounced"
- ),
- ),
- 'Unsubscribe Requests' =>
- array(
- 'report' => array(
- 'report_name' => 'Mailing Details',
- 'Mailing' => "Mailing $mailingName Webtest",
- 'Unsubscribed' => 'Is equal to Yes'
- ),
- 'search' => array(
- 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
- 'Mailing: -' => "Unsubscribe Requests"
- ),
- ),
- 'Opt-out Requests' =>
- array(
- 'report' => array(
- 'report_name' => 'Mailing Details',
- 'Mailing' => "Mailing $mailingName Webtest",
- 'Opted-out' => 'Is equal to Yes'
- ),
- 'search' => array(
- 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
- 'Mailing: -' => "Opt-out Requests"
- ),
- ),
- );
+ $criteriaCheck = array(
+ 'Intended Recipients' => array(
+ 'report' => array('report_name' => 'Mailing Details', 'Mailing' => "Mailing $mailingName Webtest"),
+ 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest"),
+ ),
+ 'Successful Deliveries' => array(
+ 'report' => array(
+ 'report_name' => 'Mailing Details',
+ 'Mailing' => "Mailing $mailingName Webtest",
+ "Delivery Status" => " Successful",
+ ),
+ 'search' => array(
+ 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+ 'Mailing Delivery -' => "Successful",
+ ),
+ ),
+ 'Tracked Opens' => array(
+ 'report' => array('report_name' => 'Mail Opened', 'Mailing' => "Mailing $mailingName Webtest"),
+ 'search' => array(
+ 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+ 'Mailing: Trackable Opens -' => "Opened",
+ ),
+ ),
+ 'Click-throughs' => array(
+ 'report' => array('report_name' => 'Mail Clickthroughs', 'Mailing' => "Mailing $mailingName Webtest"),
+ 'search' => array(
+ 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+ 'Mailing: Trackable URL Clicks -' => "Clicked",
+ ),
+ ),
+ 'Forwards' => array(
+ 'report' => array(
+ 'report_name' => 'Mailing Details',
+ 'Mailing' => "Mailing $mailingName Webtest",
+ 'Forwarded' => 'Is equal to Yes',
+ ),
+ 'search' => array('Mailing Name IN' => "\"Mailing {$mailingName} Webtest", 'Mailing: -' => "Forwards"),
+ ),
+ 'Replies' => array(
+ 'report' => array(
+ 'report_name' => 'Mailing Details',
+ 'Mailing' => "Mailing $mailingName Webtest",
+ 'Replied' => 'Is equal to Yes',
+ ),
+ 'search' => array(
+ 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+ 'Mailing: Trackable Replies -' => "Replied",
+ ),
+ ),
+ 'Bounces' => array(
+ 'report' => array('report_name' => 'Mail Bounces', 'Mailing' => "Mailing $mailingName Webtest"),
+ 'search' => array(
+ 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+ 'Mailing Delivery -' => "Bounced",
+ ),
+ ),
+ 'Unsubscribe Requests' => array(
+ 'report' => array(
+ 'report_name' => 'Mailing Details',
+ 'Mailing' => "Mailing $mailingName Webtest",
+ 'Unsubscribed' => 'Is equal to Yes',
+ ),
+ 'search' => array(
+ 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+ 'Mailing: -' => "Unsubscribe Requests",
+ ),
+ ),
+ 'Opt-out Requests' => array(
+ 'report' => array(
+ 'report_name' => 'Mailing Details',
+ 'Mailing' => "Mailing $mailingName Webtest",
+ 'Opted-out' => 'Is equal to Yes',
+ ),
+ 'search' => array(
+ 'Mailing Name IN' => "\"Mailing {$mailingName} Webtest",
+ 'Mailing: -' => "Opt-out Requests",
+ ),
+ ),
+ );
$this->criteriaCheck($criteriaCheck, $mailingReportUrl);
}