Skip to content

Commit

Permalink
Resolve conflicts
Browse files Browse the repository at this point in the history
  • Loading branch information
joapta committed Nov 10, 2021
2 parents 5ebb299 + b7dad67 commit a4edaaf
Show file tree
Hide file tree
Showing 19 changed files with 4,038 additions and 3,814 deletions.
2 changes: 1 addition & 1 deletion CRM/Campaign/Selector/Search.php
Original file line number Diff line number Diff line change
Expand Up @@ -267,7 +267,7 @@ public function buildPrevNextCache($sort) {

$selectSQL = "
SELECT %1, contact_a.id, contact_a.display_name
{$sql['from']}
{$sql['from']} {$sql['where']}
";

try {
Expand Down
33 changes: 18 additions & 15 deletions CRM/Contact/Page/View.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public function preProcess() {
// check logged in user permission
self::checkUserPermission($this);

list($displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl) = self::getContactDetails($this->_contactId);
[$displayName, $contactImage, $contactType, $contactSubtype, $contactImageUrl] = self::getContactDetails($this->_contactId);
$this->assign('displayName', $displayName);

$this->set('contactType', $contactType);
Expand Down Expand Up @@ -208,19 +208,7 @@ public function preProcess() {

// Add links for actions menu
self::addUrls($this, $this->_contactId);

if ($contactType == 'Organization' &&
CRM_Core_Permission::check('administer Multiple Organizations') &&
Civi::settings()->get('is_enabled')) {
//check is any relationship between the organization and groups
$groupOrg = CRM_Contact_BAO_GroupOrganization::hasGroupAssociated($this->_contactId);
if ($groupOrg) {
$groupOrganizationUrl = CRM_Utils_System::url('civicrm/group',
"reset=1&oid={$this->_contactId}"
);
$this->assign('groupOrganizationUrl', $groupOrganizationUrl);
}
}
$this->assign('groupOrganizationUrl', $this->getGroupOrganizationUrl($contactType));
}

/**
Expand Down Expand Up @@ -292,7 +280,7 @@ public static function setTitle($contactId, $isDeleted = FALSE) {
static $contactDetails;
$contactImage = NULL;
if (!isset($contactDetails[$contactId])) {
list($displayName, $contactImage) = self::getContactDetails($contactId);
[$displayName, $contactImage] = self::getContactDetails($contactId);
$contactDetails[$contactId] = [
'displayName' => $displayName,
'contactImage' => $contactImage,
Expand Down Expand Up @@ -371,4 +359,19 @@ public static function addUrls(&$obj, $cid) {
}
}

/**
* @param string $contactType
*
* @return string
*/
protected function getGroupOrganizationUrl(string $contactType): string {
if ($contactType !== 'Organization' || !CRM_Core_Permission::check('administer Multiple Organizations')
|| !CRM_Contact_BAO_GroupOrganization::hasGroupAssociated($this->_contactId)
|| !Civi::settings()->get('is_enabled')
) {
return '';
}
return CRM_Utils_System::url('civicrm/group', "reset=1&oid={$this->_contactId}");
}

}
8 changes: 8 additions & 0 deletions CRM/Contact/Page/View/Summary.php
Original file line number Diff line number Diff line change
Expand Up @@ -444,6 +444,14 @@ public function getTabs() {

// now sort the tabs based on weight
usort($allTabs, ['CRM_Utils_Sort', 'cmpFunc']);
$expectedKeys = ['count', 'class', 'template', 'hideCount', 'icon'];
foreach ($allTabs as $index => $tab) {
foreach ($expectedKeys as $key) {
if (!array_key_exists($key, $tab)) {
$allTabs[$index][$key] = NULL;
}
}
}
return $allTabs;
}

Expand Down
1 change: 1 addition & 0 deletions CRM/Core/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -172,6 +172,7 @@ public function __construct(
if (!isset(self::$_template)) {
self::$_template = CRM_Core_Smarty::singleton();
self::$_session = CRM_Core_Session::singleton();
self::$_template->ensureVariablesAreAssigned(['formTpl']);
}

// lets try to get it from the session and/or the request vars
Expand Down
2 changes: 1 addition & 1 deletion CRM/Core/Page.php
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ class CRM_Core_Page {
*
* @var string[]
*/
public $expectedSmartyVariables = ['breadcrumb', 'pageTitle', 'isForm', 'hookContent'];
public $expectedSmartyVariables = ['breadcrumb', 'pageTitle', 'isForm', 'hookContent', 'hookContentPlacement'];

/**
* Class constructor.
Expand Down
2 changes: 1 addition & 1 deletion CRM/Mailing/BAO/Mailing.php
Original file line number Diff line number Diff line change
Expand Up @@ -2061,7 +2061,7 @@ public static function &report($id, $skipDetails = FALSE, $isSMS = FALSE) {
'clicks' => $mailing->clicks,
'unique' => $mailing->unique_clicks,
'rate' => !empty($report['event_totals']['delivered']) ? (100.0 * $mailing->unique_clicks) / $report['event_totals']['delivered'] : 0,
'report' => CRM_Report_Utils_Report::getNextUrl('mailing/clicks', "reset=1&mailing_id_value={$mailing_id}&url_value={$mailing->url}", FALSE, TRUE),
'report' => CRM_Report_Utils_Report::getNextUrl('mailing/clicks', "reset=1&mailing_id_value={$mailing_id}&url_value=" . rawurlencode($mailing->url), FALSE, TRUE),
];
}

Expand Down
6 changes: 2 additions & 4 deletions CRM/Report/Form/Contribute/History.php
Original file line number Diff line number Diff line change
Expand Up @@ -839,12 +839,10 @@ public function alterDisplay(&$rows) {

if (!empty($row['civicrm_financial_trxn_card_type_id'])) {
$rows[$rowNum]['civicrm_financial_trxn_card_type_id'] = $this->getLabels($row['civicrm_financial_trxn_card_type_id'], 'CRM_Financial_DAO_FinancialTrxn', 'card_type_id');
$entryFound = TRUE;
}

$entryFound = $this->alterDisplayContactFields($row, $rows, $rowNum, NULL, NULL) ? TRUE : $entryFound;
$entryFound = $this->alterDisplayAddressFields($row, $rows, $rowNum, NULL, NULL) ? TRUE : $entryFound;

$this->alterDisplayContactFields($row, $rows, $rowNum, NULL, NULL);
$this->alterDisplayAddressFields($row, $rows, $rowNum, NULL, NULL);
}
}

Expand Down
7 changes: 7 additions & 0 deletions CRM/Upgrade/Incremental/sql/5.45.alpha1.mysql.tpl
Original file line number Diff line number Diff line change
@@ -1,4 +1,11 @@
{* file to handle db changes in 5.45.alpha1 during upgrade *}
-- Add in missing province for Philippines and update names as per ISO.
SELECT @PHILIPPINESID := id FROM civicrm_country WHERE name = 'Philippines' AND iso_code='PH';
INSERT IGNORE INTO civicrm_state_province (country_id, abbreviation, is_active, name) VALUES (@PHILIPPINESID, "DIN", 1, 'Dinagat Islands');
UPDATE civicrm_state_province SET name = 'Davao del Norte' WHERE country_id = @PHILIPPINESID AND abbreviation = "DAV" AND name = "Davao";
UPDATE civicrm_state_province SET name = 'Davao de Oro' WHERE country_id = @PHILIPPINESID AND abbreviation = "COM" AND name = "Compostela Valley";
UPDATE civicrm_state_province SET name = 'Kalinga' WHERE country_id = @PHILIPPINESID AND abbreviation = "KAL" AND name = "Kalinga-Apayso";
UPDATE civicrm_state_province SET name = 'Cotabato' WHERE country_id = @PHILIPPINESID AND abbreviation = "NCO" AND name = "North Cotabato";

-- Add missing state for Colombia
SELECT @country_id := id from civicrm_country where name = 'Colombia' AND iso_code = 'CO';
Expand Down
6 changes: 6 additions & 0 deletions CRM/Utils/Mail/Incoming.php
Original file line number Diff line number Diff line change
Expand Up @@ -452,6 +452,12 @@ public static function getContactID($email, $name, $create, &$mail) {
$contactID = NULL;
if ($dao) {
$contactID = $dao->contact_id;
} else {
$dao = CRM_Contact_BAO_Contact::matchContactOnEmail($email, 'Organization');

if ($dao) {
$contactID = $dao->contact_id;
}
}

$result = NULL;
Expand Down
Loading

0 comments on commit a4edaaf

Please sign in to comment.