$status = array(ts('%count activities tagged', array('count' => $added, 'plural' => '%count activities tagged')));
if ($notAdded) {
$status[] = ts('%count activities already had this tag', array(
- 'count' => $notAdded,
- 'plural' => '%count activities already had this tag'
- ));
+ 'count' => $notAdded,
+ 'plural' => '%count activities already had this tag',
+ ));
}
$status = '<ul><li>' . implode('</li><li>', $status) . '</li></ul>';
CRM_Core_Session::setStatus($status, ts("Added Tag <em>%1</em>", array(1 => $this->_tags[$key])), 'success', array('expires' => 0));
* @param string $inputCheck
* Checksum to match against.
*
- * @return boolean
+ * @return bool
* true if valid, else false
*/
public static function validChecksum($contactID, $inputCheck) {
'relationship_type_id' => $relTypeId . '_a_b',
'contact_check' => array($organization => TRUE),
);
- list($valid, $invalid, $duplicate,
- $saved, $relationshipIds
- ) = CRM_Contact_BAO_Relationship::createMultiple($relationshipParams, $cid);
-
+ list($valid, $invalid, $duplicate, $saved, $relationshipIds)
+ = CRM_Contact_BAO_Relationship::createMultiple($relationshipParams, $cid);
// In case we change employer, clean previous employer related records.
if (!$previousEmployerID && !$newContact) {
// check permission on acl basis.
if (in_array($task, array(
'view',
- 'edit'
+ 'edit',
))) {
$aclPermission = CRM_Core_Permission::VIEW;
if ($task == 'edit') {
foreach ($returnProperties as $property => $ignore) {
$value = (in_array($property, array(
'city',
- 'street_address'
+ 'street_address',
))) ? 'address' : $property;
switch ($property) {
case 'sort_name':
* @param string $greetingType
* Greeting type.
*
- * @return int
- * or null
+ * @return int|NULL
*/
public static function defaultGreeting($contactType, $greetingType) {
- $contactTypeFilters = array('Individual' => 1, 'Household' => 2, 'Organization' => 3);
+ $contactTypeFilters = array(
+ 'Individual' => 1,
+ 'Household' => 2,
+ 'Organization' => 3,
+ );
if (!isset($contactTypeFilters[$contactType])) {
- return;
+ return NULL;
}
$filter = $contactTypeFilters[$contactType];
* @param string $groupElementType
*
*/
- static function buildQuickForm(
+ public static function buildQuickForm(
&$form,
$contactId = 0,
$type = self::ALL,
// more than one contact deleted
$message = ts('One of the selected contacts has an address record that is shared with 1 other contact.', array(
'plural' => 'One or more selected contacts have address records which are shared with %count other contacts.',
- 'count' => $sharedAddressCount
+ 'count' => $sharedAddressCount,
));
}
else {
// only one contact deleted
$message = ts('This contact has an address record which is shared with 1 other contact.', array(
'plural' => 'This contact has an address record which is shared with %count other contacts.',
- 'count' => $sharedAddressCount
+ 'count' => $sharedAddressCount,
));
}
CRM_Core_Session::setStatus($message . ' ' . ts('Shared addresses will not be removed or altered but will no longer be shared.'), ts('Shared Addesses Owner'));
$status = ts('%1 has been restored from the trash.', array(
1 => $name,
'plural' => '%count contacts restored from trash.',
- 'count' => $deleted
+ 'count' => $deleted,
));
}
elseif ($this->_skipUndelete) {
$status = ts('%1 has been permanently deleted.', array(
1 => $name,
'plural' => '%count contacts permanently deleted.',
- 'count' => $deleted
+ 'count' => $deleted,
));
}
else {
$status = ts('%1 has been moved to the trash.', array(
1 => $name,
'plural' => '%count contacts moved to trash.',
- 'count' => $deleted
+ 'count' => $deleted,
));
}
$session->setStatus($status, $title, 'success');
AND e.is_primary = 1
AND c.id IN ( $contactIDs )";
-
$rows = array();
$dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
'groupAdditions',
'tagAdditions',
'unMatchCount',
- 'unparsedAddressCount'
+ 'unparsedAddressCount',
);
foreach ($properties as $property) {
$this->assign($property, $this->get($property));
*
* @return mixed
*/
- function run(
+ public function run(
$tableName,
&$mapper,
$mode = self::MODE_PREVIEW,
* Given a list of the importable field keys that the user has selected
* set the active fields array to this list
*
- * @param array mapped array of values
- *
- * @return void
+ * @param array $fieldKeys
+ * Mapped array of values.
*/
public function setActiveFields($fieldKeys) {
$this->_activeFieldCount = count($fieldKeys);
}
$value = array(
- $this->_activeFields[$i]->_name =>
- $this->_activeFields[$i]->_value,
- 'location_type_id' =>
- $this->_activeFields[$i]->_hasLocationType,
+ $this->_activeFields[$i]->_name => $this->_activeFields[$i]->_value,
+ 'location_type_id' => $this->_activeFields[$i]->_hasLocationType,
);
if (isset($this->_activeFields[$i]->_phoneType)) {
* @param string $dataPattern
* @param bool $hasLocationType
*/
- function addField(
+ public function addField(
$name, $title, $type = CRM_Utils_Type::T_INT,
$headerPattern = '//', $dataPattern = '//',
$hasLocationType = FALSE
* associated array
*
*/
- static function processConfirm(
+ public static function processConfirm(
&$form,
&$paymentParams,
&$premiumParams,
1 => array(
'email' => $params['email'],
'location_type_id' => $billingLocTypeId,
- )
+ ),
);
}
if (!in_array($type, array(
'paypal',
'google',
- 'csv'
+ 'csv',
))
) {
// return the params as is
// if this is a recurring contribution then process it first
if ($params['trxn_type'] == 'subscrpayment') {
// see if a recurring record already exists
- $recurring = new CRM_Contribute_BAO_ContributionRecur;
+ $recurring = new CRM_Contribute_BAO_ContributionRecur();
$recurring->processor_id = $params['processor_id'];
if (!$recurring->find(TRUE)) {
- $recurring = new CRM_Contribute_BAO_ContributionRecur;
+ $recurring = new CRM_Contribute_BAO_ContributionRecur();
$recurring->invoice_id = $params['invoice_id'];
$recurring->find(TRUE);
}
*
* @throws Exception
*/
- static function filePostProcess(
+ public static function filePostProcess(
$data,
$fileTypeID,
$entityTable,
* @param $entityTable
* @param int $entityID
*/
- static function formatAttachment(
+ public static function formatAttachment(
&$formValues,
&$params,
$entityTable,
*
* @param int $optionGroupId
* Id of the Option Group to be deleted.
- *
- * @return void
- *
*/
public static function del($optionGroupId) {
// need to delete all option value field before deleting group
* @param int $optionGroupId
* Id of the Option Group.
*
- * @return String
+ * @return string
* title
- *
*/
public static function getTitle($optionGroupId) {
$optionGroup = new CRM_Core_DAO_OptionGroup();
$wherePrev = " WHERE pn.id < %1 AND pn.cacheKey = %2 {$where} ORDER BY ID DESC LIMIT 1";
$sqlPrev = $sql . $wherePrev;
-
$dao = CRM_Core_DAO::executeQuery($sqlPrev, $p);
if ($dao->fetch()) {
$pos['prev']['id1'] = $dao->entity_id1;
$sql = "DELETE FROM civicrm_prevnext_cache WHERE entity_table = %1";
$params = array(1 => array($entityTable, 'String'));
- $pair =
- !$isViceVersa ?
- "entity_id1 = %2 AND entity_id2 = %3" :
- "(entity_id1 = %2 AND entity_id2 = %3) OR (entity_id1 = %3 AND entity_id2 = %2)";
+ $pair = !$isViceVersa ? "entity_id1 = %2 AND entity_id2 = %3" : "(entity_id1 = %2 AND entity_id2 = %3) OR (entity_id1 = %3 AND entity_id2 = %2)";
$sql .= " AND ( {$pair} )";
$params[2] = array($id1, 'Integer');
$params[3] = array($id2, 'Integer');
* @param string $entity_table
* Entity table.
*
- * @return array
+ * @return array|NULL
*/
public static function getSelection($cacheKey, $action = 'get', $entity_table = 'civicrm_contact') {
if (!$cacheKey) {
- return;
+ return NULL;
}
$params = array();
* URL of a .zip file.
* @param string $localFile
* Path at which to store the .zip file.
- * @return boolean
+ * @return bool
* Whether the download was successful.
*/
public function fetch($remoteFile, $localFile) {
case self::STATUS_INSTALLED_MISSING:
throw new CRM_Extension_Exception("Cannot uninstall extension; disable it first: $key");
- break;
case self::STATUS_DISABLED:
list ($info, $typeManager) = $this->_getInfoTypeHandler($key); // throws Exception
$typeManager->onPreUninstall($info);
/**
* Retrieve the default payment processor
*
- * @param NULL
- *
* @return object
* The default payment processor object on success,
* null otherwise
* @param int $paymentProcessorTypeId
* ID of the processor to be deleted.
*
- * @return bool
+ * @return bool|NULL
*/
public static function del($paymentProcessorTypeId) {
$query = "
if ($dao->fetch()) {
CRM_Core_Session::setStatus(ts('There is a Payment Processor associated with selected Payment Processor type, hence it can not be deleted.'), ts('Deletion Error'), 'error');
- return;
+ return NULL;
}
$paymentProcessorType = new CRM_Financial_DAO_PaymentProcessorType();
$this->add('text', 'accounting_code', ts('Accounting Code'), $attributes['accounting_code']);
$elementAccounting = $this->add('text', 'account_type_code', ts('Account Type Code'), $attributes['account_type_code']);
$this->addEntityRef('contact_id', ts('Owner'), array(
- 'api' => array('params' => array('contact_type' => 'Organization')),
- 'create' => TRUE
- ));
+ 'api' => array('params' => array('contact_type' => 'Organization')),
+ 'create' => TRUE,
+ ));
$this->add('text', 'tax_rate', ts('Tax Rate'), $attributes['tax_rate']);
$this->add('checkbox', 'is_deductible', ts('Tax-Deductible?'));
$elementActive = $this->add('checkbox', 'is_active', ts('Enabled?'));
'url' => CRM_Utils_System::url('civicrm/group',
'reset=1'
),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
$groupValues = array(
'id' => $this->_id,
'title' => $this->_title,
- 'saved_search_id' =>
- isset($this->_groupValues['saved_search_id']) ? $this->_groupValues['saved_search_id'] : '',
+ 'saved_search_id' => isset($this->_groupValues['saved_search_id']) ? $this->_groupValues['saved_search_id'] : '',
);
if (isset($this->_groupValues['saved_search_id'])) {
$groupValues['mapping_id'] = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_SavedSearch',
);
}
if (!empty($this->_groupValues['created_id'])) {
- $groupValues['created_by'] =
- CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", $this->_groupValues['created_id'], 'sort_name', 'id');
+ $groupValues['created_by'] = CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", $this->_groupValues['created_id'], 'sort_name', 'id');
}
if (!empty($this->_groupValues['modified_id'])) {
- $groupValues['modified_by'] =
- CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", $this->_groupValues['modified_id'], 'sort_name', 'id');
+ $groupValues['modified_by'] = CRM_Core_DAO::getFieldValue("CRM_Contact_DAO_Contact", $this->_groupValues['modified_id'], 'sort_name', 'id');
}
$this->assign_by_ref('group', $groupValues);
$this->addButtons(array(
array(
'type' => 'upload',
- 'name' =>
- ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'),
+ 'name' => ($this->_action == CRM_Core_Action::ADD) ? ts('Continue') : ts('Save'),
'isDefault' => TRUE,
),
array(
$assigneeID = CRM_Utils_Array::key('Activity Assignees', $activityContacts);
$targetID = CRM_Utils_Array::key('Activity Targets', $activityContacts);
- $this->_logTables =
- array(
- 'log_civicrm_contact' => array(
- 'fk' => 'id',
+ $this->_logTables = array(
+ 'log_civicrm_contact' => array(
+ 'fk' => 'id',
+ ),
+ 'log_civicrm_email' => array(
+ 'fk' => 'contact_id',
+ 'log_type' => 'Contact',
+ ),
+ 'log_civicrm_phone' => array(
+ 'fk' => 'contact_id',
+ 'log_type' => 'Contact',
+ ),
+ 'log_civicrm_address' => array(
+ 'fk' => 'contact_id',
+ 'log_type' => 'Contact',
+ ),
+ 'log_civicrm_note' => array(
+ 'fk' => 'entity_id',
+ 'entity_table' => TRUE,
+ 'bracket_info' => array(
+ 'table' => 'log_civicrm_note',
+ 'column' => 'subject',
),
- 'log_civicrm_email' => array(
- 'fk' => 'contact_id',
- 'log_type' => 'Contact',
+ ),
+ 'log_civicrm_note_comment' => array(
+ 'fk' => 'entity_id',
+ 'table_name' => 'log_civicrm_note',
+ 'joins' => array(
+ 'table' => 'log_civicrm_note',
+ 'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'",
),
- 'log_civicrm_phone' => array(
- 'fk' => 'contact_id',
- 'log_type' => 'Contact',
+ 'entity_table' => TRUE,
+ 'bracket_info' => array(
+ 'table' => 'log_civicrm_note',
+ 'column' => 'subject',
),
- 'log_civicrm_address' => array(
- 'fk' => 'contact_id',
- 'log_type' => 'Contact',
+ ),
+ 'log_civicrm_group_contact' => array(
+ 'fk' => 'contact_id',
+ 'bracket_info' => array(
+ 'entity_column' => 'group_id',
+ 'table' => 'log_civicrm_group',
+ 'column' => 'title',
),
- 'log_civicrm_note' => array(
- 'fk' => 'entity_id',
- 'entity_table' => TRUE,
- 'bracket_info' => array(
- 'table' => 'log_civicrm_note',
- 'column' => 'subject',
- ),
+ 'action_column' => 'status',
+ 'log_type' => 'Group',
+ ),
+ 'log_civicrm_entity_tag' => array(
+ 'fk' => 'entity_id',
+ 'bracket_info' => array(
+ 'entity_column' => 'tag_id',
+ 'table' => 'log_civicrm_tag',
+ 'column' => 'name',
),
- 'log_civicrm_note_comment' => array(
- 'fk' => 'entity_id',
- 'table_name' => 'log_civicrm_note',
- 'joins' => array(
- 'table' => 'log_civicrm_note',
- 'join' => "entity_log_civireport.entity_id = fk_table.id AND entity_log_civireport.entity_table = 'civicrm_note'",
- ),
- 'entity_table' => TRUE,
- 'bracket_info' => array(
- 'table' => 'log_civicrm_note',
- 'column' => 'subject',
- ),
+ 'entity_table' => TRUE,
+ ),
+ 'log_civicrm_relationship' => array(
+ 'fk' => 'contact_id_a',
+ 'bracket_info' => array(
+ 'entity_column' => 'relationship_type_id',
+ 'table' => 'log_civicrm_relationship_type',
+ 'column' => 'label_a_b',
),
- 'log_civicrm_group_contact' => array(
- 'fk' => 'contact_id',
- 'bracket_info' => array(
- 'entity_column' => 'group_id',
- 'table' => 'log_civicrm_group',
- 'column' => 'title',
- ),
- 'action_column' => 'status',
- 'log_type' => 'Group',
+ ),
+ 'log_civicrm_activity_for_target' => array(
+ 'fk' => 'contact_id',
+ 'table_name' => 'log_civicrm_activity',
+ 'joins' => array(
+ 'table' => 'log_civicrm_activity_contact',
+ 'join' => "(entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$targetID})",
),
- 'log_civicrm_entity_tag' => array(
- 'fk' => 'entity_id',
- 'bracket_info' => array(
- 'entity_column' => 'tag_id',
- 'table' => 'log_civicrm_tag',
- 'column' => 'name',
- ),
- 'entity_table' => TRUE,
+ 'bracket_info' => array(
+ 'entity_column' => 'activity_type_id',
+ 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
),
- 'log_civicrm_relationship' => array(
- 'fk' => 'contact_id_a',
- 'bracket_info' => array(
- 'entity_column' => 'relationship_type_id',
- 'table' => 'log_civicrm_relationship_type',
- 'column' => 'label_a_b',
- ),
+ 'log_type' => 'Activity',
+ ),
+ 'log_civicrm_activity_for_assignee' => array(
+ 'fk' => 'contact_id',
+ 'table_name' => 'log_civicrm_activity',
+ 'joins' => array(
+ 'table' => 'log_civicrm_activity_contact',
+ 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$assigneeID}",
),
- 'log_civicrm_activity_for_target' => array(
- 'fk' => 'contact_id',
- 'table_name' => 'log_civicrm_activity',
- 'joins' => array(
- 'table' => 'log_civicrm_activity_contact',
- 'join' => "(entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$targetID})",
- ),
- 'bracket_info' => array(
- 'entity_column' => 'activity_type_id',
- 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
- ),
- 'log_type' => 'Activity',
+ 'bracket_info' => array(
+ 'entity_column' => 'activity_type_id',
+ 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
),
- 'log_civicrm_activity_for_assignee' => array(
- 'fk' => 'contact_id',
- 'table_name' => 'log_civicrm_activity',
- 'joins' => array(
- 'table' => 'log_civicrm_activity_contact',
- 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$assigneeID}",
- ),
- 'bracket_info' => array(
- 'entity_column' => 'activity_type_id',
- 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
- ),
- 'log_type' => 'Activity',
+ 'log_type' => 'Activity',
+ ),
+ 'log_civicrm_activity_for_source' => array(
+ 'fk' => 'contact_id',
+ 'table_name' => 'log_civicrm_activity',
+ 'joins' => array(
+ 'table' => 'log_civicrm_activity_contact',
+ 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$sourceID}",
),
- 'log_civicrm_activity_for_source' => array(
- 'fk' => 'contact_id',
- 'table_name' => 'log_civicrm_activity',
- 'joins' => array(
- 'table' => 'log_civicrm_activity_contact',
- 'join' => "entity_log_civireport.id = fk_table.activity_id AND fk_table.record_type_id = {$sourceID}",
- ),
- 'bracket_info' => array(
- 'entity_column' => 'activity_type_id',
- 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
- ),
- 'log_type' => 'Activity',
+ 'bracket_info' => array(
+ 'entity_column' => 'activity_type_id',
+ 'options' => CRM_Core_PseudoConstant::activityType(TRUE, TRUE, FALSE, 'label', TRUE),
),
- 'log_civicrm_case' => array(
- 'fk' => 'contact_id',
- 'joins' => array(
- 'table' => 'log_civicrm_case_contact',
- 'join' => 'entity_log_civireport.id = fk_table.case_id',
- ),
- 'bracket_info' => array(
- 'entity_column' => 'case_type_id',
- 'options' => CRM_Case_PseudoConstant::caseType('title', FALSE),
- ),
+ 'log_type' => 'Activity',
+ ),
+ 'log_civicrm_case' => array(
+ 'fk' => 'contact_id',
+ 'joins' => array(
+ 'table' => 'log_civicrm_case_contact',
+ 'join' => 'entity_log_civireport.id = fk_table.case_id',
),
- );
+ 'bracket_info' => array(
+ 'entity_column' => 'case_type_id',
+ 'options' => CRM_Case_PseudoConstant::caseType('title', FALSE),
+ ),
+ ),
+ );
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
// build _logTables for contact custom tables
$customTables = $logging->entityCustomDataLogTables('Contact');
// build _logTables for address custom tables
$customTables = $logging->entityCustomDataLogTables('Address');
foreach ($customTables as $table) {
- $this->_logTables[$table] =
- array(
- 'fk' => 'contact_id',// for join of fk_table with contact table
- 'joins' => array(
- 'table' => 'log_civicrm_address', // fk_table
- 'join' => 'entity_log_civireport.entity_id = fk_table.id',
- ),
- 'log_type' => 'Contact',
- );
+ $this->_logTables[$table] = array(
+ 'fk' => 'contact_id', // for join of fk_table with contact table
+ 'joins' => array(
+ 'table' => 'log_civicrm_address', // fk_table
+ 'join' => 'entity_log_civireport.entity_id = fk_table.id',
+ ),
+ 'log_type' => 'Contact',
+ );
}
// allow log tables to be extended via report hooks
$entityID = $id;
}
-
if ($entityID && $logDate &&
array_key_exists('table', $this->_logTables[$entity]['bracket_info'])
) {
* Drop triggers for all logged tables.
*/
public function dropTriggers($tableName = NULL) {
- $dao = new CRM_Core_DAO;
+ $dao = new CRM_Core_DAO();
if ($tableName) {
$tableNames = array($tableName);
// add report instances
$domain_id = CRM_Core_Config::domainID();
foreach ($this->reports as $report) {
- $dao = new CRM_Report_DAO_ReportInstance;
+ $dao = new CRM_Report_DAO_ReportInstance();
$dao->domain_id = $domain_id;
$dao->report_id = $report;
$dao->title = $titles[$report];
$dao->permission = 'administer CiviCRM';
- if ($report == 'logging/contact/summary')
+ if ($report == 'logging/contact/summary') {
$dao->is_reserved = 1;
+ }
$dao->insert();
}
}
if (!array_key_exists($dao->TABLE_NAME, $columnSpecs)) {
$columnSpecs[$dao->TABLE_NAME] = array();
}
- $columnSpecs[$dao->TABLE_NAME][$dao->COLUMN_NAME] =
- array(
- 'COLUMN_NAME' => $dao->COLUMN_NAME,
- 'DATA_TYPE' => $dao->DATA_TYPE,
- 'IS_NULLABLE' => $dao->IS_NULLABLE,
- 'COLUMN_DEFAULT' => $dao->COLUMN_DEFAULT,
- );
+ $columnSpecs[$dao->TABLE_NAME][$dao->COLUMN_NAME] = array(
+ 'COLUMN_NAME' => $dao->COLUMN_NAME,
+ 'DATA_TYPE' => $dao->DATA_TYPE,
+ 'IS_NULLABLE' => $dao->IS_NULLABLE,
+ 'COLUMN_DEFAULT' => $dao->COLUMN_DEFAULT,
+ );
}
}
return $columnSpecs[$table];
// delete report instances
$domain_id = CRM_Core_Config::domainID();
foreach ($this->reports as $report) {
- $dao = new CRM_Report_DAO_ReportInstance;
+ $dao = new CRM_Report_DAO_ReportInstance();
$dao->domain_id = $domain_id;
$dao->report_id = $report;
$dao->delete();
* @param string $hash
* The hash.
*
- * @return boolean
+ * @return bool
* Was the contact successfully unsubscribed?
*/
public static function unsub_from_domain($job_id, $queue_id, $hash) {
/**
* called when action is browse
- *
- * @return null
*/
public function browse() {
$links = self::links('all', $this->_isPaymentProcessor, $this->_accessContribution);
if (CRM_Utils_Array::value('is_current_member', $statusANDType[$dao->id]) // membership is active
&& CRM_Utils_Array::value('relationship_type_id', $statusANDType[$dao->id]) // membership type allows inheritance
&& empty($dao->owner_membership_id)
- ) { // not an related membership
+ ) {
+ // not an related membership
$query = "
SELECT COUNT(m.id)
FROM civicrm_membership m
$max_related = CRM_Utils_Array::value('max_related', $membership[$dao->id]);
$membership[$dao->id]['related_count'] = ($max_related == '' ? ts('%1 created', array(1 => $num_related)) : ts('%1 out of %2', array(
1 => $num_related,
- 2 => $max_related
+ 2 => $max_related,
))
);
}
* @return array
* (reference) of action links
*/
- static function &links(
+ public static function &links(
$status = 'all',
$isPaymentProcessor = NULL,
$accessContribution = NULL,
*
* @param int $contactId
* @param int $membershipId
- *
- * @return null
*/
public static function associatedContribution($contactId = NULL, $membershipId = NULL) {
$controller = new CRM_Core_Controller_Simple(
/**
* Set variables up before form is built
- *
- * @param null
- *
- * @return void
*/
public function preProcess() {
if ($this->_action & CRM_Core_Action::DELETE) {
* 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
*/
/**
* Build the form object
- *
- * @param null
- *
- * @return void
*/
public function buildQuickForm() {
if ($this->_action & CRM_Core_Action::DELETE) {
*
* @param array $fields
* Posted values of the form.
- *
- * @param $files
+ * @param array $files
* @param CRM_Core_Form $form
*
- * @return array
+ * @return array|NULL
* list of errors to be posted back to the form
*/
public static function formRule($fields, $files, $form) {
+ return NULL;
}
/**
* Process the form
- *
- * @param null
- *
- * @return void
*/
public function postProcess() {
if ($this->_action & CRM_Core_Action::DELETE) {
if ($this->_context == 'standalone') {
$this->addEntityRef('contact_id', ts('Contact'), array(
'create' => TRUE,
- 'api' => array('extra' => array('email'))
+ 'api' => array('extra' => array('email')),
), TRUE);
}
}
$element = &$this->add('select', 'frequency_unit',
ts('Frequency'),
- array(
- '' => ts('- select -')
- ) + $freqUnitsDisplay,
+ array('' => ts('- select -')) + $freqUnitsDisplay,
TRUE
);
$pledgePages[$value['entity_id']] = $pages[$value['entity_id']];
}
$ele = $this->add('select', 'contribution_page_id', ts('Self-service Payments Page'),
- array(
- '' => ts('- select -')
- ) + $pledgePages
+ array('' => ts('- select -')) + $pledgePages
);
$mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
if (count($processors) > 0) {
$statusMsg .= ' ' . ts("If a payment is due now, you can record <a href='%1'>a check, EFT, or cash payment for this pledge</a> OR <a href='%2'>submit a credit card payment</a>.", array(
1 => $contribURL,
- 2 => $creditURL
+ 2 => $creditURL,
));
}
else {
/**
* 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
*/
/**
* Build the form object
- *
- * @param null
- *
- * @return void
*/
public function buildQuickForm() {
// lets trim all the whitespace
$js = array('onchange' => "calculateRowValues( $i );");
$this->add('select', 'membership_type_id[' . $i . ']', ts('Membership Type'),
- array(
- '' => ' '
- ) + $membershipTypes, FALSE, $js
+ array('' => ' ') + $membershipTypes, FALSE, $js
);
$this->add('text', 'membership_num_terms[' . $i . ']', ts('Number of Terms'), CRM_Utils_Array::value('membership_num_terms', $attributes));
}
/**
* Process the form
- *
- * @param null
- *
- * @return void
*/
public function postProcess() {
// store the submitted values in an array
foreach ($this->_component as $val) {
if (!empty($select[$val])) {
- $this->_selectComponent[$val] =
- "SELECT " . implode(', ', $select[$val]) . " ";
+ $this->_selectComponent[$val] = "SELECT " . implode(', ', $select[$val]) . " ";
unset($select[$val]);
}
}
//unset Conmponent id and contact id from display
foreach ($this->_columnHeadersComponent as $componentTitle => $headers) {
- $id_header =
- 'civicrm_' . substr_replace($componentTitle, '', -11, 11) . '_' .
+ $id_header = 'civicrm_' . substr_replace($componentTitle, '', -11, 11) . '_' .
substr_replace($componentTitle, '', -11, 11) . '_id';
- $contact_header =
- 'civicrm_' . substr_replace($componentTitle, '', -11, 11) .
+ $contact_header = 'civicrm_' . substr_replace($componentTitle, '', -11, 11) .
'_contact_id';
if ($componentTitle == 'activity_civireport') {
- $id_header =
- 'civicrm_' . substr_replace($componentTitle, '', -11, 11) . '_id';
+ $id_header = 'civicrm_' . substr_replace($componentTitle, '', -11, 11) . '_id';
}
unset($this->_columnHeadersComponent[$componentTitle][$id_header]);
// handle contribution
if ($component == 'contribution_civireport') {
if ($val = CRM_Utils_Array::value('civicrm_contribution_financial_type_id', $row)) {
- $componentRows[$contactID][$component][$rowNum]['civicrm_contribution_financial_type_id'] =
- CRM_Contribute_PseudoConstant::financialType($val, FALSE);
+ $componentRows[$contactID][$component][$rowNum]['civicrm_contribution_financial_type_id'] = CRM_Contribute_PseudoConstant::financialType($val, FALSE);
}
if ($val = CRM_Utils_Array::value('civicrm_contribution_contribution_status_id', $row)) {
),
),
),
- )
- + $this->addAddressFields()
- + array(
+ );
+ $this->_columns += $this->addAddressFields();
+ $this->_columns += array(
'civicrm_contribution' => array(
'dao' => 'CRM_Contribute_DAO_Contribution',
'fields' => array(
}
public function groupBy() {
- $this->_groupBy =
- "GROUP BY {$this->_aliases['civicrm_contribution']}.contact_id, " .
+ $this->_groupBy = "GROUP BY {$this->_aliases['civicrm_contribution']}.contact_id, " .
self::fiscalYearOffset($this->_aliases['civicrm_contribution'] .
'.receive_date') . " WITH ROLLUP";
$this->assign('chartSupported', TRUE);
$sql = "{$this->_select} {$this->_from} {$this->_where} {$this->_groupBy}";
}
else {
- $sql =
- "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" .
+ $sql = "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" .
implode(',', $contactIds) .
") AND {$this->_aliases['civicrm_contribution']}.is_test = 0 {$this->_statusClause} {$this->_groupBy} ";
}
foreach ($rows as $key => $row) {
$display['life_time'] = CRM_Utils_Array::value('life_time', $display) +
$row['civicrm_life_time_total'];
- $display[$previous_year] =
- CRM_Utils_Array::value($previous_year, $display) + $row[$previous_year];
+ $display[$previous_year] = CRM_Utils_Array::value($previous_year, $display) + $row[$previous_year];
}
$config = CRM_Core_Config::Singleton();
'pieChart' => 'Pie Chart',
);
- /**
- */
/**
*/
public function __construct() {
$this->_columns = array(
- 'civicrm_contact' => array(
- 'dao' => 'CRM_Contact_DAO_Contact',
- 'fields' => array(
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
- ),
- 'display_name' => array(
- 'title' => ts('Contact Name'),
- 'required' => TRUE,
- 'no_repeat' => TRUE,
- ),
- 'first_name' => array(
- 'title' => ts('First Name'),
- ),
- 'last_name' => array(
- 'title' => ts('Last Name'),
- ),
- 'contact_type' => array(
- 'title' => ts('Contact Type'),
- ),
- 'contact_sub_type' => array(
- 'title' => ts('Contact Subtype'),
- ),
+ 'civicrm_contact' => array(
+ 'dao' => 'CRM_Contact_DAO_Contact',
+ 'fields' => array(
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'display_name' => array(
+ 'title' => ts('Contact Name'),
+ 'required' => TRUE,
+ 'no_repeat' => TRUE,
+ ),
+ 'first_name' => array(
+ 'title' => ts('First Name'),
+ ),
+ 'last_name' => array(
+ 'title' => ts('Last Name'),
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
),
),
- )
- + $this->getAddressColumns()
- + array(
- 'civicrm_contribution' => array(
- 'dao' => 'CRM_Contribute_DAO_Contribution',
- 'fields' => array(
- 'total_amount' => array(
- 'title' => ts('Amount Statistics'),
- 'required' => TRUE,
- 'statistics' => array(
- 'sum' => ts('Aggregate Amount'),
- 'count' => ts('Donations'),
- 'avg' => ts('Average'),
- ),
- ),
- 'currency' => array(
- 'required' => TRUE,
- 'no_display' => TRUE,
+ ),
+ );
+ $this->_columns += $this->getAddressColumns();
+ $this->_columns += array(
+ 'civicrm_contribution' => array(
+ 'dao' => 'CRM_Contribute_DAO_Contribution',
+ 'fields' => array(
+ 'total_amount' => array(
+ 'title' => ts('Amount Statistics'),
+ 'required' => TRUE,
+ 'statistics' => array(
+ 'sum' => ts('Aggregate Amount'),
+ 'count' => ts('Donations'),
+ 'avg' => ts('Average'),
),
),
- 'filters' => array(
- 'receive_date' => array(
- 'default' => 'this.year',
- 'operatorType' => CRM_Report_Form::OP_DATE,
- ),
- 'currency' => array(
- 'title' => 'Currency',
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
- 'default' => NULL,
- 'type' => CRM_Utils_Type::T_STRING,
- ),
- 'total_range' => array(
- 'title' => ts('Show no. of Top Donors'),
- 'type' => CRM_Utils_Type::T_INT,
- 'default_op' => 'eq',
- ),
- 'financial_type_id' => array(
- 'name' => 'financial_type_id',
- 'title' => ts('Financial Type'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::financialType(),
- ),
- 'contribution_status_id' => array(
- 'title' => ts('Contribution Status'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
- 'default' => array(1),
- ),
+ 'currency' => array(
+ 'required' => TRUE,
+ 'no_display' => TRUE,
),
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'fields' => array(
- 'email' => array(
- 'title' => ts('Email'),
- 'default' => TRUE,
- 'no_repeat' => TRUE,
- ),
+ 'filters' => array(
+ 'receive_date' => array(
+ 'default' => 'this.year',
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'currency' => array(
+ 'title' => 'Currency',
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Core_OptionGroup::values('currencies_enabled'),
+ 'default' => NULL,
+ 'type' => CRM_Utils_Type::T_STRING,
+ ),
+ 'total_range' => array(
+ 'title' => ts('Show no. of Top Donors'),
+ 'type' => CRM_Utils_Type::T_INT,
+ 'default_op' => 'eq',
+ ),
+ 'financial_type_id' => array(
+ 'name' => 'financial_type_id',
+ 'title' => ts('Financial Type'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::financialType(),
+ ),
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+ 'default' => array(1),
),
- 'grouping' => 'email-fields',
),
- 'civicrm_phone' => array(
- 'dao' => 'CRM_Core_DAO_Phone',
- 'fields' => array(
- 'phone' => array(
- 'title' => ts('Phone'),
- 'default' => TRUE,
- 'no_repeat' => TRUE,
- ),
+ ),
+ 'civicrm_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'fields' => array(
+ 'email' => array(
+ 'title' => ts('Email'),
+ 'default' => TRUE,
+ 'no_repeat' => TRUE,
+ ),
+ ),
+ 'grouping' => 'email-fields',
+ ),
+ 'civicrm_phone' => array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'fields' => array(
+ 'phone' => array(
+ 'title' => ts('Phone'),
+ 'default' => TRUE,
+ 'no_repeat' => TRUE,
),
- 'grouping' => 'phone-fields',
),
- );
+ 'grouping' => 'phone-fields',
+ ),
+ );
$this->_groupFilter = TRUE;
$this->_tagFilter = TRUE;
// If we have active campaigns add those elements to both the fields and filters
if ($campaignEnabled && !empty($this->activeCampaigns)) {
- $this->_columns['civicrm_participant']['fields']['campaign_id'] =
- array(
- 'title' => ts('Campaign'),
- 'default' => 'false',
- );
- $this->_columns['civicrm_participant']['filters']['campaign_id'] =
- array(
- 'title' => ts('Campaign'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => $this->activeCampaigns,
- );
- $this->_columns['civicrm_participant']['order_bys']['campaign_id'] =
- array('title' => ts('Campaign'));
-
+ $this->_columns['civicrm_participant']['fields']['campaign_id'] = array(
+ 'title' => ts('Campaign'),
+ 'default' => 'false',
+ );
+ $this->_columns['civicrm_participant']['filters']['campaign_id'] = array(
+ 'title' => ts('Campaign'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => $this->activeCampaigns,
+ );
+ $this->_columns['civicrm_participant']['order_bys']['campaign_id'] = array(
+ 'title' => ts('Campaign'),
+ );
}
$this->_currencyColumn = 'civicrm_participant_fee_currency';
}
/**
+ * Searches database for priceset values.
+ *
* @return array
*/
public function getPriceLevels() {
}
return $elements;
- } //searches database for priceset values
-
+ }
public function preProcess() {
parent::preProcess();
$this->_where = "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 ";
}
else {
- $this->_where =
- "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 AND " .
+ $this->_where = "WHERE {$this->_aliases['civicrm_participant']}.is_test = 0 AND " .
implode(' AND ', $clauses);
}
if ($this->_aclWhere) {
* Name of component if report list is filtered
*
* @var string
- **/
+ */
protected $_compName = NULL;
/**
* ID of component if report list is filtered
*
* @var int
- **/
+ */
protected $_compID = NULL;
/**
* ID of grouping if report list is filtered
*
* @var int
- **/
+ */
protected $_grouping = NULL;
/**
* ID of parent report template if list is filtered by template
*
* @var int
- **/
+ */
protected $_ovID = NULL;
-
/**
* Title of parent report template if list is filtered by template
*
* @var string
- **/
+ */
protected $_title = NULL;
/**
*
* @return array
*/
- function &actionLinks() {
+ public function &actionLinks() {
if (!isset(self::$_actionLinks)) {
self::$_actionLinks = array(
CRM_Core_Action::UPDATE => array(
* @param string $method
* @param null|string $name
*/
- function __construct(
+ public function __construct(
$state = NULL,
$action = CRM_Core_Action::NONE,
$method = 'post',
if ($upgrade->checkVersionRelease($rev, 'alpha1')) {
if (!(is_callable(array(
$versionObject,
- 'verifyPreDBstate'
+ 'verifyPreDBstate',
)))
) {
CRM_Core_Error::fatal("verifyPreDBstate method was not found for $rev");
if (is_callable(array(
$versionObject,
- $phpFunctionName
+ $phpFunctionName,
))) {
$versionObject->$phpFunctionName($rev, $originalVer, $latestVer);
}
// set post-upgrade-message if any
if (is_callable(array(
$versionObject,
- 'setPostUpgradeMessage'
+ 'setPostUpgradeMessage',
))) {
$postUpgradeMessage = file_get_contents($postUpgradeMessageFile);
$versionObject->setPostUpgradeMessage($postUpgradeMessage, $rev);
$versionObject = $this->incrementalPhpObject($rev);
if (is_callable(array(
$versionObject,
- 'setPreUpgradeMessage'
+ 'setPreUpgradeMessage',
))) {
$versionObject->setPreUpgradeMessage($preUpgradeMessage, $rev, $currentVer);
}
$label = ts('Additional Contribution');
$useRequired = 0;
}
- elseif (!empty($fieldOptions[$optionKey]['label'])) { //check for label.
+ elseif (!empty($fieldOptions[$optionKey]['label'])) {
$label = $fieldOptions[$optionKey]['label'];
}
}
}
$element = &$qf->add('select', $elementName, $label,
- array(
- '' => ts('- select -')
- ) + $selectOption,
+ array('' => ts('- select -')) + $selectOption,
$useRequired && $field->is_required,
array('price' => json_encode($priceVal))
);
$dao = CRM_Core_DAO::executeQuery($query, array(
1 => array($optionGroupName, 'String'),
- 2 => array($optionLabel, 'String')
+ 2 => array($optionLabel, 'String'),
));
while ($dao->fetch()) {
* @param int $id
* Field Id.
*
- * @return boolean
- *
+ * @return mixed
+ * Boolean-ish
*/
public static function deleteField($id) {
$field = new CRM_Upgrade_Snapshot_V4p2_Price_DAO_Field();
* Validate the priceset
*
* @param int $priceSetId
- * , array $fields.
- *
- * retrun the error string
- *
- * @param $fields
- * @param $error
- *
+ * @param array $fields
+ * @param array $error
*/
-
public static function priceSetValidation($priceSetId, $fields, &$error) {
// check for at least one positive
// amount price field should be selected.
}
/**
- * @param $values
+ * @param array $values
* @param bool $castToString
- *
- * @return mixed|void
*/
public function decodeOutput(&$values, $castToString = FALSE) {
if (is_array($values)) {
* @param string $name
* Name of file.
*
- * @return boolean
+ * @return bool
* true if file is ascii
*/
public static function isAscii($name) {
* @param string $name
* Name of file.
*
- * @return boolean
+ * @return bool
* true if file is html
*/
public static function isHtml($name) {
}
/**
- * @param $source
- * @param $destination
+ * @param string $source
+ * @param string $destination
*/
- static function copyDir($source, $destination) {
+ public static function copyDir($source, $destination) {
if ($dh = opendir($source)) {
@mkdir($destination);
while (FALSE !== ($file = readdir($dh))) {
* @param string $name
* Name of file.
*
- * @return boolean
+ * @return bool
* whether the file was recoded properly
*/
public static function toUtf8($name) {
* @param string $name
* Name of file.
*
- * @return boolean
+ * @return bool
* whether the file can be include()d or require()d
*/
public static function isIncludable($name) {
*
* @return mixed
*/
- function invoke(
+ public function invoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix
* @param array $params
* (by reference).
*
- * @return boolean
- * true if a mail was sent, else false
+ * @return bool
+ * TRUE if a mail was sent, else FALSE.
*/
public static function send(&$params) {
$returnPath = CRM_Core_BAO_MailSettings::defaultReturnPath();
$headers = array_merge($headers, $params['headers']);
}
$headers['From'] = $params['from'];
- $headers['To'] =
- self::formatRFC822Email(
- CRM_Utils_Array::value('toName', $params),
- CRM_Utils_Array::value('toEmail', $params),
- FALSE
- );
+ $headers['To'] = self::formatRFC822Email(
+ CRM_Utils_Array::value('toName', $params),
+ CRM_Utils_Array::value('toEmail', $params),
+ FALSE
+ );
$headers['Cc'] = CRM_Utils_Array::value('cc', $params);
$headers['Bcc'] = CRM_Utils_Array::value('bcc', $params);
$headers['Subject'] = CRM_Utils_Array::value('subject', $params);
*/
public static function errorMessage($mailer, $result) {
$message = '<p>' . ts('An error occurred when CiviCRM attempted to send an email (via %1). If you received this error after submitting on online contribution or event registration - the transaction was completed, but we were unable to send the email receipt.', array(
- 1 => 'SMTP'
+ 1 => 'SMTP',
)) . '</p>' . '<p>' . ts('The mail library returned the following error message:') . '<br /><span class="font-red"><strong>' . $result->getMessage() . '</strong></span></p>' . '<p>' . ts('This is probably related to a problem in your Outbound Email Settings (Administer CiviCRM » System Settings » Outbound Email), OR the FROM email address specifically configured for your contribution page or event. Possible causes are:') . '</p>';
if (is_a($mailer, 'Mail_smtp')) {
}
$message .= '<li>' . ts('The FROM Email Address configured for this feature may not be a valid sender based on your email service provider rules.') . '</li>' . '</ul>' . '<p>' . ts('Check <a href="%1">this page</a> for more information.', array(
- 1 => CRM_Utils_System::docURL2('user/advanced-configuration/email-system-configuration', TRUE)
+ 1 => CRM_Utils_System::docURL2('user/advanced-configuration/email-system-configuration', TRUE),
)) . '</p>';
return $message;
/**
* Get the Active outBound email
*
- * @return boolean
- * true if valid outBound email configuration found, false otherwise
+ * @return bool
+ * TRUE if valid outBound email configuration found, false otherwise.
*/
public static function validOutBoundMail() {
$mailingInfo = CRM_Core_BAO_Setting::getItem(CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
/**
* Process the default mailbox (ie. that is used by civiMail for the bounce)
*
- * @return boolean
- * always returns true (for the api). at a later stage we should
- * fix this to return true on success / false on failure etc
+ * @return bool
+ * Always returns true (for the api). at a later stage we should
+ * fix this to return true on success / false on failure etc.
*/
public static function processBounces() {
- $dao = new CRM_Core_DAO_MailSettings;
+ $dao = new CRM_Core_DAO_MailSettings();
$dao->domain_id = CRM_Core_Config::domainID();
$dao->is_default = TRUE;
$dao->find();
* @return void
*/
public static function processActivities() {
- $dao = new CRM_Core_DAO_MailSettings;
+ $dao = new CRM_Core_DAO_MailSettings();
$dao->domain_id = CRM_Core_Config::domainID();
$dao->is_default = FALSE;
$dao->find();
* @return void
*/
public static function process($civiMail = TRUE) {
- $dao = new CRM_Core_DAO_MailSettings;
+ $dao = new CRM_Core_DAO_MailSettings();
$dao->domain_id = CRM_Core_Config::domainID();
$dao->find();
// 0 = activities; 1 = bounce;
$usedfor = $dao->is_default;
- $emailActivityTypeId =
- (defined('EMAIL_ACTIVITY_TYPE_ID') && EMAIL_ACTIVITY_TYPE_ID) ? EMAIL_ACTIVITY_TYPE_ID : CRM_Core_OptionGroup::getValue(
+ $emailActivityTypeId
+ = (defined('EMAIL_ACTIVITY_TYPE_ID') && EMAIL_ACTIVITY_TYPE_ID) ? EMAIL_ACTIVITY_TYPE_ID : CRM_Core_OptionGroup::getValue(
'activity_type',
'Inbound Email',
'name'
/**
* Rewrite various system urls to https
- *
- * @param null
- *
- * @return void
*/
public function mapConfigToSSL() {
global $base_url;
if (!$contactID) {
return FALSE;
}
- else { //success
+ else {
+ //success
if ($loadCMSBootstrap) {
$bootStrapParams = array();
if ($name && $password) {
* e.g. for drupal : records a watchdog message about the new session,
* saves the login timestamp, calls hook_user op 'login' and generates a new session.
*
- * @param array params
+ * @param array $params
*
* FIXME: Document values accepted/required by $params
*/
/**
* Check is user logged in.
*
- * @return boolean
+ * @return bool
*/
public function isUserLoggedIn() {
$isloggedIn = FALSE;
* Array to search on.
*
* @return array
- * * {@getfields CustomGroup_get}
- * @example CustomGroupGet.php
- **/
+ */
function civicrm_api3_custom_group_get($params) {
return _civicrm_api3_basic_get(_civicrm_api3_get_BAO(__FUNCTION__), $params);
}
/**
* @param array $params
*
- * @return boolean
- * | error true if successfull, error otherwise
- * {@getfields message_template_delete}
+ * @return bool
+ * API result array
*/
function civicrm_api3_message_template_delete($params) {
return _civicrm_api3_basic_delete(_civicrm_api3_get_BAO(__FUNCTION__), $params);
* Gets field for civicrm_pledge_payment functions
*
* @param array $params
- *
- * @return array
- * fields valid for other functions
+ * Modifiable list of fields allowed for the PledgePayment.get action.
*/
function civicrm_api3_pledge_payment_get_spec(&$params) {
$params['option.create_new'] = array('title' => "Create new field rather than update an unpaid payment");
p.warning {
padding: 0.5em;
background-color: #e70;
- border: 1px #A70 solid;
+ border: 1px #a70 solid;
color: white;
clear: both;
}
$this->_permissionedDisabledGroup = $this->groupCreate(array(
'title' => 'pick-me-disabled',
'is_active' => 0,
- 'name' => 'pick-me-disabled'
+ 'name' => 'pick-me-disabled',
));
$this->_permissionedGroup = $this->groupCreate(array(
'title' => 'pick-me-active',
'is_active' => 1,
- 'name' => 'pick-me-active'
+ 'name' => 'pick-me-active',
));
$this->groupCreate(array('title' => 'not-me-disabled', 'is_active' => 0, 'name' => 'not-me-disabled'));
$this->groupCreate(array('title' => 'not-me-active', 'is_active' => 1, 'name' => 'not-me-active'));
$config = CRM_Core_Config::singleton();
$config->keyDisable = TRUE;
- $membershipRenewal = new CRM_Core_Form;
- $membershipRenewal->controller = new CRM_Core_Controller;
+ $membershipRenewal = new CRM_Core_Form();
+ $membershipRenewal->controller = new CRM_Core_Controller();
$isTestMembership = 0;
- $MembershipRenew =
- CRM_Member_BAO_Membership::renewMembershipFormWrapper(
- $contactId,
- $this->_membershipTypeID,
- $isTestMembership,
- $membershipRenewal,
- NULL,
- NULL
- );
+ $MembershipRenew = CRM_Member_BAO_Membership::renewMembershipFormWrapper(
+ $contactId,
+ $this->_membershipTypeID,
+ $isTestMembership,
+ $membershipRenewal,
+ NULL,
+ NULL
+ );
$endDate = date("Y-m-d", strtotime($membership->end_date . " +1 year"));
$this->assertDBNotNull('CRM_Member_BAO_MembershipLog',
$config = CRM_Core_Config::singleton();
$config->keyDisable = TRUE;
- $membershipRenewal = new CRM_Core_Form;
- $membershipRenewal->controller = new CRM_Core_Controller;
+ $membershipRenewal = new CRM_Core_Form();
+ $membershipRenewal->controller = new CRM_Core_Controller();
$MembershipRenew = CRM_Member_BAO_Membership::renewMembershipFormWrapper($contactId, $this->_membershipTypeID, $isTestMembership = 0, $membershipRenewal, NULL, NULL);
$this->assertDBNotNull('CRM_Member_BAO_MembershipLog',
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
'edit-2-access-all-cases-and-activities',
'edit-2-access-my-cases-and-activities',
'edit-2-administer-civicase',
- 'edit-2-delete-in-civicase'
+ 'edit-2-delete-in-civicase',
);
$this->changePermissions($permission);
$this->openCiviPage("admin/custom/group/field", array(
'reset' => 1,
'action' => 'browse',
- 'gid' => $customGrpId1
+ 'gid' => $customGrpId1,
));
$custom1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr[1]/td[8]/span/a[text()='Edit Field']/@href"));
$custom1 = $custom1[1];
$this->openCiviPage("admin/custom/group/field", array(
'reset' => 1,
'action' => 'browse',
- 'gid' => $customGrpId1
+ 'gid' => $customGrpId1,
));
$custom1 = explode('&id=', $this->getAttribute("xpath=//div[@id='field_page']//table/tbody//tr[1]/td[8]/span/a[text()='Edit Field']/@href"));
$custom1 = $custom1[1];
'action' => 'delete',
'reset' => '1',
'gid' => $customGrpId1,
- 'id' => $cValue
+ 'id' => $cValue,
));
$this->clickLink("_qf_DeleteField_next-bottom");
}
'edit-2-access-all-cases-and-activities',
'edit-2-access-my-cases-and-activities',
'edit-2-administer-civicase',
- 'edit-2-delete-in-civicase'
+ 'edit-2-delete-in-civicase',
);
$this->changePermissions($permission);
* @param string $dataName
* @param array $browser
*/
- function __construct($name = NULL, array$data = array(), $dataName = '', array$browser = array()) {
+ public function __construct($name = NULL, array$data = array(), $dataName = '', array$browser = array()) {
parent::__construct($name, $data, $dataName, $browser);
require_once 'CiviTest/ReleaseTestSettings.php';
/**
* Check for Each data type: loop through available form input types
- **/
+ */
public function testCustomFieldCreateAllAvailableFormInputs() {
$gid = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'testAllFormInputs'));
$this->assertTrue(is_numeric($optionGroupID) && ($optionGroupID > 0));
$optionGroup = $this->callAPISuccess('option_group', 'getsingle', array(
- 'id' => $optionGroupID
+ 'id' => $optionGroupID,
));
$this->assertEquals($optionGroup['title'], 'Country');
$optionValueCount = $this->callAPISuccess('option_value', 'getcount', array(
- 'option_group_id' => $optionGroupID
+ 'option_group_id' => $optionGroupID,
));
$this->assertEquals(0, $optionValueCount);
}
$contactGroup = $this->customGroupCreate(array('extends' => 'Contact', 'title' => 'test_group_c'));
$contactField = $this->customFieldCreate(array(
'custom_group_id' => $contactGroup['id'],
- 'label' => 'For Contacts'
+ 'label' => 'For Contacts',
));
$indivGroup = $this->customGroupCreate(array('extends' => 'Individual', 'title' => 'test_group_i'));
$indivField = $this->customFieldCreate(array('custom_group_id' => $indivGroup['id'], 'label' => 'For Individuals'));
$activityGroup = $this->customGroupCreate(array('extends' => 'Activity', 'title' => 'test_group_a'));
$activityField = $this->customFieldCreate(array(
'custom_group_id' => $activityGroup['id'],
- 'label' => 'For Activities'
+ 'label' => 'For Activities',
));
// Check getfields
);
}
- // function tearDown() {
- // $this->quickCleanup(array('civicrm_product'), TRUE);
- // }
-
public function testGetFields() {
$fields = $this->callAPISuccess($this->_entity, 'getfields', array('action' => 'create'));
$this->assertArrayHasKey('period_type', $fields['values']);