Skip to content

Commit

Permalink
Update to CiviCRM 5.5.1. This release includes a number of bug fixes …
Browse files Browse the repository at this point in the history
…and improvements, including database changes. Read more about the changes: https://civicrm.org/blog/dev-team/announcing-civicrm-55-release and https://civicrm.org/blog/dev-team/announcing-civicrm-54-release.

Make sure you backup using Pantheon's database backup tool first. Then either go to http://<your_drupal_home>/civicrm/upgrade?reset=1 or use terminus drush site.env civicrm-upgrade-db. Fully test on a dev environment before upgrading on live. Don't merge this code yet if you've got other updates which are urgent.

If you have questions contact http://civicrmstarterkit.org/contact. We provide some basic general support for the public. If you require help with your specific website there will likely be a cost.
  • Loading branch information
herbdool committed Sep 14, 2018
1 parent 9c2b620 commit 9035027
Show file tree
Hide file tree
Showing 669 changed files with 27,833 additions and 5,747 deletions.
4 changes: 2 additions & 2 deletions profiles/civicrm_starterkit/civicrm_starterkit.make
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ projects[drupal][version] = "7.51"
; ====== CIVICRM RELATED =========

libraries[civicrm][download][type] = get
libraries[civicrm][download][url] = "https://download.civicrm.org/civicrm-5.3.1-drupal.tar.gz"
libraries[civicrm][download][url] = "https://download.civicrm.org/civicrm-5.5.1-drupal.tar.gz"
libraries[civicrm][destination] = modules
libraries[civicrm][directory_name] = civicrm

Expand All @@ -22,7 +22,7 @@ libraries[civicrm][directory_name] = civicrm
; Private folders: https://civicrm.org/advisory/civi-sa-2014-001-risk-information-disclosure
; Define [civicrm.files] and [civicrm.private] paths since there is no htaccess file
; to set public/private folders.
libraries[civicrm][patch][pantheonsettings] = ./patches/pantheon-settings-starterkit-50.patch
libraries[civicrm][patch][pantheonsettings] = ./patches/pantheon-settings-starterkit-55.patch
libraries[civicrm][patch][publicfiledir] = ./patches/public_files_config.patch

; Set session for cron.
Expand Down
32 changes: 27 additions & 5 deletions profiles/civicrm_starterkit/modules/civicrm/CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
@@ -1,25 +1,39 @@
The following people and organizations sponsored and/or contributed new and improved features to the project.

************************************************
Key Contributors and Sponsors for 5.x
Code Contributors for 5.x
************************************************

CiviCRM - Coleman Watts, Tim Otten

AGH Strategies - Alice Frumin, Andrew Hunt, Eli Lisseck
Agileware - Alok Patel, Francis Whittle, Justin Freeman
Andrew Thompson
applicado
Australian Greens - Seamus Lee
CiviDesk - Yashodha Chaku
CompuCorp - Michael Devery, Mukesh Ram, Omar Abu Hussein, René Olivo, Vinu
Varshith Sekar
Coop SymbioTIC - Samuel Vanhove
Bastien Ho
Blackfly Solutions - Alan Dixon
Calibrate - Wannes De Roy
Caltha - Tomasz Pietrzkowski
CEDC - Laryn Kragt Bakker
Chris Burgess
CiviCoop - Jaap Jansma
CiviDesk - Sunil Pawar, Yashodha Chaku
CompuCorp - Camilo Rodriguez, Davi Alexandre, Debarshi Bhaumik, Michael Devery,
Mukesh Ram, Omar Abu Hussein, René Olivo, Vinu Varshith Sekar
Coop SymbioTIC - Mathieu Lutfy, Samuel Vanhove
Davis Media Access - Darrick Servis
Electronic Frontier Foundation - Mark Burdett
eQuality Technology - Greg Rundlett
Freeform Solutions - Herb van den Dool
Fuzion - Jitendra Purohit
Ginkgo Street Labs - Frank Gómez
Hossein Amin
JMA Consulting - Monish Deb
Johan Vervloet
John Kingsnorth
Joinery - Allen Shaw
Kanzu Code - Carl Andrew Lema
Kompetenzzentrum Technik-Diversity-Chancengleichheit - Niels Heinemann
Left Join Labs - Sean Madsen
Lighthouse Design and Consulting - Brian Shaughnessy
Expand All @@ -29,12 +43,20 @@ MJW Consulting - Matthew Wire
myDropWizard - David Snopek
Naomi Rosenberg
Olivier Tétard
OSSeed Technologies - Madhavi Malgaonkar
Oxfam Germany - Thomas Schüttler, Yuliyana Liyana
Pradeep Nayak
Progressive Technology Project - Jamie McClelland
Richard van Oosterhout
Romain Thouvenin
Squiffle Consulting - Aidan Saunders
Systopia - Björn Endres
Tadpole Collective - Kevin Cristiano
Third Sector Design - Michael McAndrew
Tom Bloor
Wikimedia Foundation - Eileen McNaughton
Wildsight - Lars Sanders-Green
Will Long

