Verified Commit fb5d93e1 authored by Kevin Cristiano's avatar Kevin Cristiano 🌎
Browse files

civicrm release

parent 18ec554c
......@@ -9,11 +9,14 @@ This is the development repository for the *CiviCRM* plugin for *WordPress*. Wha
If you want to contribute to the development of this plugin, please bear the following in mind:
* Bug fixes should go in the branch 4.5 branch (stable)* Structural changes should go under master (trunk, i.e. 4.6).
* Bug Fixes and structural changes should go in the master branch.
* Regression fixes should go in the current version branch.
----
### 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.
### 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.
As a non profit committed to the public good itself, CiviCRM understands that forging and growing strong relationships with constituents is about more than collecting and tracking constituent data - it is about sustaining relationships with supporters over time.
......@@ -23,4 +26,4 @@ With CiviCRM's robust feature set, organizations can further their mission throu
CiviCRM is localized in over 20 languages including: Chinese (Taiwan, China), Dutch, English (Australia, Canada, U.S., UK), French (France, Canada), German, Italian, Japanese, Russian, and Swedish.
For more information, visit the [CiviCRM website](https://civicrm.org).
\ No newline at end of file
For more information, visit the [CiviCRM website](https://civicrm.org).
......@@ -2,7 +2,9 @@
/*
Plugin Name: CiviCRM
Description: CiviCRM - Growing and Sustaining Relationships
Version: 5.26.2
Version: 5.27.0
Requires at least: 4.9
Requires PHP: 7.1
Author: CiviCRM LLC
Author URI: https://civicrm.org/
Plugin URI: https://docs.civicrm.org/sysadmin/en/latest/install/wordpress/
......@@ -54,7 +56,7 @@ if ( ! defined( 'ABSPATH' ) ) exit;
// Set version here: when it changes, will force JS to reload
define( 'CIVICRM_PLUGIN_VERSION', '5.26.2' );
define( 'CIVICRM_PLUGIN_VERSION', '5.27.0' );
// Store reference to this file
if (!defined('CIVICRM_PLUGIN_FILE')) {
......
......@@ -88,11 +88,13 @@ class CRM_ACL_API {
// the default value which is valid for the final AND
$deleteClause = ' ( 1 ) ';
if (!$skipDeleteClause) {
if (CRM_Core_Permission::check('access deleted contacts') and $onlyDeleted) {
$deleteClause = '(contact_a.is_deleted)';
if (CRM_Core_Permission::check('access deleted contacts')) {
if ($onlyDeleted) {
$deleteClause = '(contact_a.is_deleted)';
}
}
else {
// CRM-6181
// Exclude deleted contacts due to permissions
$deleteClause = '(contact_a.is_deleted = 0)';
}
}
......
......@@ -182,6 +182,8 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
// CRM-13994 delete activity entity_tag
$query = "DELETE FROM civicrm_entity_tag WHERE entity_table = 'civicrm_activity' AND entity_id = %1";
$dao = CRM_Core_DAO::executeQuery($query, [1 => [$activity->id, 'Positive']]);
CRM_Core_BAO_File::deleteEntityFile('civicrm_activity', $activity->id);
}
}
else {
......@@ -989,11 +991,13 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
}
/**
* @param int $userID
* @param int $sourceContactID
* The contact ID of the email "from".
* @param string $subject
* @param string $html
* @param string $text
* @param string $additionalDetails
* The additional information of CC and BCC appended to the activity details.
* @param int $campaignID
* @param array $attachments
* @param int $caseID
......@@ -1002,12 +1006,12 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
* The created activity ID
* @throws \CRM_Core_Exception
*/
public static function createEmailActivity($userID, $subject, $html, $text, $additionalDetails, $campaignID, $attachments, $caseID) {
public static function createEmailActivity($sourceContactID, $subject, $html, $text, $additionalDetails, $campaignID, $attachments, $caseID) {
$activityTypeID = CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'activity_type_id', 'Email');
// CRM-6265: save both text and HTML parts in details (if present)
if ($html and $text) {
$details = "-ALTERNATIVE ITEM 0-\n$html$additionalDetails\n-ALTERNATIVE ITEM 1-\n$text$additionalDetails\n-ALTERNATIVE END-\n";
$details = "-ALTERNATIVE ITEM 0-\n{$html}{$additionalDetails}\n-ALTERNATIVE ITEM 1-\n{$text}{$additionalDetails}\n-ALTERNATIVE END-\n";
}
else {
$details = $html ? $html : $text;
......@@ -1015,12 +1019,11 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
}
$activityParams = [
'source_contact_id' => $userID,
'source_contact_id' => $sourceContactID,
'activity_type_id' => $activityTypeID,
'activity_date_time' => date('YmdHis'),
'subject' => $subject,
'details' => $details,
// FIXME: check for name Completed and get ID from that lookup
'status_id' => CRM_Core_PseudoConstant::getKey('CRM_Activity_BAO_Activity', 'status_id', 'Completed'),
'campaign_id' => $campaignID,
];
......@@ -1038,6 +1041,7 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
}
$activity = civicrm_api3('Activity', 'create', $activityParams);
return $activity['id'];
}
......@@ -1077,10 +1081,10 @@ class CRM_Activity_BAO_Activity extends CRM_Activity_DAO_Activity {
* @throws \CiviCRM_API3_Exception
*/
public static function sendEmail(
&$contactDetails,
&$subject,
&$text,
&$html,
$contactDetails,
$subject,
$text,
$html,
$emailAddress,
$userID = NULL,
$from = NULL,
......@@ -2587,7 +2591,7 @@ INNER JOIN civicrm_option_group grp ON (grp.id = option_group_id AND grp.name =
$activity['DT_RowAttr']['data-entity'] = 'activity';
$activity['DT_RowAttr']['data-id'] = $activityId;
$activity['activity_type'] = (!empty($activityIcons[$values['activity_type_id']]) ? '<span class="crm-i ' . $activityIcons[$values['activity_type_id']] . '"></span> ' : '') . $values['activity_type'];
$activity['activity_type'] = (!empty($activityIcons[$values['activity_type_id']]) ? '<span class="crm-i ' . $activityIcons[$values['activity_type_id']] . '" aria-hidden="true"></span> ' : '') . $values['activity_type'];
$activity['subject'] = $values['subject'];
if ($params['contact_id'] == $values['source_contact_id']) {
......
......@@ -30,7 +30,7 @@ class CRM_Activity_Form_ActivityLinks extends CRM_Core_Form {
public static function commonBuildQuickForm($self) {
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', $self);
if (!$contactId) {
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive', CRM_Core_DAO::$_nullObject, FALSE, NULL, $_REQUEST);
$contactId = CRM_Utils_Request::retrieve('cid', 'Positive');
}
$urlParams = "action=add&reset=1&cid={$contactId}&selectedChild=activity&atype=";
......
......@@ -209,7 +209,7 @@ class CRM_Activity_Page_AJAX {
}
// email column links/icon
if ($row['email']) {
$row['email'] = '<a class="crm-hover-button crm-popup" href="' . CRM_Utils_System::url('civicrm/activity/email/add', 'reset=1&action=add&atype=3&cid=' . $row['cid']) . '&caseid=' . $caseID . '" title="' . ts('Send an Email') . '"><i class="crm-i fa-envelope"></i></a>';
$row['email'] = '<a class="crm-hover-button crm-popup" href="' . CRM_Utils_System::url('civicrm/activity/email/add', 'reset=1&action=add&atype=3&cid=' . $row['cid']) . '&caseid=' . $caseID . '" title="' . ts('Send an Email') . '"><i class="crm-i fa-envelope" aria-hidden="true"></i></a>';
}
// edit links
$row['actions'] = '';
......@@ -219,7 +219,7 @@ class CRM_Activity_Page_AJAX {
switch ($row['source']) {
case 'caseRel':
$row['actions'] = '<a href="#editCaseRoleDialog" title="' . ts('Reassign %1', [1 => $typeLabel]) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '_' . $row['relationship_direction'] . '" data-cid="' . $row['cid'] . '" data-rel_id="' . $row['rel_id'] . '"data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
'<i class="crm-i fa-pencil"></i>' .
'<i class="crm-i fa-pencil" aria-hidden="true"></i>' .
'</a>' .
'<a href="#deleteCaseRoleDialog" title="' . ts('Remove %1', [1 => $typeLabel]) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '_' . $row['relationship_direction'] . '" data-cid="' . $row['cid'] . '" data-key="' . CRM_Core_Key::get('civicrm/ajax/delcaserole') . '">' .
'<span class="icon delete-icon"></span>' .
......@@ -228,7 +228,7 @@ class CRM_Activity_Page_AJAX {
case 'caseRoles':
$row['actions'] = '<a href="#editCaseRoleDialog" title="' . ts('Assign %1', [1 => $typeLabel]) . '" class="crm-hover-button case-miniform" data-contact_type="' . $contactType . '" data-rel_type="' . $row['relation_type'] . '_a_b" data-key="' . CRM_Core_Key::get('civicrm/ajax/relation') . '">' .
'<i class="crm-i fa-pencil"></i>' .
'<i class="crm-i fa-pencil" aria-hidden="true"></i>' .
'</a>';
break;
}
......@@ -353,7 +353,7 @@ class CRM_Activity_Page_AJAX {
if (!empty($params['assigneeContactIds'])) {
$assigneeContacts = array_unique(explode(',', $params['assigneeContactIds']));
}
foreach ($assigneeContacts as $key => $value) {
foreach ($assigneeContacts as $value) {
$assigneeParams = [
'activity_id' => $mainActivityId,
'contact_id' => $value,
......
......@@ -167,6 +167,7 @@ class CRM_Admin_Form_MessageTemplates extends CRM_Core_Form {
//get the tokens.
$tokens = CRM_Core_SelectValues::contactTokens();
$tokens = array_merge($tokens, CRM_Core_SelectValues::domainTokens());
$this->assign('tokens', CRM_Utils_Token::formatTokensForDisplay($tokens));
......
......@@ -33,6 +33,8 @@ class CRM_Admin_Form_Preferences_Mailing extends CRM_Admin_Form_Preferences {
'dedupe_email_default' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'hash_mailing_url' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'auto_recipient_rebuild' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'url_tracking_default' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
'open_tracking_default' => CRM_Core_BAO_Setting::MAILING_PREFERENCES_NAME,
];
public function postProcess() {
......
......@@ -161,30 +161,13 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
//cache contact fields retaining localized titles
//though we changed localization, so reseting cache.
Civi::cache('fields')->flush();
Civi::cache('fields')->clear();
//CRM-8559, cache navigation do not respect locale if it is changed, so reseting cache.
Civi::cache('navigation')->flush();
Civi::cache('navigation')->clear();
// reset ACL and System caches
CRM_Core_BAO_Cache::resetCaches();
// we do this only to initialize monetary decimal point and thousand separator
$config = CRM_Core_Config::singleton();
// save enabled currencies and default currency in option group 'currencies_enabled'
// CRM-1496
if (empty($values['currencyLimit'])) {
$values['currencyLimit'] = [$values['defaultCurrency']];
}
elseif (!in_array($values['defaultCurrency'], $values['currencyLimit'])) {
$values['currencyLimit'][] = $values['defaultCurrency'];
}
self::updateEnabledCurrencies($values['currencyLimit'], $values['defaultCurrency']);
// unset currencyLimit so we dont store there
unset($values['currencyLimit']);
// make the site multi-lang if requested
if (!empty($values['makeMultilingual'])) {
CRM_Core_I18n_Schema::makeMultilingual($values['lcMessages']);
......@@ -214,6 +197,21 @@ class CRM_Admin_Form_Setting_Localization extends CRM_Admin_Form_Setting {
// if we manipulated the language list, return to the localization admin screen
$return = (bool) (CRM_Utils_Array::value('makeMultilingual', $values) or CRM_Utils_Array::value('addLanguage', $values));
// Update enabled currencies
// we do this only to initialize monetary decimal point and thousand separator
$config = CRM_Core_Config::singleton();
// save enabled currencies and default currency in option group 'currencies_enabled'
// CRM-1496
if (empty($values['currencyLimit'])) {
$values['currencyLimit'] = [$values['defaultCurrency']];
}
elseif (!in_array($values['defaultCurrency'], $values['currencyLimit'])) {
$values['currencyLimit'][] = $values['defaultCurrency'];
}
self::updateEnabledCurrencies($values['currencyLimit'], $values['defaultCurrency']);
// unset currencyLimit so we dont store there
unset($values['currencyLimit']);
$filteredValues = $values;
unset($filteredValues['makeMultilingual']);
unset($filteredValues['makeSinglelingual']);
......
......@@ -21,6 +21,7 @@
class CRM_Admin_Form_Setting_Url extends CRM_Admin_Form_Setting {
protected $_settings = [
'disable_core_css' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'defaultExternUrl' => CRM_Core_BAO_Setting::SYSTEM_PREFERENCES_NAME,
'userFrameworkResourceURL' => CRM_Core_BAO_Setting::URL_PREFERENCES_NAME,
'imageUploadURL' => CRM_Core_BAO_Setting::URL_PREFERENCES_NAME,
'customCSSURL' => CRM_Core_BAO_Setting::URL_PREFERENCES_NAME,
......
......@@ -177,7 +177,7 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page {
// Fetch block for a specific action
else {
$action = strtolower($action);
$fnName = 'civicrm_api3_' . _civicrm_api_get_entity_name_from_camel($entity) . '_' . $action;
$fnName = 'civicrm_api3_' . CRM_Core_DAO_AllCoreTables::convertEntityNameToLower($entity) . '_' . $action;
// Support the alternate "1 file per action" structure
$actionFile = "api/v3/$entity/" . ucfirst($action) . '.php';
$actionFileContents = file_get_contents("api/v3/$entity/" . ucfirst($action) . '.php', FILE_USE_INCLUDE_PATH);
......@@ -205,7 +205,8 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page {
/**
* Format a docblock to be a bit more readable
* Not a proper doc parser... patches welcome :)
*
* FIXME: APIv4 uses markdown in code docs. Switch to that.
*
* @param string $text
* @return string
......@@ -224,8 +225,8 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page {
// Extract code blocks - save for later to skip html conversion
$code = [];
preg_match_all('#@code(.*?)@endcode#is', $text, $code);
$text = preg_replace('#@code.*?@endcode#is', '<pre></pre>', $text);
preg_match_all('#(@code|```)(.*?)(@endcode|```)#is', $text, $code);
$text = preg_replace('#(@code|```)(.*?)(@endcode|```)#is', '<pre></pre>', $text);
// Convert @annotations to titles
$text = preg_replace_callback(
......@@ -242,8 +243,8 @@ class CRM_Admin_Page_APIExplorer extends CRM_Core_Page {
$text = nl2br($text);
// Add unformatted code blocks back in
if ($code && !empty($code[1])) {
foreach ($code[1] as $block) {
if ($code && !empty($code[2])) {
foreach ($code[2] as $block) {
$text = preg_replace('#<pre></pre>#', "<pre>$block</pre>", $text, 1);
}
}
......
......@@ -39,60 +39,28 @@ class CRM_Admin_Page_Admin extends CRM_Core_Page {
];
$config = CRM_Core_Config::singleton();
if (in_array('CiviContribute', $config->enableComponents)) {
$groups['CiviContribute'] = ts('CiviContribute');
}
if (in_array('CiviMember', $config->enableComponents)) {
$groups['CiviMember'] = ts('CiviMember');
}
if (in_array('CiviEvent', $config->enableComponents)) {
$groups['CiviEvent'] = ts('CiviEvent');
}
if (in_array('CiviMail', $config->enableComponents)) {
$groups['CiviMail'] = ts('CiviMail');
}
if (in_array('CiviCase', $config->enableComponents)) {
$groups['CiviCase'] = ts('CiviCase');
}
if (in_array('CiviReport', $config->enableComponents)) {
$groups['CiviReport'] = ts('CiviReport');
}
if (in_array('CiviCampaign', $config->enableComponents)) {
$groups['CiviCampaign'] = ts('CiviCampaign');
foreach ($config->enableComponents as $component) {
$comp = CRM_Core_Component::get($component);
$groups[$comp->info['name']] = $comp->info['translatedName'];
}
$values = CRM_Core_Menu::getAdminLinks();
$this->_showHide = new CRM_Core_ShowHideBlocks();
foreach ($groups as $group => $title) {
$groupId = str_replace(' ', '_', $group);
$this->_showHide->addShow("id_{$groupId}_show");
$this->_showHide->addHide("id_{$groupId}");
$v = CRM_Core_ShowHideBlocks::links($this, $groupId, '', '', FALSE);
if (isset($values[$group])) {
$adminPanel[$groupId] = $values[$group];
$adminPanel[$groupId]['show'] = $v['show'];
$adminPanel[$groupId]['hide'] = $v['hide'];
$adminPanel[$groupId]['title'] = $title;
}
else {
$adminPanel[$groupId] = [];
$adminPanel[$groupId]['show'] = '';
$adminPanel[$groupId]['hide'] = '';
$adminPanel[$groupId]['title'] = $title;
}
$adminPanel[$groupId] = array_merge($values[$group] ?? [], ['title' => $title]);
}
CRM_Utils_Hook::alterAdminPanel($adminPanel);
foreach ($adminPanel as $groupId => $group) {
if (count($group) == 1) {
// Presumably the only thing is the title; remove the section.
// This is done here to give the hook a chance to edit the section.
unset($adminPanel[$groupId]);
}
}
$this->assign('adminPanel', $adminPanel);
$this->_showHide->addToTemplate();
return parent::run();
}
......
......@@ -46,7 +46,7 @@ class CRM_Admin_Page_ConfigTaskList extends CRM_Core_Page {
'sequential' => 1,
'return' => ["enable_components"],
]);
$enabled = array();
$enabled = [];
foreach ($result['values'][0]['enable_components'] as $component) {
$enabled[$component] = 1;
}
......
......@@ -144,7 +144,7 @@ class CRM_Admin_Page_Job extends CRM_Core_Page_Basic {
}
$sj = new CRM_Core_JobManager();
$rows = $temp = array();
$rows = $temp = [];
foreach ($sj->jobs as $job) {
$action = array_sum(array_keys($this->links()));
......
......@@ -95,7 +95,7 @@ class CRM_Admin_Page_JobLog extends CRM_Core_Page_Basic {
}
$dao->find();
$rows = array();
$rows = [];
while ($dao->fetch()) {
unset($row);
CRM_Core_DAO::storeValues($dao, $row);
......
......@@ -108,7 +108,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic {
*/
public function browse($action = NULL) {
// get all custom groups sorted by weight
$paymentProcessor = array();
$paymentProcessor = [];
$dao = new CRM_Financial_DAO_PaymentProcessor();
$dao->is_test = 0;
$dao->domain_id = CRM_Core_Config::domainID();
......@@ -116,7 +116,7 @@ class CRM_Admin_Page_PaymentProcessor extends CRM_Core_Page_Basic {
$dao->find();
while ($dao->fetch()) {
$paymentProcessor[$dao->id] = array();
$paymentProcessor[$dao->id] = [];
CRM_Core_DAO::storeValues($dao, $paymentProcessor[$dao->id]);
$paymentProcessor[$dao->id]['payment_processor_type'] = CRM_Core_PseudoConstant::getLabel(
'CRM_Financial_DAO_PaymentProcessor', 'payment_processor_type_id', $dao->payment_processor_type_id
......
......@@ -42,20 +42,10 @@ class CRM_Batch_BAO_Batch extends CRM_Batch_DAO_Batch {
* $batch batch object
*/
public static function create(&$params) {
$op = 'edit';
$batchId = $params['id'] ?? NULL;
if (!$batchId) {
$op = 'create';
if (empty($params['id']) && empty($params['name'])) {
$params['name'] = CRM_Utils_String::titleToVar($params['title']);
}
CRM_Utils_Hook::pre($op, 'Batch', $batchId, $params);
$batch = new CRM_Batch_DAO_Batch();
$batch->copyValues($params);
$batch->save();
CRM_Utils_Hook::post($op, 'Batch', $batch->id, $batch);
return $batch;
return self::writeRecord($params);
}
/**
......
......@@ -34,10 +34,8 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
}
if (empty($params['id'])) {
if (empty($params['created_id'])) {
$session = CRM_Core_Session::singleton();
$params['created_id'] = $session->get('userID');
$params['created_id'] = CRM_Core_Session::getLoggedInContactID();
}
if (empty($params['created_date'])) {
......@@ -47,26 +45,11 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
if (empty($params['name'])) {
$params['name'] = CRM_Utils_String::titleToVar($params['title'], 64);
}
CRM_Utils_Hook::pre('create', 'Campaign', NULL, $params);
}
else {
CRM_Utils_Hook::pre('edit', 'Campaign', $params['id'], $params);
}
$campaign = new CRM_Campaign_DAO_Campaign();
$campaign->copyValues($params);
$campaign->save();
if (!empty($params['id'])) {
CRM_Utils_Hook::post('edit', 'Campaign', $campaign->id, $campaign);
}
else {
CRM_Utils_Hook::post('create', 'Campaign', $campaign->id, $campaign);
}
$campaign = self::writeRecord($params);
/* Create the campaign group record */
$groupTableName = CRM_Contact_BAO_Group::getTableName();
if (isset($params['groups']) && !empty($params['groups']['include']) && is_array($params['groups']['include'])) {
......@@ -81,9 +64,7 @@ class CRM_Campaign_BAO_Campaign extends CRM_Campaign_DAO_Campaign {
}
//store custom data
if (!empty($params['custom']) &&
is_array($params['custom'])
) {
if (!empty($params['custom']) && is_array($params['custom'])) {
CRM_Core_BAO_CustomValueTable::store($params['custom'], 'civicrm_campaign', $campaign->id);
}
......
......@@ -62,36 +62,19 @@ class CRM_Campaign_BAO_Survey extends CRM_Campaign_DAO_Survey {
CRM_Core_DAO::executeQuery($query);
}
if (!(CRM_Utils_Array::value('id', $params))) {
if (!(CRM_Utils_Array::value('created_id', $params))) {
$session = CRM_Core_Session::singleton();
$params['created_id'] = $session->get('userID');
if (empty($params['id'])) {
if (empty($params['created_id'])) {
$params['created_id'] = CRM_Core_Session::getLoggedInContactID();
}
if (!(CRM_Utils_Array::value('created_date', $params))) {
if (empty($params['created_date'])) {
$params['created_date'] = date('YmdHis');
}
CRM_Utils_Hook::pre('create', 'Survey', NULL, $params);
}
else {
CRM_Utils_Hook::pre('edit', 'Survey', $params['id'], $params);
}
$dao = new CRM_Campaign_DAO_Survey();
$dao->copyValues($params);
$dao->save();
if (!empty($params['id'])) {
CRM_Utils_Hook::post('edit', 'Survey', $dao->id, $dao);
}
else {
CRM_Utils_Hook::post('create', 'Survey', $dao->id, $dao);
}
$dao = self::writeRecord($params);
if (!empty($params['custom']) &&
is_array($params['custom'])
) {
if (!empty($params['custom']) && is_array($params['custom'])) {
CRM_Core_BAO_CustomValueTable::store($params['custom'], 'civicrm_survey', $dao->id);
}
return $dao;
......
......@@ -55,7 +55,7 @@ class CRM_Campaign_Form_Search extends CRM_Core_Form_Search {
*/
public function preProcess() {
$this->_done = FALSE;
$this->_defaults = array();
$this->_defaults = [];
//set the button name.
$this->_printButtonName = $this->getButtonName('next', 'print');
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment