Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve #110 Sync repo with CiviCRM-Drupal repo #115

Merged
merged 25 commits into from
Oct 12, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
4944ce3
Add Contributions relevant to the Participant record.
JohnFF Aug 10, 2017
c5d44d2
Civilint views components files
seamuslee001 Sep 16, 2017
3b35ef3
PHP 7.1 incompatibility error fix
Aug 31, 2018
a9a68f3
dev/core#381 - Clear session vars while retriving the files with id a…
Sep 11, 2018
a2cb42d
Make address Supplemental line 3 available to views
aydun Dec 4, 2018
0fc21eb
Update the civicrm_handler_field_file to be about non custom fields a…
seamuslee001 Feb 16, 2019
cc15447
Lint .inc files in Drupal module folder to match newer coder standard
seamuslee001 Apr 11, 2019
292a851
(NFC) Update for compliance with next phpcs standard
totten Apr 12, 2019
76bfbd4
Don't render an empty mailto link for empty email addresses
JKingsnorth Aug 17, 2018
9636a1c
Enable contribution views to filter on empty Receipt and Thank You dates
aydun Apr 11, 2019
dbd0ceb
CRM-20006 Standard groups relationships in views
seamuslee001 Dec 2, 2017
fe4aafa
Include new CiviCRM Group title field in filters
seamuslee001 Feb 10, 2018
9b5efe5
Update civicrmtheme module to use new isFrontEndPage function on user…
seamuslee001 Jul 25, 2019
7d7dbd4
set proper path for civicrm.settings.php when civicrm under profiles/…
sluc23 Dec 11, 2018
9a7fcb7
providing clear indication that module is deprecated.
jmcclelland Jul 26, 2019
12422a4
Add participant is_test field to views
magnolia61 Nov 22, 2019
1e53908
(dev/drupal#79) Fail more gracefully when upgrading on PHP 5.x
totten Aug 20, 2019
385fde8
Update unit tests to use name spaced format of phpunit test classes f…
seamuslee001 Dec 17, 2019
c04f23e
[NFC] Doc Block fix should be bool no boolean as per coding standards
seamuslee001 Jan 26, 2020
6eb1a2d
CIVICRM-984: Make "Add CiviCRM Tag to Contact" action list tags, not …
agileware-fj Oct 29, 2018
5fe2b1f
CIVICRM-984: Update indentation and spacing from feedback.
agileware-fj Nov 9, 2018
43c0040
CIVICRM-984: Satisfy Checkstyle CommaLastItem warnings.
agileware-fj Nov 11, 2018
f5948a0
change some drupals to backdrops that were missed
herbdool Mar 6, 2020
ddd653c
Update CiviCRM Module for the new views handlers
seamuslee001 Mar 13, 2020
5df8351
Updates as per comments from Herb
seamuslee001 Mar 14, 2020
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions civicrm.config.php.backdrop
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ function civicrm_conf_init() {
// to the script that invokes it
$moduleDir = 'sites' . DIRECTORY_SEPARATOR . 'all' . DIRECTORY_SEPARATOR . 'modules';
$contribDir = $moduleDir . DIRECTORY_SEPARATOR . 'contrib';
$profileDir = DIRECTORY_SEPARATOR . 'profiles' . DIRECTORY_SEPARATOR;
// check to see if this is under sites/all/modules/contrib or subdir civicrm-core
if (strpos($currentDir, $contribDir) !== FALSE || strpos($currentDir, 'civicrm-core') !== FALSE) {
$confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..';
Expand All @@ -66,6 +67,17 @@ function civicrm_conf_init() {
elseif (strpos($currentDir, $moduleDir) !== FALSE) {
$confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR . '..';
}
// check to see if this is under profiles/[PROFILE]/modules
elseif (strpos($currentDir, $profileDir) !== FALSE) {
// check to see if this is under profiles/[PROFILE]/modules/contrib
if (strpos($currentDir, "contrib") !== FALSE) {
$sublevels = 5;
}
else {
$sublevels = 4;
}
$confdir = $currentDir . str_repeat('..' . DIRECTORY_SEPARATOR, $sublevels) . 'sites';
}
else {
$confdir = $currentDir . '..' . DIRECTORY_SEPARATOR . '..' . DIRECTORY_SEPARATOR;
}
Expand Down
22 changes: 13 additions & 9 deletions civicrm.module
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ define('CIVICRM_UF_HEAD', TRUE);
* on PHP 5.x.)
*
* @see CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER
* @see CiviDrupal\PhpVersionTest::testConstantMatch()
* @see CiviBackdrop\PhpVersionTest::testConstantMatch()
*/
define('CIVICRM_DRUPAL_PHP_MINIMUM', '7.1.0');
define('CIVICRM_BACKDROP_PHP_MINIMUM', '7.1.0');

/**
* Adds CiviCRM CSS and JS resources into the header.
Expand Down Expand Up @@ -163,7 +163,7 @@ function civicrm_menu_alter(&$items) {
* Display profile form in tabs on user account
*/
function civicrm_profile_form($form, &$form_state, $account, $profile_name) {
$output = civicrm_form_data($account, $profile_name, TRUE);
$output = civicrm_form_data($form, $account, $profile_name, TRUE);
if (!empty($output)) {
$form['#attributes']['enctype'] = 'multipart/form-data';
$form = array_merge($form, $output);
Expand Down Expand Up @@ -229,8 +229,8 @@ function civicrm_profile_form_validate($form, &$form_state) {
*/
function civicrm_initialize() {
// Check for php version and ensure its greater than minPhpVersion
if (version_compare(PHP_VERSION, CIVICRM_DRUPAL_PHP_MINIMUM) < 0) {
echo "CiviCRM requires PHP " . CIVICRM_DRUPAL_PHP_MINIMUM . "+. The web server is running PHP " . PHP_VERSION . ".<p>";
if (version_compare(PHP_VERSION, CIVICRM_BACKDROP_PHP_MINIMUM) < 0) {
echo "CiviCRM requires PHP " . CIVICRM_BACKDROP_PHP_MINIMUM . "+. The web server is running PHP " . PHP_VERSION . ".<p>";
exit();
}
_civicrm_registerClassLoader();
Expand Down Expand Up @@ -601,7 +601,7 @@ function civicrm_user_form_validate($form, &$form_state) {
// lets suppress key generation for all validation also
civicrm_key_disable();

static $validated = FALSE;
$validated = &backdrop_static(__FUNCTION__, FALSE);

if ($validated) {
return;
Expand Down Expand Up @@ -638,7 +638,7 @@ function civicrm_user_form_validate($form, &$form_state) {
*
* @return array $output
*/
function civicrm_form_data($account, $profile, $reset, $doNotProcess = FALSE) {
function civicrm_form_data($edit, $account, $profile, $reset, $doNotProcess = FALSE) {
// lets suppress key generation for all CMS forms
civicrm_key_disable();

Expand Down Expand Up @@ -667,10 +667,10 @@ function civicrm_form_data($account, $profile, $reset, $doNotProcess = FALSE) {
// do not allow edit for anon users in joomla frontend, CRM-4668, unless u have checksum CRM-5228
$config = CRM_Core_Config::singleton();
if ($config->userFrameworkFrontend) {
CRM_Contact_BAO_Contact_Permission::validateOnlyChecksum($userID, $this);
CRM_Contact_BAO_Contact_Permission::validateOnlyChecksum($userID, $edit);
herbdool marked this conversation as resolved.
Show resolved Hide resolved
}
else {
CRM_Contact_BAO_Contact_Permission::validateChecksumContact($userID, $this);
CRM_Contact_BAO_Contact_Permission::validateChecksumContact($userID, $edit);
}
}
$ctype = CRM_Core_DAO::getFieldValue('CRM_Contact_DAO_Contact', $userID, 'contact_type');
Expand Down Expand Up @@ -873,6 +873,7 @@ function civicrm_autoload_info() {
'civicrm_handler_filter_datetime' => 'modules/views/civicrm/civicrm_handler_filter_datetime.inc',
'civicrm_handler_filter_domain' => 'modules/views/civicrm/civicrm_handler_filter_domain.inc',
'civicrm_handler_filter_encounter_medium' => 'modules/views/civicrm/civicrm_handler_filter_encounter_medium.inc',
'civicrm_handler_filter_group_name' => 'modules/views/civicrm/civicrm_handler_filter_group_name.inc',
'civicrm_handler_filter_group_status' => 'modules/views/civicrm/civicrm_handler_filter_group_status.inc',
'civicrm_handler_filter_option' => 'modules/views/civicrm/civicrm_handler_filter_option.inc',
'civicrm_handler_filter_pseudo_constant' => 'modules/views/civicrm/civicrm_handler_filter_pseudo_constant.inc',
Expand All @@ -884,6 +885,9 @@ function civicrm_autoload_info() {
'civicrm_handler_relationship' => 'modules/views/civicrm/civicrm_handler_relationship.inc',
'civicrm_handler_relationship_address' => 'modules/views/civicrm/civicrm_handler_relationship_address.inc',
'civicrm_handler_relationship_contact2users' => 'modules/views/civicrm/civicrm_handler_relationship_contact2users.inc',
'civicrm_handler_relationship_group' => 'modules/views/civicrm/civicrm_handler_relationship_group.inc',
'civicrm_handler_relationship_standard_group' => 'modules/views/civicrm/civicrm_handler_relationship_standard_group.inc',
'civicrm_handler_relationship_standard_group_contact' => 'modules/views/civicrm/civicrm_handler_relationship_standard_group_contact.inc',
'civicrm_handler_relationship_im' => 'modules/views/civicrm/civicrm_handler_relationship_im.inc',
'civicrm_handler_relationship_location' => 'modules/views/civicrm/civicrm_handler_relationship_location.inc',
'civicrm_handler_relationship_mail' => 'modules/views/civicrm/civicrm_handler_relationship_mail.inc',
Expand Down
4 changes: 2 additions & 2 deletions drush/civicrm.drush.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1426,10 +1426,10 @@ function _civicrm_init($fail = TRUE, $load_config = TRUE) {
return $init;
}

if (!version_compare(phpversion(), CIVICRM_DRUPAL_PHP_MINIMUM, '>=')) {
if (!version_compare(phpversion(), CIVICRM_BACKDROP_PHP_MINIMUM, '>=')) {
return drush_set_error('CIVICRM_PHP_MINIMUM', dt('CiviCRM requires PHP @required+. Drush is running PHP @current.', [
'@current' => phpversion(),
'@required' => CIVICRM_DRUPAL_PHP_MINIMUM,
'@required' => CIVICRM_BACKDROP_PHP_MINIMUM,
]));
}

Expand Down
12 changes: 6 additions & 6 deletions modules/civicrm_engage/Engage/Report/Form/List.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,39 +36,39 @@ class Engage_Report_Form_List extends CRM_Report_Form {

/**
* Address information needed in output
* @var boolean
* @var bool
*/
protected $_addressField = FALSE;

/**
* Email address needed in output
* @var boolean
* @var bool
*/
protected $_emailField = FALSE;

/**
* Demographic information needed in output
* @var boolean
* @var bool
*/
protected $_demoField = FALSE;

protected $_coreField = FALSE;

/**
* Phone number needed in output
* @var boolean
* @var bool
*/
protected $_phoneField = FALSE;

/**
* Group membership information needed in output
* @var boolean
* @var bool
*/
protected $_groupField = FALSE;

/**
* Voter Info information needed in output
* @var boolean
* @var bool
*/
protected $_voterInfoField = FALSE;

Expand Down
2 changes: 1 addition & 1 deletion modules/civicrm_engage/civicrm_engage.info
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
name = CiviEngage
description = Walklist and Phone-banking support for CiviCRM.
description = DEPRECATED Walklist and Phone-banking support for CiviCRM. This module will not be ported to Drupal 8. Please see: https://civicrm.org/blog/jamie/civicrmengage-is-dead-long-live-civicrmengage
version = 1.x-4.7
backdrop = 1.x
type = module
Expand Down
21 changes: 21 additions & 0 deletions modules/civicrm_rules/civicrm_rules.contact-eval.inc
Original file line number Diff line number Diff line change
Expand Up @@ -130,3 +130,24 @@ function civicrm_rules_options_list() {
$settings['groups'] = _civicrm_get_groups();
return $settings;
}

/**
* Options list callback for listing of CiviCRM Tags
*/
function civicrm_rules_tags_list() {
if (!civicrm_initialize()) {
return array();
}
$result = civicrm_api3('tag', 'get', array(
'used_for' => 'civicrm_contact',
'options' => array(
'limit' => 0,
'sort' => 'name ASC',
),
));
$values = array();
foreach ($result['values'] as $tag) {
$values[$tag['id']] = $tag['name'];
}
return $values;
}
2 changes: 1 addition & 1 deletion modules/civicrm_rules/civicrm_rules_action.inc
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ The content of the email is:
'civicrm_tags' => array(
'type' => 'list<integer>',
'label' => t('CiviCRM Tags'),
'options list' => 'civicrm_rules_options_list',
'options list' => 'civicrm_rules_tags_list',
),
),
'group' => t('CiviCRM Contact'),
Expand Down
9 changes: 1 addition & 8 deletions modules/civicrmtheme/civicrmtheme.module
Original file line number Diff line number Diff line change
Expand Up @@ -137,17 +137,10 @@ function civicrmtheme_custom_theme() {
return;
}

// Get the menu items.
$args = explode('?', $_GET['q']);
$path = $args[0];

// Get the menu for above URL.
$item = CRM_Core_Menu::get($path);

// Check for public pages
// If public page and civicrm public theme is set, apply civicrm public theme
// If user does not have access to CiviCRM use the public page for the error message
if (!user_access('access CiviCRM') || CRM_Utils_Array::value('is_public', $item)) {
if (!user_access('access CiviCRM') || CRM_Core_Config::singleton()->userSystem->isFrontEndPage()) {
if ($public_theme) {
return $public_theme;
}
Expand Down
13 changes: 13 additions & 0 deletions modules/views/civicrm.views.inc
Original file line number Diff line number Diff line change
Expand Up @@ -368,6 +368,19 @@ function civicrm_views_custom_data_cache(&$data, $entity_type, $group_id, $sub_t
'field' => 'entity_id',
);
}

// Expose group custom data to group relationship.
if ($join_table == 'civicrm_group') {
$data[$current_group['table_name']]['table']['join']['civicrm_group'] = array(
'left_field' => 'id',
'field' => 'entity_id',
);
$data[$current_group['table_name']]['table']['join']['civicrm_group_contact'] = array(
'left_table' => $join_table,
'left_field' => 'id',
'field' => 'entity_id',
);
}
}

foreach ($current_group['fields'] as $key => $current_field) {
Expand Down
2 changes: 1 addition & 1 deletion modules/views/civicrm/civicrm_handler_field_activity.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
class civicrm_handler_field_activity extends civicrm_handler_field {

static $_recordType;
public static $_recordType;

public function construct() {
parent::construct();
Expand Down
4 changes: 2 additions & 2 deletions modules/views/civicrm/civicrm_handler_field_country.inc
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,8 @@
*/
class civicrm_handler_field_country extends civicrm_handler_field_address {

static $_countries;
static $_countries_full;
public static $_countries;
public static $_countries_full;

public function construct() {
parent::construct();
Expand Down
2 changes: 1 addition & 1 deletion modules/views/civicrm/civicrm_handler_field_county.inc
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
*/
class civicrm_handler_field_county extends civicrm_handler_field_address {

static $_counties;
public static $_counties;

public function construct() {
parent::construct();
Expand Down
2 changes: 1 addition & 1 deletion modules/views/civicrm/civicrm_handler_field_email.inc
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ class civicrm_handler_field_email extends civicrm_handler_field_location {
}

public function render($values) {
if ($this->options['link_to_user'] == 'mailto') {
if ($this->options['link_to_user'] == 'mailto' && !empty($values->{$this->field_alias})) {
return l($values->{$this->field_alias}, "mailto:" . $values->{$this->field_alias});
}
return check_plain($values->{$this->field_alias});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
class civicrm_handler_field_encounter_medium extends views_handler_field {

static $_encounter_medium;
public static $_encounter_medium;

public function construct() {
parent::construct();
Expand Down
5 changes: 5 additions & 0 deletions modules/views/civicrm/civicrm_handler_field_file.inc
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,11 @@ class civicrm_handler_field_file extends views_handler_field {

$path = sprintf('%s/imagefile', $path);
}
//Reset session params as we send only id and eid to retrieve the file.
$file = new CRM_Core_Page_File();
$file->set('filename', NULL);
$file->set('mime-type', NULL);

$fileHash = CRM_Core_BAO_File::generateFileHash($value, $fileId);
return CRM_Utils_System::url($path,
"id={$fileId}&eid={$value}&fcs={$fileHash}",
Expand Down
2 changes: 1 addition & 1 deletion modules/views/civicrm/civicrm_handler_field_option.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
class civicrm_handler_field_option extends civicrm_handler_field {

static $_options;
public static $_options;

public function render($values) {
$this->initialize();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
*/
class civicrm_handler_field_relationship_type extends views_handler_field {

static $_relationshipType;
public static $_relationshipType;

public function construct() {
parent::construct();
Expand Down
4 changes: 2 additions & 2 deletions modules/views/civicrm/civicrm_handler_field_state.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,8 @@
*/
class civicrm_handler_field_state extends civicrm_handler_field_address {

static $_states;
static $_states_full;
public static $_states;
public static $_states_full;

public function construct() {
parent::construct();
Expand Down
2 changes: 1 addition & 1 deletion modules/views/civicrm/civicrm_handler_field_website.inc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
*/
class civicrm_handler_field_website extends civicrm_handler_field {

static $_websiteType;
public static $_websiteType;

public function construct() {
parent::construct();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
*/
class civicrm_handler_filter_encounter_medium extends views_handler_filter_in_operator {

static $_encounter_medium;
public static $_encounter_medium;

public function construct() {
parent::construct();
Expand Down
Loading