* 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;
* The sql params we use to get the list of contacts
*
* @var string
- * @access protected
*/
protected $_params;
* The public visible fields to be shown to the user
*
* @var array
- * @access protected
*/
protected $_fields;
* The custom fields for this domain
*
* @var array
- * @access protected
*/
protected $_customFields;
* Cache the query object
*
* @var object
- * @access protected
*/
protected $_query;
* Cache the expanded options list if any
*
* @var object
- * @access protected
*/
protected $_options;
/**
* 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 null $gids
*
* @return array
- * @access public
*/
- static function &links($map = FALSE, $editLink = FALSE, $ufLink = FALSE, $gids = NULL) {
+ public static function &links($map = FALSE, $editLink = FALSE, $ufLink = FALSE, $gids = NULL) {
if (!self::$_links) {
self::$_links = array();
*
* @param $action
* @param array $params
- *
- * @access public
*/
- function getPagerParams($action, &$params) {
- $status =
- CRM_Utils_System::isNull($this->_multiRecordTableName) ? ts('Contact %%StatusMessage%%') : ts('Contact Multi Records %%StatusMessage%%');
- $params['status'] = $status;
+ public function getPagerParams($action, &$params) {
+ $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';
* Returns the column headers as an array of tuples:
* (name, sortName (key to the sort array))
*
- * @param string $action the action being performed
- * @param enum $output what should the result set include (web/email/csv)
+ * @param string $action
+ * The action being performed.
+ * @param string $output
+ * What should the result set include (web/email/csv).
*
- * @return array the column headers that need to be displayed
- * @access public
+ * @return array
+ * the column headers that need to be displayed
*/
- function &getColumnHeaders($action = NULL, $output = NULL) {
+ 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`";
}
*
* @param
*
- * @return int Total number of rows
- * @access public
+ * @return int
+ * Total number of rows
*/
- function getTotalCount($action) {
+ public function getTotalCount($action) {
$additionalWhereClause = 'contact_a.is_deleted = 0';
$additionalFromClause = NULL;
$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;
}
* Return the qill for this selector
*
* @return string
- * @access public
*/
- function getQill() {
+ public function getQill() {
return $this->_query->qill();
}
/**
* Returns all the rows in the given offset and rowCount
*
- * @param enum $action the action being performed
- * @param int $offset the row number to start from
- * @param int $rowCount the number of rows to return
- * @param string $sort the sql string that describes the sort order
- * @param enum $output what should the result set include (web/email/csv)
+ * @param string $action
+ * The action being performed.
+ * @param int $offset
+ * The row number to start from.
+ * @param int $rowCount
+ * The number of rows to return.
+ * @param string $sort
+ * The sql string that describes the sort order.
+ * @param string $output
+ * What should the result set include (web/email/csv).
*
- * @return int the total number of rows for this action
+ * @return int
+ * the total number of rows for this action
*/
- function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $extraWhereClause = NULL) {
+ public function &getRows($action, $offset, $rowCount, $sort, $output = NULL, $extraWhereClause = NULL) {
$multipleFields = array('url');
//$sort object processing for location fields
$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}";
}
}
}
-
$multipleSelectFields = array('preferred_communication_method' => 1);
$multiRecordTableId = NULL;
if ($this->_multiRecordTableName) {
$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,
+ $row[] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type,
FALSE,
$result->contact_id,
$showProfileOverlay
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)) {
// pass record id param to view url for multi record view
if ($multiRecordTableId && $newLinks) {
- if ($result->$multiRecordTableId){
+ if ($result->$multiRecordTableId) {
if ($newLinks[CRM_Core_Action::VIEW]['url'] == 'civicrm/profile/view') {
$newLinks[CRM_Core_Action::VIEW]['qs'] .= "&multiRecord=view&recordId=%%recordId%%&allFields=1";
$params['recordId'] = $result->$multiRecordTableId;
/**
* Name of export file.
*
- * @param string $output type of output
+ * @param string $output
+ * Type of output.
*
- * @return string name of the file
+ * @return string
+ * name of the file
*/
- function getExportFileName($output = 'csv') {
+ public function getExportFileName($output = 'csv') {
return ts('CiviCRM Profile Listings');
}
* set the _multiRecordTableName to display the result set
* according to multi record custom field values
*/
- function setMultiRecordTableName($fields) {
- $customGroupId = $multiRecordTableName = NULL;
- $selectorSet = FALSE;
+ public function setMultiRecordTableName($fields) {
+ $customGroupId = $multiRecordTableName = NULL;
+ $selectorSet = FALSE;
foreach ($fields as $field => $properties) {
if (!CRM_Core_BAO_CustomField::getKeyID($field)) {
}
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
}
-