Index: branches/5.2.x/core/units/forms/submission_log/submission_log_eh.php =================================================================== diff -u -N -r15049 -r15065 --- branches/5.2.x/core/units/forms/submission_log/submission_log_eh.php (.../submission_log_eh.php) (revision 15049) +++ branches/5.2.x/core/units/forms/submission_log/submission_log_eh.php (.../submission_log_eh.php) (revision 15065) @@ -1,6 +1,6 @@ GetDBField('ReplyFromEmail'); $to_email = $form_submission_helper->getFieldByRole($form_submission, SubmissionFormField::COMMUNICATION_ROLE_EMAIL); - if ($this->Application->GetVar('client_mode')) { + if ( $this->Application->GetVar('client_mode') ) { // debug code for sending email from client $object->SetDBField('FromEmail', $to_email); $object->SetDBField('ToEmail', $from_email); @@ -104,26 +105,26 @@ $object->SetDBField('Bcc', $form->GetDBField('ReplyBcc')); $ids = $this->StoreSelectedIDs($event); - if ($ids) { + if ( $ids ) { $org_message =& $this->Application->recallObject($event->Prefix . '.-item', null, Array ('skip_autoload' => true)); /* @var $org_message kDBItem */ - $org_message->Load( array_shift($ids) ); + $org_message->Load(array_shift($ids)); // client could reply from different email, so compare to admin email! - if ($org_message->GetDBField('ToEmail') == $from_email) { + if ( $org_message->GetDBField('ToEmail') == $from_email ) { // can reply only to client email, not own :) // transform subject $message_subject = $org_message->GetDBField('Subject'); - if ($message_subject) { + if ( $message_subject ) { $object->SetDBField('Subject', $this->_transformSubject($message_subject, 'Re')); } // add signature $message_body = $form->GetDBField('ReplyMessageSignature'); - if ($org_message->GetDBField('Message')) { + if ( $org_message->GetDBField('Message') ) { // add replied marks $message_body .= '> ' . preg_replace('/([\r]*\n)/', '\\1> ', $org_message->GetDBField('Message')); } @@ -139,11 +140,11 @@ WHERE FormSubmissionId = ' . $form_submission->GetID(); $replies_found = $this->Conn->GetOne($sql); - if (!$replies_found) { + if ( !$replies_found ) { // 1st message from admin -> quote subject & text from feedback $message_subject = $form_submission_helper->getFieldByRole($form_submission, SubmissionFormField::COMMUNICATION_ROLE_SUBJECT, true); - if ($message_subject) { + if ( $message_subject ) { $object->SetDBField('Subject', $this->_transformSubject($message_subject, 'Re')); } @@ -153,7 +154,7 @@ // add replied marks $original_message_body = $form_submission_helper->getFieldByRole($form_submission, SubmissionFormField::COMMUNICATION_ROLE_BODY); - if ($original_message_body) { + if ( $original_message_body ) { $message_body .= '> ' . preg_replace('/([\r]*\n)/', '\\1> ', $original_message_body); } @@ -246,7 +247,7 @@ * @return void * @access protected */ - protected function OnBeforeItemCreate(&$event) + protected function OnBeforeItemCreate(kEvent &$event) { parent::OnBeforeItemCreate($event); @@ -261,7 +262,7 @@ * @return void * @access protected */ - protected function OnBeforeItemUpdate(&$event) + protected function OnBeforeItemUpdate(kEvent &$event) { parent::OnBeforeItemUpdate($event); @@ -409,7 +410,7 @@ * @return void * @access protected */ - protected function OnAfterItemCreate(&$event) + protected function OnAfterItemCreate(kEvent &$event) { parent::OnAfterItemCreate($event); @@ -471,8 +472,10 @@ * Updates last update time for submission * * @param kEvent $event + * @return void + * @access protected */ - function OnAfterItemUpdate(&$event) + protected function OnAfterItemUpdate(kEvent &$event) { parent::OnAfterItemUpdate($event); @@ -482,9 +485,9 @@ /* @var $object kDBItem */ // send out email event to admin for bouncing - if ( $object->GetOriginalField('SentStatus') != $object->GetDBField('SentStatus') - && $object->GetDBField('SentStatus') == SUBMISSION_LOG_BOUNCE ) { + $sent_status = $object->GetDBField('SentStatus'); + if ( $object->GetOriginalField('SentStatus') != $sent_status && $sent_status == SUBMISSION_LOG_BOUNCE ) { $this->Application->EmailEventAdmin('FORM.SUBMISSION.REPLY.FROM.USER.BOUNCED'); } }