if (in_array($activityTypeId, array(
$emailTypeValue,
- $letterTypeValue
+ $letterTypeValue,
))) {
return;
}
*
* @return \CRM_Activity_Selector_Activity
*/
- function __construct(
+ public function __construct(
$contactId,
$permission,
$admin = FALSE,
'url' => $url,
'qs' => $qsView,
'title' => ts('View Activity'),
- )
+ ),
);
}
'url' => $updateUrl,
'qs' => $qsUpdate,
'title' => ts('Update Activity'),
- )
+ ),
);
}
}
'url' => '#',
'extra' => 'onclick="javascript:fileOnCase( \'file\', \'%%id%%\', null, this ); return false;"',
'title' => ts('File on Case'),
- )
+ ),
);
}
'url' => $delUrl,
'qs' => $qsDelete,
'title' => ts('Delete Activity'),
- )
+ ),
);
}
'url' => 'civicrm/mailing/report',
'qs' => "mid={$sourceRecordId}&reset=1&cid=%%cid%%&context=activitySelector",
'title' => ts('View Mailing Report'),
- )
+ ),
);
}
'url' => CRM_Utils_System::url('civicrm/admin/messageTemplates',
'action=browse&reset=1'
),
- )
+ ),
);
CRM_Utils_System::appendBreadCrumb($breadCrumb);
$this->add('select', 'pdf_format_id', ts('PDF Page Format'),
array(
- 'null' => ts('- default -')
+ 'null' => ts('- default -'),
) + CRM_Core_BAO_PdfFormat::getList(TRUE), FALSE
);
$scriptURL = "<a href='" . CRM_Utils_System::docURL2('Update Greetings and Address Data for Contacts', TRUE, NULL, NULL, NULL, "wiki") . "'>" . ts('Learn more about a script that can automatically update contact addressee and greeting options.') . "</a>";
CRM_Core_Session::setStatus(ts('The selected %1 option has <strong>not been deleted</strong> because it is currently in use. Please update these contacts to use a different format before deleting this option. %2', array(
1 => $this->_gLabel,
- 2 => $scriptURL
+ 2 => $scriptURL,
)), ts('Sorry'), 'error');
$redirect = CRM_Utils_System::url($url, $params);
CRM_Utils_System::redirect($redirect);
if (in_array($this->_gName, array(
'email_greeting',
'postal_greeting',
- 'addressee'
+ 'addressee',
))) {
$defaults['contactOptions'] = (CRM_Utils_Array::value('filter', $defaults)) ? $defaults['filter'] : NULL;
}
if (!in_array($this->_gName, array(
'email_greeting',
'postal_greeting',
- 'addressee'
+ 'addressee',
)) && !$isReserved
) {
$this->addRule('label',
if (in_array($this->_gName, array(
'email_greeting',
'postal_greeting',
- 'addressee'
+ 'addressee',
)) && !$isReserved
) {
$values = array(
if (in_array($self->_gName, array(
'email_greeting',
'postal_greeting',
- 'addressee'
+ 'addressee',
)) && empty($self->_defaultValues['is_reserved'])
) {
$label = $fields['label'];
CRM_Core_Session::setStatus(ts('The %1 \'%2\' has been saved.', array(
1 => $this->_gLabel,
- 2 => $optionValue->label
+ 2 => $optionValue->label,
)), ts('Saved'), 'success');
}
}
}
/**
- * Get Surveys activity types
- *
- *
+ * Get Survey activity types.
*/
- static function getSurveyActivityType(
- $returnColumn = 'label',
- $includePetitionActivityType = FALSE
- ) {
+ public static function getSurveyActivityType($returnColumn = 'label', $includePetitionActivityType = FALSE) {
static $activityTypes;
$cacheKey = "{$returnColumn}_{$includePetitionActivityType}";
foreach ($returnProperties as $property => $ignore) {
$value = (in_array($property, array(
'city',
- 'street_address'
+ 'street_address',
))) ? 'address' : $property;
switch ($property) {
case 'sort_name':
* @return array
* array of survey activity.
*/
- static function voterActivityDetails(
- $surveyId, $voterIds, $interviewerId = NULL,
- $statusIds = array()) {
+ public static function voterActivityDetails($surveyId, $voterIds, $interviewerId = NULL, $statusIds = array()) {
$activityDetails = array();
if (!$surveyId ||
!is_array($voterIds) || empty($voterIds)
* @return array
* An array of survey activity.
*/
- static function getSurveyActivities(
+ public static function getSurveyActivities(
$surveyId,
$interviewerId = NULL,
$statusIds = NULL,
*
* @param int $activityId
* Activity id.
- * @return boolean
+ * @return bool
*/
public static function isSurveyActivity($activityId) {
$isSurveyActivity = FALSE;
if (CRM_Core_Permission::check('access CiviReport')) {
$reportID = self::getReportID($surveyId);
if ($reportID) {
- $voterLinks['report'] =
- array(
- 'name' => 'report',
- 'url' => "civicrm/report/instance/{$reportID}",
- 'qs' => 'reset=1',
- 'title' => ts('View Survey Report'),
- );
+ $voterLinks['report'] = array(
+ 'name' => 'report',
+ 'url' => "civicrm/report/instance/{$reportID}",
+ 'qs' => 'reset=1',
+ 'title' => ts('View Survey Report'),
+ );
}
}
CRM_Core_Error::fatal('The contact profile needs to contain the primary email address field');
}
-
$ufJoinParams['weight'] = 1;
$this->_activityProfileId = CRM_Core_BAO_UFJoin::findUFGroupId($ufJoinParams);
* @return void
* @see valid_date
*/
-
public static function formRule($fields, $files, $errors) {
$errors = array();
'tag_unconfirmed'
);
-
if ($tag_name) {
// Check if contact 'email confirmed' tag exists, else create one
// This should be in the petition module initialise code to create a default tag for this
break;
}
-
$transaction = new CRM_Core_Transaction();
$addToGroupID = isset($this->_addToGroupID) ? $this->_addToGroupID : NULL;
$this->postProcessHook();
// set the template to thank you
- $url =
- CRM_Utils_System::url(
- 'civicrm/petition/thankyou',
- 'pid=' . $this->_surveyId . '&id=' . $this->_sendEmailMode . '&reset=1'
- );
+ $url = CRM_Utils_System::url(
+ 'civicrm/petition/thankyou',
+ 'pid=' . $this->_surveyId . '&id=' . $this->_sendEmailMode . '&reset=1'
+ );
CRM_Utils_System::redirect($url);
}
}
}
if ($fields) {
- /*
- // unset any email-* fields since we already collect it, CRM-2888
- foreach ( array_keys( $fields ) as $fieldName ) {
- if ( substr( $fieldName, 0, 6 ) == 'email-' ) {
- unset( $fields[$fieldName] );
- }
- }
- */
-
-
$this->assign($name, $fields);
$addCaptcha = FALSE;
if ($relatedCases) {
$this->assign('relatedCaseLabel', ts('%1 Related Case', array(
'count' => count($relatedCases),
- 'plural' => '%1 Related Cases'
+ 'plural' => '%1 Related Cases',
)));
$this->assign('relatedCaseUrl', CRM_Utils_System::url('civicrm/contact/view/case', array(
'id' => $this->_caseID,
$this->add('select', 'merge_case_id',
ts('Select Case for Merge'),
array(
- '' => ts('- select case -')
+ '' => ts('- select case -'),
) + $otherCases,
FALSE,
array('class' => 'crm-select2 huge')
*
* @return \CRM_Case_Selector_Search
*/
- function __construct(
+ public function __construct(
&$queryParams,
$action = CRM_Core_Action::NONE,
$additionalClause = NULL,
*
* @return array
*/
- static
- public function &links($isDeleted = FALSE, $key = NULL) {
+ static public function &links($isDeleted = FALSE, $key = NULL) {
$extraParams = ($key) ? "&key={$key}" : NULL;
if ($isDeleted) {
*
* @return string
*/
- function all(
+ public function all(
$offset = 0,
$rowcount = 0,
$sort = NULL,
ORDER BY donation_amount desc
";
-
if ($justIDs) {
CRM_Core_DAO::executeQuery("DROP TEMPORARY TABLE IF EXISTS CustomSearch_SYBNT_temp");
$query = "CREATE TEMPORARY TABLE CustomSearch_SYBNT_temp AS ({$sql})";
*
* @return string
*/
- function all(
- $offset = 0, $rowcount = 0, $sort = NULL,
- $includeContactIDs = FALSE, $justIDs = FALSE
- ) {
+ public function all($offset = 0, $rowcount = 0, $sort = NULL, $includeContactIDs = FALSE, $justIDs = FALSE) {
if ($justIDs) {
$selectClause = "contact_a.id as contact_id";
$sort = 'contact_a.id';
$contact = CRM_Core_DAO::executeQuery($sql);
while ($contact->fetch()) {
$contactTypes[$contact->contact_type] = TRUE;
- if (count($contactTypes) > 1)
+ if (count($contactTypes) > 1) {
break;
+ }
}
if (count($contactTypes) > 1) {
$statusMsg = ts('Selected records must all be the same contact type (i.e. all Individuals).');
*
* @return \CRM_Contribute_Selector_Search
*/
- function __construct(
+ public function __construct(
&$queryParams,
$action = CRM_Core_Action::NONE,
$contributionClause = NULL,
),
);
if ($this->_includeSoftCredits) {
- self::$_columnHeaders =
- array_merge(
+ self::$_columnHeaders
+ = array_merge(
self::$_columnHeaders,
array(
array(
)
);
}
- self::$_columnHeaders =
- array_merge(
+ self::$_columnHeaders
+ = array_merge(
self::$_columnHeaders,
array(
array(
self::$_columnHeaders = array_merge($pre, self::$_columnHeaders);
}
if ($this->_includeSoftCredits) {
- self::$_columnHeaders =
- array_merge(
- self::$_columnHeaders,
+ self::$_columnHeaders
+ = array_merge(
+ self::$_columnHeaders,
+ array(
array(
- array(
- 'name' => ts('Soft Credit For'),
- 'sort' => 'contribution_soft_credit_name',
- 'direction' => CRM_Utils_Sort::DONTCARE,
- ),
- array(
- 'name' => ts('Soft Credit Type'),
- 'sort' => 'contribution_soft_credit_type',
- 'direction' => CRM_Utils_Sort::ASCENDING,
- ),
- )
- );
+ 'name' => ts('Soft Credit For'),
+ 'sort' => 'contribution_soft_credit_name',
+ 'direction' => CRM_Utils_Sort::DONTCARE,
+ ),
+ array(
+ 'name' => ts('Soft Credit Type'),
+ 'sort' => 'contribution_soft_credit_type',
+ 'direction' => CRM_Utils_Sort::ASCENDING,
+ ),
+ )
+ );
}
- self::$_columnHeaders =
- array_merge(
+ self::$_columnHeaders
+ = array_merge(
self::$_columnHeaders, array(
array('desc' => ts('Actions')),
)
return $this->_query->summaryContribution($this->_context);
}
}
-
* @param string $value
* The data to be validated.
*
- * @return boolean
+ * @return bool
* True if the value is of the specified type
*/
public static function typecheck($type, $value) {
* @param string $entityTable
* Name of the entity table usually 'civicrm_contact'.
*
- * @return array(
- * ) reference $tag array of category id's the contact belongs to.
+ * @return array
+ * reference $tag array of category id's the contact belongs to.
*
*/
public static function &getTag($entityID, $entityTable = 'civicrm_contact') {
* @param array $params
* An assoc array of name/value pairs.
*
- * @return boolean
+ * @return bool
*/
public static function dataExists($params) {
return !($params['tag_id'] == 0);
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
- *
- * @return CRM_Core_BAO_EntityTag
*/
public static function del(&$params) {
$entityTag = new CRM_Core_BAO_EntityTag();
/**
* Get options for a given field.
+ *
* @see CRM_Core_DAO::buildOptions
+ * @see CRM_Core_DAO::buildOptionsContext
*
* @param string $fieldName
* @param string $context
- * @see CRM_Core_DAO::buildOptionsContext.
+ * As per CRM_Core_DAO::buildOptionsContext.
* @param array $props
* whatever is known about this dao object.
*
- * @return Array|bool
+ * @return array|bool
*/
public static function buildOptions($fieldName, $context = NULL, $props = array()) {
$params = array();
* @param string $identity_url
* The OpenID to check.
*
- * @return boolean
+ * @return bool
*/
public static function isAllowedToLogin($identity_url) {
$openId = new CRM_Core_DAO_OpenID();
$config = CRM_Core_Config::singleton();
if ($config->logging) {
// logging support
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
$logging->fixSchemaDifferencesFor($params['name'], NULL, FALSE);
}
if ($config->logging) {
// logging support: if we’re adding a column (but only then!) make sure the potential relevant log table gets a column as well
if ($params['operation'] == 'add') {
- $logging = new CRM_Logging_Schema;
+ $logging = new CRM_Logging_Schema();
$logging->fixSchemaDifferencesFor($params['table_name'], array('ADD' => array($params['name'])), FALSE);
}
}
}
/**
- * Delete a civiCRM-table
+ * Delete a CiviCRM-table
*
* @param string $tableName
* Name of the table to be created.
- *
- * @return bool
- * TRUE if successfully deleted, FALSE otherwise.
- *
*/
public static function dropTable($tableName) {
$sql = "DROP TABLE $tableName";
public static function createIndexes(&$tables, $createIndexPrefix = 'index', $substrLenghts = array()) {
$queries = array();
require_once 'CRM/Core/DAO/Domain.php';
- $domain = new CRM_Core_DAO_Domain;
+ $domain = new CRM_Core_DAO_Domain();
$domain->find(TRUE);
$locales = explode(CRM_Core_DAO::VALUE_SEPARATOR, $domain->locales);
"index_{$field}{$lengthName}",
"FK_{$table}_{$field}{$lengthName}",
"UI_{$field}{$lengthName}",
- "{$createIndexPrefix}_{$field}{$lengthName}"
+ "{$createIndexPrefix}_{$field}{$lengthName}",
);
// skip to the next $field if one of the above $names exists; handle multilingual for CRM-4126
}
// run the queries without i18n-rewriting
- $dao = new CRM_Core_DAO;
+ $dao = new CRM_Core_DAO();
foreach ($queries as $query) {
$dao->query($query, FALSE);
}
if (!in_array($this->config->cms, array(
'drupal',
'joomla',
- 'wordpress'
- ))
- ) {
+ 'wordpress',
+ ))) {
echo "Config file for '{$this->config->cms}' not known.";
exit();
}
self::$_singleton = $cache->get('CRM_Core_Config' . CRM_Core_Config::domainID());
// if not in cache, fire off config construction
if (!self::$_singleton) {
- self::$_singleton = new CRM_Core_Config;
+ self::$_singleton = new CRM_Core_Config();
self::$_singleton->_initialize($loadFromDB);
//initialize variables. for gencode we cannot load from the
// also make sure we create the config directory within this directory
// the below statement will create both the templates directory and the config and log directory
- $this->configAndLogDir =
- CRM_Utils_File::baseFilePath($this->templateCompileDir) .
+ $this->configAndLogDir
+ = CRM_Utils_File::baseFilePath($this->templateCompileDir) .
'ConfigAndLog' . DIRECTORY_SEPARATOR;
CRM_Utils_File::createDir($this->configAndLogDir);
CRM_Utils_File::restrictAccess($this->configAndLogDir);
$this->templateCompileDir,
$this->uploadDir,
$this->configAndLogDir,
- $this->customFileUploadDir
+ $this->customFileUploadDir,
) as $dir) {
if ($dir && is_dir($dir)) {
CRM_Utils_File::restrictAccess($dir);
/**
* Verify that the needed parameters are not null in the config
*
- * @param CRM_Core_Config (reference ) the system config object
- * @param array (reference ) the parameters that need a value
+ * @param CRM_Core_Config $config (reference) the system config object
+ * @param array $required (reference) the parameters that need a value
*
- * @return boolean
+ * @return bool
*/
public static function check(&$config, &$required) {
foreach ($required as $name) {
* @param string $dateFormat
* @param bool|string $displayTime
*
- *
*/
-
- static function buildDateRange(
+ public static function buildDateRange(
&$form, $fieldName, $count = 1,
$from = '_from', $to = '_to', $fromLabel = 'From:',
$required = FALSE, $operators = array(),
$dateFormat = 'searchDate', $displayTime = FALSE
) {
- $selector =
- CRM_Core_Form_Date::returnDateRangeSelector(
+ $selector
+ = CRM_Core_Form_Date::returnDateRangeSelector(
$form, $fieldName, $count,
$from, $to, $fromLabel,
$required, $operators,
* @return array
* Values for Selector
*/
- static function returnDateRangeSelector(
+ public static function returnDateRangeSelector(
&$form, $fieldName, $count = 1,
$from = '_from', $to = '_to', $fromLabel = 'From:',
$required = FALSE, $operators = array(),
$dateFormat = 'searchDate', $displayTime = FALSE
) {
- $selector =
- array(
- '' => ts('- any -'),
- 0 => ts('Choose Date Range'),
- 'previous_2.year' => ts('Previous 2 Years'),
- 'previous_2.quarter' => ts('Previous 2 Quarters'),
- 'previous_2.month' => ts('Previous 2 Months'),
- 'previous_2.week' => ts('Previous 2 Weeks'),
- 'previous_2.day' => ts('Previous 2 Days'),
- 'previous_before.year' => ts('Prior to Previous Year'),
- 'previous_before.quarter' => ts('Prior to Previous Quarter'),
- 'previous_before.month' => ts('Prior to Previous Month'),
- 'previous_before.week' => ts('Prior to Previous Week'),
- 'previous_before.day' => ts('Prior to Previous Day'),
- 'previous.year' => ts('Previous Year'),
- 'previous.fiscal_year' => ts('Previous Fiscal Year'),
- 'previous.quarter' => ts('Previous Quarter'),
- 'previous.month' => ts('Previous Month'),
- 'previous.week' => ts('Previous Week'),
- 'earlier.year' => ts('To End of Previous Year'),
- 'earlier.quarter' => ts('To End of Previous Quarter'),
- 'earlier.month' => ts('To End of Previous Month'),
- 'earlier.week' => ts('To End of Previous Week'),
- 'earlier.day' => ts('To End of Previous Day'),
- 'greater_previous.year' => ts('From End of Previous Year'),
- 'greater_previous.quarter' => ts('From End of Previous Quarter'),
- 'greater_previous.month' => ts('From End of Previous Month'),
- 'greater_previous.week' => ts('From End of Previous Week'),
- 'greater.year' => ts('From Start of Current Year'),
- 'greater.quarter' => ts('From Start of Current Quarter'),
- 'greater.month' => ts('From Start of Current Month'),
- 'greater.week' => ts('From Start of Current Week'),
- 'greater.day' => ts('From Start of Current Day'),
- 'current.year' => ts('Current Year to-date'),
- 'current.quarter' => ts('Current Quarter to-date'),
- 'current.month' => ts('Current Month to-date'),
- 'current.week' => ts('Current Week to-date'),
- 'ending_3.year' => ts('Last 3 Years'),
- 'ending_2.year' => ts('Last 2 Years'),
- 'ending.year' => ts('Last 12 Months'),
- 'ending.quarter' => ts('Last 3 Months'),
- 'ending.month' => ts('Last Month'),
- 'ending.week' => ts('Last 7 days'),
- 'previous.day' => ts('Yesterday'),
- 'this.year' => ts('This Year'),
- 'this.fiscal_year' => ts('This Fiscal Year'),
- 'this.quarter' => ts('This Quarter'),
- 'this.month' => ts('This Month'),
- 'this.week' => ts('This Week'),
- 'this.day' => ts('Today'),
- 'starting.day' => ts('Tomorrow'),
- 'starting.week' => ts('Upcoming 7 days'),
- 'starting.month' => ts('Upcoming Month'),
- 'starting.year' => ts('Upcoming 12 Months'),
- 'less.year' => ts('To End of Current Year'),
- 'less.quarter' => ts('To End of Current Quarter'),
- 'less.month' => ts('To End of Current Month'),
- 'less.week' => ts('To End of Current Week'),
- 'next.week' => ts('Next Week'),
- 'next.month' => ts('Next Month'),
- 'next.quarter' => ts('Next Quarter'),
- 'next.fiscal_year' => ts('Next Fiscal Year'),
- 'next.year' => ts('Next Year'),
-
- );
+ $selector = array(
+ '' => ts('- any -'),
+ 0 => ts('Choose Date Range'),
+ 'previous_2.year' => ts('Previous 2 Years'),
+ 'previous_2.quarter' => ts('Previous 2 Quarters'),
+ 'previous_2.month' => ts('Previous 2 Months'),
+ 'previous_2.week' => ts('Previous 2 Weeks'),
+ 'previous_2.day' => ts('Previous 2 Days'),
+ 'previous_before.year' => ts('Prior to Previous Year'),
+ 'previous_before.quarter' => ts('Prior to Previous Quarter'),
+ 'previous_before.month' => ts('Prior to Previous Month'),
+ 'previous_before.week' => ts('Prior to Previous Week'),
+ 'previous_before.day' => ts('Prior to Previous Day'),
+ 'previous.year' => ts('Previous Year'),
+ 'previous.fiscal_year' => ts('Previous Fiscal Year'),
+ 'previous.quarter' => ts('Previous Quarter'),
+ 'previous.month' => ts('Previous Month'),
+ 'previous.week' => ts('Previous Week'),
+ 'earlier.year' => ts('To End of Previous Year'),
+ 'earlier.quarter' => ts('To End of Previous Quarter'),
+ 'earlier.month' => ts('To End of Previous Month'),
+ 'earlier.week' => ts('To End of Previous Week'),
+ 'earlier.day' => ts('To End of Previous Day'),
+ 'greater_previous.year' => ts('From End of Previous Year'),
+ 'greater_previous.quarter' => ts('From End of Previous Quarter'),
+ 'greater_previous.month' => ts('From End of Previous Month'),
+ 'greater_previous.week' => ts('From End of Previous Week'),
+ 'greater.year' => ts('From Start of Current Year'),
+ 'greater.quarter' => ts('From Start of Current Quarter'),
+ 'greater.month' => ts('From Start of Current Month'),
+ 'greater.week' => ts('From Start of Current Week'),
+ 'greater.day' => ts('From Start of Current Day'),
+ 'current.year' => ts('Current Year to-date'),
+ 'current.quarter' => ts('Current Quarter to-date'),
+ 'current.month' => ts('Current Month to-date'),
+ 'current.week' => ts('Current Week to-date'),
+ 'ending_3.year' => ts('Last 3 Years'),
+ 'ending_2.year' => ts('Last 2 Years'),
+ 'ending.year' => ts('Last 12 Months'),
+ 'ending.quarter' => ts('Last 3 Months'),
+ 'ending.month' => ts('Last Month'),
+ 'ending.week' => ts('Last 7 days'),
+ 'previous.day' => ts('Yesterday'),
+ 'this.year' => ts('This Year'),
+ 'this.fiscal_year' => ts('This Fiscal Year'),
+ 'this.quarter' => ts('This Quarter'),
+ 'this.month' => ts('This Month'),
+ 'this.week' => ts('This Week'),
+ 'this.day' => ts('Today'),
+ 'starting.day' => ts('Tomorrow'),
+ 'starting.week' => ts('Upcoming 7 days'),
+ 'starting.month' => ts('Upcoming Month'),
+ 'starting.year' => ts('Upcoming 12 Months'),
+ 'less.year' => ts('To End of Current Year'),
+ 'less.quarter' => ts('To End of Current Quarter'),
+ 'less.month' => ts('To End of Current Month'),
+ 'less.week' => ts('To End of Current Week'),
+ 'next.week' => ts('Next Week'),
+ 'next.month' => ts('Next Month'),
+ 'next.quarter' => ts('Next Quarter'),
+ 'next.fiscal_year' => ts('Next Fiscal Year'),
+ 'next.year' => ts('Next Year'),
+ );
if (is_array($operators)) {
$selector = array_merge($selector, $operators);
* @param bool $required
* @param string $dateFormat
* @param bool $displayTime
- *
- * @return null
*/
public static function addDateRangeToForm(&$form, $fieldName, $selector, $from = '_from', $to = '_to', $fromLabel = 'From:', $required = FALSE, $dateFormat = 'searchDate', $displayTime = FALSE) {
$form->add('select',
*
* @param array $groupParams
* Array containing group fields whose option-values is to retrieved.
- * @param string $orderBy
- * For orderBy clause.
* @param array $links
* Has links like edit, delete, disable ..etc.
+ * @param string $orderBy
+ * For orderBy clause.
*
* @return array
* Array of option-values
* @param array $groupParams
* Array containing group fields whose option-values is to retrieved/saved.
* @param $action
- * @param int $optionValueIDHas the id of the optionValue being edited, disabled ..etc.
+ * @param int $optionValueID Has the id of the optionValue being edited, disabled ..etc.
* Has the id of the optionValue being edited, disabled ..etc.
*
* @return CRM_Core_DAO_OptionValue
* @param string $fieldName
* The name of the field in the DAO.
*
- * @return boolean
+ * @return bool
* true if object exists
*/
public static function optionExists($value, $daoName, $daoID, $optionGroupID, $fieldName = 'name') {
* @param string $mode
* @param string $contactType
*
- * @return boolean
+ * @return bool
* true if object exists
*/
public static function getFields($mode = '', $contactType = 'Individual') {
'Individual',
'Household',
'Organization',
- 'All'
+ 'All',
))) {
$nameTitle = array(
'addressee' => array(
* @param string $orderBy
* For orderBy clause.
*
- * @param bool $isActiveDo you want only active option values?.
- * Do you want only active option values?.
+ * @param bool $isActive Do you want only active option values?
*
* @return array
* Array of option-values
/**
* This function takes care of all the things common to all
- * pages. This typically involves assigning the appropriate
- * smarty variable :)
+ * pages. This typically involves assigning the appropriate smarty
+ * variable :)
*
- * @return string
+ * @return void|string
* The content generated by running this page
*/
public function run() {
if ($this->_embedded) {
- return;
+ return NULL;
}
self::$_template->assign('mode', $this->_mode);
CRM_Core_Smarty::PRINT_SNIPPET,
CRM_Core_Smarty::PRINT_PDF,
CRM_Core_Smarty::PRINT_NOFORM,
- CRM_Core_Smarty::PRINT_JSON
+ CRM_Core_Smarty::PRINT_JSON,
))) {
$content = self::$_template->fetch('CRM/common/snippet.tpl');
}
CRM_Utils_Hook::alterContent($content, 'page', $pageTemplateFile, $this);
echo CRM_Utils_System::theme($content, $this->_print);
- return;
}
/**
/**
* Get the variable from the form scope
*
- * @param string name : name of the variable
- *
+ * @param string $name name of the variable
*
* @return mixed
*/
/**
* Getter for embedded
*
- * @return boolean
+ * @return bool
* return the embedded value
*/
public function getEmbedded() {
/**
* Getter for print
*
- * @return boolean
+ * @return bool
* return the print value
*/
public function getPrint() {
* @param bool $recur
* @param bool $first
*/
- function single(
+ public function single(
&$input, &$ids, &$objects,
$recur = FALSE,
$first = FALSE
* - fresh boolean ignore cache entries and go back to DB
* @param string $context : Context string
*
- * @return Array|bool
+ * @return array|bool
* array on success, FALSE on error.
*
*/
}
// Core field: load schema
- $dao = new $daoName;
+ $dao = new $daoName();
$fieldSpec = $dao->getFieldSpec($fieldName);
$dao->free();
// If neither worked then this field doesn't exist. Return false.
return FALSE;
}
// Get list of fields for the option table
- $dao = new $daoName;
+ $dao = new $daoName();
$availableFields = array_keys($dao->fieldKeys());
$dao->free();
* @param string $fieldName
* @param string|Int $value
*
- * @return bool|null|string|number
+ * @return bool|null|string|int
* FALSE if the given field has no associated option list
* NULL if the given key has no corresponding option
* String|Number if key is found
return $var;
}
- $object = new $name ();
+ $object = new $name();
$object->selectAdd();
$object->selectAdd("$key, $retrieve");
$defaultGreetings = array();
$contactTypes = self::get('CRM_Contact_DAO_Contact', 'contact_type', array(
'keyColumn' => 'id',
- 'labelColumn' => 'name'
+ 'labelColumn' => 'name',
));
foreach ($contactTypes as $filter => $contactType) {
<?php
/*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
- +--------------------------------------------------------------------+
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.6 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
*/
/**
if (self::$_singleton === NULL) {
$sys = CRM_Extension_System::singleton();
$cache = new CRM_Utils_Cache_SqlGroup(array(
- 'group' => 'js-strings',
- 'prefetch' => FALSE,
- ));
+ 'group' => 'js-strings',
+ 'prefetch' => FALSE,
+ ));
self::$_singleton = new CRM_Core_Resources(
$sys->getMapper(),
$cache,
*/
public function addScriptUrl($url, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
CRM_Core_Region::instance($region)->add(array(
- 'name' => $url,
- 'type' => 'scriptUrl',
- 'scriptUrl' => $url,
- 'weight' => $weight,
- 'region' => $region,
- ));
+ 'name' => $url,
+ 'type' => 'scriptUrl',
+ 'scriptUrl' => $url,
+ 'weight' => $weight,
+ 'region' => $region,
+ ));
return $this;
}
*/
public function addScript($code, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
CRM_Core_Region::instance($region)->add(array(
- // 'name' => automatic
- 'type' => 'script',
- 'script' => $code,
- 'weight' => $weight,
- 'region' => $region,
- ));
+ // 'name' => automatic
+ 'type' => 'script',
+ 'script' => $code,
+ 'weight' => $weight,
+ 'region' => $region,
+ ));
return $this;
}
*/
public function addStyleUrl($url, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
CRM_Core_Region::instance($region)->add(array(
- 'name' => $url,
- 'type' => 'styleUrl',
- 'styleUrl' => $url,
- 'weight' => $weight,
- 'region' => $region,
- ));
+ 'name' => $url,
+ 'type' => 'styleUrl',
+ 'styleUrl' => $url,
+ 'weight' => $weight,
+ 'region' => $region,
+ ));
return $this;
}
*/
public function addStyle($code, $weight = self::DEFAULT_WEIGHT, $region = self::DEFAULT_REGION) {
CRM_Core_Region::instance($region)->add(array(
- // 'name' => automatic
- 'type' => 'style',
- 'style' => $code,
- 'weight' => $weight,
- 'region' => $region,
- ));
+ // 'name' => automatic
+ 'type' => 'style',
+ 'style' => $code,
+ 'weight' => $weight,
+ 'region' => $region,
+ ));
return $this;
}
'config' => array(
'ajaxPopupsEnabled' => $this->ajaxPopupsEnabled,
'isFrontend' => $config->userFrameworkFrontend,
- )
+ ),
);
// Disable profile creation if user lacks permission
if (!CRM_Core_Permission::check('edit all contacts') && !CRM_Core_Permission::check('add contacts')) {
}
/**
- * Create dynamic script for localizing js widgets
- *
- * @return string
- * javascript content
+ * Create dynamic script for localizing js widgets.
*/
public static function outputLocalizationJS() {
CRM_Core_Page_AJAX::setJsHeaders();
return in_array(CRM_Utils_Array::value('snippet', $_REQUEST), array(
CRM_Core_Smarty::PRINT_SNIPPET,
CRM_Core_Smarty::PRINT_NOFORM,
- CRM_Core_Smarty::PRINT_JSON
+ CRM_Core_Smarty::PRINT_JSON,
));
}
array('key' => '{"BETWEEN":["now - 3 month","now"]}', 'value' => ts('Past 3 Months')),
array('key' => '{"BETWEEN":["now - 6 month","now"]}', 'value' => ts('Past 6 Months')),
array('key' => '{"BETWEEN":["now - 1 year","now"]}', 'value' => ts('Past Year')),
- )
+ ),
),
);
/**
* Get the action links for this page.
*
- * @param null
- *
* @return array
* array of action links that we need to display for the browse screen
*/
/**
* Browse all custom group fields.
*
- * @param null
- *
* @return void
*/
public function browse() {
* This method is called after the page is created. It checks for the
* type of action and executes that action.
*
- * @param null
- *
* @return void
*/
public function run() {
* @return mixed
* @throws Exception
*/
- function run(
+ public function run(
$fileName,
$seperator = ',',
&$mapper,
* 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
+ * @param $fieldKeys array mapped array of values
*
* @return void
*/
$this->assign('mapKey', $config->mapAPIKey);
$sumLat = $sumLng = 0;
$maxLat = $maxLng = -400;
- $minLat = $minLng = +400;
+ $minLat = $minLng = 400;
foreach ($locations as $location) {
$sumLat += $location['lat'];
$sumLng += $location['lng'];
*
* @return void
*/
- function preProcess() {
-
+ public function preProcess() {
/**
* set the button names
*/
-
$this->_searchButtonName = $this->getButtonName('refresh');
$this->_actionButtonName = $this->getButtonName('next', 'action');
$group[$groupID]['status'] = $contactGroups[$groupID]['status'];
$status = ts('You are already subscribed in %1, your subscription is %2.', array(
1 => $group[$groupID]['title'],
- 2 => $group[$groupID]['status']
+ 2 => $group[$groupID]['status'],
));
CRM_Utils_System::setUFMessage($status);
continue;
* @param $files
* @param $self
*
- * @return boolean
- * True if either we deliver immediately, or the
- * date is properly set.
+ * @return bool
+ * True if either we deliver immediately, or the date is properly
+ * set.
*/
public static function formRule($params, $files, $self) {
if (!empty($params['_qf_Schedule_submit'])) {
'Email',
'IM',
'OpenID',
- 'Phone_Ext'
+ 'Phone_Ext',
) as $block) {
$name = strtolower($block);
if (!array_key_exists($name, $values)) {
*/
private static function getInstance() {
if (is_null(self::$instance)) {
- self::$instance = new self;
+ self::$instance = new self();
}
return self::$instance;
}
'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
'column_name' => 'test_Country_' . $customField->id,
'file_id' => '',
- )
+ ),
);
CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
'column_name' => 'test_File_' . $customField->id,
'file_id' => 1,
- )
+ ),
);
CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
'column_name' => 'test_StateProvince_' . $customField->id,
'file_id' => 1,
- )
+ ),
);
CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
'column_name' => 'test_Date_' . $customField->id,
'file_id' => '',
- )
+ ),
);
CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
'column_name' => 'test_Memo_' . $customField->id,
'file_id' => '',
- )
+ ),
);
CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
'table_name' => 'civicrm_value_test_group_' . $customGroup->id,
'column_name' => 'test_Memo_' . $customField->id,
'file_id' => '',
- )
+ ),
);
CRM_Core_BAO_CustomValueTable::store($params, 'civicrm_contact', $contactID);
$post_move_values[$cid_to_missing]['source'] = $this->_loadDataFromApi($cid_to_missing, $from_group_id);
$post_move_values[$cid_to_missing]['destination'] = $this->_loadDataFromApi($cid_to_missing, $to_group_id);
- //Make sure that only the appropriate values have changed
+ // Make sure that only the appropriate values have changed.
foreach (array(
$cid_all,
$cid_from_missing,
- $cid_to_missing
+ $cid_to_missing,
) as $cid) {
foreach (array(
'source',
- 'destination'
+ 'destination',
) as $fieldset) {
foreach ($pre_move_values[$cid][$fieldset] as $id => $value) {
if ($id != $field_to_move) {
'option_07',
'option_08',
'option_09',
- 'option_10'
+ 'option_10',
),
),
'integer' => array(
//get the custom id of the custom field that was just created
$results = $this->webtest_civicrm_api("CustomField", "get", array(
'label' => $fieldLabel,
- 'custom_group_id' => $group_id
+ 'custom_group_id' => $group_id,
));
//While there _technically_ could be two fields with the same name, its highly unlikely
//so assert that exactly one result is return
* @param string $prefix
* @param array $values
*/
- function _createFieldOptions($count = 3, $prefix = "option", $values = array()) {
+ public function _createFieldOptions($count = 3, $prefix = "option", $values = array()) {
// Only support up to 10 options on the creation form
$count = $count > 10 ? 10 : $count;
$field_ids = array_keys($fields);
$contact = $this->webtest_civicrm_api("Contact", "get", array(
'contact_id' => $contact_id,
- 'return.custom_' . $field_ids[0] => 1
+ 'return.custom_' . $field_ids[0] => 1,
));
$group = $this->webtest_civicrm_api("CustomGroup", "get", array('id' => $group_id, 'return.table_name' => 1));
parent::setUp();
}
- //Test that option to create a cms user is present on a contact who does not
- //have a cms account already( in this case, a new contact )
+ /**
+ * Test that option to create a cms user is present on a contact who
+ * does not have a cms account already (in this case, a new
+ * contact).
+ */
public function testCreateContactLinkPresent() {
//login
$this->assertElementContainsText("css=#actions li.crm-contact-user-record", "Create User Record", "Create User Record link not in action menu of new contact");
}
- //Test that the action link is missing for users who already have a contact
- //record. The contact record for drupal user 1 is used
+ /**
+ * Test that the action link is missing for users who already have a
+ * contact record. The contact record for drupal user 1 is used.
+ */
public function testCreateContactLinkMissing() {
//login
$this->assertElementNotContainsText("css=#actions li.crm-contact-user-record", "Create User Record", "Create User Record link not in action menu of new contact");
}
- //Test the ajax "check username availibity" link when adding cms user
+ /**
+ * Test the ajax "check username availibity" link when adding cms user.
+ */
public function testCheckUsernameAvailability() {
$this->webtestLogin('admin');
$this->assertElementContainsText("msgbox", "This username is currently available", "Available username is indicated as being taken");
}
- //Test form submission when the username is taken
+ /**
+ * Test form submission when the username is taken.
+ */
public function testTakenUsernameSubmission() {
//login
$this->assertTrue($results['count'] == 0);
}
- //Test form sumbission when user passwords dont match
+ /**
+ * Test form sumbission when user passwords dont match.
+ */
public function testMismatchPasswordSubmission() {
//login
$this->assertTrue($results['count'] == 0);
}
- //Test a valid (username unique and passwords match) submission
+ /**
+ * Test a valid (username unique and passwords match) submission.
+ */
public function testValidSubmission() {
//login
array(
'entity' => 'ParticipantEventName',
'subEntity' => 'Fall Fundraiser Dinner',
- 'triggerElement' => array('name' => "event_id", 'type' => "select2")
+ 'triggerElement' => array(
+ 'name' => "event_id",
+ 'type' => "select2",
+ ),
),
array(
'entity' => 'ParticipantRole',
'subEntity' => 'Attendee',
- 'triggerElement' => array('name' => 'role_id', 'type' => "select")
+ 'triggerElement' => array(
+ 'name' => 'role_id',
+ 'type' => "select",
+ ),
),
);
$pageUrl = array('url' => "participant/add", 'args' => "reset=1&action=add&context=standalone");
$this->customFieldSetLoadOnTheFlyCheck($customSets, $pageUrl, TRUE);
}
- /*
+ /**
* Webtest for CRM-10983
*/
public function testCheckDuplicateCustomDataLoad() {
array(
'entity' => 'ParticipantEventType',
'subEntity' => '- Any -',
- 'triggerElement' => array('name' => "event_id", 'type' => "select")
+ 'triggerElement' => array(
+ 'name' => "event_id",
+ 'type' => "select",
+ ),
),
array(
'entity' => 'ParticipantEventName',
'subEntity' => '- Any -',
- 'triggerElement' => array('name' => "event_id", 'type' => "select")
+ 'triggerElement' => array(
+ 'name' => "event_id",
+ 'type' => "select",
+ ),
),
array(
'entity' => 'ParticipantEventName',
'subEntity' => 'Rain-forest Cup Youth Soccer Tournament',
- 'triggerElement' => array('name' => "event_id", 'type' => "select")
+ 'triggerElement' => array(
+ 'name' => "event_id",
+ 'type' => "select",
+ ),
+ ),
+ array(
+ 'entity' => 'ParticipantRole',
+ 'subEntity' => '- Any -',
+ 'triggerElement' => array(
+ 'type' => "checkbox",
+ ),
+ ),
+ array(
+ 'entity' => 'ParticipantRole',
+ 'subEntity' => 'Volunteer',
+ 'triggerElement' => array(
+ 'type' => "checkbox",
+ ),
),
- array('entity' => 'ParticipantRole', 'subEntity' => '- Any -', 'triggerElement' => array('type' => "checkbox")),
- array('entity' => 'ParticipantRole', 'subEntity' => 'Volunteer', 'triggerElement' => array('type' => "checkbox")),
);
$return = $this->addCustomGroupField($customSets);
parent::setUp();
}
- /*
+ /**
* Test contact import for yyyy_mm_dd date format.
*/
public function testDateFormat_yyyy_mm_dd() {
$this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
}
- /*
+ /**
* Test contact import for mm_dd_yy date format.
*/
public function testDateFormat_mm_dd_yy() {
$this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
}
- /*
+ /**
* Test contact import for mm_dd_yyyy date format.
*/
public function testDateFormat_mm_dd_yyyy() {
$this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
}
- /*
+ /**
* Test contact import for Month_dd_yyyy date format.
*/
public function testDateFormat_Month_dd_yyyy() {
$this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
}
- /*
+ /**
* Test contact import for dd_mon_yy date format.
*/
public function testDateFormat_dd_mon_yy() {
$this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
}
- /*
+ /**
* Test contact import for dd_mm_yyyy date format.
*/
public function testDateFormat_dd_mm_yyyy() {
$this->importContacts($headers, $rows, 'Individual', 'Skip', array(), $other);
}
- /*
+ /**
* Helper function to provide data for contact import for Individuals and yyyy-mm-dd OR yyyymmdd dateformat.
*/
/**
return array($headers, $rows);
}
- /*
+ /**
* Helper function to provide data for contact import for Individuals and mm/dd/yy OR mm-dd-yy dateformat.
*/
/**
return array($headers, $rows);
}
- /*
+ /**
* Helper function to provide data for contact import for Individuals and mm/dd/yyyy OR mm-dd-yyyy dateformat.
*/
/**
return array($headers, $rows);
}
- /*
+ /**
* Helper function to provide data for contact import for Individuals and Month dd, yyyy dateformat.
*/
/**
return array($headers, $rows);
}
- /*
+ /**
* Helper function to provide data for contact import for Individuals and dd-mon-yy OR dd/mm/yy dateformat.
*/
/**
return array($headers, $rows);
}
- /*
+ /**
* Helper function to provide data for contact import for Individuals and dd/mm/yyyy dateformat.
*/
/**
<?php
/*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License along with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
- +--------------------------------------------------------------------+
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.6 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License along with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
*/
require_once 'WebTest/Import/ImportCiviSeleniumTestCase.php';
'state' => 'State',
'country' => 'Country',
'contact_relationships' =>
- array(
- '4_a_b' => array(
- 'organization_name' => 'Organization Name',
- 'organization_email' => 'Organization Email',
- 'organization_add' => 'Organization Street Address',
- 'organization_city' => 'Organization City',
- 'organization_state' => 'Organization State',
- 'organization_country' => 'Organization Country',
- ),
- '7_a_b' => array(
- 'household_name' => 'Household Name',
- 'household_email' => 'Household Name',
- 'household_add' => 'Household Street Address',
- 'household_city' => 'Household City',
- 'household_state' => 'Household State',
- 'household_country' => 'Household Country',
- ),
- '2_a_b' => array(
- 'spouse_f_name' => 'Spouse First Name',
- 'spouse_l_name' => 'Spouse Last Name',
- 'spouse_email' => 'Spouse Email',
- 'spouse_add' => 'Spouse Street Address',
- 'spouse_city' => 'Spouse City',
- 'spouse_state' => 'Spouse State',
- 'spouse_country' => 'Spouse Country',
- ),
+ array(
+ '4_a_b' => array(
+ 'organization_name' => 'Organization Name',
+ 'organization_email' => 'Organization Email',
+ 'organization_add' => 'Organization Street Address',
+ 'organization_city' => 'Organization City',
+ 'organization_state' => 'Organization State',
+ 'organization_country' => 'Organization Country',
+ ),
+ '7_a_b' => array(
+ 'household_name' => 'Household Name',
+ 'household_email' => 'Household Name',
+ 'household_add' => 'Household Street Address',
+ 'household_city' => 'Household City',
+ 'household_state' => 'Household State',
+ 'household_country' => 'Household Country',
+ ),
+ '2_a_b' => array(
+ 'spouse_f_name' => 'Spouse First Name',
+ 'spouse_l_name' => 'Spouse Last Name',
+ 'spouse_email' => 'Spouse Email',
+ 'spouse_add' => 'Spouse Street Address',
+ 'spouse_city' => 'Spouse City',
+ 'spouse_state' => 'Spouse State',
+ 'spouse_country' => 'Spouse Country',
),
+ ),
);
$rows = array(
'state' => 'NY',
'country' => 'United States',
'contact_relationships' =>
- array(
- '4_a_b' => array(
- 'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
- 'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
- 'organization_add' => 'Org Street Address',
- 'organization_city' => 'Org City',
- 'organization_state' => 'NY',
- 'organization_country' => 'United States',
- ),
- '7_a_b' => array(
- 'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
- 'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
- 'household_add' => 'House Street Address',
- 'household_city' => 'House City',
- 'household_state' => 'NY',
- 'household_country' => 'United States',
- ),
- '2_a_b' => array(
- 'spouse_f_name' => substr(sha1(rand()), 0, 7),
- 'spouse_l_name' => substr(sha1(rand()), 0, 7),
- 'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
- 'spouse_add' => 'Spouse Street Address',
- 'spouse_city' => 'Spouse City',
- 'spouse_state' => 'NY',
- 'spouse_country' => 'United States',
- ),
+ array(
+ '4_a_b' => array(
+ 'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
+ 'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
+ 'organization_add' => 'Org Street Address',
+ 'organization_city' => 'Org City',
+ 'organization_state' => 'NY',
+ 'organization_country' => 'United States',
),
+ '7_a_b' => array(
+ 'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
+ 'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
+ 'household_add' => 'House Street Address',
+ 'household_city' => 'House City',
+ 'household_state' => 'NY',
+ 'household_country' => 'United States',
+ ),
+ '2_a_b' => array(
+ 'spouse_f_name' => substr(sha1(rand()), 0, 7),
+ 'spouse_l_name' => substr(sha1(rand()), 0, 7),
+ 'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
+ 'spouse_add' => 'Spouse Street Address',
+ 'spouse_city' => 'Spouse City',
+ 'spouse_state' => 'NY',
+ 'spouse_country' => 'United States',
+ ),
+ ),
),
array(
'first_name' => substr(sha1(rand()), 0, 7),
'state' => 'NY',
'country' => 'United States',
'contact_relationships' =>
- array(
- '4_a_b' => array(
- 'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
- 'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
- 'organization_add' => 'Org Street Address',
- 'organization_city' => 'Org City',
- 'organization_state' => 'NY',
- 'organization_country' => 'United States',
- ),
- '7_a_b' => array(
- 'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
- 'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
- 'household_add' => 'House Street Address',
- 'household_city' => 'House City',
- 'household_state' => 'NY',
- 'household_country' => 'United States',
- ),
- '2_a_b' => array(
- 'spouse_f_name' => substr(sha1(rand()), 0, 7),
- 'spouse_l_name' => substr(sha1(rand()), 0, 7),
- 'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
- 'spouse_add' => 'Spouse Street Address',
- 'spouse_city' => 'Spouse City',
- 'spouse_state' => 'NY',
- 'spouse_country' => 'United States',
- ),
+ array(
+ '4_a_b' => array(
+ 'organization_name' => 'Org ' . substr(sha1(rand()), 0, 7),
+ 'organization_email' => substr(sha1(rand()), 0, 7) . 'org@example.org',
+ 'organization_add' => 'Org Street Address',
+ 'organization_city' => 'Org City',
+ 'organization_state' => 'NY',
+ 'organization_country' => 'United States',
),
+ '7_a_b' => array(
+ 'household_name' => 'House ' . substr(sha1(rand()), 0, 7),
+ 'household_email' => substr(sha1(rand()), 0, 7) . 'house@example.org',
+ 'household_add' => 'House Street Address',
+ 'household_city' => 'House City',
+ 'household_state' => 'NY',
+ 'household_country' => 'United States',
+ ),
+ '2_a_b' => array(
+ 'spouse_f_name' => substr(sha1(rand()), 0, 7),
+ 'spouse_l_name' => substr(sha1(rand()), 0, 7),
+ 'spouse_email' => substr(sha1(rand()), 0, 7) . 'spouse@example.org',
+ 'spouse_add' => 'Spouse Street Address',
+ 'spouse_city' => 'Spouse City',
+ 'spouse_state' => 'NY',
+ 'spouse_country' => 'United States',
+ ),
+ ),
),
);
// for Employee of relationship
$this->openCiviPage('admin/uf/group/field/add', array(
'action' => 'add',
'reset' => 1,
- 'gid' => $gid
+ 'gid' => $gid,
), 'field_name[0]');
$this->click('field_name[0]');
$this->select('field_name[0]', 'value=Contact');
$delresult = $this->callAPISuccess('email', 'delete', array('id' => $result['id']));
}
- /*
+ /**
* If a new email is set to is_primary the prev should no longer be
*
* If is_primary is not set then it should become is_primary is no others exist
*/
-
-
public function testCreateEmailPrimaryHandlingChangeToPrimary() {
$params = $this->_params;
unset($params['is_primary']);
'id' => 1,
'child_group_id' => 2,
'parent_group_id' => 1,
- )
+ ),
);
$this->assertEquals($expected, $result['values']);
<?php
/*
- +--------------------------------------------------------------------+
- | CiviCRM version 4.6 |
- +--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-2014 |
- +--------------------------------------------------------------------+
- | This file is a part of CiviCRM. |
- | |
- | CiviCRM is free software; you can copy, modify, and distribute it |
- | under the terms of the GNU Affero General Public License |
- | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
- | |
- | CiviCRM is distributed in the hope that it will be useful, but |
- | WITHOUT ANY WARRANTY; without even the implied warranty of |
- | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
- | See the GNU Affero General Public License for more details. |
- | |
- | You should have received a copy of the GNU Affero General Public |
- | License and the CiviCRM Licensing Exception along |
- | with this program; if not, contact CiviCRM LLC |
- | at info[AT]civicrm[DOT]org. If you have questions about the |
- | GNU Affero General Public License or the licensing of CiviCRM, |
- | see the CiviCRM license FAQ at http://civicrm.org/licensing |
- +--------------------------------------------------------------------+
- */
+ +--------------------------------------------------------------------+
+ | CiviCRM version 4.6 |
+ +--------------------------------------------------------------------+
+ | Copyright CiviCRM LLC (c) 2004-2014 |
+ +--------------------------------------------------------------------+
+ | This file is a part of CiviCRM. |
+ | |
+ | CiviCRM is free software; you can copy, modify, and distribute it |
+ | under the terms of the GNU Affero General Public License |
+ | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
+ | |
+ | CiviCRM is distributed in the hope that it will be useful, but |
+ | WITHOUT ANY WARRANTY; without even the implied warranty of |
+ | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
+ | See the GNU Affero General Public License for more details. |
+ | |
+ | You should have received a copy of the GNU Affero General Public |
+ | License and the CiviCRM Licensing Exception along |
+ | with this program; if not, contact CiviCRM LLC |
+ | at info[AT]civicrm[DOT]org. If you have questions about the |
+ | GNU Affero General Public License or the licensing of CiviCRM, |
+ | see the CiviCRM license FAQ at http://civicrm.org/licensing |
+ +--------------------------------------------------------------------+
+*/
require_once 'CiviTest/CiviUnitTestCase.php';
$this->membershipTypeDelete($params);
}
- ///////////////// civicrm_membership_type_create methods
+ /**
+ * Civicrm_membership_type_create methods.
+ */
public function testCreateWithEmptyParams() {
$membershiptype = $this->callAPIFailure('membership_type', 'create', array());
$this->assertEquals($membershiptype['error_message'],
'Mandatory key(s) missing from params array: domain_id, member_of_contact_id, financial_type_id, duration_unit, duration_interval, name'
- );
+ );
}
public function testCreateWithoutMemberOfContactId() {
);
$membershiptype = $this->callAPIFailure('membership_type', 'create', $params,
- 'Mandatory key(s) missing from params array: member_of_contact_id'
- );
+ 'Mandatory key(s) missing from params array: member_of_contact_id'
+ );
}
public function testCreateWithoutContributionTypeId() {
$membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
$this->assertEquals($membershiptype['error_message'],
'Mandatory key(s) missing from params array: financial_type_id'
- );
+ );
}
public function testCreateWithoutDurationUnit() {
$membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
$this->assertEquals($membershiptype['error_message'],
'Mandatory key(s) missing from params array: duration_unit'
- );
+ );
}
public function testCreateWithoutDurationInterval() {
$membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
$this->assertEquals($membershiptype['error_message'],
'Mandatory key(s) missing from params array: financial_type_id, duration_interval'
- );
+ );
}
public function testCreateWithoutNameandDomainIDandDurationUnit() {
$membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
$this->assertEquals($membershiptype['error_message'],
'Mandatory key(s) missing from params array: domain_id, duration_unit, name'
- );
+ );
}
public function testCreateWithoutName() {
$membershiptype = $this->callAPIFailure('membership_type', 'create', $params);
$this->assertEquals($membershiptype['error_message'],
'Mandatory key(s) missing from params array: domain_id, member_of_contact_id, financial_type_id, duration_unit, duration_interval, name'
- );
+ );
}
public function testUpdateWithoutId() {
'id' => 'doesNotExist',
);
$membershiptype = $this->callAPIFailure('membership_type', 'delete', $params,
- 'Error while deleting membership type. id : ' . $params['id']
- );
+ 'Error while deleting membership type. id : ' . $params['id']
+ );
}
public function testDelete() {
);
}
- /*
- * Good to test option group as a representative on the Camel Case
- */
-
+ /**
+ * Good to test option group as a representative on the Camel Case
+ */
public function testGetOptionGroupGetFields() {
$result = $this->callAPISuccess('option_group', 'getfields', array());
$this->assertFalse(empty($result['values']), 'In line ' . __LINE__);
'value' => 35,
'is_default' => 1,
'is_active' => 1,
- 'format.only_id' => 1
- )
+ 'format.only_id' => 1,
+ ),
);
$result = $this->callAPIAndDocument('OptionGroup', 'create', $params, __FUNCTION__, __FILE__);
$this->assertEquals('civicrm_event.amount.560', $result['values'][0]['name'], 'In line ' . __LINE__);
- $this->assertTrue(is_integer($result['values'][0]['api.OptionValue.create']));
+ $this->assertTrue(is_int($result['values'][0]['api.OptionValue.create']));
$this->assertGreaterThan(0, $result['values'][0]['api.OptionValue.create']);
$this->callAPISuccess('OptionGroup', 'delete', array('id' => $result['id']));
}
- /*
+ /**
* Test the error message when a failure is due to a key duplication issue
*/
-
public function testGetOptionCreateFailOnDuplicate() {
$params = array(
'sequential' => 1,
$this->callAPISuccess('OptionGroup', 'delete', array('id' => $result1['id']));
}
- /*
+ /**
* Test that transaction is completely rolled back on fail.
- * Also check error returned
+ *
+ * Check error returned.
*/
-
public function testGetOptionCreateFailRollback() {
$countFirst = $this->callAPISuccess('OptionGroup', 'getcount', array(
'options' => array('limit' => 5000),
module('group a');
-test( "a basic test example", function() {
+test("a basic test example", function() {
var value = "hello";
- equal( value, "hello", "We expect value to be hello" );
+ equal(value, "hello", "We expect value to be hello");
});
-test( "another basic test example", function() {
+test("another basic test example", function() {
var value = "hello";
- equal( value, "hello", "We expect value to be hello" );
+ equal(value, "hello", "We expect value to be hello");
});