Skip to content
Snippets Groups Projects
Verified Commit 6d970d9d authored by Kevin Cristiano's avatar Kevin Cristiano :earth_americas:
Browse files

civicrm release 5.47.0

parent 104bea16
No related branches found
No related tags found
No related merge requests found
Showing
with 311 additions and 188 deletions
...@@ -5,7 +5,7 @@ This is the development repository for the *CiviCRM* plugin for *WordPress*. Wha ...@@ -5,7 +5,7 @@ This is the development repository for the *CiviCRM* plugin for *WordPress*. Wha
[https://civicrm.org/download](https://civicrm.org/download) [https://civicrm.org/download](https://civicrm.org/download)
### Contribute ### ### Contribute
If you want to contribute to the development of this plugin, please bear the following in mind: If you want to contribute to the development of this plugin, please bear the following in mind:
...@@ -14,7 +14,17 @@ If you want to contribute to the development of this plugin, please bear the fol ...@@ -14,7 +14,17 @@ If you want to contribute to the development of this plugin, please bear the fol
---- ----
### About CiviCRM ### ### WordPress REST API integration
Please refer to the [REST API Documentation](/wp-rest/README.md) for details.
### WP-CLI integration
Please refer to the [WP-CLI Documentation](/wp-cli/README.md) for details.
----
### About CiviCRM
CiviCRM is web-based, open source, Constituent Relationship Management (CRM) software geared toward meeting the needs of non-profit and other civic-sector organizations. CiviCRM is web-based, open source, Constituent Relationship Management (CRM) software geared toward meeting the needs of non-profit and other civic-sector organizations.
......
...@@ -2,7 +2,7 @@ ...@@ -2,7 +2,7 @@
/** /**
* Plugin Name: CiviCRM * Plugin Name: CiviCRM
* Description: CiviCRM - Growing and Sustaining Relationships * Description: CiviCRM - Growing and Sustaining Relationships
* Version: 5.46.2 * Version: 5.47.0
* Requires at least: 4.9 * Requires at least: 4.9
* Requires PHP: 7.2 * Requires PHP: 7.2
* Author: CiviCRM LLC * Author: CiviCRM LLC
...@@ -30,31 +30,13 @@ ...@@ -30,31 +30,13 @@
* *
*/ */
/*
* -----------------------------------------------------------------------------
* WordPress resources for developers
* -----------------------------------------------------------------------------
* Not that they're ever adhered to anywhere other than core, but people do their
* best to comply...
*
* WordPress core coding standards:
* https://developer.wordpress.org/coding-standards/wordpress-coding-standards/php/
*
* WordPress HTML standards:
* https://make.wordpress.org/core/handbook/best-practices/coding-standards/html/
*
* WordPress JavaScript standards:
* https://developer.wordpress.org/coding-standards/wordpress-coding-standards/javascript/
* -----------------------------------------------------------------------------
*/
// This file must not accessed directly. // This file must not accessed directly.
if (!defined('ABSPATH')) { if (!defined('ABSPATH')) {
exit; exit;
} }
// Set version here: when it changes, will force Javascript & CSS to reload. // Set version here: changing it forces Javascript and CSS to reload.
define('CIVICRM_PLUGIN_VERSION', '5.46.2'); define('CIVICRM_PLUGIN_VERSION', '5.47.0');
// Store reference to this file. // Store reference to this file.
if (!defined('CIVICRM_PLUGIN_FILE')) { if (!defined('CIVICRM_PLUGIN_FILE')) {
...@@ -71,24 +53,26 @@ if (!defined('CIVICRM_PLUGIN_DIR')) { ...@@ -71,24 +53,26 @@ if (!defined('CIVICRM_PLUGIN_DIR')) {
define('CIVICRM_PLUGIN_DIR', plugin_dir_path(CIVICRM_PLUGIN_FILE)); define('CIVICRM_PLUGIN_DIR', plugin_dir_path(CIVICRM_PLUGIN_FILE));
} }
/*
* Minimum required PHP.
*
* Note: This duplicates `CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER`.
* The duplication helps avoid dependency issues. (Reading
* `CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER` requires loading
* `civicrm.settings.php`, but that triggers a parse-error on PHP 5.x.)
*
* @see CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER
* @see CiviWP\PhpVersionTest::testConstantMatch()
*/
if (!defined('CIVICRM_WP_PHP_MINIMUM')) { if (!defined('CIVICRM_WP_PHP_MINIMUM')) {
/**
* Minimum required PHP.
*
* Note: This duplicates `CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER`.
* The duplication helps avoid dependency issues. (Reading
* `CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER` requires loading
* `civicrm.settings.php`, but that triggers a parse-error on PHP 5.x.)
*
* @see CRM_Upgrade_Incremental_General::MIN_INSTALL_PHP_VER
* @see CiviWP\PhpVersionTest::testConstantMatch()
*/
define('CIVICRM_WP_PHP_MINIMUM', '7.2.0'); define('CIVICRM_WP_PHP_MINIMUM', '7.2.0');
} }
/* /*
* The constant `CIVICRM_SETTINGS_PATH` is also defined in `civicrm.config.php` * The constant `CIVICRM_SETTINGS_PATH` is also defined in `civicrm.config.php`
* and may already have been defined there - e.g. by cron or external scripts. * and may already have been defined there - e.g. by cron or external scripts.
* These legacy routes should not be used because they try to bootstrap WordPress
* in unreliable ways. Use WP-CLI or WP-REST routes instead.
*/ */
if (!defined('CIVICRM_SETTINGS_PATH')) { if (!defined('CIVICRM_SETTINGS_PATH')) {
...@@ -98,14 +82,13 @@ if (!defined('CIVICRM_SETTINGS_PATH')) { ...@@ -98,14 +82,13 @@ if (!defined('CIVICRM_SETTINGS_PATH')) {
* If the settings file is found in the 4.6 and prior location, use that as * If the settings file is found in the 4.6 and prior location, use that as
* `CIVICRM_SETTINGS_PATH`, otherwise use the new location. * `CIVICRM_SETTINGS_PATH`, otherwise use the new location.
*/ */
$upload_dir = wp_upload_dir(); $wp_civi_settings_deprecated = CIVICRM_PLUGIN_DIR . 'civicrm.settings.php';
$wp_civi_settings = $upload_dir['basedir'] . DIRECTORY_SEPARATOR . 'civicrm' . DIRECTORY_SEPARATOR . 'civicrm.settings.php'; if (file_exists($wp_civi_settings_deprecated)) {
$wp_civi_settings_deprectated = CIVICRM_PLUGIN_DIR . 'civicrm.settings.php'; define('CIVICRM_SETTINGS_PATH', $wp_civi_settings_deprecated);
if (file_exists($wp_civi_settings_deprectated)) {
define('CIVICRM_SETTINGS_PATH', $wp_civi_settings_deprectated);
} }
else { else {
$upload_dir = wp_upload_dir();
$wp_civi_settings = implode(DIRECTORY_SEPARATOR, [$upload_dir['basedir'], 'civicrm', 'civicrm.settings.php']);
define('CIVICRM_SETTINGS_PATH', $wp_civi_settings); define('CIVICRM_SETTINGS_PATH', $wp_civi_settings);
} }
...@@ -184,7 +167,7 @@ class CiviCRM_For_WordPress { ...@@ -184,7 +167,7 @@ class CiviCRM_For_WordPress {
/** /**
* @var object * @var object
* Basepage management object. * Base Page management object.
* @since 4.4 * @since 4.4
* @access public * @access public
*/ */
...@@ -234,6 +217,17 @@ class CiviCRM_For_WordPress { ...@@ -234,6 +217,17 @@ class CiviCRM_For_WordPress {
// Create instance. // Create instance.
self::$instance = new CiviCRM_For_WordPress(); self::$instance = new CiviCRM_For_WordPress();
// Include legacy global scope functions.
include_once CIVICRM_PLUGIN_DIR . 'includes/civicrm.functions.php';
/*
* Incorporate WP-CLI Integration based on drush CiviCRM functionality.
* @see https://github.com/andy-walker/wp-cli-civicrm
*/
if (defined('WP_CLI') && WP_CLI) {
include_once CIVICRM_PLUGIN_DIR . 'wp-cli/civicrm.php';
}
// Delay setup until 'plugins_loaded' to allow other plugins to load as well. // Delay setup until 'plugins_loaded' to allow other plugins to load as well.
add_action('plugins_loaded', [self::$instance, 'setup_instance']); add_action('plugins_loaded', [self::$instance, 'setup_instance']);
...@@ -272,9 +266,13 @@ class CiviCRM_For_WordPress { ...@@ -272,9 +266,13 @@ class CiviCRM_For_WordPress {
/** /**
* Plugin activation. * Plugin activation.
* *
* This method is called only when CiviCRM plugin is activated. In order for * This method is called only when CiviCRM plugin is activated. Other plugins
* other plugins to be able to interact with CiviCRM's activation, we wait until * are able to interact with CiviCRM's activation because "plugins_loaded" has
* after the activation redirect to perform activation actions. * already fired.
*
* Since CiviCRM has an Installer UI when activated via the WordPress Plugins
* screen, this method sets an option that can be read on the next page load
* allowing `self::activation()` to redirect to it when possible.
* *
* @since 4.4 * @since 4.4
*/ */
...@@ -283,10 +281,25 @@ class CiviCRM_For_WordPress { ...@@ -283,10 +281,25 @@ class CiviCRM_For_WordPress {
// Set a one-time-only option. // Set a one-time-only option.
add_option('civicrm_activation_in_progress', 'true'); add_option('civicrm_activation_in_progress', 'true');
// Include and init classes because "plugins_loaded" has already fired.
include_once CIVICRM_PLUGIN_DIR . 'includes/civicrm.users.php';
$this->users = new CiviCRM_For_WordPress_Users();
/**
* Broadcast that the CiviCRM plugin has been activated.
*
* Used internally by:
*
* - CiviCRM_For_WordPress_Users::activate()
*
* @since 5.44
*/
do_action('civicrm_activate');
} }
/** /**
* Run CiviCRM's plugin activation procedure. * Runs the CiviCRM activation procedure when activated via the WordPress UI.
* *
* @since 4.4 * @since 4.4
*/ */
...@@ -303,7 +316,10 @@ class CiviCRM_For_WordPress { ...@@ -303,7 +316,10 @@ class CiviCRM_For_WordPress {
} }
/** /**
* Broadcast that activation actions need to happen now. * Broadcast that activation via the WordPress UI has happened.
*
* This fires on the admin page load that happens directly after the CiviCRM
* plugin has been activated via the WordPress UI.
* *
* @since 5.6 * @since 5.6
*/ */
...@@ -312,11 +328,12 @@ class CiviCRM_For_WordPress { ...@@ -312,11 +328,12 @@ class CiviCRM_For_WordPress {
// Change option so this action never fires again. // Change option so this action never fires again.
update_option('civicrm_activation_in_progress', 'false'); update_option('civicrm_activation_in_progress', 'false');
// Try and redirect to the Installer page. // When installed via the WordPress UI, try and redirect to the Installer page.
if (!is_multisite() && !isset($_GET['activate-multi']) && !CIVICRM_INSTALLED) { if (!is_multisite() && !isset($_GET['activate-multi']) && !CIVICRM_INSTALLED) {
wp_redirect(admin_url('admin.php?page=civicrm-install')); wp_redirect(admin_url('admin.php?page=civicrm-install'));
exit; exit;
} }
} }
/** /**
...@@ -336,6 +353,10 @@ class CiviCRM_For_WordPress { ...@@ -336,6 +353,10 @@ class CiviCRM_For_WordPress {
/** /**
* Broadcast that deactivation actions need to happen now. * Broadcast that deactivation actions need to happen now.
* *
* Used internally by:
*
* - CiviCRM_For_WordPress_Users::deactivate()
*
* @since 5.6 * @since 5.6
*/ */
do_action('civicrm_deactivation'); do_action('civicrm_deactivation');
...@@ -377,7 +398,7 @@ class CiviCRM_For_WordPress { ...@@ -377,7 +398,7 @@ class CiviCRM_For_WordPress {
$this->include_files(); $this->include_files();
$this->setup_objects(); $this->setup_objects();
// Do plugin activation. // Do plugin activation when activated via the WordPress UI.
$this->activation(); $this->activation();
// Use translation files. // Use translation files.
...@@ -389,6 +410,10 @@ class CiviCRM_For_WordPress { ...@@ -389,6 +410,10 @@ class CiviCRM_For_WordPress {
/** /**
* Broadcast that this plugin is now loaded. * Broadcast that this plugin is now loaded.
* *
* Used internally by:
*
* - CiviCRM_For_WordPress_Basepage::maybe_create_basepage()
*
* @since 4.4 * @since 4.4
*/ */
do_action('civicrm_instance_loaded'); do_action('civicrm_instance_loaded');
...@@ -514,11 +539,11 @@ class CiviCRM_For_WordPress { ...@@ -514,11 +539,11 @@ class CiviCRM_For_WordPress {
* Setter for determining if CiviCRM is currently being displayed in WordPress. * Setter for determining if CiviCRM is currently being displayed in WordPress.
* This becomes true whe CiviCRM is called in the following contexts: * This becomes true whe CiviCRM is called in the following contexts:
* *
* (a) in the WordPress back-end * (a) In the WordPress back-end.
* (b) when CiviCRM content is being displayed on the front-end via wpBasePage * (b) When CiviCRM content is being displayed on the front-end via the Base Page.
* (c) when an AJAX request is made to CiviCRM * (c) When an AJAX request is made to CiviCRM.
* *
* It is NOT true when CiviCRM is called via a shortcode. * It is NOT true when CiviCRM is called via a Shortcode.
* *
* @since 4.4 * @since 4.4
*/ */
...@@ -549,7 +574,6 @@ class CiviCRM_For_WordPress { ...@@ -549,7 +574,6 @@ class CiviCRM_For_WordPress {
* @since 4.4 * @since 4.4
* *
* @param bool $in_wordpress True if CiviCRM is displayed in WordPress, false otherwise. * @param bool $in_wordpress True if CiviCRM is displayed in WordPress, false otherwise.
* @return bool $in_wordpress True if CiviCRM is displayed in WordPress, false otherwise.
*/ */
return apply_filters('civicrm_in_wordpress', self::$in_wordpress); return apply_filters('civicrm_in_wordpress', self::$in_wordpress);
...@@ -561,10 +585,10 @@ class CiviCRM_For_WordPress { ...@@ -561,10 +585,10 @@ class CiviCRM_For_WordPress {
* Setter for determining how CiviCRM is currently being displayed in WordPress. * Setter for determining how CiviCRM is currently being displayed in WordPress.
* This can be one of the following contexts: * This can be one of the following contexts:
* *
* (a) in the WordPress back-end * (a) In the WordPress back-end.
* (b) when CiviCRM content is being displayed on the front-end via wpBasePage * (b) When CiviCRM content is being displayed on the front-end via the Base Page.
* (c) when a "non-page" request is made to CiviCRM * (c) When a "non-page" request is made to CiviCRM.
* (d) when CiviCRM is called via a shortcode * (d) When CiviCRM is called via a Shortcode.
* *
* The following codes correspond to the different contexts: * The following codes correspond to the different contexts:
* *
...@@ -600,10 +624,13 @@ class CiviCRM_For_WordPress { ...@@ -600,10 +624,13 @@ class CiviCRM_For_WordPress {
/** /**
* Allow specific context to be filtered. * Allow specific context to be filtered.
* *
* Used internally by:
*
* - CiviCRM_For_WordPress_Shortcodes::get_context()
*
* @since 4.4 * @since 4.4
* *
* @param bool $context The existing context in which CiviCRM is displayed in WordPress. * @param bool $context The existing context in which CiviCRM is displayed in WordPress.
* @return bool $context The modified context in which CiviCRM is displayed in WordPress.
*/ */
return apply_filters('civicrm_context', self::$context); return apply_filters('civicrm_context', self::$context);
...@@ -632,7 +659,7 @@ class CiviCRM_For_WordPress { ...@@ -632,7 +659,7 @@ class CiviCRM_For_WordPress {
// Handle WordPress Admin context. // Handle WordPress Admin context.
$this->admin->register_hooks(); $this->admin->register_hooks();
// Enable shortcode modal. // Enable Shortcode modal.
$this->modal->register_hooks(); $this->modal->register_hooks();
return; return;
...@@ -813,7 +840,7 @@ class CiviCRM_For_WordPress { ...@@ -813,7 +840,7 @@ class CiviCRM_For_WordPress {
// Get config. // Get config.
$config = CRM_Core_Config::singleton(); $config = CRM_Core_Config::singleton();
// Get basepage object. // Get Base Page object.
$basepage = get_page_by_path($config->wpBasePage); $basepage = get_page_by_path($config->wpBasePage);
// Sanity check. // Sanity check.
...@@ -821,7 +848,7 @@ class CiviCRM_For_WordPress { ...@@ -821,7 +848,7 @@ class CiviCRM_For_WordPress {
return; return;
} }
// Let's add rewrite rule when viewing the basepage. // Let's add Rewrite Rule when viewing the Base Page.
add_rewrite_rule( add_rewrite_rule(
'^' . $config->wpBasePage . '/([^?]*)?', '^' . $config->wpBasePage . '/([^?]*)?',
'index.php?page_id=' . $basepage->ID . '&civiwp=CiviCRM&q=civicrm%2F$matches[1]', 'index.php?page_id=' . $basepage->ID . '&civiwp=CiviCRM&q=civicrm%2F$matches[1]',
...@@ -836,11 +863,15 @@ class CiviCRM_For_WordPress { ...@@ -836,11 +863,15 @@ class CiviCRM_For_WordPress {
/** /**
* Broadcast the rewrite rules event. * Broadcast the rewrite rules event.
* *
* Used internally by:
*
* - CiviCRM_For_WordPress_Compat::rewrite_rules_polylang()
*
* @since 5.7 * @since 5.7
* @since 5.24 Added $basepage parameter. * @since 5.24 Added $basepage parameter.
* *
* @param bool $flush_rewrite_rules True if rules flushed, false otherwise. * @param bool $flush_rewrite_rules True if rules flushed, false otherwise.
* @param WP_Post $basepage The Basepage post object. * @param WP_Post $basepage The Base Page post object.
*/ */
do_action('civicrm_after_rewrite_rules', $flush_rewrite_rules, $basepage); do_action('civicrm_after_rewrite_rules', $flush_rewrite_rules, $basepage);
...@@ -879,7 +910,6 @@ class CiviCRM_For_WordPress { ...@@ -879,7 +910,6 @@ class CiviCRM_For_WordPress {
* @since 5.7 * @since 5.7
* *
* @param array $civicrm_query_vars The default set of query vars. * @param array $civicrm_query_vars The default set of query vars.
* @return array $civicrm_query_vars The modified set of query vars.
*/ */
$civicrm_query_vars = apply_filters('civicrm_query_vars', $civicrm_query_vars); $civicrm_query_vars = apply_filters('civicrm_query_vars', $civicrm_query_vars);
...@@ -1390,7 +1420,7 @@ class CiviCRM_For_WordPress { ...@@ -1390,7 +1420,7 @@ class CiviCRM_For_WordPress {
* Get base URL. * Get base URL.
* *
* Clone of CRM_Utils_System_WordPress::getBaseUrl() whose access is set to * Clone of CRM_Utils_System_WordPress::getBaseUrl() whose access is set to
* private. Until it is public, we cannot access the URL of the basepage since * private. Until it is public, we cannot access the URL of the Base Page since
* CRM_Utils_System_WordPress::url(). * CRM_Utils_System_WordPress::url().
* *
* 27-09-2016 * 27-09-2016
...@@ -1466,19 +1496,3 @@ register_deactivation_hook(CIVICRM_PLUGIN_FILE, [civi_wp(), 'deactivate']); ...@@ -1466,19 +1496,3 @@ register_deactivation_hook(CIVICRM_PLUGIN_FILE, [civi_wp(), 'deactivate']);
* *
* @see https://developer.wordpress.org/reference/functions/register_uninstall_hook/ * @see https://developer.wordpress.org/reference/functions/register_uninstall_hook/
*/ */
// Include legacy global scope functions.
include_once CIVICRM_PLUGIN_DIR . 'includes/civicrm.functions.php';
/**
* Incorporate WP-CLI Integration.
*
* Based on drush CiviCRM functionality, work done by Andy Walker.
* https://github.com/andy-walker/wp-cli-civicrm
*
* @since 4.5
*/
if (defined('WP_CLI') && WP_CLI) {
// Changed from __DIR__ because of possible symlink issues.
include_once CIVICRM_PLUGIN_DIR . 'wp-cli/civicrm.php';
}
...@@ -33,7 +33,7 @@ class CRM_ACL_API { ...@@ -33,7 +33,7 @@ class CRM_ACL_API {
* *
* @param string $str * @param string $str
* The permission to check. * The permission to check.
* @param int $contactID * @param int|null $contactID
* The contactID for whom the check is made. * The contactID for whom the check is made.
* *
* @return bool * @return bool
...@@ -64,7 +64,7 @@ class CRM_ACL_API { ...@@ -64,7 +64,7 @@ class CRM_ACL_API {
* (reference ) add the tables that are needed for the select clause. * (reference ) add the tables that are needed for the select clause.
* @param array $whereTables * @param array $whereTables
* (reference ) add the tables that are needed for the where clause. * (reference ) add the tables that are needed for the where clause.
* @param int $contactID * @param int|null $contactID
* The contactID for whom the check is made. * The contactID for whom the check is made.
* @param bool $onlyDeleted * @param bool $onlyDeleted
* Whether to include only deleted contacts. * Whether to include only deleted contacts.
...@@ -135,12 +135,12 @@ class CRM_ACL_API { ...@@ -135,12 +135,12 @@ class CRM_ACL_API {
* *
* @param int $type * @param int $type
* The type of permission needed. * The type of permission needed.
* @param int $contactID * @param int|null $contactID
* The contactID for whom the check is made. * The contactID for whom the check is made.
* *
* @param string $tableName * @param string $tableName
* @param null $allGroups * @param array|null $allGroups
* @param null $includedGroups * @param array|null $includedGroups
* *
* @return array * @return array
* the ids of the groups for which the user has permissions * the ids of the groups for which the user has permissions
...@@ -165,11 +165,11 @@ class CRM_ACL_API { ...@@ -165,11 +165,11 @@ class CRM_ACL_API {
* @param int $type * @param int $type
* The type of permission needed. * The type of permission needed.
* @param int $groupID * @param int $groupID
* @param int $contactID * @param int|null $contactID
* The contactID for whom the check is made. * The contactID for whom the check is made.
* @param string $tableName * @param string $tableName
* @param null $allGroups * @param array|null $allGroups
* @param null $includedGroups * @param array|null $includedGroups
* *
* @return bool * @return bool
*/ */
......
...@@ -83,7 +83,7 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL implements \Civi\Test\HookInterfac ...@@ -83,7 +83,7 @@ class CRM_ACL_BAO_ACL extends CRM_ACL_DAO_ACL implements \Civi\Test\HookInterfac
/** /**
* Get all ACLs owned by a given contact, including domain and group-level. * Get all ACLs owned by a given contact, including domain and group-level.
* *
* @param int|null $contact_id * @param int $contact_id
* The contact ID. * The contact ID.
* *
* @return array * @return array
...@@ -185,7 +185,7 @@ SELECT acl.* ...@@ -185,7 +185,7 @@ SELECT acl.*
} }
/** /**
* @param $str * @param string $str
* @param int $contactID * @param int $contactID
* *
* @return bool * @return bool
...@@ -219,9 +219,9 @@ SELECT count( a.id ) ...@@ -219,9 +219,9 @@ SELECT count( a.id )
} }
/** /**
* @param $type * @param int $type
* @param $tables * @param array $tables
* @param $whereTables * @param array $whereTables
* @param int $contactID * @param int $contactID
* *
* @return null|string * @return null|string
...@@ -314,8 +314,8 @@ SELECT g.* ...@@ -314,8 +314,8 @@ SELECT g.*
* @param int $type * @param int $type
* @param int $contactID * @param int $contactID
* @param string $tableName * @param string $tableName
* @param null $allGroups * @param array|null $allGroups
* @param null $includedGroups * @param array|null $includedGroups
* *
* @return array * @return array
*/ */
...@@ -385,7 +385,7 @@ SELECT g.* ...@@ -385,7 +385,7 @@ SELECT g.*
/** /**
* @param int $type * @param int $type
* @param $operation * @param string $operation
* *
* @return bool * @return bool
*/ */
...@@ -456,7 +456,7 @@ SELECT g.* ...@@ -456,7 +456,7 @@ SELECT g.*
* @param int $contactID * @param int $contactID
* @param string $tableName * @param string $tableName
* @param int $type * @param int $type
* @param $allGroups * @param array $allGroups
* *
* @return array * @return array
*/ */
......
...@@ -35,7 +35,7 @@ class CRM_ACL_BAO_ACLEntityRole extends CRM_ACL_DAO_ACLEntityRole { ...@@ -35,7 +35,7 @@ class CRM_ACL_BAO_ACLEntityRole extends CRM_ACL_DAO_ACLEntityRole {
/** /**
* @param array $params * @param array $params
* *
* @return CRM_ACL_DAO_EntityRole * @return CRM_ACL_BAO_ACLEntityRole
*/ */
public static function create(&$params) { public static function create(&$params) {
return self::writeRecord($params); return self::writeRecord($params);
...@@ -43,7 +43,7 @@ class CRM_ACL_BAO_ACLEntityRole extends CRM_ACL_DAO_ACLEntityRole { ...@@ -43,7 +43,7 @@ class CRM_ACL_BAO_ACLEntityRole extends CRM_ACL_DAO_ACLEntityRole {
/** /**
* @param array $params * @param array $params
* @param $defaults * @param array $defaults
*/ */
public static function retrieve(&$params, &$defaults) { public static function retrieve(&$params, &$defaults) {
CRM_Core_DAO::commonRetrieve(__CLASS__, $params, $defaults); CRM_Core_DAO::commonRetrieve(__CLASS__, $params, $defaults);
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Generated from xml/schema/CRM/ACL/ACL.xml * Generated from xml/schema/CRM/ACL/ACL.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen * DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:709746b9e63da79d9ee75de3a0687db4) * (GenCodeChecksum:5245f10c478c4187d1fb420e76f2fd76)
*/ */
/** /**
...@@ -33,21 +33,27 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO { ...@@ -33,21 +33,27 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO {
/** /**
* Unique table ID * Unique table ID
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $id; public $id;
/** /**
* ACL Name. * ACL Name.
* *
* @var string * @var string|null
* (SQL type: varchar(64))
* Note that values will be retrieved from the database as a string.
*/ */
public $name; public $name;
/** /**
* Is this ACL entry Allow (0) or Deny (1) ? * Is this ACL entry Allow (0) or Deny (1) ?
* *
* @var bool * @var bool|string
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/ */
public $deny; public $deny;
...@@ -55,13 +61,17 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO { ...@@ -55,13 +61,17 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO {
* Table of the object possessing this ACL entry (Contact, Group, or ACL Group) * Table of the object possessing this ACL entry (Contact, Group, or ACL Group)
* *
* @var string * @var string
* (SQL type: varchar(64))
* Note that values will be retrieved from the database as a string.
*/ */
public $entity_table; public $entity_table;
/** /**
* ID of the object possessing this ACL * ID of the object possessing this ACL
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $entity_id; public $entity_id;
...@@ -69,41 +79,53 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO { ...@@ -69,41 +79,53 @@ class CRM_ACL_DAO_ACL extends CRM_Core_DAO {
* What operation does this ACL entry control? * What operation does this ACL entry control?
* *
* @var string * @var string
* (SQL type: varchar(8))
* Note that values will be retrieved from the database as a string.
*/ */
public $operation; public $operation;
/** /**
* The table of the object controlled by this ACL entry * The table of the object controlled by this ACL entry
* *
* @var string * @var string|null
* (SQL type: varchar(64))
* Note that values will be retrieved from the database as a string.
*/ */
public $object_table; public $object_table;
/** /**
* The ID of the object controlled by this ACL entry * The ID of the object controlled by this ACL entry
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $object_id; public $object_id;
/** /**
* If this is a grant/revoke entry, what table are we granting? * If this is a grant/revoke entry, what table are we granting?
* *
* @var string * @var string|null
* (SQL type: varchar(64))
* Note that values will be retrieved from the database as a string.
*/ */
public $acl_table; public $acl_table;
/** /**
* ID of the ACL or ACL group being granted/revoked * ID of the ACL or ACL group being granted/revoked
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $acl_id; public $acl_id;
/** /**
* Is this property active? * Is this property active?
* *
* @var bool * @var bool|string|null
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/ */
public $is_active; public $is_active;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Generated from xml/schema/CRM/ACL/ACLCache.xml * Generated from xml/schema/CRM/ACL/ACLCache.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen * DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:6593794a6e82670ad992cc331c22f33e) * (GenCodeChecksum:329e9070bd70f3fb3d053eb731d1b266)
*/ */
/** /**
...@@ -33,28 +33,36 @@ class CRM_ACL_DAO_ACLCache extends CRM_Core_DAO { ...@@ -33,28 +33,36 @@ class CRM_ACL_DAO_ACLCache extends CRM_Core_DAO {
/** /**
* Unique table ID * Unique table ID
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $id; public $id;
/** /**
* Foreign Key to Contact * Foreign Key to Contact
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $contact_id; public $contact_id;
/** /**
* Foreign Key to ACL * Foreign Key to ACL
* *
* @var int * @var int|string
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $acl_id; public $acl_id;
/** /**
* When was this cache entry last modified * When was this cache entry last modified
* *
* @var timestamp * @var string
* (SQL type: timestamp)
* Note that values will be retrieved from the database as a string.
*/ */
public $modified_date; public $modified_date;
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Generated from xml/schema/CRM/ACL/ACLEntityRole.xml * Generated from xml/schema/CRM/ACL/ACLEntityRole.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen * DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:fe3bd0baaffcc93590b3285c6cf96fc1) * (GenCodeChecksum:22633176232bcef28b59ab0388720837)
*/ */
/** /**
...@@ -33,14 +33,18 @@ class CRM_ACL_DAO_ACLEntityRole extends CRM_Core_DAO { ...@@ -33,14 +33,18 @@ class CRM_ACL_DAO_ACLEntityRole extends CRM_Core_DAO {
/** /**
* Unique table ID * Unique table ID
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $id; public $id;
/** /**
* Foreign Key to ACL Role (which is an option value pair and hence an implicit FK) * Foreign Key to ACL Role (which is an option value pair and hence an implicit FK)
* *
* @var int * @var int|string
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $acl_role_id; public $acl_role_id;
...@@ -48,20 +52,26 @@ class CRM_ACL_DAO_ACLEntityRole extends CRM_Core_DAO { ...@@ -48,20 +52,26 @@ class CRM_ACL_DAO_ACLEntityRole extends CRM_Core_DAO {
* Table of the object joined to the ACL Role (Contact or Group) * Table of the object joined to the ACL Role (Contact or Group)
* *
* @var string * @var string
* (SQL type: varchar(64))
* Note that values will be retrieved from the database as a string.
*/ */
public $entity_table; public $entity_table;
/** /**
* ID of the group/contact object being joined * ID of the group/contact object being joined
* *
* @var int * @var int|string
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $entity_id; public $entity_id;
/** /**
* Is this property active? * Is this property active?
* *
* @var bool * @var bool|string|null
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/ */
public $is_active; public $is_active;
......
...@@ -781,7 +781,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { ...@@ -781,7 +781,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
* Filter the activity types to only return the ones we actually asked for * Filter the activity types to only return the ones we actually asked for
* Uses params['activity_type_id'] and params['activity_type_exclude_id'] * Uses params['activity_type_id'] and params['activity_type_exclude_id']
* *
* @param $params * @param array $params
* @return array|null (Use in Activity.get API activity_type_id) * @return array|null (Use in Activity.get API activity_type_id)
*/ */
public static function filterActivityTypes($params) { public static function filterActivityTypes($params) {
...@@ -884,7 +884,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity { ...@@ -884,7 +884,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
$includeComponent = !$excludeComponentHandledActivities || !empty($compObj->info['showActivitiesInCore']); $includeComponent = !$excludeComponentHandledActivities || !empty($compObj->info['showActivitiesInCore']);
if ($includeComponent) { if ($includeComponent) {
if ($compObj->info['name'] == 'CiviCampaign') { if ($compObj->info['name'] == 'CiviCampaign') {
$componentPermission = "administer {$compObj->name}"; $componentPermission = "manage campaign";
} }
else { else {
$componentPermission = "access {$compObj->name}"; $componentPermission = "access {$compObj->name}";
...@@ -2067,8 +2067,7 @@ AND cl.modified_id = c.id ...@@ -2067,8 +2067,7 @@ AND cl.modified_id = c.id
'is_current_revision', 'is_current_revision',
'activity_is_deleted', 'activity_is_deleted',
]; ];
$config = CRM_Core_Config::singleton(); if (!CRM_Core_Component::isEnabled('CiviCampaign')) {
if (!in_array('CiviCampaign', $config->enableComponents)) {
$skipFields[] = 'activity_engagement_level'; $skipFields[] = 'activity_engagement_level';
} }
...@@ -2288,7 +2287,7 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name = ...@@ -2288,7 +2287,7 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name =
} }
/** /**
* @param $params * @param array $params
* @return array * @return array
*/ */
protected static function getActivityParamsForDashboardFunctions($params) { protected static function getActivityParamsForDashboardFunctions($params) {
...@@ -2556,19 +2555,22 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name = ...@@ -2556,19 +2555,22 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name =
/** /**
* Get the right links depending on the activity type and other factors. * Get the right links depending on the activity type and other factors.
*
* @param array $values * @param array $values
* @param int $activityId * @param int $activityId
* @param ?int $contactId * @param int|null $contactId
* @param bool $isViewOnly Is this a special type that shouldn't be edited * @param bool $isViewOnly Is this a special type that shouldn't be edited
* @param ?string $context * @param string|null $context
* @param ?int $mask * @param int|null $mask
* @param bool $dontBreakCaseActivities Originally this function was * @param bool $dontBreakCaseActivities
* Originally this function was
* part of another function that was only used on the contact's activity * part of another function that was only used on the contact's activity
* tab and this parameter would only be false when you're not displaying * tab and this parameter would only be false when you're not displaying
* case activities anyway and so was effectively never used. And I'm not * case activities anyway and so was effectively never used. And I'm not
* sure why for the purposes of links you would ever want a case activity * sure why for the purposes of links you would ever want a case activity
* to link to the regular form, so I think this can be removed, but am * to link to the regular form, so I think this can be removed, but am
* leaving it as-is for now. * leaving it as-is for now.
*
* @return string HTML string * @return string HTML string
*/ */
public static function getActionLinks( public static function getActionLinks(
......
...@@ -20,13 +20,6 @@ ...@@ -20,13 +20,6 @@
*/ */
class CRM_Activity_BAO_ActivityAssignment extends CRM_Activity_DAO_ActivityContact { class CRM_Activity_BAO_ActivityAssignment extends CRM_Activity_DAO_ActivityContact {
/**
* Class constructor.
*/
public function __construct() {
parent::__construct();
}
/** /**
* Add activity assignment. * Add activity assignment.
* *
......
...@@ -20,13 +20,6 @@ ...@@ -20,13 +20,6 @@
*/ */
class CRM_Activity_BAO_ActivityTarget extends CRM_Activity_DAO_ActivityContact { class CRM_Activity_BAO_ActivityTarget extends CRM_Activity_DAO_ActivityContact {
/**
* Class constructor.
*/
public function __construct() {
parent::__construct();
}
/** /**
* Add activity target. * Add activity target.
* *
......
...@@ -37,7 +37,7 @@ class CRM_Activity_BAO_ActivityType { ...@@ -37,7 +37,7 @@ class CRM_Activity_BAO_ActivityType {
/** /**
* Constructor * Constructor
* *
* @param $activity_type_id int This matches up to the option_value 'value' column in the database. * @param int $activity_type_id This matches up to the option_value 'value' column in the database.
*/ */
public function __construct($activity_type_id) { public function __construct($activity_type_id) {
$this->setActivityType($activity_type_id); $this->setActivityType($activity_type_id);
...@@ -57,7 +57,7 @@ class CRM_Activity_BAO_ActivityType { ...@@ -57,7 +57,7 @@ class CRM_Activity_BAO_ActivityType {
* Look up the key/value pair representing this activity type from the id. * Look up the key/value pair representing this activity type from the id.
* Generally called from constructor. * Generally called from constructor.
* *
* @param $activity_type_id int This matches up to the option_value 'value' column in the database. * @param int $activity_type_id This matches up to the option_value 'value' column in the database.
*/ */
public function setActivityType($activity_type_id) { public function setActivityType($activity_type_id) {
if ($activity_type_id && is_numeric($activity_type_id)) { if ($activity_type_id && is_numeric($activity_type_id)) {
......
...@@ -33,7 +33,7 @@ class CRM_Activity_Controller_Search extends CRM_Core_Controller { ...@@ -33,7 +33,7 @@ class CRM_Activity_Controller_Search extends CRM_Core_Controller {
/** /**
* Class constructor. * Class constructor.
* *
* @param null $title * @param string $title
* @param bool $modal * @param bool $modal
* @param int|mixed|null $action * @param int|mixed|null $action
*/ */
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Generated from xml/schema/CRM/Activity/Activity.xml * Generated from xml/schema/CRM/Activity/Activity.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen * DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:3a511b57e91904eb91c445524853106a) * (GenCodeChecksum:b37cf83d01ce6a8f72be6de97f00d7d3)
*/ */
/** /**
...@@ -59,179 +59,233 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { ...@@ -59,179 +59,233 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO {
/** /**
* Unique Other Activity ID * Unique Other Activity ID
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $id; public $id;
/** /**
* Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry. * Artificial FK to original transaction (e.g. contribution) IF it is not an Activity. Table can be figured out through activity_type_id, and further through component registry.
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $source_record_id; public $source_record_id;
/** /**
* FK to civicrm_option_value.id, that has to be valid, registered activity type. * FK to civicrm_option_value.id, that has to be valid, registered activity type.
* *
* @var int * @var int|string
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $activity_type_id; public $activity_type_id;
/** /**
* The subject/purpose/short description of the activity. * The subject/purpose/short description of the activity.
* *
* @var string * @var string|null
* (SQL type: varchar(255))
* Note that values will be retrieved from the database as a string.
*/ */
public $subject; public $subject;
/** /**
* Date and time this activity is scheduled to occur. Formerly named scheduled_date_time. * Date and time this activity is scheduled to occur. Formerly named scheduled_date_time.
* *
* @var datetime * @var string
* (SQL type: datetime)
* Note that values will be retrieved from the database as a string.
*/ */
public $activity_date_time; public $activity_date_time;
/** /**
* Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes. * Planned or actual duration of activity expressed in minutes. Conglomerate of former duration_hours and duration_minutes.
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $duration; public $duration;
/** /**
* Location of the activity (optional, open text). * Location of the activity (optional, open text).
* *
* @var string * @var string|null
* (SQL type: varchar(255))
* Note that values will be retrieved from the database as a string.
*/ */
public $location; public $location;
/** /**
* Phone ID of the number called (optional - used if an existing phone number is selected). * Phone ID of the number called (optional - used if an existing phone number is selected).
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $phone_id; public $phone_id;
/** /**
* Phone number in case the number does not exist in the civicrm_phone table. * Phone number in case the number does not exist in the civicrm_phone table.
* *
* @var string * @var string|null
* (SQL type: varchar(64))
* Note that values will be retrieved from the database as a string.
*/ */
public $phone_number; public $phone_number;
/** /**
* Details about the activity (agenda, notes, etc). * Details about the activity (agenda, notes, etc).
* *
* @var longtext * @var string|null
* (SQL type: longtext)
* Note that values will be retrieved from the database as a string.
*/ */
public $details; public $details;
/** /**
* ID of the status this activity is currently in. Foreign key to civicrm_option_value. * ID of the status this activity is currently in. Foreign key to civicrm_option_value.
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $status_id; public $status_id;
/** /**
* ID of the priority given to this activity. Foreign key to civicrm_option_value. * ID of the priority given to this activity. Foreign key to civicrm_option_value.
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $priority_id; public $priority_id;
/** /**
* Parent meeting ID (if this is a follow-up item). This is not currently implemented * Parent meeting ID (if this is a follow-up item). This is not currently implemented
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $parent_id; public $parent_id;
/** /**
* @var bool * @var bool|string|null
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/ */
public $is_test; public $is_test;
/** /**
* Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium. * Activity Medium, Implicit FK to civicrm_option_value where option_group = encounter_medium.
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $medium_id; public $medium_id;
/** /**
* @var bool * @var bool|string|null
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/ */
public $is_auto; public $is_auto;
/** /**
* FK to Relationship ID * FK to Relationship ID
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $relationship_id; public $relationship_id;
/** /**
* @var bool * @var bool|string|null
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/ */
public $is_current_revision; public $is_current_revision;
/** /**
* Activity ID of the first activity record in versioning chain. * Activity ID of the first activity record in versioning chain.
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $original_id; public $original_id;
/** /**
* Currently being used to store result id for survey activity, FK to option value. * Currently being used to store result id for survey activity, FK to option value.
* *
* @var string * @var string|null
* (SQL type: varchar(255))
* Note that values will be retrieved from the database as a string.
*/ */
public $result; public $result;
/** /**
* @var bool * @var bool|string|null
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/ */
public $is_deleted; public $is_deleted;
/** /**
* The campaign for which this activity has been triggered. * The campaign for which this activity has been triggered.
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $campaign_id; public $campaign_id;
/** /**
* Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement. * Assign a specific level of engagement to this activity. Used for tracking constituents in ladder of engagement.
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $engagement_level; public $engagement_level;
/** /**
* @var int * @var int|string|null
* (SQL type: int)
* Note that values will be retrieved from the database as a string.
*/ */
public $weight; public $weight;
/** /**
* Activity marked as favorite. * Activity marked as favorite.
* *
* @var bool * @var bool|string|null
* (SQL type: tinyint)
* Note that values will be retrieved from the database as a string.
*/ */
public $is_star; public $is_star;
/** /**
* When was the activity was created. * When was the activity was created.
* *
* @var timestamp * @var string
* (SQL type: timestamp)
* Note that values will be retrieved from the database as a string.
*/ */
public $created_date; public $created_date;
/** /**
* When was the activity (or closely related entity) was created or modified or deleted. * When was the activity (or closely related entity) was created or modified or deleted.
* *
* @var timestamp * @var string
* (SQL type: timestamp)
* Note that values will be retrieved from the database as a string.
*/ */
public $modified_date; public $modified_date;
...@@ -759,6 +813,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { ...@@ -759,6 +813,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO {
'bao' => 'CRM_Activity_BAO_Activity', 'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0, 'localizable' => 0,
'html' => [ 'html' => [
'type' => 'Select Date',
'label' => ts("Created Date"), 'label' => ts("Created Date"),
], ],
'add' => '4.7', 'add' => '4.7',
...@@ -777,6 +832,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO { ...@@ -777,6 +832,7 @@ class CRM_Activity_DAO_Activity extends CRM_Core_DAO {
'bao' => 'CRM_Activity_BAO_Activity', 'bao' => 'CRM_Activity_BAO_Activity',
'localizable' => 0, 'localizable' => 0,
'html' => [ 'html' => [
'type' => 'Select Date',
'label' => ts("Modified Date"), 'label' => ts("Modified Date"),
], ],
'readonly' => TRUE, 'readonly' => TRUE,
......
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* *
* Generated from xml/schema/CRM/Activity/ActivityContact.xml * Generated from xml/schema/CRM/Activity/ActivityContact.xml
* DO NOT EDIT. Generated by CRM_Core_CodeGen * DO NOT EDIT. Generated by CRM_Core_CodeGen
* (GenCodeChecksum:9d55ecc09cc160c1cc41485bf7d026ef) * (GenCodeChecksum:2e8b2b826a1e0f70d39ea967462796d4)
*/ */
/** /**
...@@ -33,28 +33,36 @@ class CRM_Activity_DAO_ActivityContact extends CRM_Core_DAO { ...@@ -33,28 +33,36 @@ class CRM_Activity_DAO_ActivityContact extends CRM_Core_DAO {
/** /**
* Activity contact id * Activity contact id
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $id; public $id;
/** /**
* Foreign key to the activity for this record. * Foreign key to the activity for this record.
* *
* @var int * @var int|string
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $activity_id; public $activity_id;
/** /**
* Foreign key to the contact for this record. * Foreign key to the contact for this record.
* *
* @var int * @var int|string
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $contact_id; public $contact_id;
/** /**
* Determines the contact's role in the activity (source, target, or assignee). * Determines the contact's role in the activity (source, target, or assignee).
* *
* @var int * @var int|string|null
* (SQL type: int unsigned)
* Note that values will be retrieved from the database as a string.
*/ */
public $record_type_id; public $record_type_id;
......
...@@ -364,13 +364,15 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { ...@@ -364,13 +364,15 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
); );
} }
$activityTypeDescription = NULL;
if ($this->_activityTypeId) { if ($this->_activityTypeId) {
// Set activity type name and description to template.
list($this->_activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($this->_activityTypeId); list($this->_activityTypeName, $activityTypeDescription) = CRM_Core_BAO_OptionValue::getActivityTypeDetails($this->_activityTypeId);
$this->assign('activityTypeName', $this->_activityTypeName);
$this->assign('activityTypeDescription', $activityTypeDescription);
} }
// Set activity type name and description to template.
$this->assign('activityTypeName', $this->_activityTypeName ?? FALSE);
$this->assign('activityTypeDescription', $activityTypeDescription ?? FALSE);
// set user context // set user context
$urlParams = $urlString = NULL; $urlParams = $urlString = NULL;
$qfKey = CRM_Utils_Request::retrieve('key', 'String', $this); $qfKey = CRM_Utils_Request::retrieve('key', 'String', $this);
...@@ -829,7 +831,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { ...@@ -829,7 +831,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
* The input form values. * The input form values.
* @param array $files * @param array $files
* The uploaded files if any. * The uploaded files if any.
* @param $self * @param self $self
* *
* @return bool|array * @return bool|array
* true if no errors, else array of errors * true if no errors, else array of errors
...@@ -1235,6 +1237,9 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { ...@@ -1235,6 +1237,9 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
* For the moment this is just pulled from preProcess * For the moment this is just pulled from preProcess
*/ */
public function assignActivityType() { public function assignActivityType() {
// Default array with required key for Smarty template
$activityTypeNameAndLabel = ['machineName' => FALSE];
if ($this->_activityTypeId) { if ($this->_activityTypeId) {
$activityTypeDisplayLabels = $this->getActivityTypeDisplayLabels(); $activityTypeDisplayLabels = $this->getActivityTypeDisplayLabels();
if ($activityTypeDisplayLabels[$this->_activityTypeId]) { if ($activityTypeDisplayLabels[$this->_activityTypeId]) {
...@@ -1242,7 +1247,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { ...@@ -1242,7 +1247,7 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
// At the moment this is duplicating other code in this section, but refactoring in small steps. // At the moment this is duplicating other code in this section, but refactoring in small steps.
$activityTypeObj = new CRM_Activity_BAO_ActivityType($this->_activityTypeId); $activityTypeObj = new CRM_Activity_BAO_ActivityType($this->_activityTypeId);
$this->assign('activityTypeNameAndLabel', $activityTypeObj->getActivityType()); $activityTypeNameAndLabel = $activityTypeObj->getActivityType();
} }
// Set title. // Set title.
if (isset($activityTypeDisplayLabels)) { if (isset($activityTypeDisplayLabels)) {
...@@ -1262,6 +1267,8 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task { ...@@ -1262,6 +1267,8 @@ class CRM_Activity_Form_Activity extends CRM_Contact_Form_Task {
} }
} }
} }
$this->assign('activityTypeNameAndLabel', $activityTypeNameAndLabel);
} }
} }
...@@ -25,7 +25,7 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form { ...@@ -25,7 +25,7 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form {
} }
/** /**
* @param $self * @param self $self
*/ */
public static function commonBuildQuickForm($self) { public static function commonBuildQuickForm($self) {
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $self); $contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $self);
......
...@@ -94,7 +94,7 @@ class CRM_Activity_Form_Task_PDF extends CRM_Activity_Form_Task { ...@@ -94,7 +94,7 @@ class CRM_Activity_Form_Task_PDF extends CRM_Activity_Form_Task {
/** /**
* Render html from rows * Render html from rows
* *
* @param $rows * @param array $rows
* @param string $msgPart * @param string $msgPart
* The name registered with the TokenProcessor * The name registered with the TokenProcessor
* @param array $formValues * @param array $formValues
......
...@@ -32,7 +32,7 @@ class CRM_Activity_Form_Task_Print extends CRM_Activity_Form_Task { ...@@ -32,7 +32,7 @@ class CRM_Activity_Form_Task_Print extends CRM_Activity_Form_Task {
parent::preprocess(); parent::preprocess();
// set print view, so that print templates are called // set print view, so that print templates are called
$this->controller->setPrint(1); $this->controller->setPrint(CRM_Core_Smarty::PRINT_PAGE);
// get the formatted params // get the formatted params
$queryParams = $this->get('queryParams'); $queryParams = $this->get('queryParams');
......
...@@ -113,7 +113,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM ...@@ -113,7 +113,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
/** /**
* The query object. * The query object.
* *
* @var \CRM_Contact_BAO_Query * @var CRM_Contact_BAO_Query
*/ */
protected $_query; protected $_query;
...@@ -395,7 +395,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM ...@@ -395,7 +395,7 @@ class CRM_Activity_Selector_Search extends CRM_Core_Selector_Base implements CRM
} }
/** /**
* @return \CRM_Contact_BAO_Query * @return CRM_Contact_BAO_Query
*/ */
public function &getQuery() { public function &getQuery() {
return $this->_query; return $this->_query;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment