projects
/
civicrm-core.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Merge pull request #6457 from GinkgoFJG/angular_snippets
[civicrm-core.git]
/
CRM
/
Contact
/
BAO
/
Individual.php
diff --git
a/CRM/Contact/BAO/Individual.php
b/CRM/Contact/BAO/Individual.php
index b2750a788ead75e88598d74c8ae60c79ca64fde6..245b59059ed43859366f33c9b1325d7178b6710e 100644
(file)
--- a/
CRM/Contact/BAO/Individual.php
+++ b/
CRM/Contact/BAO/Individual.php
@@
-3,7
+3,7
@@
+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
+--------------------------------------------------------------------+
| CiviCRM version 4.6 |
+--------------------------------------------------------------------+
- | Copyright CiviCRM LLC (c) 2004-201
4
|
+ | Copyright CiviCRM LLC (c) 2004-201
5
|
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
+--------------------------------------------------------------------+
| This file is a part of CiviCRM. |
| |
@@
-23,12
+23,12
@@
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
| GNU Affero General Public License or the licensing of CiviCRM, |
| see the CiviCRM license FAQ at http://civicrm.org/licensing |
+--------------------------------------------------------------------+
-*/
+
*/
/**
*
* @package CRM
/**
*
* @package CRM
- * @copyright CiviCRM LLC (c) 2004-201
4
+ * @copyright CiviCRM LLC (c) 2004-201
5
* $Id$
*
*/
* $Id$
*
*/
@@
-45,11
+45,11
@@
class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
}
/**
}
/**
- * Function is used to format the individual contact values
+ * Function is used to format the individual contact values
.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
*
* @param array $params
* (reference ) an assoc array of name/value pairs.
- * @param
array
$contact
+ * @param
CRM
$contact
* Contact object.
*
* @return CRM_Contact_BAO_Contact
* Contact object.
*
* @return CRM_Contact_BAO_Contact
@@
-254,7
+254,7
@@
class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
}
//now set the names.
}
//now set the names.
- $names = array('
sortName' => 'sort_name', 'displayName' => 'display
_name');
+ $names = array('
displayName' => 'display_name', 'sortName' => 'sort
_name');
foreach ($names as $value => $name) {
if (empty($$value)) {
if ($email) {
foreach ($names as $value => $name) {
if (empty($$value)) {
if ($email) {
@@
-263,6
+263,13
@@
class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
elseif ($uniqId) {
$$value = $uniqId;
}
elseif ($uniqId) {
$$value = $uniqId;
}
+ elseif (!empty($params[$name])) {
+ $$value = $params[$name];
+ }
+ // If we have nothing else going on set sort_name to display_name.
+ elseif ($displayName) {
+ $$value = $displayName;
+ }
}
//finally if we could not pass anything lets keep db.
if (!empty($$value)) {
}
//finally if we could not pass anything lets keep db.
if (!empty($$value)) {
@@
-393,7
+400,7
@@
class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
}
/**
}
/**
- * Creates display name
+ * Creates display name
.
*
* @return string
* the constructed display name
*
* @return string
* the constructed display name
@@
-405,18
+412,18
@@
class CRM_Contact_BAO_Individual extends CRM_Contact_DAO_Contact {
}
/**
}
/**
- * Check if there is data to create the object
+ * Check if there is data to create the object
.
*
* @param array $params
*
* @param array $params
- * (reference ) an assoc array of name/value pairs.
*
* @return bool
*/
*
* @return bool
*/
- public static function dataExists(
&
$params) {
+ public static function dataExists($params) {
if ($params['contact_type'] == 'Individual') {
return TRUE;
}
return FALSE;
}
if ($params['contact_type'] == 'Individual') {
return TRUE;
}
return FALSE;
}
+
}
}