From a86839e731d73e0f286795c6c62ec0207fc73530 Mon Sep 17 00:00:00 2001 From: eileen Date: Fri, 3 Mar 2017 19:14:55 +1300 Subject: [PATCH] CRM-20213 Change participant_register_date to use datepicker widget --- CRM/Core/BAO/UFGroup.php | 14 ++------------ CRM/Event/Form/Task/Batch.php | 14 +------------- templates/CRM/Event/Form/Task/Batch.tpl | 2 -- 3 files changed, 3 insertions(+), 27 deletions(-) diff --git a/CRM/Core/BAO/UFGroup.php b/CRM/Core/BAO/UFGroup.php index d02c545ee5..0f66ca72aa 100644 --- a/CRM/Core/BAO/UFGroup.php +++ b/CRM/Core/BAO/UFGroup.php @@ -2337,7 +2337,6 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) 'receipt_date' => 'activityDateTime', 'thankyou_date' => 'activityDateTime', 'cancel_date' => 'activityDateTime', - 'participant_register_date' => 'activityDateTime', 'activity_date_time' => 'activityDateTime', ); } @@ -3289,17 +3288,8 @@ AND ( entity_id IS NULL OR entity_id <= 0 ) $formattedGroupTree = array(); // @todo - as we put these on datepicker they need to be removed from here. - $dateTimeFields = array( - 'participant_register_date', - 'activity_date_time', - 'receive_date', - 'receipt_date', - 'cancel_date', - 'thankyou_date', - 'membership_start_date', - 'membership_end_date', - 'join_date', - ); + $dateTimeFields = array_keys(self::getNonUpgradedDateFields()); + foreach ($fields as $name => $field) { $fldName = $isStandalone ? $name : "field[$componentId][$name]"; if (in_array($name, $dateTimeFields)) { diff --git a/CRM/Event/Form/Task/Batch.php b/CRM/Event/Form/Task/Batch.php index bec74ceb2b..515ce6d04b 100644 --- a/CRM/Event/Form/Task/Batch.php +++ b/CRM/Event/Form/Task/Batch.php @@ -269,9 +269,6 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { /** * Process the form after the input has been submitted and validated. - * - * - * @return void */ public function postProcess() { $params = $this->exportValues(); @@ -286,12 +283,8 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { ); $value['id'] = $key; - if (!empty($value['participant_register_date'])) { - $value['register_date'] = CRM_Utils_Date::processDate($value['participant_register_date'], $value['participant_register_date_time']); - } if (!empty($value['participant_role'])) { - $participantRoles = CRM_Event_PseudoConstant::participantRole(); if (is_array($value['participant_role'])) { $value['role_id'] = implode(CRM_Core_DAO::VALUE_SEPARATOR, array_keys($value['participant_role'])); } @@ -318,14 +311,9 @@ class CRM_Event_Form_Task_Batch extends CRM_Event_Form_Task { } } - if (!empty($value['participant_source'])) { - $value['source'] = $value['participant_source']; - } - unset($value['participant_register_date']); unset($value['participant_status']); - unset($value['participant_source']); - CRM_Event_BAO_Participant::create($value); + civicrm_api3('Participant', 'create', $value); //need to trigger mails when we change status if ($statusChange) { diff --git a/templates/CRM/Event/Form/Task/Batch.tpl b/templates/CRM/Event/Form/Task/Batch.tpl index 883c7af87b..d5f5f04255 100644 --- a/templates/CRM/Event/Form/Task/Batch.tpl +++ b/templates/CRM/Event/Form/Task/Batch.tpl @@ -101,8 +101,6 @@ {/strip} - {elseif ( $n eq 'participant_register_date' ) } - {include file="CRM/common/jcalendar.tpl" elementName=$n elementIndex=$pid batchUpdate=1} {else} {$form.field.$pid.$n.html} {/if} -- 2.25.1