array(
'title' => ts('Access Control'),
'url' => CRM_Utils_System::url('civicrm/admin/access', 'reset=1'),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
return;
}
elseif ($this->_action & (CRM_Core_Action::UPDATE)) {
- $this->_mappingID =
- CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'mapping_id');
+ $this->_mappingID = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_ActionSchedule', $this->_id, 'mapping_id');
if ($this->_context == 'event') {
$this->_compId = CRM_Utils_Request::retrieve('compId', 'Integer', $this);
}
'query' => "reset=1&action=add&atype=$atype&context=standalone",
'ref' => 'new-case',
'title' => ts('Case'),
- )
+ ),
));
}
}
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
- * @param int $contactId
- * This is contact id for adding relationship.
* @param array $ids
* The array that holds all the db ids.
+ * @param int $contactId
+ * This is contact id for adding relationship.
*
* @return CRM_Contact_BAO_Relationship
*/
public static function add(&$params, $ids = array(), $contactId = NULL) {
- $relationshipId =
- CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params));
+ $relationshipId = CRM_Utils_Array::value('relationship', $ids, CRM_Utils_Array::value('id', $params));
$hook = 'create';
if ($relationshipId) {
* @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
* @return array
* array reference of all relationship types with context to current contact.
*/
- static function getContactRelationshipType(
+ public static function getContactRelationshipType(
$contactId = NULL,
$contactSuffix = NULL,
$relationshipId = NULL,
*
* @param $action
*
- * @return null
*/
public static function disableEnableRelationship($id, $action) {
$relationship = self::clearCurrentEmployer($id, $action);
* @param int $relationshipTypeId
* Relationship type id.
*
- * @return boolean
+ * @return bool
* true if it is valid relationship else false
*/
public static function checkRelationshipType($contact_a, $contact_b, $relationshipTypeId) {
* @param int $relationshipId
* This is relationship id for the contact.
*
- * @return boolean
+ * @return bool
* true if record exists else false
*/
public static function checkDuplicateRelationship(&$params, $id, $contactId = 0, $relationshipId = 0) {
* @return array|int
* relationship records
*/
- static function getRelationship(
+ public static function getRelationship(
$contactId = NULL,
$status = 0, $numRelationship = 0,
$count = 0, $relationshipId = 0,
* Api input array.
* @param null $direction
*
- * @return array
+ * @return array|void
*/
public static function membershipTypeToRelationshipTypes(&$params, $direction = NULL) {
$membershipType = civicrm_api3('membership_type', 'getsingle', array(
));
$relationshipTypes = $membershipType['relationship_type_id'];
if (empty($relationshipTypes)) {
- return;
+ return NULL;
}
// if we don't have any contact data we can only filter on type
if (empty($params['contact_id']) && empty($params['contact_id_a']) && empty($params['contact_id_a'])) {
$params['relationship_type_id'] = array('IN' => $relationshipTypes);
- return;
+ return NULL;
}
else {
$relationshipDirections = (array) $membershipType['relationship_direction'];
$form->addSelect("im[$blockId][location_type_id]", array(
'entity' => 'im',
'class' => 'eight',
- 'placeholder' => NULL
+ 'placeholder' => NULL,
));
//IM box
$coreTypes = array('Contact', 'Organization');
$entities[] = array(
- 'entity_name' => array ('contact_1'),
+ 'entity_name' => array('contact_1'),
'entity_type' => 'OrganizationModel',
);
if ($member && $member['is_active']) {
$coreTypes[] = 'Membership';
$entities[] = array(
- 'entity_name' => array ('membership_1'),
+ 'entity_name' => array('membership_1'),
'entity_type' => 'MembershipModel',
);
}
-
- $allowCoreTypes = array_merge($coreTypes,
- CRM_Contact_BAO_ContactType::subTypes('Organization'));
+
+ $allowCoreTypes = array_merge($coreTypes, CRM_Contact_BAO_ContactType::subTypes('Organization'));
$allowSubTypes = array();
$this->addProfileSelector('onbehalf_profile_id', ts('Organization Profile'), $allowCoreTypes, $allowSubTypes, $entities);
'Contact',
'Individual',
'Organization',
- 'Household'
+ 'Household',
), CRM_Contact_BAO_ContactType::subTypes('Individual'));
$allowSubTypes = array();
$dao = CRM_Contribute_BAO_ContributionPage::create($params);
$ufJoinParams = array(
- 'onbehalf_profile_id' =>
- array(
- 'is_active' => 1,
- 'module' => 'OnBehalf',
- 'entity_table' => 'civicrm_contribution_page',
- 'entity_id' => $dao->id,
- ),
- 'honor_block_is_active' =>
- array(
- 'module' => 'soft_credit',
- 'entity_table' => 'civicrm_contribution_page',
- 'entity_id' => $dao->id,
- ),
+ 'onbehalf_profile_id' => array(
+ 'is_active' => 1,
+ 'module' => 'OnBehalf',
+ 'entity_table' => 'civicrm_contribution_page',
+ 'entity_id' => $dao->id,
+ ),
+ 'honor_block_is_active' => array(
+ 'module' => 'soft_credit',
+ 'entity_table' => 'civicrm_contribution_page',
+ 'entity_id' => $dao->id,
+ ),
);
foreach ($ufJoinParams as $index => $ufJoinParam) {
$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');
static $mailSettings = array();
$domainID = CRM_Core_Config::domainID();
if (empty($mailSettings[$domainID]) || $reset) {
- $dao = new self;
+ $dao = new self();
$dao->is_default = 1;
$dao->domain_id = $domainID;
$dao->find(TRUE);
/**
* Return the "include message ID" flag from the default set of settings.
*
- * @return boolean
+ * @return bool
* default include message ID
*/
public static function includeMessageId() {
}
/**
- * @return array
+ * @return array $result
*/
- static function &tables() {
+ public static function &tables() {
static $result = NULL;
if (!$result) {
$result = array_keys(self::columns());
* ie - all other amounts will return a failed response.
*
* -----------------------------------------------------------------------------------------------
- **/
+ */
class CRM_Core_Payment_eWAY extends CRM_Core_Payment {
# (not used, implicit in the API, might need to convert?)
const CHARSET = 'UTF-8';
*/
static private $_singleton = NULL;
- /**********************************************************
+ /**
+ * *******************************************************
* Constructor
*
* @param string $mode
* The mode of operation: live or test.
*
- * @param $paymentProcessor
+ * @param int $paymentProcessor
*
- * @return \CRM_Core_Payment_eWAY *******************************************************
+ * *******************************************************
*/
public function __construct($mode, &$paymentProcessor) {
// require Standard eWAY API libraries
$this->_processorName = ts('eWay');
}
- /**********************************************************
+ /**
+ * *******************************************************
* This function sends request and receives response from
* eWAY payment process
- **********************************************************/
+ * *******************************************************
+ */
public function doDirectPayment(&$params) {
if (CRM_Utils_Array::value('is_recur', $params) == TRUE) {
CRM_Core_Error::fatal(ts('eWAY - recurring payments not implemented'));
//------------------------------------
// create eWAY gateway objects
//------------------------------------
- $eWAYRequest = new GatewayRequest;
+ $eWAYRequest = new GatewayRequest();
if (($eWAYRequest == NULL) || (!($eWAYRequest instanceof GatewayRequest))) {
return self::errorExit(9001, "Error: Unable to create eWAY Request object.");
}
- $eWAYResponse = new GatewayResponse;
+ $eWAYResponse = new GatewayResponse();
if (($eWAYResponse == NULL) || (!($eWAYResponse instanceof GatewayResponse))) {
return self::errorExit(9002, "Error: Unable to create eWAY Response object.");
return $contribution->find();
}
- /*************************************************************************************************
+ /**
+ * **********************************************************************************************
* This function checks the eWAY response status - returning a boolean false if status != 'true'
- *************************************************************************************************/
+ * ************************************************************************************************
+ */
public function isError(&$response) {
$status = $response->Status();
return FALSE;
}
- /**************************************************
+ /**
+ * ************************************************
* Produces error message and returns from class
- **************************************************/
+ * *************************************************
+ */
public function &errorExit($errorCode = NULL, $errorMessage = NULL) {
$e = CRM_Core_Error::singleton();
return $e;
}
- /**************************************************
+ /**
+ * ************************************************
* NOTE: 'doTransferCheckout' not implemented
- **************************************************/
+ * ************************************************
+ */
public function doTransferCheckout(&$params, $component) {
CRM_Core_Error::fatal(ts('This function is not implemented'));
}
- /********************************************************************************************
+ /**
+ * *****************************************************************************************
* This public function checks to see if we have the right processor config values set
*
* NOTE: Called by Events and Contribute to check config params are set prior to trying
*
* returns string $errorMsg if any errors found - null if OK
*
- ******************************************************************************************
+ * *****************************************************************************************
*/
- //function checkConfig( $mode ) // CiviCRM V1.9 Declaration
- // CiviCRM V2.0 Declaration
public function checkConfig() {
$errorMsg = array();
* @param array $array
* The roles to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public function checkGroupRole($array) {
* @param string $str
* The permission to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public function check($str) {
* @param array $array
* The roles to check.
*
- * @return boolean
+ * @return bool
* true if yes, else false
*/
public function checkGroupRole($array) {
$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');
* Helps decide how to behave when there are conflicts.
* A 'safe' value skips the merge if there are any un-resolved conflicts.
* Does a force merge otherwise.
- * @param bool $autoFlipWether to let api decide which contact to retain and which to delete.
+ * @param bool $autoFlip to let api decide which contact to retain and which to delete.
* Wether to let api decide which contact to retain and which to delete.
* @param bool $redirectForPerformance
*
* Helps decide how to behave when there are conflicts.
* A 'safe' value skips the merge if there are any un-resolved conflicts.
* Does a force merge otherwise (aggressive mode).
- * @param bool $autoFlipWether to let api decide which contact to retain and which to delete.
+ * @param bool $autoFlip to let api decide which contact to retain and which to delete.
* Wether to let api decide which contact to retain and which to delete.
*
*
$params = array(
'contact_id' => $cid,
'version' => 3,
- 'return' => array_merge(array('display_name'), self::getContactFields())
+ 'return' => array_merge(array('display_name'), self::getContactFields()),
);
$result = civicrm_api('contact', 'get', $params);
$specialValues[$moniker]['preferred_communication_method'] = CRM_Core_DAO::VALUE_SEPARATOR . $prefCommList . CRM_Core_DAO::VALUE_SEPARATOR;
}
$names = array(
- 'preferred_communication_method' =>
- array(
- 'newName' => 'preferred_communication_method_display',
- 'groupName' => 'preferred_communication_method',
- ),
+ 'preferred_communication_method' => array(
+ 'newName' => 'preferred_communication_method_display',
+ 'groupName' => 'preferred_communication_method',
+ ),
);
CRM_Core_OptionGroup::lookupValues($specialValues[$moniker], $names);
if (in_array($htmlType, array(
'CheckBox',
'Multi-Select',
- 'AdvMulti-Select'
+ 'AdvMulti-Select',
))) {
$submitted[$key] = CRM_Core_DAO::VALUE_SEPARATOR . implode(CRM_Core_DAO::VALUE_SEPARATOR,
$mergeValue
}
elseif (in_array($htmlType, array(
'Multi-Select Country',
- 'Multi-Select State/Province'
+ 'Multi-Select State/Province',
))) {
//we require submitted values should be in array format
if ($value) {
'modified_date',
'primary_contact_id',
'sort_name',
- 'user_unique_id'
+ 'user_unique_id',
);
foreach ($contactFields as $field => $value) {
if (in_array($field, $invalidFields)) {
/**
* Added for CRM-12695
- * Based on the contactId provided
+ * Based on the contactID provided
* add/update membership(s) to related contacts
*
- * @param contactId
+ * @param int $contactID
*/
public static function addMembershipToRealtedContacts($contactID) {
$dao = new CRM_Member_DAO_Membership();
/**
* called when action is browse
- *
- * @return null
*/
public function browse() {
$controller = new CRM_Core_Controller_Simple(
/**
* used for the to show the associated
* contribution for the participant
- *
- * @return null
*/
public function associatedContribution() {
if (CRM_Core_Permission::access('CiviContribute')) {
$selectedArray['selected'] = 'Selected';
}
$elements[] = array(
- 'name' => $name,
- 'value' => $id,
- ) + $selectedArray;
+ 'name' => $name,
+ 'value' => $id,
+ ) + $selectedArray;
}
}
CRM_Utils_JSON::output($elements);
}
public static function getFinancialTransactionsList() {
- $sortMapper =
- array(
- 0 => '',
- 1 => '',
- 2 => 'sort_name',
- 3 => 'amount',
- 4 => 'trxn_id',
- 5 => 'transaction_date',
- 6 => 'payment_method',
- 7 => 'status',
- 8 => 'name',
- );
+ $sortMapper = array(
+ 0 => '',
+ 1 => '',
+ 2 => 'sort_name',
+ 3 => 'amount',
+ 4 => 'trxn_id',
+ 5 => 'transaction_date',
+ 6 => 'payment_method',
+ 7 => 'status',
+ 8 => 'name',
+ );
$sEcho = CRM_Utils_Type::escape($_REQUEST['sEcho'], 'Integer');
$offset = isset($_REQUEST['iDisplayStart']) ? CRM_Utils_Type::escape($_REQUEST['iDisplayStart'], 'Integer') : 0;
$params['sortBy'] = $sort . ' ' . $sortOrder;
}
- $returnvalues =
- array(
- 'civicrm_financial_trxn.payment_instrument_id as payment_method',
- 'civicrm_contribution.contact_id as contact_id',
- 'civicrm_contribution.id as contributionID',
- 'contact_a.sort_name',
- 'civicrm_financial_trxn.total_amount as amount',
- 'civicrm_financial_trxn.trxn_id as trxn_id',
- 'contact_a.contact_type',
- 'contact_a.contact_sub_type',
- 'civicrm_financial_trxn.trxn_date as transaction_date',
- 'name',
- 'civicrm_contribution.currency as currency',
- 'civicrm_financial_trxn.status_id as status',
- 'civicrm_financial_trxn.check_number as check_number',
- );
+ $returnvalues = array(
+ 'civicrm_financial_trxn.payment_instrument_id as payment_method',
+ 'civicrm_contribution.contact_id as contact_id',
+ 'civicrm_contribution.id as contributionID',
+ 'contact_a.sort_name',
+ 'civicrm_financial_trxn.total_amount as amount',
+ 'civicrm_financial_trxn.trxn_id as trxn_id',
+ 'contact_a.contact_type',
+ 'contact_a.contact_sub_type',
+ 'civicrm_financial_trxn.trxn_date as transaction_date',
+ 'name',
+ 'civicrm_contribution.currency as currency',
+ 'civicrm_financial_trxn.status_id as status',
+ 'civicrm_financial_trxn.check_number as check_number',
+ );
- $columnHeader =
- array(
- 'contact_type' => '',
- 'sort_name' => ts('Contact Name'),
- 'amount' => ts('Amount'),
- 'trxn_id' => ts('Trxn ID'),
- 'transaction_date' => ts('Received'),
- 'payment_method' => ts('Payment Method'),
- 'status' => ts('Status'),
- 'name' => ts('Type'),
- );
+ $columnHeader = array(
+ 'contact_type' => '',
+ 'sort_name' => ts('Contact Name'),
+ 'amount' => ts('Amount'),
+ 'trxn_id' => ts('Trxn ID'),
+ 'transaction_date' => ts('Received'),
+ 'payment_method' => ts('Payment Method'),
+ 'status' => ts('Status'),
+ 'name' => ts('Type'),
+ );
if ($sort && $sortOrder) {
$params['sortBy'] = $sort . ' ' . $sortOrder;
}
$iFilteredTotal = $iTotal = $params['total'];
- $selectorElements =
- array(
- 'check',
- 'contact_type',
- 'sort_name',
- 'amount',
- 'trxn_id',
- 'transaction_date',
- 'payment_method',
- 'status',
- 'name',
- 'action',
- );
+ $selectorElements = array(
+ 'check',
+ 'contact_type',
+ 'sort_name',
+ 'amount',
+ 'trxn_id',
+ 'transaction_date',
+ 'payment_method',
+ 'status',
+ 'name',
+ 'action',
+ );
echo CRM_Utils_JSON::encodeDataTableSelector($financialitems, $sEcho, $iTotal, $iFilteredTotal, $selectorElements);
CRM_Utils_System::civiExit();
foreach ($cIDs as $key => $value) {
$recordPID = CRM_Core_DAO::getFieldValue('CRM_Financial_DAO_FinancialTrxn', $value, 'payment_instrument_id');
if ($action == 'Remove' || ($recordPID == $batchPID && $action == 'Assign') || !isset($batchPID)) {
- $params =
- array(
- 'entity_id' => $value,
- 'entity_table' => 'civicrm_financial_trxn',
- 'batch_id' => $entityID,
- );
+ $params = array(
+ 'entity_id' => $value,
+ 'entity_table' => 'civicrm_financial_trxn',
+ 'batch_id' => $entityID,
+ );
if ($action == 'Assign') {
$updated = CRM_Batch_BAO_Batch::addBatchEntity($params);
}
$params = array('id' => $batchID);
$batchInfo = CRM_Batch_BAO_Batch::retrieve($params, $value);
$batchTotals = CRM_Batch_BAO_Batch::batchTotals(array($batchID));
- $batchSummary =
- array(
- 'created_by' => CRM_Contact_BAO_Contact::displayName($batchInfo->created_id),
- 'status' => CRM_Core_OptionGroup::getLabel('batch_status', $batchInfo->status_id),
- 'description' => $batchInfo->description,
- 'payment_instrument' => CRM_Core_OptionGroup::getLabel('payment_instrument', $batchInfo->payment_instrument_id),
- 'item_count' => $batchInfo->item_count,
- 'assigned_item_count' => $batchTotals[$batchID]['item_count'],
- 'total' => CRM_Utils_Money::format($batchInfo->total),
- 'assigned_total' => CRM_Utils_Money::format($batchTotals[$batchID]['total']),
- 'opened_date' => CRM_Utils_Date::customFormat($batchInfo->created_date),
- );
+ $batchSummary = array(
+ 'created_by' => CRM_Contact_BAO_Contact::displayName($batchInfo->created_id),
+ 'status' => CRM_Core_OptionGroup::getLabel('batch_status', $batchInfo->status_id),
+ 'description' => $batchInfo->description,
+ 'payment_instrument' => CRM_Core_OptionGroup::getLabel('payment_instrument', $batchInfo->payment_instrument_id),
+ 'item_count' => $batchInfo->item_count,
+ 'assigned_item_count' => $batchTotals[$batchID]['item_count'],
+ 'total' => CRM_Utils_Money::format($batchInfo->total),
+ 'assigned_total' => CRM_Utils_Money::format($batchTotals[$batchID]['total']),
+ 'opened_date' => CRM_Utils_Date::customFormat($batchInfo->created_date),
+ );
CRM_Utils_JSON::output($batchSummary);
}
*
* @return void
*/
- function preProcess() {
+ public function preProcess() {
parent::preProcess();
//check permission for delete.
}
public function postProcess() {
-
$values = $this->exportValues();
// check if EmailTyped matches Email address
$result = CRM_Utils_String::compareStr($this->_email, $values['email_confirm'], TRUE);
-
-
$job_id = $this->_job_id;
$queue_id = $this->_queue_id;
$hash = $this->_hash;
/**
* Build all the data structures needed to build the form
- *
- * @return void
*/
- function preProcess() {
+ public function preProcess() {
//check for delete
if (!CRM_Core_Permission::checkActionPermission('CiviPledge', CRM_Core_Action::DELETE)) {
CRM_Core_Error::fatal(ts('You do not have permission to access this page.'));
$status = ts('Deleted Pledge(s): %1 (Total Selected: %2) ', array(
1 => $deletedPledges,
- 2 => count($this->_pledgeIds)
+ 2 => count($this->_pledgeIds),
));
CRM_Core_Session::setStatus($status, '', 'info');
}
'query' => 'reset=1&action=add&context=standalone',
'ref' => 'new-pledge',
'title' => ts('Pledge'),
- )
+ ),
));
}
}
/**
* Class constructor
*
- * @param array $params
- * @param $customFields
- * @param string params the params for the where clause
- *
+ * @param array $params the params for the where clause
+ * @param array $customFields
+ * @param array $ufGroupIds
* @param bool $map
* @param bool $editLink
* @param bool $linkToUF
*
* @return \CRM_Profile_Selector_Listings
*/
- function __construct(
+ public function __construct(
&$params,
&$customFields,
$ufGroupIds = NULL,
* @param array $params
*/
public function getPagerParams($action, &$params) {
- $status =
- CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%');
+ $status = CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%');
$params['status'] = $status;
$params['csvString'] = NULL;
$params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
if (in_array($fieldName, array(
'phone',
'im',
- 'email'
+ 'email',
))) {
if ($type) {
$name = "`$locationTypeName-$fieldName-$type`";
if (in_array($fieldName, array(
'phone',
'im',
- 'email'
+ 'email',
))) {
if ($type) {
$names[] = "{$locationTypeName}-{$fieldName}-{$type}";
elseif (in_array($name, array(
'addressee',
'email_greeting',
- 'postal_greeting'
+ 'postal_greeting',
))) {
$dname = $name . '_display';
$row[] = $result->$dname;
}
elseif (in_array($name, array(
'birth_date',
- 'deceased_date'
+ 'deceased_date',
))) {
$row[] = CRM_Utils_Date::customFormat($result->$name);
}
}
if ($isSubmitted) {
- $this->_multiRecordTableName = $multiRecordTableName =
- CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name');
+ $this->_multiRecordTableName
+ = $multiRecordTableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name');
if ($multiRecordTableName) {
- return;
+ return NULL;
}
}
}
if (!isset($customGroupId) || !$customGroupId) {
- return;
+ return NULL;
}
//if the field is in selector and not a searchable field
//get the proper customvalue table name
if ($selectorSet) {
- $this->_multiRecordTableName = $multiRecordTableName =
- CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name');
+ $this->_multiRecordTableName
+ = $multiRecordTableName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'table_name');
}
} //func close
}
}
$this->_columns = array(
- 'civicrm_contact' => array(
- 'dao' => 'CRM_Contact_DAO_Contact',
- 'fields' => array(
- 'sort_name' => array(
- 'title' => ts('Contact Name'),
- 'default' => TRUE,
- 'required' => TRUE,
- 'no_repeat' => TRUE,
- ),
- 'id' => array(
- 'no_display' => TRUE,
- 'default' => TRUE,
- 'required' => TRUE,
- ),
- '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(
+ 'sort_name' => array(
+ 'title' => ts('Contact Name'),
+ 'default' => TRUE,
+ 'required' => TRUE,
+ 'no_repeat' => TRUE,
),
- 'grouping' => 'contact-fields',
- 'filters' => array(
- 'sort_name' => array('title' => ts('Contact Name')),
- 'id' => array(
- 'title' => ts('Contact ID'),
- 'no_display' => TRUE,
- ),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'default' => TRUE,
+ 'required' => TRUE,
+ ),
+ 'contact_type' => array(
+ 'title' => ts('Contact Type'),
+ ),
+ 'contact_sub_type' => array(
+ 'title' => ts('Contact Subtype'),
),
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'fields' => array(
- 'email' => array(
- 'title' => ts('Email'),
- 'no_repeat' => TRUE,
- ),
+ 'grouping' => 'contact-fields',
+ 'filters' => array(
+ 'sort_name' => array('title' => ts('Contact Name')),
+ 'id' => array(
+ 'title' => ts('Contact ID'),
+ 'no_display' => TRUE,
),
- 'grouping' => 'contact-fields',
),
- 'civicrm_phone' => array(
- 'dao' => 'CRM_Core_DAO_Phone',
- 'fields' => array(
- 'phone' => array(
- 'title' => ts('Phone'),
- 'no_repeat' => TRUE,
- ),
+ ),
+ 'civicrm_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'fields' => array(
+ 'email' => array(
+ 'title' => ts('Email'),
+ 'no_repeat' => TRUE,
),
- 'grouping' => 'contact-fields',
),
- ) + $this->addAddressFields(FALSE, FALSE, FALSE, array()) + array(
- 'civicrm_relationship' => array(
- 'dao' => 'CRM_Contact_DAO_Relationship',
- 'fields' => array(
- 'relationship_type_id' => array(
- 'title' => ts('Relationship Type'),
- 'default' => TRUE,
- ),
- 'contact_id_a' => array('no_display' => TRUE),
- 'contact_id_b' => array('no_display' => TRUE),
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_phone' => array(
+ 'dao' => 'CRM_Core_DAO_Phone',
+ 'fields' => array(
+ 'phone' => array(
+ 'title' => ts('Phone'),
+ 'no_repeat' => TRUE,
),
- 'filters' => array(
- 'relationship_type_id' => array(
- 'title' => ts('Relationship Type'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => $relationTypeOp,
- 'type' => CRM_Utils_Type::T_STRING,
- ),
+ ),
+ 'grouping' => 'contact-fields',
+ ),
+ ) + $this->addAddressFields(FALSE, FALSE, FALSE, array()) + array(
+ 'civicrm_relationship' => array(
+ 'dao' => 'CRM_Contact_DAO_Relationship',
+ 'fields' => array(
+ 'relationship_type_id' => array(
+ 'title' => ts('Relationship Type'),
+ 'default' => TRUE,
),
+ 'contact_id_a' => array('no_display' => TRUE),
+ 'contact_id_b' => array('no_display' => TRUE),
),
- ) + array(
- 'civicrm_contribution' => array(
- 'dao' => 'CRM_Contribute_DAO_Contribution',
- 'fields' => array(
- 'total_amount' => array(
- 'title' => ts('Amount Statistics'),
- 'default' => TRUE,
- 'required' => TRUE,
- 'no_display' => TRUE,
- 'statistics' => array('sum' => ts('Aggregate Amount')),
- ),
- 'receive_date' => array(
- 'required' => TRUE,
- 'default' => TRUE,
- 'no_display' => TRUE,
- ),
+ 'filters' => array(
+ 'relationship_type_id' => array(
+ 'title' => ts('Relationship Type'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => $relationTypeOp,
+ 'type' => CRM_Utils_Type::T_STRING,
),
- 'grouping' => 'contri-fields',
- 'filters' => array(
- 'this_year' => array(
- 'title' => ts('This Year'),
- 'operatorType' => CRM_Report_Form::OP_SELECT,
- 'options' => $optionYear,
- 'default' => '',
- ),
- 'other_year' => array(
- 'title' => ts('Other Years'),
- 'operatorType' => CRM_Report_Form::OP_SELECT,
- 'options' => $optionYear,
- 'default' => '',
- ),
- 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
- 'contribution_status_id' => array(
- 'title' => ts('Contribution Status'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
- 'default' => array(1),
- ),
- 'financial_type_id' => array(
- 'title' => ts('Financial Type'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Contribute_PseudoConstant::financialType(),
- ),
- 'total_amount' => array(
- 'title' => ts('Contribution Amount'),
- ),
- 'total_sum' => array(
- 'title' => ts('Aggregate Amount'),
- 'type' => CRM_Report_Form::OP_INT,
- 'dbAlias' => 'civicrm_contribution_total_amount_sum',
- 'having' => TRUE,
- ),
+ ),
+ ),
+ ) + array(
+ 'civicrm_contribution' => array(
+ 'dao' => 'CRM_Contribute_DAO_Contribution',
+ 'fields' => array(
+ 'total_amount' => array(
+ 'title' => ts('Amount Statistics'),
+ 'default' => TRUE,
+ 'required' => TRUE,
+ 'no_display' => TRUE,
+ 'statistics' => array('sum' => ts('Aggregate Amount')),
+ ),
+ 'receive_date' => array(
+ 'required' => TRUE,
+ 'default' => TRUE,
+ 'no_display' => TRUE,
),
),
- );
+ 'grouping' => 'contri-fields',
+ 'filters' => array(
+ 'this_year' => array(
+ 'title' => ts('This Year'),
+ 'operatorType' => CRM_Report_Form::OP_SELECT,
+ 'options' => $optionYear,
+ 'default' => '',
+ ),
+ 'other_year' => array(
+ 'title' => ts('Other Years'),
+ 'operatorType' => CRM_Report_Form::OP_SELECT,
+ 'options' => $optionYear,
+ 'default' => '',
+ ),
+ 'receive_date' => array('operatorType' => CRM_Report_Form::OP_DATE),
+ 'contribution_status_id' => array(
+ 'title' => ts('Contribution Status'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::contributionStatus(),
+ 'default' => array(1),
+ ),
+ 'financial_type_id' => array(
+ 'title' => ts('Financial Type'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Contribute_PseudoConstant::financialType(),
+ ),
+ 'total_amount' => array(
+ 'title' => ts('Contribution Amount'),
+ ),
+ 'total_sum' => array(
+ 'title' => ts('Aggregate Amount'),
+ 'type' => CRM_Report_Form::OP_INT,
+ 'dbAlias' => 'civicrm_contribution_total_amount_sum',
+ 'having' => TRUE,
+ ),
+ ),
+ ),
+ );
$this->_columns['civicrm_contribution']['fields']['civicrm_upto_' .
$this->_yearStatisticsFrom] = array(
return $rows;
}
- $sqlContribution =
- "{$this->_select} {$this->_from} WHERE {$this->_aliases['civicrm_contact']}.id IN (" .
+ $sqlContribution = "{$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} ";
if (!empty($this->_relationshipColumns)) {
$addRelSelect = ', ' . implode(', ', $this->_relationshipColumns);
}
- $sqlRelationship =
- "SELECT {$this->_aliases['civicrm_relationship']}.relationship_type_id as relationship_type_id, {$this->_aliases['civicrm_relationship']}.contact_id_a as contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b as contact_id_b {$addRelSelect} FROM civicrm_contact {$relContactAlias} {$this->_relationshipFrom} WHERE {$relContactAlias}.id IN (" .
+ $sqlRelationship = "SELECT {$this->_aliases['civicrm_relationship']}.relationship_type_id as relationship_type_id, {$this->_aliases['civicrm_relationship']}.contact_id_a as contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b as contact_id_b {$addRelSelect} FROM civicrm_contact {$relContactAlias} {$this->_relationshipFrom} WHERE {$relContactAlias}.id IN (" .
implode(',', $contactIds) .
") AND {$this->_aliases['civicrm_relationship']}.is_active = 1 {$this->_relationshipWhere} GROUP BY {$this->_aliases['civicrm_relationship']}.contact_id_a, {$this->_aliases['civicrm_relationship']}.contact_id_b";
$relationshipTypes = CRM_Core_PseudoConstant::relationshipType();
*/
public function __construct() {
$this->_columns = array(
- 'civicrm_contact' => array(
- 'dao' => 'CRM_Contact_DAO_Contact',
- 'fields' => array(
- 'sort_name' => array(
- 'title' => ts('Contact Name'),
- 'no_repeat' => TRUE,
- ),
- 'postal_greeting_display' => array('title' => ts('Postal Greeting')),
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => TRUE,
- ),
+ 'civicrm_contact' => array(
+ 'dao' => 'CRM_Contact_DAO_Contact',
+ 'fields' => array(
+ 'sort_name' => array(
+ 'title' => ts('Contact Name'),
+ 'no_repeat' => TRUE,
),
- 'grouping' => 'contact-fields',
- 'group_bys' => array(
- 'id' => array('title' => ts('Contact ID')),
- 'sort_name' => array(
- 'title' => ts('Contact Name'),
- ),
+ 'postal_greeting_display' => array('title' => ts('Postal Greeting')),
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => TRUE,
),
),
- 'civicrm_email' => array(
- 'dao' => 'CRM_Core_DAO_Email',
- 'fields' => array(
- 'email' => array(
- 'no_repeat' => TRUE,
- 'title' => ts('email'),
- ),
+ 'grouping' => 'contact-fields',
+ 'group_bys' => array(
+ 'id' => array('title' => ts('Contact ID')),
+ 'sort_name' => array(
+ 'title' => ts('Contact Name'),
),
- 'grouping' => 'contact-fields',
),
- 'civicrm_pledge' => array(
- 'dao' => 'CRM_Pledge_DAO_Pledge',
- 'fields' => array(
- 'id' => array(
- 'no_display' => TRUE,
- 'required' => FALSE,
- ),
- 'currency' => array(
- 'required' => TRUE,
- 'no_display' => TRUE,
- ),
- 'amount' => array(
- 'title' => ts('Pledge Amount'),
- 'required' => TRUE,
- 'type' => CRM_Utils_Type::T_MONEY,
- 'statistics' => array(
- 'sum' => ts('Aggregate Amount Pledged'),
- 'count' => ts('Pledges'),
- 'avg' => ts('Average'),
- ),
- ),
- 'frequency_unit' => array(
- 'title' => ts('Frequency Unit'),
- ),
- 'installments' => array(
- 'title' => ts('Installments'),
- ),
- 'pledge_create_date' => array(
- 'title' => ts('Pledge Made Date'),
- ),
- 'start_date' => array(
- 'title' => ts('Pledge Start Date'),
- 'type' => CRM_Utils_Type::T_DATE,
- ),
- 'end_date' => array(
- 'title' => ts('Pledge End Date'),
- 'type' => CRM_Utils_Type::T_DATE,
- ),
- 'status_id' => array(
- 'title' => ts('Pledge Status'),
- ),
+ ),
+ 'civicrm_email' => array(
+ 'dao' => 'CRM_Core_DAO_Email',
+ 'fields' => array(
+ 'email' => array(
+ 'no_repeat' => TRUE,
+ 'title' => ts('email'),
),
- 'filters' => array(
- 'pledge_create_date' => array(
- 'title' => 'Pledge Made Date',
- 'operatorType' => CRM_Report_Form::OP_DATE,
- ),
- 'pledge_amount' => array(
- 'title' => ts('Pledged Amount'),
- 'operatorType' => CRM_Report_Form::OP_INT,
- ),
- '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,
- ),
- 'sid' => array(
- 'name' => 'status_id',
- 'title' => ts('Pledge Status'),
- 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
- 'options' => CRM_Core_OptionGroup::values('contribution_status'),
- ),
+ ),
+ 'grouping' => 'contact-fields',
+ ),
+ 'civicrm_pledge' => array(
+ 'dao' => 'CRM_Pledge_DAO_Pledge',
+ 'fields' => array(
+ 'id' => array(
+ 'no_display' => TRUE,
+ 'required' => FALSE,
),
- 'group_bys' => array(
- 'pledge_create_date' => array(
- 'frequency' => TRUE,
- 'default' => TRUE,
- 'chart' => TRUE,
- ),
- 'frequency_unit' => array(
- 'title' => ts('Frequency Unit'),
- ),
- 'status_id' => array(
- 'title' => ts('Pledge Status'),
+ 'currency' => array(
+ 'required' => TRUE,
+ 'no_display' => TRUE,
+ ),
+ 'amount' => array(
+ 'title' => ts('Pledge Amount'),
+ 'required' => TRUE,
+ 'type' => CRM_Utils_Type::T_MONEY,
+ 'statistics' => array(
+ 'sum' => ts('Aggregate Amount Pledged'),
+ 'count' => ts('Pledges'),
+ 'avg' => ts('Average'),
),
),
+ 'frequency_unit' => array(
+ 'title' => ts('Frequency Unit'),
+ ),
+ 'installments' => array(
+ 'title' => ts('Installments'),
+ ),
+ 'pledge_create_date' => array(
+ 'title' => ts('Pledge Made Date'),
+ ),
+ 'start_date' => array(
+ 'title' => ts('Pledge Start Date'),
+ 'type' => CRM_Utils_Type::T_DATE,
+ ),
+ 'end_date' => array(
+ 'title' => ts('Pledge End Date'),
+ 'type' => CRM_Utils_Type::T_DATE,
+ ),
+ 'status_id' => array(
+ 'title' => ts('Pledge Status'),
+ ),
),
- 'civicrm_pledge_payment' => array(
- 'dao' => 'CRM_Pledge_DAO_PledgePayment',
- 'fields' => array(
- 'total_paid' => array(
- 'title' => ts('Total Amount Paid'),
- 'type' => CRM_Utils_Type::T_STRING,
- 'dbAlias' => 'sum(pledge_payment_civireport.actual_amount)',
- ),
+ 'filters' => array(
+ 'pledge_create_date' => array(
+ 'title' => 'Pledge Made Date',
+ 'operatorType' => CRM_Report_Form::OP_DATE,
+ ),
+ 'pledge_amount' => array(
+ 'title' => ts('Pledged Amount'),
+ 'operatorType' => CRM_Report_Form::OP_INT,
+ ),
+ '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,
+ ),
+ 'sid' => array(
+ 'name' => 'status_id',
+ 'title' => ts('Pledge Status'),
+ 'operatorType' => CRM_Report_Form::OP_MULTISELECT,
+ 'options' => CRM_Core_OptionGroup::values('contribution_status'),
+ ),
+ ),
+ 'group_bys' => array(
+ 'pledge_create_date' => array(
+ 'frequency' => TRUE,
+ 'default' => TRUE,
+ 'chart' => TRUE,
+ ),
+ 'frequency_unit' => array(
+ 'title' => ts('Frequency Unit'),
+ ),
+ 'status_id' => array(
+ 'title' => ts('Pledge Status'),
+ ),
+ ),
+ ),
+ 'civicrm_pledge_payment' => array(
+ 'dao' => 'CRM_Pledge_DAO_PledgePayment',
+ 'fields' => array(
+ 'total_paid' => array(
+ 'title' => ts('Total Amount Paid'),
+ 'type' => CRM_Utils_Type::T_STRING,
+ 'dbAlias' => 'sum(pledge_payment_civireport.actual_amount)',
),
),
- ) + $this->addAddressFields();
+ ),
+ ) + $this->addAddressFields();
$this->_groupFilter = TRUE;
$this->_tagFilter = TRUE;
*
* @return mixed
*/
- function invoke(
+ public function invoke(
$numParams,
&$arg1, &$arg2, &$arg3, &$arg4, &$arg5, &$arg6,
$fnSuffix
) {
// suppress all hok calls during soap
- return;
+ return NULL;
}
}
return sha1($result[2]);
}
- /*** MAILER API ***/
+ /**
+ * MAILER API
+ */
public function mailer_event_bounce($key, $job, $queue, $hash, $body) {
$this->verify($key);
$params = array(
* @param array $params
* An array of parameters (see CRM_Utils_System::docURL2 method for names)
*
- * @return string|void
+ * @return void|string
* URL or link to documentation page, based on provided parameters.
*/
public static function docURL($params) {
if (!isset($params['page'])) {
- return;
+ return NULL;
}
if (CRM_Utils_Array::value('resource', $params) == 'wiki') {
CRM_ACL_BAO_Cache::resetCache();
// reset various static arrays used here
- CRM_Contact_BAO_Contact::$_importableFields
- = CRM_Contact_BAO_Contact::$_exportableFields
+ CRM_Contact_BAO_Contact::$_importableFields = CRM_Contact_BAO_Contact::$_exportableFields
= CRM_Contribute_BAO_Contribution::$_importableFields
- = CRM_Contribute_BAO_Contribution::$_exportableFields
- = CRM_Pledge_BAO_Pledge::$_exportableFields
- = CRM_Contribute_BAO_Query::$_contributionFields
- = CRM_Core_BAO_CustomField::$_importFields
- = CRM_Core_BAO_Cache::$_cache
- = CRM_Core_DAO::$_dbColumnValueCache
- = NULL;
+ = CRM_Contribute_BAO_Contribution::$_exportableFields
+ = CRM_Pledge_BAO_Pledge::$_exportableFields = CRM_Contribute_BAO_Query::$_contributionFields
+ = CRM_Core_BAO_CustomField::$_importFields
+ = CRM_Core_BAO_Cache::$_cache = CRM_Core_DAO::$_dbColumnValueCache = NULL;
CRM_Core_OptionGroup::flushAll();
CRM_Utils_PseudoConstant::flushAll();
/**
* Rewrite various system urls to https
*
- * @param null
- *
* @return void
*/
public function mapConfigToSSL() {
* Load cms bootstrap?.
* @param NULL|string $realPath filename of script
*
- * @return mixed
- * false if no auth
- * array(
- * contactID, ufID, unique string ) if success
+ * @return mixed false if no auth array(contactID, ufID, unique string ) if success
*/
public static function authenticate($name, $password, $loadCMSBootstrap = FALSE, $realPath = NULL) {
require_once 'DB.php';
* 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;
* @param null $pageTitle
*/
public function setTitle($title, $pageTitle = NULL) {
- return;
+ return NULL;
}
/**
* @param $breadCrumbs
*/
public function appendBreadCrumb($breadCrumbs) {
- return;
+ return NULL;
}
public function resetBreadCrumb() {
- return;
+ return NULL;
}
/**
* @param string $head
*/
public function addHTMLHead($head) {
- return;
+ return NULL;
}
public function mapConfigToSSL() {
/**
* @param mix $action
*
- * @return string
+ * @return void
*/
public function postURL($action) {
- return;
+ return NULL;
}
/**
*
* @return string
*/
- function url(
+ public function url(
$path = NULL, $query = NULL, $absolute = FALSE,
$fragment = NULL, $htmlize = TRUE,
$frontend = FALSE, $forceBackend = FALSE
* @param string $message
*/
public function setMessage($message) {
- return;
+ return NULL;
}
public function permissionDenied() {
* with the locale or null for none
*/
/**
- * @return string
+ * @return void
*/
public function getUFLocale() {
return NULL;
* @param string $destination
* If present, add destination to querystring (works for Drupal only).
*
- * @throws Exception
- * @return string
+ * @Throws Exception
* loginURL for the current CMS
*/
public function getLoginURL($destination = '') {
* Name of the node we are searching for.
* @param array (ref) $parentNode which parent node should we search in ?
*
- * @return array(
- * ref) | false node if found else false
+ * @return array(ref) | false node if found else false
*/
- //public function &findNode(&$parentNode, $name)
public function &findNode($name, &$parentNode) {
// if no parent node specified, please start from root node
if (!$parentNode) {
* Check if node is a leaf node.
* Currently leaf nodes are strings and non-leaf nodes are arrays
*
- * @param array (
- * ref) $node node which needs to checked
+ * @param array $node node which needs to checked
*
- * @return boolean
+ * @return bool
*/
public function isLeafNode(&$node) {
return (count($node['children']) ? TRUE : FALSE);
*
* @param string $parentName
* Name of the parent ?.
- * @param array (ref) - node to be added
+ * @param array (ref) $node - node to be added
*
* @return void
*/
/**
* Add Data
*
- * @param string $parentName
- * Name of the parent ?.
- * @param mixed - data to be added
- * @param string - key to be used (optional)
+ * @param string $parentName Name of the parent ?.
+ * @param string $childName - key to be used (optional)
+ * @param mixed $data - data to be added
*
* @return void
*/
/**
* Get Tree
*
- * @param none
- *
* @return tree
*/
public function getTree() {
/**
* Print the tree
*
- * @param none
- *
* @return void
*/
public function display() {
* @param int $contributionPageID
* @param string $widgetID
*
- * @return stdClass
+ * @return object
*/
public function getContributionPageData($contributionPageID, $widgetID) {
$config = CRM_Core_Config::singleton();
* php bin/csv/delete.php -e <entity> --file /path/to/csv/file [ -s site.org ]
* e.g.: php bin/csv/delete.php -e Contact --file /tmp/delete.csv
*
- **/
+ */
require_once dirname(__DIR__) . '/cli.class.php';
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
public function testHookAlterMailer() {
$test = $this;
$mockMailer = new CRM_Utils_FakeObject(array(
- 'send' => function ($recipients, $headers, $body) use ($test) {
- $test->calls['send']++;
- $test->assertEquals(array('to@example.org'), $recipients);
- $test->assertEquals('Subject Example', $headers['Subject']);
- },
+ 'send' => function ($recipients, $headers, $body) use ($test) {
+ $test->calls['send']++;
+ $test->assertEquals(array('to@example.org'), $recipients);
+ $test->assertEquals('Subject Example', $headers['Subject']);
+ },
));
CRM_Utils_Hook::singleton()->setHook('civicrm_alterMailer',
- function (&$mailer, $driver, $params) use ($test, $mockMailer) {
- $test->calls['civicrm_alterMailer']++;
- $test->assertTrue(is_string($driver) && !empty($driver));
- $test->assertTrue(is_array($params));
- $test->assertTrue(is_callable(array($mailer, 'send')));
- $mailer = $mockMailer;
- }
+ function (&$mailer, $driver, $params) use ($test, $mockMailer) {
+ $test->calls['civicrm_alterMailer']++;
+ $test->assertTrue(is_string($driver) && !empty($driver));
+ $test->assertTrue(is_array($params));
+ $test->assertTrue(is_callable(array($mailer, 'send')));
+ $mailer = $mockMailer;
+ }
);
$params = array();
$paypalIPN->main();
$contribution = $this->callAPISuccess('contribution', 'get', array(
'contribution_recur_id' => $this->_contributionRecurID,
- 'sequential' => 1
+ 'sequential' => 1,
));
$this->assertEquals(2, $contribution['count']);
$this->assertEquals('secondone', $contribution['values'][1]['trxn_id']);
$this->assertEquals(strtotime('+ 1 year', strtotime($membershipEndDate)), strtotime($this->callAPISuccessGetValue('membership', array('return' => 'end_date'))));
$contribution = $this->callAPISuccess('contribution', 'get', array(
'contribution_recur_id' => $this->_contributionRecurID,
- 'sequential' => 1
+ 'sequential' => 1,
));
$this->assertEquals(2, $contribution['count']);
$this->assertEquals('secondone', $contribution['values'][1]['trxn_id']);
$this->callAPISuccessGetCount('line_item', array(
'entity_id' => $this->ids['membership'],
- 'entity_table' => 'civicrm_membership'
+ 'entity_table' => 'civicrm_membership',
), 2);
$this->callAPISuccessGetSingle('line_item', array(
'contribution_id' => $contribution['values'][1]['id'],
- 'entity_table' => 'civicrm_membership'
+ 'entity_table' => 'civicrm_membership',
));
$this->callAPISuccessGetSingle('membership_payment', array('contribution_id' => $contribution['values'][1]['id']));
$paypalIPN->main();
$contribution = $this->callAPISuccess('contribution', 'get', array(
'contribution_recur_id' => $this->_contributionRecurID,
- 'sequential' => 1
+ 'sequential' => 1,
));
$this->assertEquals(1, $contribution['count']);
$this->assertEquals('secondone', $contribution['values'][0]['trxn_id']);
'amount_per_cycle' => '15.00',
'mc_gross' => '15.00',
'payment_date' => '03:59:05 Jul 14, 2013 PDT',
- 'rp_invoice_id' => 'i=' . $this->_invoiceID
- . '&m=contribute&c='
- . $this->_contactID
- . '&r=' . $this->_contributionRecurID
- . '&b=' . $this->_contributionID . '&p=' . $this->_contributionPageID,
+ 'rp_invoice_id' => 'i=' . $this->_invoiceID . '&m=contribute&c=' . $this->_contactID . '&r=' . $this->_contributionRecurID . '&b=' . $this->_contributionID . '&p=' . $this->_contributionPageID,
'payment_status' => 'Completed',
'business' => 'nowhere@civicrm.org',
'last_name' => 'Roberty',
* @param int $id
* Id of the PayPal Pro payment processor.
* to be deleted
- * @return boolean
+ * @return bool
* true if payment processor deleted, false otherwise
*/
public function delete($id) {
'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);
$result = $this->callAPIAndDocument('activity', 'create', $params, __FUNCTION__, __FILE__, $description, $subfile);
$result = $this->callAPISuccess('activity', 'get', array(
- 'id' => $result['id'],
- 'version' => $this->_apiversion,
- 'return.assignee_contact_id' => 1,
- 'return.target_contact_id' => 1
- ));
+ 'id' => $result['id'],
+ 'version' => $this->_apiversion,
+ 'return.assignee_contact_id' => 1,
+ 'return.target_contact_id' => 1,
+ ));
$this->assertEquals($this->_contactID, $result['values'][$result['id']]['assignee_contact_id'][0], 'in line ' . __LINE__);
$this->assertEquals($this->_contactID, $result['values'][$result['id']]['target_contact_id'][0], 'in line ' . __LINE__);
$params['custom_' . $ids['custom_field_id']] = "custom string";
$result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__);
$result = $this->callAPISuccess($this->_entity, 'get', array(
- 'return.custom_' . $ids['custom_field_id'] => 1,
- 'version' => 3,
- 'id' => $result['id']
- ));
+ 'return.custom_' . $ids['custom_field_id'] => 1,
+ 'version' => 3,
+ 'id' => $result['id'],
+ ));
$this->assertEquals("custom string", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
$this->customFieldDelete($ids['custom_field_id']);
$result = $this->callAPIAndDocument($this->_entity, 'create', $params, __FUNCTION__, __FILE__, $description, $subfile, 'Create');
$result = $this->callAPIAndDocument($this->_entity, 'get', array(
- 'return.custom_' . $customField['id'] => 1,
- 'id' => $result['id']
- ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet', 'get');
+ 'return.custom_' . $customField['id'] => 1,
+ 'id' => $result['id'],
+ ), __FUNCTION__, __FILE__, 'Get with Contact Ref Custom Field', 'ContactRefCustomFieldGet', 'get');
$this->assertEquals('Anderson, Anthony', $result['values'][$result['id']]['custom_' . $customField['id']], ' in line ' . __LINE__);
$this->assertEquals($this->_contactID, $result['values'][$result['id']]['custom_' . $customField['id'] . "_id"], ' in line ' . __LINE__);
$activity = $this->callAPISuccess('Activity', 'Create', $params);
$activityget = $this->callAPISuccess('Activity', 'get', array(
- 'id' => $activity['id'],
- 'target_contact_id' => $contact2,
- 'return.target_contact_id' => 1
- ));
+ 'id' => $activity['id'],
+ 'target_contact_id' => $contact2,
+ 'return.target_contact_id' => 1,
+ ));
$this->assertEquals($activity['id'], $activityget['id'], 'In line ' . __LINE__);
$this->assertEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__);
$activityget = $this->callAPISuccess('activity', 'get', array(
- 'target_contact_id' => $this->_contactID,
- 'return.target_contact_id' => 1,
- 'id' => $activity['id']
- ));
+ 'target_contact_id' => $this->_contactID,
+ 'return.target_contact_id' => 1,
+ 'id' => $activity['id'],
+ ));
if ($activityget['count'] > 0) {
$this->assertNotEquals($contact2, $activityget['values'][$activityget['id']]['target_contact_id'][0], 'In line ' . __LINE__);
}
$this->assertEquals(0, $result['count'], 'No activities of status 1 should exist');
$result = $this->callAPISuccess('Activity', 'Get', array(
'version' => $this->_apiversion,
- 'status_id' => '2'
+ 'status_id' => '2',
));
$this->assertEquals(0, $result['count'], 'No activities of status 1 should exist');
$activityId = $result['id'];
$result = $this->callAPISuccess($this->_entity, 'get', array(
- 'return.custom_' . $ids['custom_field_id'] => 1,
- 'version' => 3,
- 'id' => $result['id']
- ));
+ 'return.custom_' . $ids['custom_field_id'] => 1,
+ 'version' => 3,
+ 'id' => $result['id'],
+ ));
$this->assertEquals("custom string", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
$this->assertEquals("2009-10-18 00:00:00", $result['values'][$result['id']]['activity_date_time'], ' in line ' . __LINE__);
$fields = $this->callAPISuccess('activity', 'getfields', array('version' => $this->_apiversion));
$result = $this->callAPISuccess('Activity', 'Create', $params);
$result = $this->callAPISuccess($this->_entity, 'get', array(
- 'return.custom_' . $ids['custom_field_id'] => 1,
- 'version' => 3,
- 'id' => $result['id']
- ));
+ 'return.custom_' . $ids['custom_field_id'] => 1,
+ 'version' => 3,
+ 'id' => $result['id'],
+ ));
$this->assertEquals("Updated my test data", $result['values'][$result['id']]['custom_' . $ids['custom_field_id']], ' in line ' . __LINE__);
}
),
'api.activity.create' => array(
'subject' => 'send letter',
- 'activity_type_id' => '$value.api.activity_type.create.values.0.value'
+ 'activity_type_id' => '$value.api.activity_type.create.values.0.value',
),
));