/**
* Class constructor
*/
- function __construct() {
+ public function __construct() {
parent::__construct();
}
/**
* Fetch object based on array of properties
*
- * @param array $params (reference ) an assoc array of name/value pairs
- * @param array $defaults (reference ) an assoc array to hold the flattened values
+ * @param array $params
+ * (reference ) an assoc array of name/value pairs.
+ * @param array $defaults
+ * (reference ) an assoc array to hold the flattened values.
*
- * @return object CRM_Core_DAO_Mapping object on success, otherwise null
- * @access public
+ * @return object CRM_Core_DAO_Mapping object on success, otherwise NULL
* @static
*/
- static function retrieve(&$params, &$defaults) {
+ public static function retrieve(&$params, &$defaults) {
$mapping = new CRM_Core_DAO_Mapping();
$mapping->copyValues($params);
if ($mapping->find(TRUE)) {
/**
* Delete the mapping
*
- * @param int $id mapping id
+ * @param int $id
+ * Mapping id.
*
* @return boolean
- * @access public
* @static
*
*/
- static function del($id) {
+ public static function del($id) {
// delete from mapping_field table
$mappingField = new CRM_Core_DAO_MappingField();
$mappingField->mapping_id = $id;
* contact object. the params array could contain additional unused name/value
* pairs
*
- * @param array $params an array of name/value pairs
+ * @param array $params
+ * An array of name/value pairs.
*
- * @return object CRM_Core_DAO_Mapper object on success, otherwise null
- * @access public
+ * @return object CRM_Core_DAO_Mapper object on success, otherwise NULL
* @static
*/
- static function add($params) {
+ public static function add($params) {
$mapping = new CRM_Core_DAO_Mapping();
$mapping->copyValues($params);
$mapping->save();
/**
* Get the list of mappings
*
- * @param string $mappingTypeId mapping type id
+ * @param string $mappingTypeId
+ * Mapping type id.
*
* @return array $mapping array of mapping name
- * @access public
* @static
*/
- static function getMappings($mappingTypeId) {
+ public static function getMappings($mappingTypeId) {
$mapping = array();
$mappingDAO = new CRM_Core_DAO_Mapping();
$mappingDAO->mapping_type_id = $mappingTypeId;
/**
* Get the mapping fields
*
- * @param int $mappingId mapping id
+ * @param int $mappingId
+ * Mapping id.
*
* @return array $mappingFields array of mapping fields
- * @access public
* @static
*/
- static function getMappingFields($mappingId) {
+ public static function getMappingFields($mappingId) {
//mapping is to be loaded from database
$mapping = new CRM_Core_DAO_MappingField();
$mapping->mapping_id = $mappingId;
/**
* Check Duplicate Mapping Name
*
- * @param $nameField string mapping Name
- * @param $mapTypeId string mapping Type
+ * @param string $nameField
+ * mapping Name.
+ * @param string $mapTypeId
+ * mapping Type.
*
* @return boolean
*/
- static function checkMapping($nameField, $mapTypeId) {
+ public static function checkMapping($nameField, $mapTypeId) {
$mapping = new CRM_Core_DAO_Mapping();
$mapping->name = $nameField;
$mapping->mapping_type_id = $mapTypeId;
/**
* Function returns associated array of elements, that will be passed for search
*
- * @param int $smartGroupId smart group id
+ * @param int $smartGroupId
+ * Smart group id.
*
- * @return array $returnFields associated array of elements@static
- * @public
+ * @return array $returnFields associated array of elements
+ * @static
*/
- static function getFormattedFields($smartGroupId) {
+ public static function getFormattedFields($smartGroupId) {
$returnFields = array();
//get the fields from mapping table
* Build the mapping form
*
* @param CRM_Core_Form $form
- * @param string $mappingType (Export/Import/Search Builder)
+ * @param string $mappingType
+ * (Export/Import/Search Builder).
* @param int $mappingId
* @param int $columnNo
- * @param int $blockCount (no of blocks shown)
- * @param null $exportMode
+ * @param int $blockCount
+ * (no of blocks shown).
+ * @param NULL $exportMode
*
* @return void
- * @access public
* @static
*/
- static function buildMappingForm(&$form, $mappingType = 'Export', $mappingId = NULL, $columnNo, $blockCount = 3, $exportMode = NULL) {
+ public static function buildMappingForm(&$form, $mappingType = 'Export', $mappingId = NULL, $columnNo, $blockCount = 3, $exportMode = NULL) {
if ($mappingType == 'Export') {
$name = "Map";
$columnCount = array('1' => $columnNo);
if (array_key_exists('note', $fields['Contact'])) {
$noteTitle = $fields['Contact']['note']['title'];
$fields['Contact']['note']['title'] = $noteTitle . ': ' . ts('Body and Subject');
- $fields['Contact']['note_body'] = array( 'title' => $noteTitle . ': ' . ts('Body Only'), 'name' => 'note_body' );
- $fields['Contact']['note_subject'] = array( 'title' => $noteTitle . ': ' . ts('Subject Only'), 'name' => 'note_subject' );
+ $fields['Contact']['note_body'] = array('title' => $noteTitle . ': ' . ts('Body Only'), 'name' => 'note_body');
+ $fields['Contact']['note_subject'] = array('title' => $noteTitle . ': ' . ts('Subject Only'), 'name' => 'note_subject');
}
}
// FIX ME: For now let's not expose custom data related to relationship
$relationshipCustomFields = array();
//$relationshipCustomFields = self::getRelationTypeCustomGroupData( $id );
- //asort( $relationshipCustomFields ) ;
+ //asort($relationshipCustomFields);
$relationshipType = new CRM_Contact_BAO_RelationshipType();
$relationshipType->id = $id;
$js .= implode(', ', $elements);
$js .= "]";
$js .= "
- for(var i=0;i<nullArray.length;i++) {
+ for (var i=0;i<nullArray.length;i++) {
if ( {$formName}['mapper['+nullArray[i][0]+']['+nullArray[i][1]+']['+nullArray[i][2]+']'] ) {
{$formName}['mapper['+nullArray[i][0]+']['+nullArray[i][1]+']['+nullArray[i][2]+']'].style.display = '';
}
$js .= implode(', ', $elements);
$js .= "]";
$js .= "
- for(var i=0;i<noneArray.length;i++) {
+ for (var i=0;i<noneArray.length;i++) {
if ( {$formName}['mapper['+noneArray[i][0]+']['+noneArray[i][1]+']['+noneArray[i][2]+']'] ) {
{$formName}['mapper['+noneArray[i][0]+']['+noneArray[i][1]+']['+noneArray[i][2]+']'].style.display = 'none';
}
* Function returns all custom fields with group title and
* field label
*
- * @param int $relationshipTypeId related relationship type id
+ * @param int $relationshipTypeId
+ * Related relationship type id.
*
* @return array all custom field titles
*/
- function getRelationTypeCustomGroupData($relationshipTypeId) {
+ public function getRelationTypeCustomGroupData($relationshipTypeId) {
$customFields = CRM_Core_BAO_CustomField::getFields('Relationship', NULL, NULL, $relationshipTypeId, NULL, NULL);
$groupTitle = array();
/**
* Function returns all Custom group Names
*
- * @param int $customfieldId related file id
+ * @param int $customfieldId
+ * Related file id.
*
- * @return null|string $customGroupName all custom group names@static
+ * @return null|string $customGroupName all custom group names
+ * @static
*/
- static function getCustomGroupName($customfieldId) {
+ public static function getCustomGroupName($customfieldId) {
if ($customFieldId = CRM_Core_BAO_CustomField::getKeyID($customfieldId)) {
$customGroupId = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomField', $customFieldId, 'custom_group_id');
$customGroupName = CRM_Core_DAO::getFieldValue('CRM_Core_DAO_CustomGroup', $customGroupId, 'title');
/**
* Function returns associated array of elements, that will be passed for search
*
- * @param array $params associated array of submitted values
- * @param bool $row row no of the fields
+ * @param array $params
+ * Associated array of submitted values.
+ * @param bool $row
+ * Row no of the fields.
*
*
- * @return array $returnFields formatted associated array of elements@static
- * @public
+ * @return array $returnFields formatted associated array of elements
+ * @static
*/
- static function formattedFields(&$params, $row = FALSE) {
+ public static function formattedFields(&$params, $row = FALSE) {
$fields = array();
if (empty($params) || !isset($params['mapper'])) {
'Multi-Select',
'AdvMulti-Select',
'Multi-Select State/Province',
- 'Multi-Select Country'
+ 'Multi-Select Country',
);
// override the operator to handle separator ( note: this might have some performance issues )
}
// CRM-14983: verify if values are comma separated convert to array
- if (!is_array($value) && (strpos($value,',') !== false || strstr($value, '(')) && empty($isCustomField) && $params['operator'][$key][$k] == 'IN') {
+ if (!is_array($value) && (strpos($value,',') !== FALSE || strstr($value, '(')) && empty($isCustomField) && $params['operator'][$key][$k] == 'IN') {
preg_match('#\((.*?)\)#', $value, $match);
$tmpArray = explode(',', $match[1]);
$value = array_combine(array_values($tmpArray),array_values($tmpArray));
*
* @return array
*/
- static function &returnProperties(&$params) {
+ public static function &returnProperties(&$params) {
$fields = array(
'contact_type' => 1,
'contact_sub_type' => 1,
/**
* Save the mapping field info for search builder / export given the formvalues
*
- * @param array $params asscociated array of formvalues
- * @param int $mappingId mapping id
+ * @param array $params
+ * Asscociated array of formvalues.
+ * @param int $mappingId
+ * Mapping id.
*
- * @return null
+ * @return NULL
* @static
- * @access public
*/
- static function saveMappingFields(&$params, $mappingId) {
+ public static function saveMappingFields(&$params, $mappingId) {
//delete mapping fields records for exixting mapping
$mappingFields = new CRM_Core_DAO_MappingField();
$mappingFields->mapping_id = $mappingId;
}
}
}
-