Skip to content

Commit

Permalink
Merge commit '5.1.0' into 5-release
Browse files Browse the repository at this point in the history
Conflicts:
	CRM/Logging/Schema.php
	CRM/Report/Form/Grant/Detail.php
	release-notes/5.0.1.md
	release-notes/5.0.2.md
	sql/civicrm_generated.mysql
	xml/version.xml
  • Loading branch information
agileware-dev committed May 7, 2018
2 parents 57f4918 + 95c7af6 commit b142919
Show file tree
Hide file tree
Showing 208 changed files with 3,979 additions and 7,896 deletions.
14 changes: 10 additions & 4 deletions CONTRIBUTORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,24 +6,30 @@ Key Contributors and Sponsors for 5.x

CiviCRM - Coleman Watts, Tim Otten

AGH Strategies - Andrew Hunt
Agileware - Alok Patel
AGH Strategies - Alice Frumin, Andrew Hunt, Eli Lisseck
Agileware - Alok Patel, Francis Whittle, Justin Freeman
Andrew Thompson
Australian Greens - Seamus Lee
CiviDesk - Yashodha Chaku
CompuCorp - Mukesh Ram, Omar Abu Hussein, René Olivo, Vinu Varshith Sekar
CompuCorp - Michael Devery, Mukesh Ram, Omar Abu Hussein, René Olivo, Vinu
Varshith Sekar
Coop SymbioTIC - Samuel Vanhove
Davis Media Access - Darrick Servis
Fuzion - Jitendra Purohit
Ginkgo Street Labs - Frank Gómez
JMA Consulting - Monish Deb
John Kingsnorth
Joinery - Allen Shaw
Kompetenzzentrum Technik-Diversity-Chancengleichheit - Niels Heinemann
Left Join Labs - Sean Madsen
Lighthouse Design and Consulting - Brian Shaughnessy
Łukasz Krutul
Megaphone Technology Consulting - Jon Goldberg
MJW Consulting - Matthew Wire
myDropWizard - David Snopek
Oxfam Germany - Thomas Schüttler
Naomi Rosenberg
Olivier Tétard
Oxfam Germany - Thomas Schüttler, Yuliyana Liyana
Progressive Technology Project - Jamie McClelland
Systopia - Björn Endres
Tadpole Collective - Kevin Cristiano
Expand Down
11 changes: 11 additions & 0 deletions CRM/Activity/Form/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -522,6 +522,17 @@ public function preProcess() {
if ($this->_action & CRM_Core_Action::UPDATE) {
CRM_Core_Form_RecurringEntity::preProcess('civicrm_activity');
}

if ($this->_action & CRM_Core_Action::VIEW) {
$url = CRM_Utils_System::url(implode("/", $this->urlPath), "reset=1&id={$this->_activityId}&action=view&cid={$this->_values['source_contact_id']}");
CRM_Utils_Recent::add($this->_values['subject'],
$url,
$this->_values['id'],
'Activity',
$this->_values['source_contact_id'],
$this->_values['source_contact']
);
}
}

