// FIXME: consider creating a common structure with cidRefs() and eidRefs()
// FIXME: the sub-pages references by the URLs should
// be loaded dynamically on the merge form instead
+ /**
+ * @return array
+ */
static function relTables() {
static $relTables;
return $sqls;
}
+ /**
+ * @param $mainId
+ * @param $otherId
+ * @param $tableName
+ * @param array $tableOperations
+ * @param string $mode
+ *
+ * @return array
+ */
static function operationSql($mainId, $otherId, $tableName, $tableOperations = array(), $mode = 'add') {
$sqls = array();
if (!$tableName || !$mainId || !$otherId) {
foreach ($cidRefs[$table] as $field) {
// carry related contributions CRM-5359
if (in_array($table, $paymentTables)) {
- $payOprSqls = self::operationSql($mainId, $otherId, $table, $tableOperations, 'payment');
- $sqls = array_merge($sqls, $payOprSqls);
-
$paymentSqls = self::paymentSql($table, $mainId, $otherId);
$sqls = array_merge($sqls, $paymentSqls);
+
+ if (!empty($tables) && !in_array('civicrm_contribution', $tables)) {
+ $payOprSqls = self::operationSql($mainId, $otherId, $table, $tableOperations, 'payment');
+ $sqls = array_merge($sqls, $payOprSqls);
+ }
}
$preOperationSqls = self::operationSql($mainId, $otherId, $table, $tableOperations);
CRM_Core_DAO::freeResult();
}
+ // get all contact subtypes
+ $contactSubTypes = CRM_Contact_BAO_ContactType::subTypePairs(NULL, TRUE, '');
+
// FIXME: there must be a better way
foreach (array('main', 'other') as $moniker) {
$contact = &$$moniker;
$value = empty($preferred_communication_method) ? array() : $preferred_communication_method;
$specialValues[$moniker] = array(
'preferred_communication_method' => $value,
+ 'contact_sub_type' => $value,
+ 'communication_style_id' => $value,
);
if (!empty($contact['preferred_communication_method'])){
),
);
CRM_Core_OptionGroup::lookupValues($specialValues[$moniker], $names);
+
+ if (!empty($contact['contact_sub_type'])) {
+ $specialValues[$moniker]['contact_sub_type'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, $contact['contact_sub_type']);
+
+ // fix contact sub type label for contact with sub type
+ $subtypes = array();
+ foreach ($contact['contact_sub_type'] as $key => $value) {
+ $subtypes[] = CRM_Utils_Array::retrieveValueRecursive($contactSubTypes, $value);
+ }
+ $contact['contact_sub_type_display'] = $specialValues[$moniker]['contact_sub_type_display'] = implode(', ', $subtypes);
+ }
+
+ if (!empty($contact['communication_style'])) {
+ $specialValues[$moniker]['communication_style_id_display'] = $contact['communication_style'];
+ }
}
static $optionValueFields = array();
foreach ($submitted as $key => $value) {
if (substr($key, 0, 7) == 'custom_') {
$fid = (int) substr($key, 7);
+ if (empty($cFields[$fid])) {
+ continue;
+ }
$htmlType = $cFields[$fid]['attributes']['html_type'];
switch ($htmlType) {
case 'File':
}
}
}
-