* Array of supported links, currenly view and edit
*
* @var array
- * @static
*/
static $_links = NULL;
* We use desc to remind us what that column is, name is used in the tpl
*
* @var array
- * @static
*/
static $_columnHeaders;
/**
* 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
- @access public
*/
- function __construct(
+ public function __construct(
&$params,
&$customFields,
$ufGroupIds = NULL,
$this->_gid = $ufGroupIds;
}
- $this->_map = $map;
+ $this->_map = $map;
$this->_editLink = $editLink;
$this->_linkToUF = $linkToUF;
$returnProperties['contact_sub_type'] = 1;
$returnProperties['sort_name'] = 1;
- $queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_params, 1);
- $this->_query = new CRM_Contact_BAO_Query($queryParams, $returnProperties, $this->_fields);
+ $queryParams = CRM_Contact_BAO_Query::convertFormValues($this->_params, 1);
+ $this->_query = new CRM_Contact_BAO_Query($queryParams, $returnProperties, $this->_fields);
//the below is done for query building for multirecord custom field listing
//to show all the custom field multi valued records of a particular contact
* @param array $params
*/
public function getPagerParams($action, &$params) {
- $status =
- CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%');
- $params['status'] = $status;
+ $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;
+ $params['rowCount'] = CRM_Utils_Pager::ROWCOUNT;
$params['buttonTop'] = 'PagerTopButton';
$params['buttonBottom'] = 'PagerBottomButton';
*
* @param string $action
* The action being performed.
- * @param enum $output
+ * @param string $output
* What should the result set include (web/email/csv).
*
* @return array
public function &getColumnHeaders($action = NULL, $output = NULL) {
static $skipFields = array('group', 'tag');
$multipleFields = array('url');
- $direction = CRM_Utils_Sort::ASCENDING;
- $empty = TRUE;
+ $direction = CRM_Utils_Sort::ASCENDING;
+ $empty = TRUE;
if (!isset(self::$_columnHeaders)) {
- self::$_columnHeaders = array(array('name' => ''),
+ self::$_columnHeaders = array(
+ array('name' => ''),
array(
'name' => ts('Name'),
'sort' => 'sort_name',
) {
if (strpos($name, '-') !== FALSE) {
- $value = explode('-', $name);
+ $value = explode('-', $name);
$fieldName = CRM_Utils_Array::value(0, $value);
- $lType = CRM_Utils_Array::value(1, $value);
- $type = CRM_Utils_Array::value(2, $value);
+ $lType = CRM_Utils_Array::value(1, $value);
+ $type = CRM_Utils_Array::value(2, $value);
if (!in_array($fieldName, $multipleFields)) {
if ($lType == 'Primary') {
}
if (in_array($fieldName, array(
- 'phone', 'im', 'email'))) {
+ 'phone',
+ 'im',
+ 'email',
+ ))) {
if ($type) {
$name = "`$locationTypeName-$fieldName-$type`";
}
$returnQuery = NULL;
if ($this->_multiRecordTableName &&
- !array_key_exists($this->_multiRecordTableName, $this->_query->_whereTables)) {
+ !array_key_exists($this->_multiRecordTableName, $this->_query->_whereTables)
+ ) {
$additionalFromClause = CRM_Utils_Array::value($this->_multiRecordTableName, $this->_query->_tables);
$returnQuery = TRUE;
}
/**
* Returns all the rows in the given offset and rowCount
*
- * @param enum $action
+ * @param string $action
* The action being performed.
* @param int $offset
* The row number to start from.
* The number of rows to return.
* @param string $sort
* The sql string that describes the sort order.
- * @param enum $output
+ * @param string $output
* What should the result set include (web/email/csv).
*
* @return int
$vars = $sort->_vars;
$varArray = array();
foreach ($vars as $key => $field) {
- $field = $vars[$key];
+ $field = $vars[$key];
$fieldArray = explode('-', $field['name']);
- $fieldType = CRM_Utils_Array::value('2', $fieldArray);
+ $fieldType = CRM_Utils_Array::value('2', $fieldArray);
if (is_numeric(CRM_Utils_Array::value('1', $fieldArray))) {
if (!in_array($fieldType, $multipleFields)) {
$locationType = new CRM_Core_DAO_LocationType();
if ($returnQuery) {
$resQuery = preg_replace('/GROUP BY contact_a.id[\s]+ORDER BY/', ' ORDER BY', $result);
- $result = CRM_Core_DAO::executeQuery($resQuery);
+ $result = CRM_Core_DAO::executeQuery($resQuery);
}
// process the result of the query
!in_array($key, $skipFields)
) {
if (strpos($key, '-') !== FALSE) {
- $value = explode('-', $key);
+ $value = explode('-', $key);
$fieldName = CRM_Utils_Array::value(0, $value);
- $id = CRM_Utils_Array::value(1, $value);
- $type = CRM_Utils_Array::value(2, $value);
+ $id = CRM_Utils_Array::value(1, $value);
+ $type = CRM_Utils_Array::value(2, $value);
if (!in_array($fieldName, $multipleFields)) {
$locationTypeName = NULL;
}
$locationTypeName = str_replace(' ', '_', $locationTypeName);
if (in_array($fieldName, array(
- 'phone', 'im', 'email'))) {
+ 'phone',
+ 'im',
+ 'email',
+ ))) {
if ($type) {
$names[] = "{$locationTypeName}-{$fieldName}-{$type}";
}
$i18n = CRM_Core_I18n::singleton();
$result->country = $i18n->translate($result->country);
}
- $row = array();
+ $row = array();
$empty = TRUE;
$row[] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type,
FALSE,
elseif (substr($name, -4) == '-url' &&
!empty($result->$name)
) {
- $url = CRM_Utils_System::fixURL($result->$name);
- $typeId = substr($name, 0, -4) . "-website_type_id";
+ $url = CRM_Utils_System::fixURL($result->$name);
+ $typeId = substr($name, 0, -4) . "-website_type_id";
$typeName = CRM_Core_PseudoConstant::getLabel('CRM_Core_DAO_Website', 'website_type_id', $result->$typeId);
if ($typeName) {
$row[] = "<a href=\"$url\">{$result->$name} (${typeName})</a>";
}
elseif (strpos($name, '-im')) {
if (!empty($result->$name)) {
- $providerId = $name . "-provider_id";
+ $providerId = $name . "-provider_id";
$providerName = CRM_Core_PseudoConstant::getLabel('CRM_Core_DAO_IM', 'provider_id', $result->$providerId);
- $row[] = $result->$name . " ({$providerName})";
+ $row[] = $result->$name . " ({$providerName})";
}
else {
$row[] = '';
}
}
elseif (in_array($name, array(
- 'addressee', 'email_greeting', 'postal_greeting'))) {
+ 'addressee',
+ 'email_greeting',
+ 'postal_greeting',
+ ))) {
$dname = $name . '_display';
$row[] = $result->$dname;
}
elseif (in_array($name, array(
- 'birth_date', 'deceased_date'))) {
+ 'birth_date',
+ 'deceased_date',
+ ))) {
$row[] = CRM_Utils_Date::customFormat($result->$name);
}
elseif (isset($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
}