);
//set respective mapper params to array.
- foreach (array_keys($mapperParams) as $mapperParam)$$mapperParam = array();
+ foreach (array_keys($mapperParams) as $mapperParam) { $$mapperParam = array();
+ }
for ($i = 0; $i < $this->_columnCount; $i++) {
//set respective mapper value to null
- foreach (array_values($mapperParams) as $mapperParam)$$mapperParam = NULL;
+ foreach (array_values($mapperParams) as $mapperParam) { $$mapperParam = NULL;
+ }
$fldName = CRM_Utils_Array::value(0, $mapperKeys[$i]);
$selOne = CRM_Utils_Array::value(1, $mapperKeys[$i]);
for ($i = 0; $i < $this->_columnCount; $i++) {
$updateMappingFields = new CRM_Core_DAO_MappingField();
- $updateMappingFields->id = CRM_Utils_Array::value($i,$mappingFieldsId);
+ $updateMappingFields->id = CRM_Utils_Array::value($i, $mappingFieldsId);
$updateMappingFields->mapping_id = $params['mappingId'];
$updateMappingFields->column_number = $i;
'mapperRelatedContactImProvider',
'mapperRelatedContactWebsiteType',
);
- foreach ($properties as $property) $this->{"_$property"} = array();
+ foreach ($properties as $property) { $this->{"_$property"} = array();
+ }
}
/**
foreach ($mapper as $key => $value) {
//set respective mapper value to null.
- foreach (array_values($mapperPeroperties) as $perpertyVal)$$perpertyVal = NULL;
+ foreach (array_values($mapperPeroperties) as $perpertyVal) { $$perpertyVal = NULL;
+ }
$fldName = CRM_Utils_Array::value(0, $mapper[$key]);
$header = array($this->_mapFields[$fldName]);
$estimatedTime = $estimatedTime - ($estMinutes * 60);
}
$timeFormatted .= round($estimatedTime) . ' ' . ts('seconds');
- $processedPercent = (int )(($this->_rowCount * 100) / $totalRowCount);
+ $processedPercent = (int ) (($this->_rowCount * 100) / $totalRowCount);
$statusMsg = ts('%1 of %2 records - %3 remaining',
array(1 => $this->_rowCount, 2 => $totalRowCount, 3 => $timeFormatted)
);
</div>
";
- $contents = json_encode (array($processedPercent, $status));
+ $contents = json_encode(array($processedPercent, $status));
file_put_contents($statusFile, $contents);
} */
}
-
if ($mode == self::MODE_PREVIEW || $mode == self::MODE_IMPORT) {
$customHeaders = $mapper;
else {
while ($dao->fetch()) {
if ($json) {
- $elements[] = array('name' => addslashes($dao->sort_name),
+ $elements[] = array(
+ 'name' => addslashes($dao->sort_name),
'id' => $dao->id,
);
}
// make sure recordClass is namespaced (we cant check CRM since extensions can also use this)
// but it should be at least 3 levels deep
if (count($recordClass) >= 3) {
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $recordBAO) . ".php");
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $recordBAO) . ".php";
$method = 'setIsActive';
if (method_exists($recordBAO, $method)) {
}
/**
- * check the CMS username
- *
- */
+ * check the CMS username
+ *
+ */
static public function checkUserName() {
$signer = new CRM_Utils_Signer(CRM_Core_Key::privateKey(), array('for', 'ts'));
if (
CRM_Utils_Array::value('cid', $_GET)
);
-
$dao = CRM_Core_DAO::executeQuery($query);
while ($dao->fetch()) {
- //working here
+ //working here
$result[] = array(
'text' => '"' . $dao->name . '" <' . $dao->email . '>',
'id' => (CRM_Utils_Array::value('id', $_GET)) ? "{$dao->id}::{$dao->email}" : '"' . $dao->name . '" <' . $dao->email . '>',
$searchRows = array();
$selectorElements = array('src', 'dst', 'weight', 'actions');
-
$join = "LEFT JOIN civicrm_dedupe_exception de ON ( pn.entity_id1 = de.contact_id1 AND
pn.entity_id2 = de.contact_id2 )";
$where = "de.id IS NULL";
$key = "{$exception->contact_id1}_{$exception->contact_id2}";
$contactIds[$exception->contact_id1] = $exception->contact_id1;
$contactIds[$exception->contact_id2] = $exception->contact_id2;
- $dedupeExceptions[$key] = array('main' => array('id' => $exception->contact_id1),
+ $dedupeExceptions[$key] = array(
+ 'main' => array('id' => $exception->contact_id1),
'other' => array('id' => $exception->contact_id2),
);
}
*
* @return array (reference) of action links
*/
- public function &links() {}
+ public function &links() {
+ }
/**
* Browse all rule groups
$entityBlock = array('id' => $addressId);
$address = CRM_Core_BAO_Address::getValues($entityBlock, FALSE, 'id');
if (!empty($address)) {
- foreach ($address as $key =>& $value) {
+ foreach ($address as $key => & $value) {
$value['location_type'] = $locationTypes[$value['location_type_id']];
}
}
}
$contact = new CRM_Contact_BAO_Contact( );
$contact->id = $contactId;
- $contact->find(true);
- $privacy = array( );
+ $contact->find(TRUE);
+ $privacy = array();
foreach ( CRM_Contact_BAO_Contact::$_commPrefs as $name ) {
if ( isset( $contact->$name ) ) {
$privacy[$name] = $contact->$name;
$contact = new CRM_Contact_BAO_Contact( );
$contact->id = $contactId;
- $contact->find(true);
- $privacy = array( );
+ $contact->find(TRUE);
+ $privacy = array();
foreach ( CRM_Contact_BAO_Contact::$_commPrefs as $name ) {
if ( isset( $contact->$name ) ) {
$privacy[$name] = $contact->$name;
$contact = new CRM_Contact_BAO_Contact( );
$contact->id = $contactId;
- $contact->find(true);
- $privacy = array( );
+ $contact->find(TRUE);
+ $privacy = array();
foreach ( CRM_Contact_BAO_Contact::$_commPrefs as $name ) {
if ( isset( $contact->$name ) ) {
$privacy[$name] = $contact->$name;
$this->assign($navContacts);
$path = CRM_Utils_System::url('civicrm/contact/view', 'reset=1&cid=' . $this->_contactId);
- CRM_Utils_System::appendBreadCrumb(array(array('title' => ts('View Contact'), 'url' => $path,)));
+ CRM_Utils_System::appendBreadCrumb(array(array('title' => ts('View Contact'), 'url' => $path)));
if ($image_URL = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $this->_contactId, 'image_URL')) {
//CRM-7265 --time being fix.
* @param int $cid
*/
public static function addUrls(&$obj, $cid) {
- $uid = CRM_Core_BAO_UFMatch::getUFId($cid);
+ $uid = CRM_Core_BAO_UFMatch::getUFId($cid);
if ($uid) {
$userRecordUrl = CRM_Core_Config::singleton()->userSystem->getUserRecordUrl($cid);
}
$allGroup = CRM_Contact_BAO_GroupContactCache::contactGroup($this->_contactId);
- $this->assign('groupSmart' , NULL);
+ $this->assign('groupSmart', NULL);
$this->assign('groupParent', NULL);
if (!empty($allGroup)) {
- $smart = $parent = array( );
+ $smart = $parent = array();
foreach ($allGroup['group'] as $group) {
// delete all smart groups which are also in static groups
if (isset($staticGroups[$group['id']])) {
"action=view&reset=1&id={$viewRelationship[$this->_id]['id']}&cid={$this->_contactId}&context=home"
);
-
$session = CRM_Core_Session::singleton();
$recentOther = array();
*/
public function getTemplateFileName() {
if ($this->_contactId) {
- $contactSubtypes = $this->get('contactSubtype') ?
- explode(CRM_Core_DAO::VALUE_SEPARATOR, $this->get('contactSubtype')) : array();
+ $contactSubtypes = $this->get('contactSubtype') ? explode(CRM_Core_DAO::VALUE_SEPARATOR, $this->get('contactSubtype')) : array();
// there could be multiple subtypes. We check templates for each of the subtype, and return the first one found.
foreach ($contactSubtypes as $csType) {
),
);
-
if (CRM_Core_Permission::check('access CiviCRM')) {
self::$_links = array_merge(self::$_links, array(
CRM_Core_Action::DISABLE => array(
// allow components to add more actions
CRM_Core_Component::searchAction($row, $result->contact_id);
- $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ?
- $result->contact_sub_type : $result->contact_type,
+ $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($result->contact_sub_type ? $result->contact_sub_type : $result->contact_type,
FALSE,
$result->contact_id
);
$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)) {
$links = self::links($this->_context, $this->_contextMenu, $this->_key);
-
foreach ($rows as $id => & $row) {
if (!empty($this->_formValues['deleted_contacts']) && CRM_Core_Permission::check('access deleted contacts')
) {
}
$row['action'] = CRM_Core_Action::formLink(
$links,
- null,
+ NULL,
array('id' => $row['contact_id']),
ts('more'),
FALSE,
* language
*
* @param array(
- reference) $formValues submitted formValues
+ reference) $formValues submitted formValues
*
* @return array $qill which contains an array of strings
*/
*/
function __construct(
$customSearchClass,
- $formValues = NULL,
- $params = NULL,
- $returnProperties = NULL,
- $action = CRM_Core_Action::NONE,
+ $formValues = NULL,
+ $params = NULL,
+ $returnProperties = NULL,
+ $action = CRM_Core_Action::NONE,
$includeContactIds = FALSE,
$searchChildGroups = TRUE,
- $searchContext = 'search',
- $contextMenu = NULL
+ $searchContext = 'search',
+ $contextMenu = NULL
) {
$this->_customSearchClass = $customSearchClass;
$this->_formValues = $formValues;
if (!$ext->isExtensionKey($customSearchClass)) {
if ($ext->isExtensionClass($customSearchClass)) {
$customSearchFile = $ext->classToPath($customSearchClass);
- require_once ($customSearchFile);
+ require_once $customSearchFile;
}
else {
- require_once (str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php');
+ require_once str_replace('_', DIRECTORY_SEPARATOR, $customSearchClass) . '.php';
}
$this->_search = new $customSearchClass( $formValues );
}
}
if ($image) {
- $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($dao->contact_sub_type ?
- $dao->contact_sub_type : $dao->contact_type, FALSE, $contactID
+ $row['contact_type'] = CRM_Contact_BAO_Contact_Utils::getImage($dao->contact_sub_type ? $dao->contact_sub_type : $dao->contact_type, FALSE, $contactID
);
}
$rows[] = $row;
* language
*
* @param array(
- reference) $formValues submitted formValues
+ reference) $formValues submitted formValues
*
* @return array $qill which contains an array of strings
*/