*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
CRM_Contact_Form_Task_EmailCommon::preProcessFromAddress($this);
parent::preProcess();
'url' => CRM_Utils_System::url('civicrm/admin',
'reset=1'
),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
$this->_search = CRM_Utils_Array::value('search', $_GET);
$this->_force = CRM_Utils_Request::retrieve('force', 'Boolean', $this, FALSE, FALSE);
$this->_searchTab = CRM_Utils_Request::retrieve('type', 'String', $this, FALSE, 'petition');
*
* @return mixed
*/
- static function getSelectElements(
+ public static function getSelectElements(
$all = FALSE,
$isSeparator = TRUE,
$separator = '__'
* Contact subType.
* @param bool $ignoreCache
*
- * @return boolean
+ * @return bool
* true if subType, false otherwise.
*/
public static function isaSubType($subType, $ignoreCache = FALSE) {
* @param bool $ignoreCache
* @param string $columnName
*
- * @return boolean
+ * @return bool
* true if contact extends, false otherwise.
*/
public static function isExtendsContactType($subType, $contactType, $ignoreCache = FALSE, $columnName = 'name') {
* @param array $params
* An assoc array of name/value pairs.
*
- * @return object
+ * @return object|void
*/
public static function add(&$params) {
// label or name
if (empty($params['id']) && empty($params['label'])) {
- return;
+ return NULL;
}
if (!empty($params['parent_id']) &&
!CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_ContactType', $params['parent_id'])
) {
- return;
+ return NULL;
}
$contactType = new CRM_Contact_DAO_ContactType();
* @param string $subType
* Subtype.
*
- * @return boolean
+ * @return bool
*/
public static function isAllowEdit($contactId, $subType = NULL) {
*
* @return bool
*/
- static function deleteCustomSetForSubtypeMigration(
+ public static function deleteCustomSetForSubtypeMigration(
$contactID,
$contactType,
$oldSubtypeSet = array(),
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
- * @return boolean
+ * @return bool
*/
public static function dataExists($params) {
// return if no data present
*
* @param int $contactID
*
- * @return boolean
+ * @return bool
*/
public static function hasGroupAssociated($contactID) {
$orgID = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_GroupOrganization',
* earth_eccentricity_sq = 2*$earth_flattening - pow($earth_flattening, 2);
* This library is an implementation of UCB CS graduate student, Ka-Ping Yee (http://www.zesty.ca).
* This version has been taken from Drupal's location module: http://drupal.org/project/location
- **/
+ */
static protected $_earthFlattening;
static protected $_earthRadiusSemiMinor;
}
/**
- * @param float $longitude
* @param float $latitude
+ * @param float $longitude
* @param float $distance
* @param string $tablePrefix
*
$params = array();
$clause = array();
- list($minLongitude, $maxLongitude) =
- self::earthLongitudeRange($longitude,
- $latitude,
- $distance
- );
- list($minLatitude, $maxLatitude) =
- self::earthLatitudeRange(
- $longitude,
- $latitude,
- $distance
- );
+ list($minLongitude, $maxLongitude) = self::earthLongitudeRange($longitude, $latitude, $distance);
+ list($minLatitude, $maxLatitude) = self::earthLatitudeRange($longitude, $latitude, $distance);
// DONT consider NAN values (which is returned by rad2deg php function)
// for checking BETWEEN geo_code's criteria as it throws obvious 'NAN' field not found DB: Error
* @param array $values
*
* @throws Exception
+ * @return void
*/
public static function process(&$query, &$values) {
list($name, $op, $distance, $grouping, $wildcard) = $values;
}
if (empty($proximityAddress)) {
- return;
+ return NULL;
}
if (isset($proximityAddress['state_province_id'])) {
$qill[] = $proximityAddress['country'];
}
-
if (
isset($proximityAddress['distance_unit']) &&
$proximityAddress['distance_unit'] == 'miles'
$qill .= ': ' . ts('We could not geocode the destination address.');
$query->_qill[$grouping][] = $qill;
$query->_where[$grouping][] = ' (0) ';
- return;
+ return NULL;
}
$query->_qill[$grouping][] = $qill;
$distance
);
- return;
+ return NULL;
}
/**
* @param array $input
+ * retun void
*/
public static function fixInputParams(&$input) {
foreach ($input as $param) {
}
}
}
- return;
+ return NULL;
}
}
}
$this->add('select', 'group_id', '', $groupSelect, TRUE, array(
'class' => 'crm-select2 crm-action-menu action-icon-plus',
- 'placeholder' => $msg
+ 'placeholder' => $msg,
));
$this->addButtons(array(
$label = $this->_action & CRM_Core_Action::ADD ? ts('Contact(s)') : ts('Contact');
$contactField = $this->addEntityRef('related_contact_id', $label, array(
'multiple' => TRUE,
- 'create' => TRUE
+ 'create' => TRUE,
), TRUE);
// This field cannot be updated
if ($this->_action & CRM_Core_Action::UPDATE) {
if ($valid) {
CRM_Core_Session::setStatus(ts('Relationship created.', array(
'count' => $valid,
- 'plural' => '%count relationships created.'
+ 'plural' => '%count relationships created.',
)), ts('Saved'), 'success');
}
if ($invalid) {
CRM_Core_Session::setStatus(ts('%count relationship record was not created due to an invalid contact type.', array(
'count' => $invalid,
- 'plural' => '%count relationship records were not created due to invalid contact types.'
+ 'plural' => '%count relationship records were not created due to invalid contact types.',
)), ts('%count invalid relationship record', array(
'count' => $invalid,
- 'plural' => '%count invalid relationship records'
+ 'plural' => '%count invalid relationship records',
)));
}
if ($duplicate) {
CRM_Core_Session::setStatus(ts('One relationship was not created because it already exists.', array(
'count' => $duplicate,
- 'plural' => '%count relationships were not created because they already exist.'
+ 'plural' => '%count relationships were not created because they already exist.',
)), ts('%count duplicate relationship', array(
'count' => $duplicate,
- 'plural' => '%count duplicate relationships'
+ 'plural' => '%count duplicate relationships',
)));
}
if ($saved) {
if ($extendTargetContacts) {
$errorMess = ts('One selected activity consists of more than one target contact.', array(
'count' => $extendTargetContacts,
- 'plural' => '%count selected activities consist of more than one target contact.'
+ 'plural' => '%count selected activities consist of more than one target contact.',
));
}
if ($invalidActivity) {
$errorMess = ($errorMess ? ' ' : '');
$errorMess .= ts('The selected activity is invalid.', array(
'count' => $invalidActivity,
- 'plural' => '%count selected activities are invalid.'
+ 'plural' => '%count selected activities are invalid.',
));
}
CRM_Core_Error::statusBounce(ts("%1: SMS Reply will not be sent.", array(1 => $errorMess)));
$form->assign('extendTargetContacts', $extendTargetContacts);
}
-
$form->assign('toContact', json_encode($toArray));
$form->assign('suppressedSms', $suppressedSms);
$form->assign('totalSelectedContacts', count($form->_contactIds));
if ($countSuccess > 0) {
CRM_Core_Session::setStatus(ts('One message was sent successfully.', array(
'plural' => '%count messages were sent successfully.',
- 'count' => $countSuccess
+ 'count' => $countSuccess,
)), ts('Message Sent', array('plural' => 'Messages Sent', 'count' => $countSuccess)), 'success');
}
$status .= '</ul>';
CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array(
'count' => count($sent),
- 'plural' => '%count Messages Not Sent'
+ 'plural' => '%count Messages Not Sent',
)), 'info');
}
else {
$status .= ')<ul><li>' . implode('</li><li>', $not_sent) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts('One Message Not Sent', array(
'count' => count($smsNotSent),
- 'plural' => '%count Messages Not Sent'
+ 'plural' => '%count Messages Not Sent',
)), 'info');
}
}
//Test database user privilege to create table(Temporary) CRM-4725
$errorScope = CRM_Core_TemporaryErrorScope::ignoreException();
- $daoTestPrivilege = new CRM_Core_DAO;
+ $daoTestPrivilege = new CRM_Core_DAO();
$daoTestPrivilege->query("CREATE TEMPORARY TABLE import_job_permission_one(test int) ENGINE=InnoDB");
$daoTestPrivilege->query("CREATE TEMPORARY TABLE import_job_permission_two(test int) ENGINE=InnoDB");
$daoTestPrivilege->query("DROP TABLE IF EXISTS import_job_permission_one, import_job_permission_two");
if (!empty($results)) {
CRM_Core_Error::fatal(ts('<b>%1</b> file(s) in %2 directory are not writable. Listed file(s) might be used during the import to log the errors occurred during Import process. Contact your site administrator for assistance.', array(
1 => implode(', ', $results),
- 2 => $config->uploadDir
+ 2 => $config->uploadDir,
)));
}
*
* @return void
*/
-
public function buildQuickForm() {
// If there's a dataSource in the query string, we need to load
if ($this->_dataSourceIsValid) {
$this->_dataSourceClassFile = str_replace('_', '/', $this->_dataSource) . ".php";
require_once $this->_dataSourceClassFile;
- $this->_dataSourceClass = new $this->_dataSource;
+ $this->_dataSourceClass = new $this->_dataSource();
$this->_dataSourceClass->buildQuickForm($this);
}
$this->assign('savedMapping', $mappingArray);
$this->addElement('select', 'savedMapping', ts('Mapping Option'), array('' => ts('- select -')) + $mappingArray);
-
$js = array('onClick' => "buildSubTypes();buildDedupeRules();");
// contact types option
$contactOptions = array();
) {
$dataSourceClass = "CRM_Import_DataSource_" . $matches[1];
require_once $dataSourceDir . DIRECTORY_SEPARATOR . $dataSourceFile;
- $object = new $dataSourceClass;
+ $object = new $dataSourceClass();
$info = $object->getInfo();
$dataSources[$dataSourceClass] = $info['title'];
}
foreach ($rest as $k => $v) {
if ($accessCiviCRM && !empty($this->_viewOptions[$k])) {
$allTabs[] = $v + array(
- 'id' => $k,
- 'url' => CRM_Utils_System::url(
- "civicrm/contact/view/$k",
- "reset=1&cid={$this->_contactId}"
- ),
- 'weight' => $weight,
- 'count' => CRM_Contact_BAO_Contact::getCountComponent($k, $this->_contactId),
- );
+ 'id' => $k,
+ 'url' => CRM_Utils_System::url(
+ "civicrm/contact/view/$k",
+ "reset=1&cid={$this->_contactId}"
+ ),
+ 'weight' => $weight,
+ 'count' => CRM_Contact_BAO_Contact::getCountComponent($k, $this->_contactId),
+ );
$weight += 10;
}
}
* @param array $ids
* The array that holds all the db ids.
*
- * @return CRM_Contribute_BAO_Contribution
+ * @return CRM_Contribute_BAO_Contribution|void
*/
public static function add(&$params, $ids = array()) {
if (empty($params)) {
- return;
+ return NULL;
}
//per http://wiki.civicrm.org/confluence/display/CRM/Database+layer we are moving away from $ids array
$contributionID = CRM_Utils_Array::value('contribution', $ids, CRM_Utils_Array::value('id', $params));
'name' => 'contribution_page',
'where' => 'civicrm_contribution_page.title',
'data_type' => CRM_Utils_Type::T_STRING,
- )
+ ),
);
$contributionNote = array(
$values['financial_type_id'] = $this->financial_type_id;
}
-
$template->assign('trxn_id', $this->trxn_id);
$template->assign('receive_date',
CRM_Utils_Date::mysqlToIso($this->receive_date)
$params['trxnParams']['trxn_id'] = $params['prevContribution']->trxn_id;
$params['trxnParams']['status_id'] = $params['prevContribution']->contribution_status_id;
-
if (!(($params['prevContribution']->contribution_status_id == array_search('Pending', $contributionStatuses)
|| $params['prevContribution']->contribution_status_id == array_search('In Progress', $contributionStatuses))
&& $params['contribution']->contribution_status_id == array_search('Completed', $contributionStatuses))
* @see CRM_Core_DAO::buildOptions
*
* @param string $fieldName
- * @param string $context
- * @see CRM_Core_DAO::buildOptionsContext.
- * @param array $props
- * whatever is known about this dao object.
+ * @param string $context see CRM_Core_DAO::buildOptionsContext.
+ * @param array $props whatever is known about this dao object.
*
* @return array|bool
*/
* @param int $contributionPageID
* @param string $widgetID
*
- * @return stdClass
+ * @return object
*/
public static function getContributionPageData($contributionPageID, $widgetID) {
$config = CRM_Core_Config::singleton();
) {
$data['is_active'] = FALSE;
$data['campaign_start'] = ts('Campaign starts on %1', array(
- 1 => CRM_Utils_Date::customFormat($dao->start_date,
- $config->dateformatFull
+ 1 => CRM_Utils_Date::customFormat($dao->start_date, $config->dateformatFull),
)
- ));
+ );
}
}
$endDate < $now
) {
$data['is_active'] = FALSE;
- $data['campaign_start'] = ts('Campaign ended on %1', array(
- 1 => CRM_Utils_Date::customFormat($dao->end_date,
- $config->dateformatFull
+ $data['campaign_start'] = ts('Campaign ended on %1',
+ array(
+ 1 => CRM_Utils_Date::customFormat($dao->end_date, $config->dateformatFull),
)
- ));
+ );
}
elseif ($startDate >= $now) {
- $data['campaign_start'] = ts('Campaign starts on %1', array(
- 1 => CRM_Utils_Date::customFormat($dao->start_date,
- $config->dateformatFull
+ $data['campaign_start'] = ts('Campaign starts on %1',
+ array(
+ 1 => CRM_Utils_Date::customFormat($dao->start_date, $config->dateformatFull),
)
- ));
+ );
}
else {
- $data['campaign_start'] = ts('Campaign ends on %1', array(
- 1 => CRM_Utils_Date::customFormat($dao->end_date,
- $config->dateformatFull
+ $data['campaign_start'] = ts('Campaign ends on %1',
+ array(
+ 1 => CRM_Utils_Date::customFormat($dao->end_date, $config->dateformatFull),
)
- ));
+ );
}
}
}
$data['money_target_display'] = CRM_Utils_Money::format($data['money_target']);
$data['money_raised'] = ts('Raised %1 of %2', array(
1 => CRM_Utils_Money::format($data['money_raised']),
- 2 => $data['money_target_display']
+ 2 => $data['money_target_display'],
));
}
else {
* Format size
*
*/
-
public static function formatUnitSize($size, $checkForPostMax = FALSE) {
if ($size) {
$last = strtolower($size{strlen($size) - 1});
/**
* Class constructor
*
- * @param void
+ * @return void
*/
public function __construct() {
$config = CRM_Core_Config::singleton();
/**
* @param string $message
*
- * @return array|null
+ * @return void
* collection of permissions, null if none
*/
public function logEntry($message) {
* @param array $params
* Assoc array of input parameters for this transaction.
*
- * @return array
+ * @return void
* the result in an nice formatted array (or an error object)
* @abstract
*/
case 'event_type_id':
$qillName = $name;
- if (in_array($name, array('event_id', 'event_is_public'))) {
+ if (in_array($name, array(
+ 'event_id',
+ 'event_is_public',
+ )
+ )) {
$name = str_replace('event_', '', $name);
}
$dataType = !empty($fields[$qillName]['type']) ? CRM_Utils_Type::typeToString($fields[$qillName]['type']) : 'String';
*
* @return array|null
*/
- static function defaultReturnProperties(
+ public static function defaultReturnProperties(
$mode,
$includeCustomFields = TRUE
) {
$this->setMaxFileSize($uploadFileSize);
$this->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
1 => $uploadSize,
- 2 => $uploadFileSize
+ 2 => $uploadFileSize,
)), 'maxfilesize', $uploadFileSize);
$this->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
$this->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
/**
* Class constructor
*/
- function __construct($controller, $action = CRM_Core_Action::NONE) {
+ public function __construct($controller, $action = CRM_Core_Action::NONE) {
parent::__construct($controller, $action);
$this->_pages = array();
$form->setMaxFileSize($uploadFileSize);
$form->addRule('uploadFile', ts('File size should be less than %1 MBytes (%2 bytes)', array(
1 => $uploadSize,
- 2 => $uploadFileSize
+ 2 => $uploadFileSize,
)), 'maxfilesize', $uploadFileSize);
$form->addRule('uploadFile', ts('Input file must be in CSV format'), 'utf8File');
$form->addRule('uploadFile', ts('A valid file must be uploaded.'), 'uploadedfile');
/**
* Abstract function definitions
*/
- abstract function init();
+ abstract protected function init();
/**
* @return mixed
*/
- abstract function fini();
+ abstract protected function fini();
/**
* @param $values
*
* @return mixed
*/
- abstract function mapField(&$values);
+ abstract protected function mapField(&$values);
/**
* @param $values
*
* @return mixed
*/
- abstract function preview(&$values);
+ abstract protected function preview(&$values);
/**
* @param $values
*
* @return mixed
*/
- abstract function summary(&$values);
+ abstract protected function summary(&$values);
/**
* @param $onDuplicate
*
* @return mixed
*/
- abstract function import($onDuplicate, &$values);
+ abstract protected function import($onDuplicate, &$values);
/**
* Set and validate field values
parent::__construct();
CRM_Utils_System::resetBreadCrumb();
- $breadcrumb =
+ $breadcrumb = array(
array(
- array(
- 'title' => ts('Home'),
- 'url' => CRM_Utils_System::url()
- ),
- array(
- 'title' => ts('CiviCRM'),
- 'url' => CRM_Utils_System::url('civicrm', 'reset=1')
- ),
- array(
- 'title' => ts('View Contact'),
- 'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}")
- ),
- array(
- 'title' => ts('Search Results'),
- 'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1")
- ),
- );
+ 'title' => ts('Home'),
+ 'url' => CRM_Utils_System::url(),
+ ),
+ array(
+ 'title' => ts('CiviCRM'),
+ 'url' => CRM_Utils_System::url('civicrm', 'reset=1'),
+ ),
+ array(
+ 'title' => ts('View Contact'),
+ 'url' => CRM_Utils_System::url('civicrm/contact/view', "reset=1&cid={$this->cid}"),
+ ),
+ array(
+ 'title' => ts('Search Results'),
+ 'url' => CRM_Utils_System::url('civicrm/contact/search', "force=1"),
+ ),
+ );
CRM_Utils_System::appendBreadCrumb($breadcrumb);
if (CRM_Utils_Request::retrieve('revert', 'Boolean', CRM_Core_DAO::$_nullObject)) {
// make sure the report works even without the params
if (!$this->log_conn_id or !$this->log_date) {
- $dao = new CRM_Core_DAO;
+ $dao = new CRM_Core_DAO();
$dao->query("SELECT log_conn_id, log_date FROM `{$this->db}`.log_{$this->tables[0]} WHERE log_action = 'Update' ORDER BY log_date DESC LIMIT 1");
$dao->fetch();
$this->log_conn_id = $dao->log_conn_id;
if ($fullEmail) {
// parse the email and set a new destination
- $parser = new ezcMailParser;
+ $parser = new ezcMailParser();
$set = new ezcMailVariableSet($fullEmail);
$parsed = array_shift($parser->parseMail($set));
$parsed->to = array(new ezcMailAddress($mailing->replyto_email));
/**
* Set variables up before form is built
*
- * @param null
- *
* @return void
*/
public function preProcess() {
* Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
- * @param null
- *
- * @return array
- * array of default values
+ * @return array|void array of default values
*/
public function setDefaultValues() {
if ($this->_action == CRM_Core_Action::DELETE) {
- return;
+ return NULL;
}
$defaults = array();
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
),
)
);
- return;
+ return NULL;
}
else {
$attributes = CRM_Core_DAO::getAttribute('CRM_Price_DAO_PriceFieldValue');
$this->assign('showMember', TRUE);
$membershipTypes = CRM_Member_PseudoConstant::membershipType();
$this->add('select', 'membership_type_id', ts('Membership Type'), array(
- '' => ' '
+ '' => ' ',
) + $membershipTypes, FALSE,
array('onClick' => "calculateRowValues( );")
);
/**
* Process the form
*
- * @param null
- *
* @return void
*/
public function postProcess() {
if (CRM_Price_BAO_PriceFieldValue::del($this->_oid)) {
CRM_Core_Session::setStatus(ts('%1 option has been deleted.', array(1 => $label)), ts('Record Deleted'), 'success');
}
- return;
+ return NULL;
}
else {
$params = $ids = array();
*
* gets session variables for group or field id
*
- * @param null
- *
* @return void
*/
- function preProcess() {
+ public function preProcess() {
// get the controller vars
$groupId = $this->get('groupId');
$fieldId = $this->get('fieldId');
array(
'title' => ts('Price Set Fields'),
'url' => $url,
- )
+ ),
);
}
else {
array(
'title' => ts('Price Sets'),
'url' => $url,
- )
+ ),
);
}
CRM_Utils_System::appendBreadCrumb($breadCrumb);
/**
* Set the default form values
*
- * @param null
- *
* @return array
* the default array reference
*/
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
/**
* Set variables up before form is built
*
- * @param null
- *
* @return void
*/
public function preProcess() {
array(
'title' => ts('Price Sets'),
'url' => $url,
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
}
/**
* Build the form object
*
- * @param null
- *
* @return void
*/
public function buildQuickForm() {
* Set default values for the form. Note that in edit/view mode
* the default values are retrieved from the database
*
- * @param null
- *
* @return array
* array of default values
*/
/**
* Process the form
*
- * @param null
- *
* @return void
*/
public function postProcess() {
'reset' => 1,
'action' => $action,
'sid' => $set->id,
- 'new' => 1
+ 'new' => 1,
));
CRM_Core_Session::setStatus(ts("Your Set '%1' has been added. You can add fields to this set now.",
array(1 => $set->title)
switch ($type) {
case CRM_Report_Form::OP_INT:
case CRM_Report_Form::OP_FLOAT:
+
return array(
'lte' => ts('Is less than or equal to'),
'gte' => ts('Is greater than or equal to'),
case CRM_Report_Form::OP_MONTH:
case CRM_Report_Form::OP_MULTISELECT:
case CRM_Report_Form::OP_ENTITYREF:
+
return array(
'in' => ts('Is one of'),
'notin' => ts('Is not one of'),
);
case CRM_Report_Form::OP_DATE:
+
return array(
'nll' => ts('Is empty (Null)'),
'nnll' => ts('Is not empty (Null)'),
*/
public function formatCustomValues($value, $customField, $fieldValueMap) {
if (CRM_Utils_System::isNull($value)) {
- return;
+ return NULL;
}
$htmlType = $customField['html_type'];
'url' => CRM_Utils_System::url('civicrm/admin/sms/provider',
'reset=1'
),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
/**
* Browse all Providers.
*
- * @param null $action
+ * @param array $action
*
* @return void
*/
if ($dao->N) {
$postUpgradeMessage .= '<br /><br /><strong>' . ts('Your database contains %1 financial transaction records with no payment instrument (Paid By is empty). If you use the Accounting Batches feature this may result in unbalanced transactions. If you do not use this feature, you can ignore the condition (although you will be required to select a Paid By value for new transactions). <a href="%2" target="_blank">You can review steps to correct transactions with missing payment instruments on the wiki.</a>', array(
1 => $dao->N,
- 2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Transactions+Missing+a+Payment+Instrument+-+4.4.3+Upgrades'
+ 2 => 'http://wiki.civicrm.org/confluence/display/CRMDOC/Fixing+Transactions+Missing+a+Payment+Instrument+-+4.4.3+Upgrades',
)) . '</strong>';
}
}
}
/**
- * @param CRM_Queue_TaskContext $ctx
- * @param int $startId
- * @param int $endId
+ * @param $rev
+ * @param $originalVer
+ * @param $latestVer
*
- * @return bool
+ * @return void
*/
public function upgrade_4_4_7($rev, $originalVer, $latestVer) {
// For WordPress/Joomla(?), cleanup broken image_URL from 4.4.6 upgrades - https://issues.civicrm.org/jira/browse/CRM-14971
}
- /***
+ /**
* CRM-13998 missing alter statements for civicrm_report_instance
- ***/
+ */
public function updateReportInstanceTable() {
// add civicrm_report_instance.name
$config = CRM_Core_Config::singleton();
if (is_callable(array(
$config->userSystem,
- 'replacePermission'
+ 'replacePermission',
))) {
$config->userSystem->replacePermission('access CiviMail', array(
'access CiviMail',
'create mailings',
'approve mailings',
- 'schedule mailings'
+ 'schedule mailings',
));
}
}
$config->userSystem->replacePermission('access CiviCase', array(
'access my cases and activities',
'access all cases and activities',
- 'administer CiviCase'
+ 'administer CiviCase',
));
//insert core acls.
* @param $rev
*/
public function upgrade_3_2_beta4($rev) {
- $upgrade = new CRM_Upgrade_Form;
+ $upgrade = new CRM_Upgrade_Form();
$config = CRM_Core_Config::singleton();
$seedLocale = $config->lcMessages;
// CRM-6451: for multilingual sites we need to find the optimal
// locale to use as the final civicrm_membership_status.name column
- $domain = new CRM_Core_DAO_Domain;
+ $domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
$locales = array();
if ($domain->locales) {
foreach (array(
'en_US',
'en_GB',
- 'en_AU'
+ 'en_AU',
) as $loc) {
if (in_array($loc, $locales)) {
$seedLocale = $loc;
$statusIds = array();
$insertedNewRecord = FALSE;
foreach ($statuses as $status) {
- $dao = new CRM_Member_DAO_MembershipStatus;
+ $dao = new CRM_Member_DAO_MembershipStatus();
// try to find an existing English status
$dao->name = $status['name'];
$config = CRM_Core_Config::singleton();
CRM_Utils_File::restrictAccess($config->uploadDir);
CRM_Utils_File::restrictAccess($config->configAndLogDir);
- $upgrade = new CRM_Upgrade_Form;
+ $upgrade = new CRM_Upgrade_Form();
$upgrade->assign('addActivityTypeIndex', $addActivityTypeIndex);
$upgrade->processSQL($rev);
}
* @param array $values
* @param bool $stateName
*
- * @return boolean
+ * @return bool
* true if we modified the address, false otherwise
*/
public static function format(&$values, $stateName = FALSE) {
list ($program, $target, $suite) = $argv;
$candidateTests = \Civi\CiUtil\PHPUnitScanner::findTestsByPath(array($suite));
-// $candidateTests = array(
-// array('class' => 'CRM_Core_RegionTest', 'method' => 'testBlank'),
-// array('class' => 'CRM_Core_RegionTest', 'method' => 'testDefault'),
-// array('class' => 'CRM_Core_RegionTest', 'method' => 'testOverride'),
-// array('class' => 'CRM_Core_RegionTest', 'method' => 'testAllTypes'),
-// );
+ // $candidateTests = array(
+ // array('class' => 'CRM_Core_RegionTest', 'method' => 'testBlank'),
+ // array('class' => 'CRM_Core_RegionTest', 'method' => 'testDefault'),
+ // array('class' => 'CRM_Core_RegionTest', 'method' => 'testOverride'),
+ // array('class' => 'CRM_Core_RegionTest', 'method' => 'testAllTypes'),
+ // );
$antagonist = self::findAntagonist($target, $candidateTests);
if ($antagonist) {
print_r(array('found an antagonist' => $antagonist));
* @return array <string> class names
*/
public static function _findTestClasses($path) {
-// print_r(array(
-// 'loading' => $path,
-// get_included_files()
-// ));
-
+ // print_r(array(
+ // 'loading' => $path,
+ // get_included_files()
+ // ));
$origClasses = get_declared_classes();
require_once $path;
$newClasses = get_declared_classes();
/**
* @param $paths
* @return array (string $file => string $class)
- * (string $file => string $class)
* @throws \Exception
*/
public static function findTestClasses($paths) {
$r[] = array(
'file' => $testFile,
'class' => $testClass,
- 'method' => $method->name
+ 'method' => $method->name,
);
}
}
*/
public $request;
- function __construct($e, $request) {
+ public function __construct($e, $request) {
$this->request = $request;
$this->exception = $e;
}
/**
* @param array $params
- * @return array
- * (0 => int $id, 1 => array $file, 2 => array $entityFile, 3 => string $name, 4 => string $content, 5 => string $moveFile, 6 => $isTrusted, 7 => bool $returnContent)
- * - array $file: whitelisted fields that can pass through directly to civicrm_file
- * - array $entityFile: whitelisted fields that can pass through directly to civicrm_entity_file
- * - string $name: the printable name
- * - string $moveFile: the full path to a local file whose content should be loaded
- * - bool $isTrusted: whether we trust the requester to do sketchy things (like moving files or reassigning entities)
- * - bool $returnContent: whether we are expected to return the full content of the file
+ * @return array (0 => int $id, 1 => array $file, 2 => array $entityFile, 3 => string $name, 4 => string $content,
+ * 5 => string $moveFile, 6 => $isTrusted, 7 => bool $returnContent)
+ * - array $file: whitelisted fields that can pass through directly to civicrm_file
+ * - array $entityFile: whitelisted fields that can pass through directly to civicrm_entity_file
+ * - string $name: the printable name
+ * - string $moveFile: the full path to a local file whose content should be loaded
+ * - bool $isTrusted: whether we trust the requester to do sketchy things (like moving files or reassigning entities)
+ * - bool $returnContent: whether we are expected to return the full content of the file
* @throws API_Exception validation errors
*/
function _civicrm_api3_attachment_parse_params($params) {
*
* @example ContributionSoftCreate.php Standard Create Example //FIXME
*
- * @return array
- * API result array
- * {@getfields contribution_soft_create}
+ * @return array API result array {@getfields contribution_soft_create}
*/
function civicrm_api3_contribution_soft_create($params) {
return _civicrm_api3_basic_create(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* @param array $params
*
* @example ContributionSoftDelete.php Standard Delete Example
- *
- * @return boolean
- * | error true if successfull, error otherwise
* {@getfields contribution_soft_delete}
*/
function civicrm_api3_contribution_soft_delete($params) {
/**
* Retrieve one or more Soft Credits
*
- * @param array input parameters
- *
- *
* @example ContributionSoftGet.php Standard Get Example
*
- * @param array $params
- * An associative array of name/value pairs.
+ * @param array $params An associative array of name/value pairs.
*
- * @return array
- * api result
- * {@getfields contribution_soft_get}
+ * @return array api result {@getfields contribution_soft_get}
*/
function civicrm_api3_contribution_soft_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* Associative array of property.
* name/value pairs to insert in new 'survey'
*
- * @return array
- * api result array
- * {@getfields mailing_event_unsubscribe_create}
+ * @return array api result array {@getfields mailing_event_unsubscribe_create}
*/
function civicrm_api3_mailing_event_unsubscribe_create($params) {
return civicrm_api3_create_success($params);
}
-
return civicrm_api3_create_error('Queue event could not be found');
}
$ufGroupBAO->setComponentDefaults($activityFields, $params['activity_id'], 'Activity', $values[$profileID], TRUE);
}
}
- elseif(!empty($params['contact_id'])) {
+ elseif (!empty($params['contact_id'])) {
$ufGroupBAO->setProfileDefaults($params['contact_id'], $profileFields, $values[$profileID], TRUE);
foreach ($values[$profileID] as $fieldName => $field) {
// we should return 'Primary' with & without capitalisation. it is more consistent with api to not
$values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result['api.address.get.1']['values'][0][$fieldname]) ? $result['api.address.get.1']['values'][0][$fieldname] : '';
}
}
- elseif(!empty($result['api.address.get.2']['count'])) {
+ elseif (!empty($result['api.address.get.2']['count'])) {
foreach ($addressFields as $fieldname) {
$values['billing_' . $fieldname . '-' . $locationTypeID] = isset($result['api.address.get.2']['values'][0][$fieldname]) ? $result['api.address.get.2']['values'][0][$fieldname] : '';
}
if (!empty($result['api.email.get.1']['count'])) {
$values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.1']['values'][0]['email'];
}
- elseif(!empty($result['api.email.get.2']['count'])) {
+ elseif (!empty($result['api.email.get.2']['count'])) {
$values['billing-email' . '-' . $locationTypeID] = $result['api.email.get.2']['values'][0]['email'];
}
else {
* 0 = don't resolve, 1 = resolve non-aggressively, 2 = resolve aggressively - ie include country & state.
* @param $is_flush
*
- * @return array
+ * @return array|void
*/
function _civicrm_api3_buildprofile_submitfields($profileID, $optionsBehaviour = 1, $is_flush) {
static $profileFields = array();
if ($is_flush) {
$profileFields = array();
if (empty($profileID)) {
- return;
+ return NULL;
}
}
if (isset($profileFields[$profileID])) {
}
$fieldName .= '-' . $field['location_type_id'];
}
- elseif(array_key_exists($fieldName, $locationFields)) {
+ elseif (array_key_exists($fieldName, $locationFields)) {
$fieldName .= '-Primary';
$entity = 'email';
}
'soft_credit_type' => 'contribution_soft',
'group' => 'group_contact',
'tag' => 'entity_tag',
- );
+ );
if (array_key_exists($fieldName, $hardCodedEntityMappings)) {
$entity = $hardCodedEntityMappings[$fieldName];
}
$this->assertEquals(array(1), $caseIds);
}
- /* FIXME: need to create an activity to run this test
+ /**
+ * FIXME: need to create an activity to run this test
* function testGetCases() {
* $cases = CRM_Case_BAO_Case::getCases(TRUE, 3);
* $this->assertEquals('Housing Support', $cases[1]['case_type']);
* $this->assertEquals(1, $cases[1]['case_type_id']);
* }
*/
-
public function testGetCasesSummary() {
$cases = CRM_Case_BAO_Case::getCasesSummary(TRUE, 3);
$this->assertEquals(1, $cases['rows']['Housing Support']['Ongoing']['count']);
}
$rows = array(
- 0 =>
-
- array(
- 'first_name' => $firstName1,
- 'last_name' => 'Anderson',
- 'address_1' => 'Add 1',
- 'address_2' => 'Add 2',
- 'city' => 'Watson',
- 'state' => 'NY',
- 'country' => 'United States',
- ),
+ 0 => array(
+ 'first_name' => $firstName1,
+ 'last_name' => 'Anderson',
+ 'address_1' => 'Add 1',
+ 'address_2' => 'Add 2',
+ 'city' => 'Watson',
+ 'state' => 'NY',
+ 'country' => 'United States',
+ ),
);
foreach ($customDataParams['rows'][0] as $key => $values) {
$rows[0][$key] = $values;
$this->openCiviPage('admin/uf/group/field/add', array(
'action' => 'add',
'reset' => 1,
- 'gid' => $gid
+ 'gid' => $gid,
), 'field_name[0]');
//Add field to profile
public function testCreateCustomValue() {
$params = array(
- 'custom_' . $this->ids['single']['custom_field_id'] => 'customString'
- ) + $this->params;
+ 'custom_' . $this->ids['single']['custom_field_id'] => 'customString',
+ ) + $this->params;
$result = $this->callAPIAndDocument('custom_value', 'create', $params, __FUNCTION__, __FILE__);
$this->assertEquals(1, $result['count'], 'In line ' . __LINE__);
)
);
- $op = new PHPUnit_Extensions_Database_Operation_Insert;
+ $op = new PHPUnit_Extensions_Database_Operation_Insert();
$op->execute(
$this->_dbconn,
$this->createFlatXMLDataSet(dirname(__FILE__) . '/dataset/uf_group_test.xml')