Skip to content

Commit

Permalink
Update Participant.php
Browse files Browse the repository at this point in the history
Removed 3 instances of assignment in if operators. This is ambiguous and against the Civi coding standards.
  • Loading branch information
JohnFF committed Jun 5, 2014
1 parent 8a6b1ea commit 0cca0bf
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions CRM/Event/BAO/Participant.php
Original file line number Diff line number Diff line change
Expand Up @@ -952,7 +952,8 @@ static function fixEventLevel(&$eventLevel) {
$eventLevel = implode(', ', explode(CRM_Core_DAO::VALUE_SEPARATOR,
substr($eventLevel, 1, -1)
));
if ($pos = strrpos($eventLevel, '(multiple participants)', 0)) {
$pos = strrpos($eventLevel, '(multiple participants)', 0);
if ($pos) {
$eventLevel = substr_replace($eventLevel, "", $pos - 3, 1);
}
}
Expand Down Expand Up @@ -1430,7 +1431,8 @@ static function sendTransitionParticipantMail(
return $mailSent;
}

if ($toEmail = CRM_Utils_Array::value('email', $contactDetails)) {
$toEmail = CRM_Utils_Array::value('email', $contactDetails);
if ($toEmail) {

$contactId = $participantValues['contact_id'];
$participantName = $contactDetails['display_name'];
Expand All @@ -1439,7 +1441,8 @@ static function sendTransitionParticipantMail(
$checksumValue = NULL;
if ($mailType == 'Confirm' && !$participantValues['registered_by_id']) {
$checksumLife = 'inf';
if ($endDate = CRM_Utils_Array::value('end_date', $eventDetails)) {
$endDate = CRM_Utils_Array::value('end_date', $eventDetails);
if ($endDate) {
$checksumLife = (CRM_Utils_Date::unixTime($endDate) - time()) / (60 * 60);
}
$checksumValue = CRM_Contact_BAO_Contact_Utils::generateChecksum($contactId, NULL, $checksumLife);
Expand Down Expand Up @@ -1774,4 +1777,3 @@ static function deleteContactParticipant($contactId) {
}
}
}

0 comments on commit 0cca0bf

Please sign in to comment.