本文整理汇总了PHP中TTLog::addEntry方法的典型用法代码示例。如果您正苦于以下问题:PHP TTLog::addEntry方法的具体用法?PHP TTLog::addEntry怎么用?PHP TTLog::addEntry使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TTLog
的用法示例。
在下文中一共展示了TTLog::addEntry方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Absence Policy'), NULL, $this->getTable());
}
示例2: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Employee Identification - Employee: ' . $this->getUser() . ' Type: ' . $this->getType()), NULL, $this->getTable());
}
示例3: changePassword
/**
* Allows currently logged in user to change their password.
* @param string $current_password
* @param string $new_password
* @param string $new_password2
* @param string $type
* @return bool
*/
function changePassword($current_password, $new_password, $new_password2, $type = 'web')
{
$ulf = TTnew('UserListFactory');
$ulf->getByIdAndCompanyId($this->getCurrentUserObject()->getId(), $this->getCurrentCompanyObject()->getId());
if ($ulf->getRecordCount() == 1) {
$uf = $ulf->getCurrent();
switch (strtolower($type)) {
case 'quick_punch':
case 'phone':
if ($this->getPermissionObject()->Check('user', 'edit_own_phone_password') == FALSE) {
return $this->getPermissionObject()->PermissionDenied();
}
$log_description = TTi18n::getText('Password - Phone');
if ($current_password != '') {
if ($uf->checkPhonePassword($current_password) !== TRUE) {
Debug::Text('Password check failed!', __FILE__, __LINE__, __METHOD__, 10);
$uf->Validator->isTrue('current_password', FALSE, TTi18n::gettext('Current password is incorrect'));
}
} else {
Debug::Text('Current password not specified', __FILE__, __LINE__, __METHOD__, 10);
$uf->Validator->isTrue('current_password', FALSE, TTi18n::gettext('Current password is incorrect'));
}
if ($new_password != '' or $new_password2 != '') {
if ($new_password == $new_password2) {
$uf->setPhonePassword($new_password);
} else {
$uf->Validator->isTrue('password', FALSE, TTi18n::gettext('Passwords don\'t match'));
}
} else {
$uf->Validator->isTrue('password', FALSE, TTi18n::gettext('Passwords don\'t match'));
}
break;
case 'web':
if ($this->getPermissionObject()->Check('user', 'edit_own_password') == FALSE) {
return $this->getPermissionObject()->PermissionDenied();
}
$log_description = TTi18n::getText('Password - Web');
if ($current_password != '') {
if ($uf->checkPassword($current_password) !== TRUE) {
Debug::Text('Password check failed!', __FILE__, __LINE__, __METHOD__, 10);
$uf->Validator->isTrue('current_password', FALSE, TTi18n::gettext('Current password is incorrect'));
}
} else {
Debug::Text('Current password not specified', __FILE__, __LINE__, __METHOD__, 10);
$uf->Validator->isTrue('current_password', FALSE, TTi18n::gettext('Current password is incorrect'));
}
if ($new_password != '' or $new_password2 != '') {
if ($new_password == $new_password2) {
$uf->setPassword($new_password);
} else {
$uf->Validator->isTrue('password', FALSE, TTi18n::gettext('Passwords don\'t match'));
}
} else {
$uf->Validator->isTrue('password', FALSE, TTi18n::gettext('Passwords don\'t match'));
}
break;
}
if ($uf->isValid()) {
if (DEMO_MODE == TRUE) {
//Return TRUE even in demo mode, but nothing happens.
return $this->returnHandler(TRUE);
} else {
TTLog::addEntry($this->getCurrentUserObject()->getId(), 20, $log_description, NULL, $uf->getTable());
return $this->returnHandler($uf->Save());
//Single valid record
}
} else {
return $this->returnHandler(FALSE, 'VALIDATION', TTi18n::getText('INVALID DATA'), $uf->Validator->getErrorsArray(), array('total_records' => 1, 'valid_records' => 0));
}
}
return $this->returnHandler(FALSE);
}
示例4: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getRecurringScheduleTemplateControl(), $log_action, TTi18n::getText('Recurring Schedule Week') . ': ' . $this->getWeek(), NULL, $this->getTable(), $this);
}
示例5: InitProgressBar
$total_days = TTDate::getDays($end_date - $start_date);
$offset = 86400 / 2;
$init_progress_bar = TRUE;
if ($init_progress_bar == TRUE) {
InitProgressBar();
$init_progress_bar = FALSE;
}
$progress_bar->setValue(0);
$progress_bar->display();
$apf = TTnew('AccrualPolicyFactory');
$aplf = TTnew('AccrualPolicyListFactory');
$aplf->getByIdAndCompanyId((int) $data['accrual_policy_id'], $current_company->getId());
if ($aplf->getRecordCount() > 0) {
foreach ($aplf as $ap_obj) {
$aplf->StartTransaction();
TTLog::addEntry($current_user->getId(), 500, 'Recalculate Accrual Policy: ' . $ap_obj->getName() . ' Start Date: ' . TTDate::getDate('TIME', $data['start_date']) . ' End Date: ' . TTDate::getDate('TIME', $data['end_date']) . ' Total Days: ' . round($total_days), $current_user->getId(), $ap_obj->getTable());
$x = 0;
for ($i = $start_date; $i < $end_date; $i += 86400) {
//$i = TTDate::getBeginDayEpoch( $i ); //This causes infinite loops during DST transitions.
Debug::Text('Recalculating Accruals for Date: ' . TTDate::getDate('DATE+TIME', TTDate::getBeginDayEpoch($i)), __FILE__, __LINE__, __METHOD__, 10);
$ap_obj->addAccrualPolicyTime(TTDate::getBeginDayEpoch($i), $offset);
$progress_bar->setValue(Misc::calculatePercent($x, $total_days));
$progress_bar->display();
$x++;
}
//$aplf->FailTransaction();
$aplf->CommitTransaction();
}
}
$progress_bar->setValue(100);
$progress_bar->display();
示例6: addLog
function addLog($log_action)
{
$u_obj = $this->getUserObject();
if (is_object($u_obj)) {
return TTLog::addEntry($this->getHierarchyControl(), $log_action, TTi18n::getText('Suborindate') . ': ' . $u_obj->getFullName(FALSE, TRUE), NULL, $this->getTable());
}
return FALSE;
}
示例7: generatePayStubs
function generatePayStubs($pay_period_ids, $user_ids = NULL, $enable_correction = FALSE)
{
global $profiler;
Debug::Text('Generate Pay Stubs!', __FILE__, __LINE__, __METHOD__, 10);
if (!$this->getPermissionObject()->Check('pay_period_schedule', 'enabled') or !($this->getPermissionObject()->Check('pay_period_schedule', 'edit') or $this->getPermissionObject()->Check('pay_period_schedule', 'edit_own'))) {
return $this->getPermissionObject()->PermissionDenied();
}
if (!is_array($pay_period_ids)) {
$pay_period_ids = array($pay_period_ids);
}
if ($user_ids !== NULL and !is_array($user_ids) and $user_ids > 0) {
$user_ids = array($user_ids);
} elseif (is_array($user_ids) and isset($user_ids[0]) and $user_ids[0] == 0) {
$user_ids = NULL;
}
foreach ($pay_period_ids as $pay_period_id) {
Debug::text('Pay Period ID: ' . $pay_period_id, __FILE__, __LINE__, __METHOD__, 10);
$pplf = TTnew('PayPeriodListFactory');
$pplf->getByIdAndCompanyId($pay_period_id, $this->getCurrentCompanyObject()->getId());
$epoch = TTDate::getTime();
foreach ($pplf as $pay_period_obj) {
Debug::text('Pay Period Schedule ID: ' . $pay_period_obj->getPayPeriodSchedule(), __FILE__, __LINE__, __METHOD__, 10);
if ($pay_period_obj->isPreviousPayPeriodClosed() == TRUE) {
//Grab all users for pay period
$ppsulf = TTnew('PayPeriodScheduleUserListFactory');
if (is_array($user_ids) and count($user_ids) > 0) {
Debug::text('Generating pay stubs for specific users...', __FILE__, __LINE__, __METHOD__, 10);
TTLog::addEntry($this->getCurrentCompanyObject()->getId(), 500, TTi18n::gettext('Calculating Company Pay Stubs for Pay Period') . ': ' . $pay_period_id, $this->getCurrentUserObject()->getId(), 'pay_stub');
//Notice
$ppsulf->getByCompanyIDAndPayPeriodScheduleIdAndUserID($this->getCurrentCompanyObject()->getId(), $pay_period_obj->getPayPeriodSchedule(), $user_ids);
} else {
TTLog::addEntry($this->getCurrentCompanyObject()->getId(), 500, TTi18n::gettext('Calculating Employee Pay Stub for Pay Period') . ': ' . $pay_period_id, $this->getCurrentUserObject()->getId(), 'pay_stub');
$ppsulf->getByCompanyIDAndPayPeriodScheduleId($this->getCurrentCompanyObject()->getId(), $pay_period_obj->getPayPeriodSchedule());
}
$total_pay_stubs = $ppsulf->getRecordCount();
$this->getProgressBarObject()->start($this->getAMFMessageID(), $total_pay_stubs, NULL, TTi18n::getText('Generating Paystubs...'));
//Delete existing pay stub. Make sure we only
//delete pay stubs that are the same as what we're creating.
$pslf = TTnew('PayStubListFactory');
$pslf->getByPayPeriodId($pay_period_obj->getId());
foreach ($pslf as $pay_stub_obj) {
if (is_array($user_ids) and count($user_ids) > 0 and in_array($pay_stub_obj->getUser(), $user_ids) == FALSE) {
continue;
//Only generating pay stubs for individual employees, skip ones not in the list.
}
Debug::text('Existing Pay Stub: ' . $pay_stub_obj->getId(), __FILE__, __LINE__, __METHOD__, 10);
//Check PS End Date to match with PP End Date
//So if an ROE was generated, it won't get deleted when they generate all other Pay Stubs
//later on.
if ($pay_stub_obj->getStatus() <= 25 and $pay_stub_obj->getTainted() === FALSE and TTDate::getMiddleDayEpoch($pay_stub_obj->getEndDate()) == TTDate::getMiddleDayEpoch($pay_period_obj->getEndDate())) {
Debug::text('Deleting pay stub: ' . $pay_stub_obj->getId(), __FILE__, __LINE__, __METHOD__, 10);
$pay_stub_obj->setDeleted(TRUE);
$pay_stub_obj->Save();
} else {
Debug::text('Pay stub does not need regenerating, or it is LOCKED! ID: ' . $pay_stub_obj->getID() . ' Status: ' . $pay_stub_obj->getStatus() . ' Tainted: ' . (int) $pay_stub_obj->getTainted() . ' Pay Stub End Date: ' . $pay_stub_obj->getEndDate() . ' Pay Period End Date: ' . $pay_period_obj->getEndDate(), __FILE__, __LINE__, __METHOD__, 10);
}
}
$i = 1;
foreach ($ppsulf as $pay_period_schdule_user_obj) {
Debug::text('Pay Period User ID: ' . $pay_period_schdule_user_obj->getUser(), __FILE__, __LINE__, __METHOD__, 10);
Debug::text('Total Pay Stubs: ' . $total_pay_stubs . ' - ' . ceil(1 / (100 / $total_pay_stubs)), __FILE__, __LINE__, __METHOD__, 10);
$profiler->startTimer('Calculating Pay Stub');
//Calc paystubs.
$cps = new CalculatePayStub();
$cps->setEnableCorrection((bool) $enable_correction);
$cps->setUser($pay_period_schdule_user_obj->getUser());
$cps->setPayPeriod($pay_period_obj->getId());
$cps->calculate();
unset($cps);
$profiler->stopTimer('Calculating Pay Stub');
$this->getProgressBarObject()->set($this->getAMFMessageID(), $i);
//sleep(1); /////////////////////////////// FOR TESTING ONLY //////////////////
$i++;
}
unset($ppsulf);
$this->getProgressBarObject()->stop($this->getAMFMessageID());
} else {
UserGenericStatusFactory::queueGenericStatus(TTi18n::gettext('ERROR'), 10, TTi18n::gettext('Pay period prior to %1 is not closed, please close all previous pay periods and try again...', array(TTDate::getDate('DATE', $pay_period_obj->getStartDate()) . ' -> ' . TTDate::getDate('DATE', $pay_period_obj->getEndDate()))), NULL);
}
}
}
if (UserGenericStatusFactory::isStaticQueue() == TRUE) {
$ugsf = TTnew('UserGenericStatusFactory');
$ugsf->setUser($this->getCurrentUserObject()->getId());
$ugsf->setBatchID($ugsf->getNextBatchId());
$ugsf->setQueue(UserGenericStatusFactory::getStaticQueue());
$ugsf->saveQueue();
$user_generic_status_batch_id = $ugsf->getBatchID();
} else {
$user_generic_status_batch_id = FALSE;
}
unset($ugsf);
return $this->returnHandler(TRUE, TRUE, FALSE, FALSE, FALSE, $user_generic_status_batch_id);
}
示例8: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Recurring Pay Stub Amendment'), NULL, $this->getTable(), $this);
}
示例9: emailMessage
function emailMessage()
{
Debug::Text('emailMessage: ', __FILE__, __LINE__, __METHOD__, 10);
$email_to_arr = $this->getEmailMessageAddresses();
if ($email_to_arr == FALSE) {
return FALSE;
}
//Get from User Object so we can include more information in the message.
if (is_object($this->getFromUserObject())) {
$u_obj = $this->getFromUserObject();
} else {
Debug::Text('From object does not exist: ' . $this->getFromUserID(), __FILE__, __LINE__, __METHOD__, 10);
return FALSE;
}
$from = $reply_to = 'DoNotReply@' . Misc::getHostName(FALSE);
global $current_user, $config_vars;
if (is_object($current_user) and $current_user->getWorkEmail() != '') {
$reply_to = $current_user->getWorkEmail();
}
Debug::Text('From: ' . $from . ' Reply-To: ' . $reply_to, __FILE__, __LINE__, __METHOD__, 10);
$to = array_shift($email_to_arr);
Debug::Text('To: ' . $to, __FILE__, __LINE__, __METHOD__, 10);
if (is_array($email_to_arr) and count($email_to_arr) > 0) {
$bcc = implode(',', $email_to_arr);
} else {
$bcc = NULL;
}
Debug::Text('Bcc: ' . $bcc, __FILE__, __LINE__, __METHOD__, 10);
//Define subject/body variables here.
$search_arr = array('#from_employee_first_name#', '#from_employee_last_name#', '#from_employee_default_branch#', '#from_employee_default_department#', '#from_employee_group#', '#from_employee_title#', '#company_name#', '#link#');
$replace_arr = array($u_obj->getFirstName(), $u_obj->getLastName(), is_object($u_obj->getDefaultBranchObject()) ? $u_obj->getDefaultBranchObject()->getName() : NULL, is_object($u_obj->getDefaultDepartmentObject()) ? $u_obj->getDefaultDepartmentObject()->getName() : NULL, is_object($u_obj->getGroupObject()) ? $u_obj->getGroupObject()->getName() : NULL, is_object($u_obj->getTitleObject()) ? $u_obj->getTitleObject()->getName() : NULL, is_object($u_obj->getCompanyObject()) ? $u_obj->getCompanyObject()->getName() : NULL, NULL);
$email_subject = TTi18n::gettext('New message waiting in') . ' ' . APPLICATION_NAME;
$email_body = TTi18n::gettext('*DO NOT REPLY TO THIS EMAIL - PLEASE USE THE LINK BELOW INSTEAD*') . "\n\n";
$email_body .= TTi18n::gettext('You have a new message waiting for you in') . ' ' . APPLICATION_NAME . "\n";
$email_body .= $this->getSubject() != '' ? TTi18n::gettext('Subject') . ': ' . $this->getSubject() . "\n" : NULL;
$email_body .= TTi18n::gettext('From') . ': #from_employee_first_name# #from_employee_last_name#' . "\n";
$email_body .= $replace_arr[2] != '' ? TTi18n::gettext('Default Branch') . ': #from_employee_default_branch#' . "\n" : NULL;
$email_body .= $replace_arr[3] != '' ? TTi18n::gettext('Default Department') . ': #from_employee_default_department#' . "\n" : NULL;
$email_body .= $replace_arr[4] != '' ? TTi18n::gettext('Group') . ': #from_employee_group#' . "\n" : NULL;
$email_body .= $replace_arr[5] != '' ? TTi18n::gettext('Title') . ': #from_employee_title#' . "\n" : NULL;
$email_body .= TTi18n::gettext('Link:') . ' <a href="http://' . Misc::getHostName() . Environment::getDefaultInterfaceBaseURL() . '">' . APPLICATION_NAME . ' ' . TTi18n::gettext('Login') . '</a>';
$email_body .= $replace_arr[6] != '' ? "\n\n\n" . TTi18n::gettext('Company') . ': #company_name#' . "\n" : NULL;
//Always put at the end
$subject = str_replace($search_arr, $replace_arr, $email_subject);
Debug::Text('Subject: ' . $subject, __FILE__, __LINE__, __METHOD__, 10);
$headers = array('From' => $from, 'Subject' => $subject, 'Bcc' => $bcc, 'Reply-To' => $reply_to, 'Return-Path' => $reply_to, 'Errors-To' => $reply_to);
$body = '<pre>' . str_replace($search_arr, $replace_arr, $email_body) . '</pre>';
Debug::Text('Body: ' . $body, __FILE__, __LINE__, __METHOD__, 10);
$mail = new TTMail();
$mail->setTo($to);
$mail->setHeaders($headers);
@$mail->getMIMEObject()->setHTMLBody($body);
$mail->setBody($mail->getMIMEObject()->get($mail->default_mime_config));
$retval = $mail->Send();
if ($retval == TRUE) {
TTLog::addEntry($this->getId(), 500, TTi18n::getText('Email Message to') . ': ' . $to . ' Bcc: ' . $headers['Bcc'], NULL, $this->getTable());
return TRUE;
}
return TRUE;
//Always return true
}
示例10: addLog
function addLog($log_action)
{
if ($this->getValue() == TRUE) {
$value_display = TTi18n::getText('ALLOW');
} else {
$value_display = TTi18n::getText('DENY');
}
return TTLog::addEntry($this->getPermissionControl(), $log_action, TTi18n::getText('Section') . ': ' . Option::getByKey($this->getSection(), $this->getOptions('section')) . ' Name: ' . Option::getByKey($this->getName(), $this->getOptions('name', $this->getSection())) . ' Value: ' . $value_display, NULL, $this->getTable());
}
示例11: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('System Setting - Name') . ': ' . $this->getName() . ' ' . TTi18n::getText('Value') . ': ' . $this->getValue(), NULL, $this->getTable());
}
示例12: emailException
function emailException($u_obj, $user_date_obj, $punch_obj = NULL, $schedule_obj = NULL, $ep_obj = NULL)
{
global $config_vars;
if (!is_object($u_obj)) {
return FALSE;
}
if (!is_object($user_date_obj)) {
return FALSE;
}
if (!is_object($ep_obj)) {
$ep_obj = $this->getExceptionPolicyObject();
}
//Only email on active exceptions.
if ($this->getType() != 50) {
return FALSE;
}
$email_to_arr = $this->getEmailExceptionAddresses($u_obj, $ep_obj);
if ($email_to_arr == FALSE) {
return FALSE;
}
$from = 'DoNotReply@' . Misc::getHostName(FALSE);
$to = array_shift($email_to_arr);
if (is_array($email_to_arr) and count($email_to_arr) > 0) {
$bcc = implode(',', $email_to_arr);
} else {
$bcc = NULL;
}
Debug::Text('To: ' . $to . ' Bcc: ' . $bcc, __FILE__, __LINE__, __METHOD__, 10);
$protocol = 'http';
if (isset($config_vars['other']['force_ssl']) and $config_vars['other']['force_ssl'] == 1) {
$protocol .= 's';
}
//Define subject/body variables here.
$search_arr = array('#employee_first_name#', '#employee_last_name#', '#employee_default_branch#', '#employee_default_department#', '#employee_group#', '#employee_title#', '#exception_code#', '#exception_name#', '#exception_severity#', '#date#', '#company_name#', '#link#', '#schedule_start_time#', '#schedule_end_time#', '#schedule_branch#', '#schedule_department#', '#punch_time#');
$replace_arr = array($u_obj->getFirstName(), $u_obj->getLastName(), is_object($u_obj->getDefaultBranchObject()) ? $u_obj->getDefaultBranchObject()->getName() : NULL, is_object($u_obj->getDefaultDepartmentObject()) ? $u_obj->getDefaultDepartmentObject()->getName() : NULL, is_object($u_obj->getGroupObject()) ? $u_obj->getGroupObject()->getName() : NULL, is_object($u_obj->getTitleObject()) ? $u_obj->getTitleObject()->getName() : NULL, $ep_obj->getType(), Option::getByKey($ep_obj->getType(), $ep_obj->getOptions('type')), Option::getByKey($ep_obj->getSeverity(), $ep_obj->getOptions('severity')), TTDate::getDate('DATE', $user_date_obj->getDateStamp()), is_object($u_obj->getCompanyObject()) ? $u_obj->getCompanyObject()->getName() : NULL, NULL, is_object($schedule_obj) ? TTDate::getDate('TIME', $schedule_obj->getStartTime()) : NULL, is_object($schedule_obj) ? TTDate::getDate('TIME', $schedule_obj->getEndTime()) : NULL, (is_object($schedule_obj) and is_object($schedule_obj->getBranchObject())) ? $schedule_obj->getBranchObject()->getName() : NULL, (is_object($schedule_obj) and is_object($schedule_obj->getDepartmentObject())) ? $schedule_obj->getDepartmentObject()->getName() : NULL, is_object($punch_obj) ? TTDate::getDate('TIME', $punch_obj->getTimeStamp()) : NULL);
$exception_email_subject = ' #exception_name# (#exception_code#) ' . TTi18n::gettext('exception for') . ' #employee_first_name# #employee_last_name# ' . TTi18n::gettext('on') . ' #date#';
$exception_email_body = TTi18n::gettext('Employee') . ': #employee_first_name# #employee_last_name#' . "\n";
$exception_email_body .= TTi18n::gettext('Date') . ': #date#' . "\n";
$exception_email_body .= TTi18n::gettext('Exception') . ': #exception_name# (#exception_code#)' . "\n";
$exception_email_body .= TTi18n::gettext('Severity') . ': #exception_severity#' . "\n";
$exception_email_body .= ($replace_arr[12] != '' or $replace_arr[13] != '' or $replace_arr[14] != '' or $replace_arr[15] != '' or $replace_arr[16] != '') ? "\n" : NULL;
$exception_email_body .= ($replace_arr[12] != '' and $replace_arr[13] != '') ? TTi18n::gettext('Schedule') . ': #schedule_start_time# - #schedule_end_time#' . "\n" : NULL;
$exception_email_body .= $replace_arr[14] != '' ? TTi18n::gettext('Schedule Branch') . ': #schedule_branch#' . "\n" : NULL;
$exception_email_body .= $replace_arr[15] != '' ? TTi18n::gettext('Schedule Department') . ': #schedule_department#' . "\n" : NULL;
if ($replace_arr[16] != '') {
$exception_email_body .= TTi18n::gettext('Punch') . ': #punch_time#' . "\n";
} elseif ($replace_arr[12] != '' and $replace_arr[13] != '') {
$exception_email_body .= TTi18n::gettext('Punch') . ': ' . TTi18n::gettext('None') . "\n";
}
$exception_email_body .= ($replace_arr[2] != '' or $replace_arr[3] != '' or $replace_arr[4] != '' or $replace_arr[5] != '') ? "\n" : NULL;
$exception_email_body .= $replace_arr[2] != '' ? TTi18n::gettext('Default Branch') . ': #employee_default_branch#' . "\n" : NULL;
$exception_email_body .= $replace_arr[3] != '' ? TTi18n::gettext('Default Department') . ': #employee_default_department#' . "\n" : NULL;
$exception_email_body .= $replace_arr[4] != '' ? TTi18n::gettext('Group') . ': #employee_group#' . "\n" : NULL;
$exception_email_body .= $replace_arr[5] != '' ? TTi18n::gettext('Title') . ': #employee_title#' . "\n" : NULL;
$exception_email_body .= "\n";
$exception_email_body .= TTi18n::gettext('Link:') . ' <a href="' . $protocol . '://' . Misc::getHostName() . Environment::getDefaultInterfaceBaseURL() . '">' . APPLICATION_NAME . ' ' . TTi18n::gettext('Login') . '</a>';
$exception_email_body .= $replace_arr[10] != '' ? "\n\n\n" . TTi18n::gettext('Company') . ': #company_name#' . "\n" : NULL;
//Always put at the end
$exception_email_body .= "\n\n" . TTi18n::gettext('Email sent') . ': ' . TTDate::getDate('DATE+TIME', time()) . "\n";
$subject = str_replace($search_arr, $replace_arr, $exception_email_subject);
//Debug::Text('Subject: '. $subject, __FILE__, __LINE__, __METHOD__,10);
$headers = array('From' => $from, 'Subject' => $subject, 'Bcc' => $bcc, 'Reply-To' => $to, 'Return-Path' => $to, 'Errors-To' => $to);
$body = '<pre>' . str_replace($search_arr, $replace_arr, $exception_email_body) . '</pre>';
Debug::Text('Body: ' . $body, __FILE__, __LINE__, __METHOD__, 10);
$mail = new TTMail();
$mail->setTo($to);
$mail->setHeaders($headers);
@$mail->getMIMEObject()->setHTMLBody($body);
$mail->setBody($mail->getMIMEObject()->get($mail->default_mime_config));
$retval = $mail->Send();
if ($retval == TRUE) {
TTLog::addEntry($this->getId(), 500, TTi18n::getText('Email Exception') . ': ' . Option::getByKey($ep_obj->getType(), $ep_obj->getOptions('type')) . ' To: ' . $to . ' Bcc: ' . $headers['Bcc'], $u_obj->getID(), $this->getTable());
//Make sure this log entry is assigned to the user triggering the exception so it can be viewed in the audit log.
}
return TRUE;
}
示例13: addLog
function addLog($log_action)
{
$object_type = Option::getByKey($this->getObjectType(), Misc::TrimSortPrefix($this->getOptions('object_type')));
return TTLog::addEntry($this->getHierarchyControl(), $log_action, TTi18n::getText('Object') . ': ' . $object_type, NULL, $this->getTable());
}
示例14: addLog
function addLog($log_action)
{
$obj = $this->getUserObject();
if (is_object($obj)) {
return TTLog::addEntry($this->getCompanyDeduction(), $log_action, TTi18n::getText('Employee Deduction') . ': ' . $obj->getFullName(), NULL, $this->getTable(), $this);
}
}
示例15: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Ethnic Group: ') . $this->getName(), NULL, $this->getTable(), $this);
}