Commit f0796f06 authored by Michael McAndrew's avatar Michael McAndrew

updating dedupe rule from strict to unsupervised

parent 77e6f3a5
......@@ -46,10 +46,10 @@ define( 'CIVICRM_ARCHIVE_EMAIL' , "CiviCRM Email Archival <archive@civicrm.o
// ** SURVEY settings **
// =======================
define( 'CIVICRM_EVENT_SURVEY_CG_TITLE', 'Event_Survey' );
// Note: Don't forget to change name of the event type in xml data file
// Note: Don't forget to change name of the event type in xml data file
// when you change the event type id below
define( 'CIVICRM_EVENT_SURVEY_EVENT_TYPE_ID', 3 );
// Note: Don't forget to change name of the template directory
// Note: Don't forget to change name of the template directory
// when you change the profile id below
define( 'CIVICRM_EVENT_SURVEY_PROFILE_ID', 9 );
......@@ -104,10 +104,10 @@ AND e.is_primary = 1
function _civicrm_regsite_civicrm_buildForm_Profile_RegSite( &$form ) {
// add first name, last name and email
$attributes = CRM_Core_DAO::getAttribute('CRM_Contact_DAO_Contact');
// first_name
$form->add('text', 'regsite_first_name', ts('First Name'), $attributes['first_name'], true );
// last_name
$form->add('text', 'regsite_last_name', ts('Last Name') , $attributes['last_name'] , true );
......@@ -126,7 +126,7 @@ function _civicrm_regsite_civicrm_buildForm_Profile_RegSite( &$form ) {
'return.last_name' => 1,
'return.email' => 1,
'version' => 3 );
require_once 'api/api.php';
$contact = civicrm_api( 'contact', 'get', $params );
if ( !civicrm_error( $contact ) ) {
......@@ -170,16 +170,16 @@ function _civicrm_regsite_civicrm_postProcess_Profile_RegSite( &$form ) {
$orgContactParams = array( 'first_name' => CRM_Utils_Array::value( 'regsite_first_name', $params ),
'last_name' => CRM_Utils_Array::value( 'regsite_last_name', $params ),
'email' => CRM_Utils_Array::value( 'regsite_email', $params ) );
$dedupeParams = CRM_Dedupe_Finder::formatParams( $orgContactParams, 'Individual' );
$dedupeParams['check_permission'] = false;
$dupeIDs = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual', 'Strict');
$dupeIDs = CRM_Dedupe_Finder::dupesByParams($dedupeParams, 'Individual', 'Unsupervised');
$contactID = null;
if ( is_array( $dupeIDs ) && !empty( $dupeIDs ) ) {
$contactID = array_pop( $dupeIDs );
}
$orgContactParams['email'] = array( );
$orgContactParams['email'][1] = array( );
$orgContactParams['email'][1]['email'] = CRM_Utils_Array::value( 'regsite_email', $params );
......@@ -191,7 +191,7 @@ function _civicrm_regsite_civicrm_postProcess_Profile_RegSite( &$form ) {
// now lets add the contact to the group as specified in the constants
$groupParams = array( 'contact_id' => $contactID,
'group_id' => REGSITE_INDIVIDUAL_GROUP,
'group_id' => REGSITE_INDIVIDUAL_GROUP,
'version' => 3);
require_once 'api/api.php';
civicrm_api( 'GroupContact', 'create', $groupParams );
......@@ -206,7 +206,7 @@ function _civicrm_regsite_civicrm_postProcess_Profile_RegSite( &$form ) {
$relationship->selectAdd();
$relationship->selectAdd( 'id, is_active, is_permission_a_b' );
$relationship->find( true );
$relationship->is_active = 1;
$relationship->is_permission_a_b = 1;
$relationship->save( );
......@@ -267,9 +267,9 @@ function civicrm_regsite_civicrm_pageRun( &$page ) {
function _civicrm_regsite_civicrm_pageRun_Profile_RegSite( &$page ) {
// get the id of the org
$orgID = $page->getVar( '_id' );
$dao =& _civicrm_regsite_get_permissioned_contacts( $orgID );
$names = array( );
while ( $dao->fetch( ) ) {
$names[] = "{$dao->display_name} ({$dao->email})";
......@@ -307,7 +307,7 @@ function _event_survey_civicrm_buildForm_Profile( $formName, &$form ) {
// simplified formatted groupTree
$groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree( $groupTree, 1, $form );
CRM_Core_BAO_CustomGroup::buildQuickForm( $form, $groupTree, false, 1, 'event_survey_' );
if ( isset($groupTree) && is_array($groupTree) ) {
$participantId = CRM_Utils_Request::retrieve( 'pid', 'Positive', $form, true, 0, 'REQUEST' );
$contactId = CRM_Core_DAO::getFieldValue( "CRM_Event_DAO_Participant", $participantId, 'contact_id' );
......@@ -328,7 +328,7 @@ function _event_survey_civicrm_postProcess_Profile( $class, &$form ) {
CIVICRM_EVENT_SURVEY_EVENT_TYPE_ID );
// simplified formatted groupTree
$groupTree = CRM_Core_BAO_CustomGroup::formatGroupTree( $groupTree, 1, $form );
if ( isset($groupTree) && is_array($groupTree) ) {
$participantId = CRM_Utils_Request::retrieve( 'pid', 'Positive', $form, true, 0, 'REQUEST' );
......@@ -357,9 +357,9 @@ function _event_survey_civicrm_postProcess_Profile( $class, &$form ) {
require_once 'CRM/Utils/Mail.php';
CRM_Utils_Mail::send( $params );
return CRM_Utils_System::redirect( CRM_Utils_System::url( 'civicrm/profile/view',
"reset=1&gid=" . $form->getVar( '_gid' ) .
"&id=" . $form->getVar( '_id' ) .
return CRM_Utils_System::redirect( CRM_Utils_System::url( 'civicrm/profile/view',
"reset=1&gid=" . $form->getVar( '_gid' ) .
"&id=" . $form->getVar( '_id' ) .
"&pid=" . $participantId ) );
}
}
......
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