/**
Expand Down
9 changes: 9 additions & 0 deletions CRM/Activity/Form/ActivityView.php
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ public function preProcess() {

$values['attachment'] = CRM_Core_BAO_File::attachmentInfo('civicrm_activity', $activityId);
$this->assign('values', $values);

$url = CRM_Utils_System::url(implode("/", $this->urlPath), "reset=1&id={$activityId}&action=view&cid={$values['source_contact_id']}");
CRM_Utils_Recent::add($this->_values['subject'],
$url,
$values['id'],
'Activity',
$values['source_contact_id'],
$values['source_contact']
);
}

/**
Expand Down
23 changes: 10 additions & 13 deletions CRM/Campaign/Form/Task/Interview.php
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,11 @@ public function preProcess() {

$orderClause = FALSE;
$buttonName = $this->controller->getButtonName();
$walkListActivityId = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'WalkList');
if ($buttonName == '_qf_Interview_submit_orderBy' && !empty($_POST['order_bys'])) {
$orderByParams = CRM_Utils_Array::value('order_bys', $_POST);
}
elseif (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id']) {
elseif ($walkListActivityId == $this->_surveyDetails['activity_type_id']) {
$orderByParams
= array(
1 => array(
Expand Down Expand Up @@ -170,8 +171,7 @@ public function preProcess() {
$this->_contactIds,
$this->_interviewerId
);
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$scheduledStatusId = array_search('Scheduled', $activityStatus);
$scheduledStatusId = CRM_Core_PseudoConstant::getKey('CRM_Activity_DAO_Activity', 'activity_status_id', 'Scheduled');

$activityIds = array();
foreach ($this->_contactIds as $key => $voterId) {
Expand Down Expand Up @@ -248,9 +248,9 @@ public function preProcess() {
}

//set the title.
$activityTypes = CRM_Core_PseudoConstant::activityType(FALSE, TRUE, FALSE, 'label', TRUE);
$this->_surveyTypeId = CRM_Utils_Array::value('activity_type_id', $this->_surveyValues);
CRM_Utils_System::setTitle(ts('Record %1 Responses', array(1 => $activityTypes[$this->_surveyTypeId])));
$surveyTypeLabel = CRM_Core_PseudoConstant::getLabel('CRM_Activity_BAO_Activity', 'activity_type_id', $this->_surveyTypeId);
CRM_Utils_System::setTitle(ts('Record %1 Responses', array(1 => $surveyTypeLabel)));
}

public function validateIds() {
Expand Down Expand Up @@ -387,7 +387,7 @@ public function setDefaultValues() {
foreach ($this->_surveyFields as $name => $field) {
$acceptable_types = CRM_Contact_BAO_ContactType::basicTypes();
$acceptable_types[] = 'Contact';
if (in_array($field['field_type'], $acceptable_types)) {
if (isset($field['field_type']) && (in_array($field['field_type'], $acceptable_types))) {
$contactFields[$name] = $field;
}
}
Expand All @@ -397,7 +397,8 @@ public function setDefaultValues() {
}
}

if (CRM_Core_OptionGroup::getValue('activity_type', 'WalkList') == $this->_surveyDetails['activity_type_id']) {
$walkListActivityId = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'WalkList');
if ($walkListActivityId == $this->_surveyDetails['activity_type_id']) {
$defaults['order_bys']
= array(
1 => array(
Expand Down Expand Up @@ -480,7 +481,7 @@ public static function registerInterview($params) {

static $statusId;
if (!$statusId) {
$statusId = array_search('Completed', CRM_Core_PseudoConstant::activityStatus('name'));
$statusId = CRM_Core_PseudoConstant::getKey('CRM_Activity_DAO_Activity', 'activity_status_id', 'Completed');
}

//format custom fields.
Expand Down Expand Up @@ -580,11 +581,7 @@ public function getVoterIds() {
$this->_contactIds = $this->get('contactIds');
if (!is_array($this->_contactIds)) {
//get the survey activities.
$activityStatus = CRM_Core_PseudoConstant::activityStatus('name');
$statusIds = array();
if ($statusId = array_search('Scheduled', $activityStatus)) {
$statusIds[] = $statusId;
}
$statusIds[] = CRM_Core_PseudoConstant::getKey('CRM_Activity_DAO_Activity', 'activity_status_id', 'Scheduled');
$surveyActivities = CRM_Campaign_BAO_Survey::getSurveyVoterInfo($this->_surveyId,
$this->_interviewerId,
$statusIds
Expand Down
15 changes: 9 additions & 6 deletions CRM/Contact/BAO/Contact/Permission.php
Original file line number Diff line number Diff line change
Expand Up @@ -199,9 +199,12 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force
// that somebody might flush the cache away from under our feet,
// but the alternative would be a SQL call every time this is called,
// and a complete rebuild if the result was an empty set...
static $_processed = array(
CRM_Core_Permission::VIEW => array(),
CRM_Core_Permission::EDIT => array());
if (!isset(Civi::$statics[__CLASS__]['processed'])) {
Civi::$statics[__CLASS__]['processed'] = [
CRM_Core_Permission::VIEW => [],
CRM_Core_Permission::EDIT => [],
];
}

if ($type == CRM_Core_Permission::VIEW) {
$operationClause = " operation IN ( 'Edit', 'View' ) ";
Expand All @@ -215,7 +218,7 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force

if (!$force) {
// skip if already calculated
if (!empty($_processed[$type][$userID])) {
if (!empty(Civi::$statics[__CLASS__]['processed'][$type][$userID])) {
return;
}

Expand All @@ -228,7 +231,7 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force
";
$count = CRM_Core_DAO::singleValueQuery($sql, $queryParams);
if ($count > 0) {
$_processed[$type][$userID] = 1;
Civi::$statics[__CLASS__]['processed'][$type][$userID] = 1;
return;
}
}
Expand Down Expand Up @@ -257,7 +260,7 @@ public static function cache($userID, $type = CRM_Core_Permission::VIEW, $force
CRM_Core_DAO::executeQuery("INSERT INTO civicrm_acl_contact_cache ( user_id, contact_id, operation ) VALUES(%1, %1, '{$operation}')", $queryParams);
}
}
$_processed[$type][$userID] = 1;
Civi::$statics[__CLASS__]['processed'][$type][$userID] = 1;
}

/**
Expand Down
9 changes: 2 additions & 7 deletions CRM/Contact/Form/Edit/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,6 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin
$blockId = $addressBlockCount;
}

$config = CRM_Core_Config::singleton();
$countryDefault = $config->defaultContactCountry;

$form->applyFilter('__ALL__', 'trim');

$js = array();
Expand Down Expand Up @@ -93,7 +90,6 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin
$addressOptions = CRM_Core_BAO_Setting::valueOptions(CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'address_options', TRUE, NULL, TRUE
);
$attributes = CRM_Core_DAO::getAttribute('CRM_Core_DAO_Address');

$elements = array(
'address_name',
Expand All @@ -115,7 +111,7 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin
);

foreach ($elements as $name) {
//Remove id from name, to allow comparison against enabled addressOtions.
//Remove id from name, to allow comparison against enabled addressOptions.
$nameWithoutID = strpos($name, '_id') !== FALSE ? substr($name, 0, -3) : $name;
// Skip fields which are not enabled in the address options.
if (empty($addressOptions[$nameWithoutID])) {
Expand Down Expand Up @@ -204,8 +200,7 @@ public static function buildQuickForm(&$form, $addressBlockCount = NULL, $sharin
// more handling done in formRule func
CRM_Contact_Form_Edit_Address::storeRequiredCustomDataInfo($form, $groupTree);

$template = CRM_Core_Smarty::singleton();
$tplGroupTree = $template->get_template_vars('address_groupTree');
$tplGroupTree = CRM_Core_Smarty::singleton()->get_template_vars('address_groupTree');
$tplGroupTree = empty($tplGroupTree) ? array() : $tplGroupTree;

$form->assign('address_groupTree', $tplGroupTree + array($blockId => $groupTree));
Expand Down
2 changes: 1 addition & 1 deletion CRM/Contact/Form/Merge.php
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ public function buildQuickForm() {
'type' => 'next',
'name' => $this->next ? ts('Merge and go to Next Pair') : ts('Merge'),
'isDefault' => TRUE,
'icon' => $this->next ? 'circle-triangle-e' : 'check',
'icon' => $this->next ? 'fa-play-circle' : 'check',
);

if ($this->next || $this->prev) {
Expand Down
Loading

0 comments on commit b142919

Please sign in to comment.