| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+ */
/**
*
* This defines two actions- 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;
/**
* Properties of contact we're interested in displaying
* @var array
- * @static
*/
static $_properties = array(
- 'contact_id', 'contact_type', 'contact_sub_type',
- 'sort_name', 'street_address',
- 'city', 'state_province', 'postal_code', 'country',
- 'geo_code_1', 'geo_code_2', 'is_deceased',
- 'email', 'on_hold', 'phone', 'status',
- 'do_not_email', 'do_not_phone', 'do_not_mail',
+ 'contact_id',
+ 'contact_type',
+ 'contact_sub_type',
+ 'sort_name',
+ 'street_address',
+ 'city',
+ 'state_province',
+ 'postal_code',
+ 'country',
+ 'geo_code_1',
+ 'geo_code_2',
+ 'is_deceased',
+ 'email',
+ 'on_hold',
+ 'phone',
+ 'status',
+ 'do_not_email',
+ 'do_not_phone',
+ 'do_not_mail',
);
/**
protected $_fields;
/**
- * Class constructor
+ * Class constructor.
*
* @param $customSearchClass
* @param array $formValues
*
* @return CRM_Contact_Selector
*/
- function __construct(
+ public function __construct(
$customSearchClass,
$formValues = NULL,
$params = NULL,
* @param array $params
*/
public function getPagerParams($action, &$params) {
- $params['status'] = ts('Contact %%StatusMessage%%');
+ $params['status'] = ts('Contact %%StatusMessage%%');
$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
$direction = CRM_Utils_Sort::ASCENDING;
$empty = TRUE;
if (!self::$_columnHeaders) {
- self::$_columnHeaders = array(array('name' => ''),
+ self::$_columnHeaders = array(
+ array('name' => ''),
array(
'name' => ts('Name'),
'sort' => 'sort_name',
}
if (in_array($fieldName, array(
- 'phone', 'im', 'email'))) {
+ 'phone',
+ 'im',
+ 'email',
+ ))) {
if ($type) {
$name = "`$locationTypeName-$fieldName-$type`";
}
$headers = self::$_columnHeaders;
}
elseif (!empty($this->_returnProperties)) {
- self::$_columnHeaders = array(array('name' => ''),
+ self::$_columnHeaders = array(
+ array('name' => ''),
array(
'name' => ts('Name'),
'sort' => 'sort_name',
}
/**
- * Returns all the rows in the given offset and rowCount
+ * 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
$locationTypeName = str_replace(' ', '_', $locationTypeName);
if (in_array($fieldName, array(
- 'phone', 'im', 'email'))) {
+ 'phone',
+ 'im',
+ 'email',
+ ))) {
if ($type) {
$names[] = "{$locationTypeName}-{$fieldName}-{$type}";
}
elseif (strpos($property, '-im')) {
$row[$property] = $result->$property;
if (!empty($result->$property)) {
- $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
- $providerId = $property . "-provider_id";
- $providerName = $imProviders[$result->$providerId];
+ $imProviders = CRM_Core_PseudoConstant::get('CRM_Core_DAO_IM', 'provider_id');
+ $providerId = $property . "-provider_id";
+ $providerName = $imProviders[$result->$providerId];
$row[$property] = $result->$property . " ({$providerName})";
}
}
elseif (in_array($property, array(
- 'addressee', 'email_greeting', 'postal_greeting'))) {
+ 'addressee',
+ 'email_greeting',
+ 'postal_greeting',
+ ))) {
$greeting = $property . '_display';
$row[$property] = $result->$greeting;
}
$websiteFld = $websiteKey . '-' . array_pop($propertyArray);
if (!empty($result->$websiteFld)) {
$websiteTypes = CRM_Core_PseudoConstant::get('CRM_Core_DAO_Website', 'website_type_id');
- $websiteType = $websiteTypes[$result->{"$websiteKey-website_type_id"}];
+ $websiteType = $websiteTypes[$result->{"$websiteKey-website_type_id"}];
$websiteValue = $result->$websiteFld;
- $websiteUrl = "<a href=\"{$websiteValue}\">{$websiteValue} ({$websiteType})</a>";
+ $websiteUrl = "<a href=\"{$websiteValue}\">{$websiteValue} ({$websiteType})</a>";
}
$row[$property] = $websiteUrl;
}
);
$row['contact_type_orig'] = $result->contact_sub_type ? $result->contact_sub_type : $result->contact_type;
- $row['contact_sub_type'] = $result->contact_sub_type ? CRM_Contact_BAO_ContactType::contactTypePairs(FALSE, $result->contact_sub_type, ', ') : $result->contact_sub_type;
+ $row['contact_sub_type'] = $result->contact_sub_type ? CRM_Contact_BAO_ContactType::contactTypePairs(FALSE, $result->contact_sub_type, ', ') : $result->contact_sub_type;
$row['contact_id'] = $result->contact_id;
$row['sort_name'] = $result->sort_name;
if (array_key_exists('id', $row)) {
}
/**
- * Given the current formValues, gets the query in local
- * language
- *
- * @param array(
- reference) $formValues submitted formValues
- *
- * @return array
- * which contains an array of strings
+ * @inheritDoc
*/
-
- // the current internationalisation is bad, but should more or less work
- // for most of "European" languages
public function getQILL() {
return $this->_query->qill();
}
}
/**
- * Get colunmn headers for search selector
- *
+ * Get colunmn headers for search selector.
*
* @return array
*/
}
return $properties;
}
+
}