Skip to content

Commit 9035027

Browse files
committed
Update to CiviCRM 5.5.1. This release includes a number of bug fixes 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.
1 parent 9c2b620 commit 9035027

File tree

669 files changed

+27833
-5747
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

669 files changed

+27833
-5747
lines changed

profiles/civicrm_starterkit/civicrm_starterkit.make

+2-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ projects[drupal][version] = "7.51"
1313
; ====== CIVICRM RELATED =========
1414

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

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

2828
; Set session for cron.

profiles/civicrm_starterkit/modules/civicrm/CONTRIBUTORS.txt

+27-5
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,39 @@
11
The following people and organizations sponsored and/or contributed new and improved features to the project.
22

33
************************************************
4-
Key Contributors and Sponsors for 5.x
4+
Code Contributors for 5.x
55
************************************************
66

77
CiviCRM - Coleman Watts, Tim Otten
88

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

3961
************************************************
4062
Key Contributors and Sponsors for 4.7

profiles/civicrm_starterkit/modules/civicrm/CRM/ACL/BAO/ACL.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -877,7 +877,7 @@ public static function group(
877877
$aclKeys = array_keys($acls);
878878
$aclKeys = implode(',', $aclKeys);
879879

880-
$cacheKey = "$tableName-$aclKeys";
880+
$cacheKey = CRM_Core_BAO_Cache::cleanKey("$tableName-$aclKeys");
881881
$cache = CRM_Utils_Cache::singleton();
882882
$ids = $cache->get($cacheKey);
883883
if (!$ids) {

profiles/civicrm_starterkit/modules/civicrm/CRM/ACL/DAO/ACL.php

+1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,7 @@ public static function &fields() {
168168
'title' => ts('Deny ACL?'),
169169
'description' => 'Is this ACL entry Allow (0) or Deny (1) ?',
170170
'required' => TRUE,
171+
'default' => '0',
171172
'table_name' => 'civicrm_acl',
172173
'entity' => 'ACL',
173174
'bao' => 'CRM_ACL_BAO_ACL',

profiles/civicrm_starterkit/modules/civicrm/CRM/Activity/BAO/Activity.php

+99-79
Original file line numberDiff line numberDiff line change
@@ -920,8 +920,7 @@ public static function deprecatedGetActivities($input) {
920920

921921
$config = CRM_Core_Config::singleton();
922922

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

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

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

1776-
$sendResult = self::sendSMSMessage(
1777-
$contactId,
1778-
$tokenText,
1779-
$smsProviderParams,
1780-
$activityID,
1781-
$sourceContactId
1782-
);
1775+
$doNotSms = CRM_Utils_Array::value('do_not_sms', $contact, 0);
17831776

1784-
if (PEAR::isError($sendResult)) {
1785-
// Collect all of the PEAR_Error objects
1786-
$errMsgs[] = $sendResult;
1777+
if ($doNotSms) {
1778+
$errMsgs[] = PEAR::raiseError('Contact Does not accept SMS', NULL, PEAR_ERROR_RETURN);
17871779
}
17881780
else {
1789-
$success++;
1781+
$sendResult = self::sendSMSMessage(
1782+
$contactId,
1783+
$tokenText,
1784+
$smsProviderParams,
1785+
$activityID,
1786+
$sourceContactId
1787+
);
1788+
1789+
if (PEAR::isError($sendResult)) {
1790+
// Collect all of the PEAR_Error objects
1791+
$errMsgs[] = $sendResult;
1792+
}
1793+
else {
1794+
$success++;
1795+
}
17901796
}
17911797
}
17921798

@@ -1827,9 +1833,7 @@ public static function sendSMSMessage(
18271833
$activityID,
18281834
$sourceContactID = NULL
18291835
) {
1830-
$doNotSms = TRUE;
18311836
$toPhoneNumber = NULL;
1832-
18331837
if ($smsProviderParams['To']) {
18341838
// If phone number is specified use it
18351839
$toPhoneNumber = trim($smsProviderParams['To']);
@@ -1843,21 +1847,20 @@ public static function sendSMSMessage(
18431847
$toPhoneNumberDetails = reset($toPhoneNumbers);
18441848
$toPhoneNumber = CRM_Utils_Array::value('phone', $toPhoneNumberDetails);
18451849
// Contact allows to send sms
1846-
$doNotSms = FALSE;
18471850
}
18481851
}
18491852

18501853
// make sure both phone are valid
18511854
// and that the recipient wants to receive sms
1852-
if (empty($toPhoneNumber) or $doNotSms) {
1855+
if (empty($toPhoneNumber)) {
18531856
return PEAR::raiseError(
18541857
'Recipient phone number is invalid or recipient does not want to receive SMS',
18551858
NULL,
18561859
PEAR_ERROR_RETURN
18571860
);
18581861
}
18591862

1860-
$recipient = $smsProviderParams['To'];
1863+
$recipient = $toPhoneNumber;
18611864
$smsProviderParams['contact_id'] = $toID;
18621865
$smsProviderParams['parent_activity_id'] = $activityID;
18631866

@@ -2529,69 +2532,70 @@ public static function isOverdue($activity) {
25292532
* @return array
25302533
* array of exportable Fields
25312534
*/
2532-
public static function &exportableFields($name = 'Activity') {
2533-
if (!isset(self::$_exportableFields[$name])) {
2534-
self::$_exportableFields[$name] = array();
2535-
2536-
// TODO: ideally we should retrieve all fields from xml, in this case since activity processing is done
2537-
// my case hence we have defined fields as case_*
2538-
if ($name == 'Activity') {
2539-
$exportableFields = CRM_Activity_DAO_Activity::export();
2540-
$exportableFields['source_contact_id']['title'] = ts('Source Contact ID');
2541-
$exportableFields['source_contact'] = array(
2542-
'title' => ts('Source Contact'),
2543-
'type' => CRM_Utils_Type::T_STRING,
2544-
);
2535+
public static function exportableFields($name = 'Activity') {
2536+
self::$_exportableFields[$name] = array();
2537+
2538+
// TODO: ideally we should retrieve all fields from xml, in this case since activity processing is done
2539+
// my case hence we have defined fields as case_*
2540+
if ($name == 'Activity') {
2541+
$exportableFields = CRM_Activity_DAO_Activity::export();
2542+
$exportableFields['source_contact_id'] = [
2543+
'title' => ts('Source Contact ID'),
2544+
'type' => CRM_Utils_Type::T_INT,
2545+
];
2546+
$exportableFields['source_contact'] = array(
2547+
'title' => ts('Source Contact'),
2548+
'type' => CRM_Utils_Type::T_STRING,
2549+
);
25452550

2546-
$Activityfields = array(
2547-
'activity_type' => array(
2548-
'title' => ts('Activity Type'),
2549-
'name' => 'activity_type',
2550-
'type' => CRM_Utils_Type::T_STRING,
2551-
'searchByLabel' => TRUE,
2552-
),
2553-
'activity_status' => array(
2554-
'title' => ts('Activity Status'),
2555-
'name' => 'activity_status',
2556-
'type' => CRM_Utils_Type::T_STRING,
2557-
'searchByLabel' => TRUE,
2558-
),
2559-
'activity_priority' => array(
2560-
'title' => ts('Activity Priority'),
2561-
'name' => 'activity_priority',
2562-
'type' => CRM_Utils_Type::T_STRING,
2563-
'searchByLabel' => TRUE,
2564-
),
2565-
);
2566-
$fields = array_merge($Activityfields, $exportableFields);
2567-
}
2568-
else {
2569-
// Set title to activity fields.
2570-
$fields = array(
2571-
'case_activity_subject' => array('title' => ts('Activity Subject'), 'type' => CRM_Utils_Type::T_STRING),
2572-
'case_source_contact_id' => array('title' => ts('Activity Reporter'), 'type' => CRM_Utils_Type::T_STRING),
2573-
'case_recent_activity_date' => array('title' => ts('Activity Actual Date'), 'type' => CRM_Utils_Type::T_DATE),
2574-
'case_scheduled_activity_date' => array(
2575-
'title' => ts('Activity Scheduled Date'),
2576-
'type' => CRM_Utils_Type::T_DATE,
2577-
),
2578-
'case_recent_activity_type' => array('title' => ts('Activity Type'), 'type' => CRM_Utils_Type::T_STRING),
2579-
'case_activity_status' => array('title' => ts('Activity Status'), 'type' => CRM_Utils_Type::T_STRING),
2580-
'case_activity_duration' => array('title' => ts('Activity Duration'), 'type' => CRM_Utils_Type::T_INT),
2581-
'case_activity_medium_id' => array('title' => ts('Activity Medium'), 'type' => CRM_Utils_Type::T_INT),
2582-
'case_activity_details' => array('title' => ts('Activity Details'), 'type' => CRM_Utils_Type::T_TEXT),
2583-
'case_activity_is_auto' => array(
2584-
'title' => ts('Activity Auto-generated?'),
2585-
'type' => CRM_Utils_Type::T_BOOLEAN,
2586-
),
2587-
);
2588-
}
2551+
$Activityfields = array(
2552+
'activity_type' => array(
2553+
'title' => ts('Activity Type'),
2554+
'name' => 'activity_type',
2555+
'type' => CRM_Utils_Type::T_STRING,
2556+
'searchByLabel' => TRUE,
2557+
),
2558+
'activity_status' => array(
2559+
'title' => ts('Activity Status'),
2560+
'name' => 'activity_status',
2561+
'type' => CRM_Utils_Type::T_STRING,
2562+
'searchByLabel' => TRUE,
2563+
),
2564+
'activity_priority' => array(
2565+
'title' => ts('Activity Priority'),
2566+
'name' => 'activity_priority',
2567+
'type' => CRM_Utils_Type::T_STRING,
2568+
'searchByLabel' => TRUE,
2569+
),
2570+
);
2571+
$fields = array_merge($Activityfields, $exportableFields);
2572+
}
2573+
else {
2574+
// Set title to activity fields.
2575+
$fields = array(
2576+
'case_activity_subject' => array('title' => ts('Activity Subject'), 'type' => CRM_Utils_Type::T_STRING),
2577+
'case_source_contact_id' => array('title' => ts('Activity Reporter'), 'type' => CRM_Utils_Type::T_STRING),
2578+
'case_recent_activity_date' => array('title' => ts('Activity Actual Date'), 'type' => CRM_Utils_Type::T_DATE),
2579+
'case_scheduled_activity_date' => array(
2580+
'title' => ts('Activity Scheduled Date'),
2581+
'type' => CRM_Utils_Type::T_DATE,
2582+
),
2583+
'case_recent_activity_type' => array('title' => ts('Activity Type'), 'type' => CRM_Utils_Type::T_STRING),
2584+
'case_activity_status' => array('title' => ts('Activity Status'), 'type' => CRM_Utils_Type::T_STRING),
2585+
'case_activity_duration' => array('title' => ts('Activity Duration'), 'type' => CRM_Utils_Type::T_INT),
2586+
'case_activity_medium_id' => array('title' => ts('Activity Medium'), 'type' => CRM_Utils_Type::T_INT),
2587+
'case_activity_details' => array('title' => ts('Activity Details'), 'type' => CRM_Utils_Type::T_TEXT),
2588+
'case_activity_is_auto' => array(
2589+
'title' => ts('Activity Auto-generated?'),
2590+
'type' => CRM_Utils_Type::T_BOOLEAN,
2591+
),
2592+
);
2593+
}
25892594

2590-
// add custom data for case activities
2591-
$fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Activity'));
2595+
// add custom data for case activities
2596+
$fields = array_merge($fields, CRM_Core_BAO_CustomField::getFieldsForImport('Activity'));
25922597

2593-
self::$_exportableFields[$name] = $fields;
2594-
}
2598+
self::$_exportableFields[$name] = $fields;
25952599
return self::$_exportableFields[$name];
25962600
}
25972601

@@ -2831,6 +2835,22 @@ public static function checkPermission($activityId, $action) {
28312835
return $allow;
28322836
}
28332837

2838+
/**
2839+
* Checks if user has permissions to edit inbound e-mails, either bsic info
2840+
* or both basic information and content.
2841+
*
2842+
* @return bool
2843+
*/
2844+
public function checkEditInboundEmailsPermissions() {
2845+
if (CRM_Core_Permission::check('edit inbound email basic information')
2846+
|| CRM_Core_Permission::check('edit inbound email basic information and content')
2847+
) {
2848+
return TRUE;
2849+
}
2850+
2851+
return FALSE;
2852+
}
2853+
28342854
/**
28352855
* Wrapper for ajax activity selector.
28362856
*

profiles/civicrm_starterkit/modules/civicrm/CRM/Activity/BAO/Query.php

+24-6
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,13 @@ public static function select(&$query) {
136136
if (!empty($query->_returnProperties['source_contact'])) {
137137
$query->_select['source_contact'] = 'source_contact.sort_name as source_contact';
138138
$query->_element['source_contact'] = 1;
139-
$query->_tables['source_contact'] = $query->_whereTables['source_contact'] = 1;
139+
$query->_tables['civicrm_activity'] = $query->_tables['source_contact'] = $query->_whereTables['source_contact'] = 1;
140+
}
141+
142+
if (!empty($query->_returnProperties['source_contact_id'])) {
143+
$query->_select['source_contact_id'] = 'source_contact.id as source_contact_id';
144+
$query->_element['source_contact_id'] = 1;
145+
$query->_tables['civicrm_activity'] = $query->_tables['source_contact'] = $query->_whereTables['source_contact'] = 1;
140146
}
141147

142148
if (!empty($query->_returnProperties['activity_result'])) {
@@ -348,6 +354,14 @@ public static function whereClauseSingle(&$values, &$query) {
348354
$query->_qill[$grouping][] = ts('Activities which are not Followup Activities');
349355
}
350356
break;
357+
358+
case 'source_contact':
359+
case 'source_contact_id':
360+
$columnName = strstr($name, '_id') ? 'id' : 'sort_name';
361+
$query->_where[$grouping][] = CRM_Contact_BAO_Query::buildClause("source_contact.{$columnName}", $op, $value, CRM_Utils_Type::typeToString($fields[$name]['type']));
362+
list($op, $value) = CRM_Contact_BAO_Query::buildQillForFieldValue('CRM_Contact_DAO_Contact', $columnName, $value, $op);
363+
$query->_qill[$grouping][] = ts('%1 %2 %3', array(1 => $fields[$name]['title'], 2 => $op, 3 => $value));
364+
break;
351365
}
352366
}
353367

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

401415
case 'source_contact':
402-
$activityContacts = CRM_Activity_BAO_ActivityContact::buildOptions('record_type_id', 'validate');
403-
$sourceID = CRM_Utils_Array::key('Activity Source', $activityContacts);
416+
$sourceID = CRM_Core_PseudoConstant::getKey(
417+
'CRM_Activity_BAO_ActivityContact',
418+
'record_type_id',
419+
'Activity Source'
420+
);
404421
$from = "
405-
LEFT JOIN civicrm_activity_contact ac
406-
ON ( ac.activity_id = civicrm_activity_contact.activity_id AND ac.record_type_id = {$sourceID})
407-
INNER JOIN civicrm_contact source_contact ON (ac.contact_id = source_contact.id)";
422+
LEFT JOIN civicrm_activity_contact source_activity
423+
ON (source_activity.activity_id = civicrm_activity_contact.activity_id
424+
AND source_activity.record_type_id = {$sourceID})
425+
LEFT JOIN civicrm_contact source_contact ON (source_activity.contact_id = source_contact.id)";
408426
break;
409427

410428
case 'parent_id':

0 commit comments

Comments
 (0)