************************************************
Key Contributors and Sponsors for 4.7
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -877,7 +877,7 @@ public static function group(
$aclKeys = array_keys($acls);
$aclKeys = implode(',', $aclKeys);

$cacheKey = "$tableName-$aclKeys";
$cacheKey = CRM_Core_BAO_Cache::cleanKey("$tableName-$aclKeys");
$cache = CRM_Utils_Cache::singleton();
$ids = $cache->get($cacheKey);
if (!$ids) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -168,6 +168,7 @@ public static function &fields() {
'title' => ts('Deny ACL?'),
'description' => 'Is this ACL entry Allow (0) or Deny (1) ?',
'required' => TRUE,
'default' => '0',
'table_name' => 'civicrm_acl',
'entity' => 'ACL',
'bao' => 'CRM_ACL_BAO_ACL',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -920,8 +920,7 @@ public static function deprecatedGetActivities($input) {

$config = CRM_Core_Config::singleton();

$randomNum = md5(uniqid());
$activityTempTable = "civicrm_temp_activity_details_{$randomNum}";
$activityTempTable = CRM_Utils_SQL_TempTable::build()->setCategory('actdetail')->getName();

$tableFields = array(
'activity_id' => 'int unsigned',
Expand Down Expand Up @@ -1012,7 +1011,7 @@ public static function deprecatedGetActivities($input) {

// step 2: Get target and assignee contacts for above activities
// create temp table for target contacts
$activityContactTempTable = "civicrm_temp_activity_contact_{$randomNum}";
$activityContactTempTable = CRM_Utils_SQL_TempTable::build()->setCategory('actcontact')->getName();
$query = "CREATE TEMPORARY TABLE {$activityContactTempTable} (
activity_id int unsigned, contact_id int unsigned, record_type_id varchar(16),
contact_name varchar(255), is_deleted int unsigned, counter int unsigned, INDEX index_activity_id( activity_id ) )
Expand Down Expand Up @@ -1773,20 +1772,27 @@ public static function sendSMS(
$smsProviderParams['To'] = '';
}

$sendResult = self::sendSMSMessage(
$contactId,
$tokenText,
$smsProviderParams,
$activityID,
$sourceContactId
);
$doNotSms = CRM_Utils_Array::value('do_not_sms', $contact, 0);

if (PEAR::isError($sendResult)) {
// Collect all of the PEAR_Error objects
$errMsgs[] = $sendResult;
if ($doNotSms) {
$errMsgs[] = PEAR::raiseError('Contact Does not accept SMS', NULL, PEAR_ERROR_RETURN);
}
else {
$success++;
$sendResult = self::sendSMSMessage(
$contactId,
$tokenText,
$smsProviderParams,
$activityID,
$sourceContactId
);

if (PEAR::isError($sendResult)) {
// Collect all of the PEAR_Error objects
$errMsgs[] = $sendResult;
}
else {
$success++;
}
}
}

Expand Down Expand Up @@ -1827,9 +1833,7 @@ public static function sendSMSMessage(
$activityID,
$sourceContactID = NULL
) {
$doNotSms = TRUE;
$toPhoneNumber = NULL;

if ($smsProviderParams['To']) {
// If phone number is specified use it
$toPhoneNumber = trim($smsProviderParams['To']);
Expand All @@ -1843,21 +1847,20 @@ public static function sendSMSMessage(
$toPhoneNumberDetails = reset($toPhoneNumbers);
$toPhoneNumber = CRM_Utils_Array::value('phone', $toPhoneNumberDetails);
// Contact allows to send sms
$doNotSms = FALSE;
}
}

// make sure both phone are valid
// and that the recipient wants to receive sms
if (empty($toPhoneNumber) or $doNotSms) {
if (empty($toPhoneNumber)) {
return PEAR::raiseError(
'Recipient phone number is invalid or recipient does not want to receive SMS',
NULL,
PEAR_ERROR_RETURN
);
}

$recipient = $smsProviderParams['To'];
$recipient = $toPhoneNumber;
$smsProviderParams['contact_id'] = $toID;
$smsProviderParams['parent_activity_id'] = $activityID;

Expand Down Expand Up @@ -2529,69 +2532,70 @@ public static function isOverdue($activity) {
* @return array
* array of exportable Fields
*/
public static function &exportableFields($name = 'Activity') {
if (!isset(self::$_exportableFields[$name])) {
self::$_exportableFields[$name] = array();

// TODO: ideally we should retrieve all fields from xml, in this case since activity processing is done
// my case hence we have defined fields as case_*
if ($name == 'Activity') {
$exportableFields = CRM_Activity_DAO_Activity::export();
$exportableFields['source_contact_id']['title'] = ts('Source Contact ID');
$exportableFields['source_contact'] = array(
'title' => ts('Source Contact'),
'type' => CRM_Utils_Type::T_STRING,
);
public static function exportableFields($name = 'Activity') {
self::$_exportableFields[$name] = array();

// TODO: ideally we should retrieve all fields from xml, in this case since activity processing is done
// my case hence we have defined fields as case_*
if ($name == 'Activity') {
$exportableFields = CRM_Activity_DAO_Activity::export();
$exportableFields['source_contact_id'] = [
'title' => ts('Source Contact ID'),
'type' => CRM_Utils_Type::T_INT,
];
$exportableFields['source_contact'] = array(
'title' => ts('Source Contact'),
'type' => CRM_Utils_Type::T_STRING,
);

$Activityfields = array(
'activity_type' => array(
'title' => ts('Activity Type'),
'name' => 'activity_type',
'type' => CRM_Utils_Type::T_STRING,
'searchByLabel' => TRUE,
),
'activity_status' => array(
'title' => ts('Activity Status'),
'name' => 'activity_status',
'type' => CRM_Utils_Type::T_STRING,
'searchByLabel' => TRUE,
),
'activity_priority' => array(
'title' => ts('Activity Priority'),
'name' => 'activity_priority',
'type' => CRM_Utils_Type::T_STRING,
'searchByLabel' => TRUE,
),
);
$fields = array_merge($Activityfields, $exportableFields);
}
else {
// Set title to activity fields.
$fields = array(
'case_activity_subject' => array('title' => ts('Activity Subject'), 'type' => CRM_Utils_Type::T_STRING),
'case_source_contact_id' => array('title' => ts('Activity Reporter'), 'type' => CRM_Utils_Type::T_STRING),
'case_recent_activity_date' => array('title' => ts('Activity Actual Date'), 'type' => CRM_Utils_Type::T_DATE),
'case_scheduled_activity_date' => array(
'title' => ts('Activity Scheduled Date'),
'type' => CRM_Utils_Type::T_DATE,
),
'case_recent_activity_type' => array('title' => ts('Activity Type'), 'type' => CRM_Utils_Type::T_STRING),
'case_activity_status' => array('title' => ts('Activity Status'), 'type' => CRM_Utils_Type::T_STRING),
'case_activity_duration' => array('title' => ts('Activity Duration'), 'type' => CRM_Utils_Type::T_INT),
'case_activity_medium_id' => array('title' => ts('Activity Medium'), 'type' => CRM_Utils_Type::T_INT),
'case_activity_details' => array('title' => ts('Activity Details'), 'type' => CRM_Utils_Type::T_TEXT),
'case_activity_is_auto' => array(
'title' => ts('Activity Auto-generated?'),
'type' => CRM_Utils_Type::T_BOOLEAN,
),
);
}
$Activityfields = array(
'activity_type' => array(
'title' => ts('Activity Type'),
'name' => 'activity_type',
'type' => CRM_Utils_Type::T_STRING,
'searchByLabel' => TRUE,
),
'activity_status' => array(
'title' => ts('Activity Status'),
'name' => 'activity_status',
'type' => CRM_Utils_Type::T_STRING,
'searchByLabel' => TRUE,
),
'activity_priority' => array(
'title' => ts('Activity Priority'),
'name' => 'activity_priority',
'type' => CRM_Utils_Type::T_STRING,
'searchByLabel' => TRUE,
),
);
$fields = array_merge($Activityfields, $exportableFields);
}
else {
// Set title to activity fields.
$fields = array(
'case_activity_subject' => array('title' => ts('Activity Subject'), 'type' => CRM_Utils_Type::T_STRING),
'case_source_contact_id' => array('title' => ts('Activity Reporter'), 'type' => CRM_Utils_Type::T_STRING),
'case_recent_activity_date' => array('title' => ts('Activity Actual Date'), 'type' => CRM_Utils_Type::T_DATE),
'case_scheduled_activity_date' => array(
'title' => ts('Activity Scheduled Date'),
'type' => CRM_Utils_Type::T_DATE,
),
'case_recent_activity_type' => array('title' => ts('Activity Type'), 'type' => CRM_Utils_Type::T_STRING),
'case_activity_status' => array('title' => ts('Activity Status'), 'type' => CRM_Utils_Type::T_STRING),
'case_activity_duration' => array('title' => ts('Activity Duration'), 'type' => CRM_Utils_Type::T_INT),
'case_activity_medium_id' => array('title' => ts('Activity Medium'), 'type' => CRM_Utils_Type::T_INT),
'case_activity_details' => array('title' => ts('Activity Details'), 'type' => CRM_Utils_Type::T_TEXT),
'case_activity_is_auto' => array(
'title' => ts('Activity Auto-generated?'),
'type' => CRM_Utils_Type::T_BOOLEAN,
),
);
}

// add custom data for case activities
$fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Activity'));
// add custom data for case activities
$fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Activity'));

self::$_exportableFields[$name] = $fields;
}
self::$_exportableFields[$name] = $fields;
return self::$_exportableFields[$name];
}

Expand Down Expand Up @@ -2831,6 +2835,22 @@ public static function checkPermission($activityId, $action) {
return $allow;
}

/**
* Checks if user has permissions to edit inbound e-mails, either bsic info
* or both basic information and content.
*
* @return bool
*/
public function checkEditInboundEmailsPermissions() {
if (CRM_Core_Permission::check('edit inbound email basic information')
|| CRM_Core_Permission::check('edit inbound email basic information and content')
) {
return TRUE;
}

return FALSE;
}

/**
* Wrapper for ajax activity selector.
*
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,13 @@ public static function select(&$query) {
if (!empty($query->_returnProperties['source_contact'])) {
$query->_select['source_contact'] = 'source_contact.sort_name as source_contact';
$query->_element['source_contact'] = 1;
$query->_tables['source_contact'] = $query->_whereTables['source_contact'] = 1;
$query->_tables['civicrm_activity'] = $query->_tables['source_contact'] = $query->_whereTables['source_contact'] = 1;
}

if (!empty($query->_returnProperties['source_contact_id'])) {
$query->_select['source_contact_id'] = 'source_contact.id as source_contact_id';
$query->_element['source_contact_id'] = 1;
$query->_tables['civicrm_activity'] = $query->_tables['source_contact'] = $query->_whereTables['source_contact'] = 1;
}

if (!empty($query->_returnProperties['activity_result'])) {
Expand Down Expand Up @@ -348,6 +354,14 @@ public static function whereClauseSingle(&$values, &$query) {
$query->_qill[$grouping][] = ts('Activities which are not Followup Activities');
}
break;

case 'source_contact':
case 'source_contact_id':
$columnName = strstr($name, '_id') ? 'id' : 'sort_name';
$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("source_contact.{$columnName}", $op, $value, CRM_Utils_Type::typeToString($fields[$name]['type']));
list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Contact_DAO_Contact', $columnName, $value, $op);
$query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$name]['title'], 2 => $op, 3 => $value));
break;
}
}

Expand Down Expand Up @@ -399,12 +413,16 @@ public static function from($name, $mode, $side) {
break;

case 'source_contact':
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate');
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
$sourceID = CRM_Core_PseudoConstant::getKey(
'CRM_Activity_BAO_ActivityContact',
'record_type_id',
'Activity Source'
);
$from = "
LEFT JOIN civicrm_activity_contact ac
ON ( ac.activity_id = civicrm_activity_contact.activity_id AND ac.record_type_id = {$sourceID})
INNER JOIN civicrm_contact source_contact ON (ac.contact_id = source_contact.id)";
LEFT JOIN civicrm_activity_contact source_activity
ON (source_activity.activity_id = civicrm_activity_contact.activity_id
AND source_activity.record_type_id = {$sourceID})
LEFT JOIN civicrm_contact source_contact ON (source_activity.contact_id = source_contact.id)";
break;

case 'parent_id':
Expand Down
Loading

0 comments on commit 9035027

Please sign in to comment.