本文整理汇总了PHP中TTLog类的典型用法代码示例。如果您正苦于以下问题:PHP TTLog类的具体用法?PHP TTLog怎么用?PHP TTLog使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TTLog类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Recurring Pay Stub Amendment'), NULL, $this->getTable(), $this);
}
开发者ID:alachaum,项目名称:timetrex,代码行数:4,代码来源:RecurringPayStubAmendmentFactory.class.php
示例2: 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);
}
开发者ID:alachaum,项目名称:timetrex,代码行数:80,代码来源:APIUser.class.php
示例3: TTUser
$tsess = TTGenid::getbypid($touser);
$ftu = new TTUser($fsess['id']);
$ttu = new TTUser($tsess['id']);
$att = $tsess['authat'];
$ut = $tsess['ut'];
$gemd = $tsess['gemd'];
if ($link['gift']) {
$lg = $link['gift'];
} else {
$lg = 0;
}
$new = 0;
if ($_REQUEST['new']) {
$new = 1;
}
TTLog::record(array('m' => 'accept_invite', 'tm' => $_SERVER['REQUEST_TIME'], 'u' => $fromuser, 'sp1' => $lg, 'sp2' => $new, 'intp1' => $touser));
//$tudata=$ftu->getf(array('name','icon'));
$getted = $link['geted'];
$ids = $link['ids'];
$got = false;
$invite = false;
if (strtotime($link['date']) < strtotime('20100906')) {
foreach ($ids as $id) {
if ($id == $touser) {
$invite = true;
break;
}
}
foreach ($getted as $u => $v) {
if ($u == $touser) {
$got = true;
开发者ID:uning,项目名称:mall-back,代码行数:31,代码来源:accept.php
示例4: addLog
function addLog($log_action)
{
$u_obj = $this->getUserObject();
if (is_object($u_obj)) {
return TTLog::addEntry($this->getStation(), $log_action, TTi18n::getText('Employee') . ': ' . $u_obj->getFullName(FALSE, TRUE), NULL, $this->getTable());
}
return FALSE;
}
开发者ID:alachaum,项目名称:timetrex,代码行数:8,代码来源:StationIncludeUserFactory.class.php
示例5: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Company Deduction'), NULL, $this->getTable());
}
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:4,代码来源:CompanyDeductionFactory.class.php
示例6:
<?php
require_once 'ttserver/test_config.php';
//璁板綍鏃ュ織
$m = $_GET['m'];
if ($m) {
$_GET['tm'] = $_SERVER['REQUEST_TIME'];
TTLog::record($_GET);
}
开发者ID:uning,项目名称:mall-back,代码行数:9,代码来源:error.php
示例7: runManualCommand
//.........这里部分代码省略.........
}
$s_obj->setLastPunchTimeStamp($s_obj->getLastPunchTimeStamp());
if ($s_obj->getTimeZone() != '' and !is_numeric($s_obj->getTimeZone())) {
Debug::text('Setting Station TimeZone To: ' . $s_obj->getTimeZone(), __FILE__, __LINE__, __METHOD__, 10);
TTDate::setTimeZone($s_obj->getTimeZone());
}
$result_str = NULL;
switch ($command) {
case 'test_connection':
if ($tc->testConnection() == TRUE) {
$result_str = TTi18n::gettext('Connection Succeeded!');
} else {
$result_str = TTi18n::gettext('Connection Failed!');
}
break;
case 'set_date':
TTDate::setTimeZone($row['time_zone_id'], $s_obj->getTimeZone());
if ($tc->setDate(time()) == TRUE) {
$result_str = TTi18n::gettext('Date Successfully Set To: ') . TTDate::getDate('DATE+TIME', time());
} else {
$result_str = TTi18n::gettext('Setting Date Failed!');
}
break;
case 'download':
if (isset($s_obj) and $tc->Poll($this->getCurrentCompanyObject(), $s_obj) == TRUE) {
$result_str = TTi18n::gettext('Download Data Succeeded!');
if ($s_obj->isValid()) {
$s_obj->Save(FALSE);
}
} else {
$result_str = TTi18n::gettext('Download Data Failed!');
}
break;
case 'upload':
if (isset($s_obj) and $tc->Push($this->getCurrentCompanyObject(), $s_obj) == TRUE) {
$result_str = TTi18n::gettext('Upload Data Succeeded!');
if ($s_obj->isValid()) {
$s_obj->Save(FALSE);
}
} else {
$result_str = TTi18n::gettext('Upload Data Failed!');
}
break;
case 'update_config':
if (isset($s_obj) and $tc->setModeFlag($s_obj->getModeFlag()) == TRUE) {
$result_str = TTi18n::gettext('Update Configuration Succeeded');
} else {
$result_str = TTi18n::gettext('Update Configuration Failed');
}
break;
case 'delete_data':
if (isset($s_obj) and $tc->DeleteAllData($s_obj) == TRUE) {
$result_str = TTi18n::gettext('Delete Data Succeeded!');
if ($s_obj->isValid()) {
$s_obj->Save(FALSE);
}
} else {
$result_str = TTi18n::gettext('Delete Data Failed!');
}
break;
case 'reset_last_punch_time_stamp':
$s_obj->setLastPunchTimeStamp(time());
if ($s_obj->isValid()) {
$s_obj->Save(FALSE);
}
$result_str = TTi18n::gettext('Reset Last Punch Time Succeeded!');
break;
case 'clear_last_punch_time_stamp':
$s_obj->setLastPunchTimeStamp(1);
if ($s_obj->isValid()) {
$s_obj->Save(FALSE);
}
$result_str = TTi18n::gettext('Clear Last Punch Time Succeeded!');
break;
case 'restart':
$tc->restart();
$result_str = TTi18n::gettext('Restart Succeeded!');
break;
case 'firmware':
if ($tc->setFirmware() == TRUE) {
$result_str = TTi18n::gettext('Firmware Update Succeeded!');
} else {
$result_str = TTi18n::gettext('Firmware Update Failed!');
}
break;
default:
$result_str = TTi18n::gettext('Invalid manual command!');
break;
}
TTLog::addEntry($s_obj->getId(), 500, TTi18n::getText('TimeClock Manual Command') . ': ' . ucwords(str_replace('_', ' ', $command)) . ' ' . TTi18n::getText('Result') . ': ' . $result_str, NULL, $s_obj->getTable());
if (isset($s_obj)) {
$row['last_poll_date'] = $s_obj->getLastPollDate();
$row['last_push_date'] = $s_obj->getLastPushDate();
}
unset($s_obj, $slf);
}
return $this->returnHandler($result_str);
}
return $this->returnHandler(FALSE);
}
开发者ID:alachaum,项目名称:timetrex,代码行数:101,代码来源:APIStation.class.php
示例8: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Punch - Employee') . ': ' . $this->getUser() . TTi18n::getText(' Timestamp') . ': ' . TTDate::getDate('DATE+TIME', $this->getTimeStamp()), NULL, $this->getTable());
}
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:4,代码来源:PunchFactory.class.php
示例9: update_help
/**
* 更新帮助获取物品
* @param
tag
fid
* @return one or a array of help open objects
*/
public function update_help($tag, $fid)
{
$oid = $this->getoid($tag, 'ho');
$obj = $this->getbyid($oid);
$now = $_SERVER['REQUEST_TIME'];
$obj['help'][$fid] = $now;
$obj['id'] = $oid;
TTLog::record(array('s' => 'OK', 'm' => __METHOD__, 'tm' => $now, 'sp1' => $tag, 'intp1' => $fid));
$this->puto($obj);
}
开发者ID:uning,项目名称:mall-back,代码行数:18,代码来源:TTUser.php
示例10: emailMessage
function emailMessage()
{
Debug::Text('emailMessage: ', __FILE__, __LINE__, __METHOD__, 10);
$email_to_arr = $this->getEmailMessageAddresses();
if ($email_to_arr == FALSE) {
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;
}
$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";
if ($this->getSubject() != '') {
$email_body .= TTi18n::gettext('Subject:') . ' ' . $this->getSubject() . "\n";
}
$protocol = 'http';
if (isset($config_vars['other']['force_ssl']) and $config_vars['other']['force_ssl'] == 1) {
$protocol .= 's';
}
$email_body .= TTi18n::gettext('Link') . ': <a href="' . $protocol . '://' . Misc::getHostName() . Environment::getDefaultInterfaceBaseURL() . '">' . APPLICATION_NAME . ' ' . TTi18n::getText('Login') . '</a>';
//Define subject/body variables here.
$search_arr = array('#employee_first_name#', '#employee_last_name#');
$replace_arr = array(NULL, NULL);
$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
}
开发者ID:alachaum,项目名称:timetrex,代码行数:52,代码来源:MessageFactory.class.php
示例11: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Pay Stub Amendment - User ID') . ': ' . $this->getUser() . ' ' . TTi18n::getText('Amount') . ': ' . $this->getAmount(), NULL, $this->getTable());
}
开发者ID:J-P-Hanafin,项目名称:TimeTrex-1,代码行数:4,代码来源:PayStubAmendmentFactory.class.php
示例12: addLog
function addLog($log_action)
{
//Don't do detail logging for this, as it will store entire figerprints in the log table.
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Employee Identification - Employee') . ': ' . UserListFactory::getFullNameById($this->getUser()) . ' ' . TTi18n::getText('Type') . ': ' . Option::getByKey($this->getType(), $this->getOptions('type')), NULL, $this->getTable());
}
开发者ID:alachaum,项目名称:timetrex,代码行数:5,代码来源:UserIdentificationFactory.class.php
示例13: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getId(), $log_action, TTi18n::getText('Ethnic Group: ') . $this->getName(), NULL, $this->getTable(), $this);
}
开发者ID:alachaum,项目名称:timetrex,代码行数:4,代码来源:EthnicGroupFactory.class.php
示例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);
}
}
开发者ID:alachaum,项目名称:timetrex,代码行数:7,代码来源:UserDeductionFactory.class.php
示例15: addLog
function addLog($log_action)
{
$u_obj = $this->getUserObject();
if (is_object($u_obj)) {
return TTLog::addEntry($this->getHierarchyControl(), $log_action, TTi18n::getText('Superior') . ': ' . $u_obj->getFullName() . ' ' . TTi18n::getText('Level') . ': ' . $this->getLevel(), NULL, $this->getTable(), $this);
}
return FALSE;
}
开发者ID:alachaum,项目名称:timetrex,代码行数:8,代码来源:HierarchyLevelFactory.class.php
示例16: addLog
function addLog($log_action)
{
$kpi_obj = $this->getKPIObject();
if (is_object($kpi_obj)) {
return TTLog::addEntry($this->getUserReviewControl(), $log_action, TTi18n::getText('Employee Review KPI') . ' - ' . TTi18n::getText('KPI') . ': ' . $kpi_obj->getName(), NULL, $this->getTable(), $this);
}
return FALSE;
}
开发者ID:alachaum,项目名称:timetrex,代码行数:8,代码来源:UserReviewFactory.class.php
示例17: _handle
protected function _handle(&$req)
{
//just add method map here
$method = $req['m'];
$mypre = $method;
if ($this->_debug) {
CrabTools::mydump($req['p'], REQ_DATA_ROOT . $mypre . '.param');
}
if (isset(self::$exist_methods[$method])) {
$caller =& self::$exist_methods[$method];
$c =& $caller[0];
$m = $caller[1];
} else {
$caller = explode('.', $method);
$cn = $caller[0];
$m = $caller[1];
$file = CONTROLLER_ROOT . "{$cn}.php";
if (!file_exists($file)) {
throw new JsonServerExecption("method {$method} file not exist:(" . CONTROLLER_ROOT . "{$cn}.php)");
}
@(require_once $file);
$c = new $cn();
if (!method_exists($c, $m)) {
throw new JsonServerExecption("{$cn} don't has callable method {$m}");
}
}
$log_method = array('Achieve.get' => 1, 'Achieve.finish' => 1, 'Advert.buy' => 1, 'Advert.set' => 1, 'Cinema.enter' => 1, 'Cinema.pick' => 1, 'Gift.send' => 1, 'Gift.accept' => 1, 'Man.update' => 1, 'UserController.login' => 1, 'UserController.precheckout' => 1, 'UserController.update_friends' => 1, 'UserController.enlarge_mall' => 1, 'ItemController.buy' => 1, 'ItemController.sale' => 1, 'CarController.buy' => 1, 'CarController.sale' => 1, 'CarController.go_goods' => 1, 'CarController.enlarge_garage' => 1, 'GoodsController.buy' => 1, 'GoodsController.remove' => 1, 'GoodsController.exhibit_goods' => 1, 'GoodsController.checkshop' => 1, 'GoodsController.checkout' => 1, 'TaskController.share' => 1, 'TaskController.request' => 1, 'TaskController.accept' => 1, 'TaskController.update' => 1, 'TaskController.finish' => 1, 'TaskController.get_award' => 1, 'Friend.dis_neighbor' => 1, 'Friend.invite_neighbor' => 1, 'Friend.accept_neighbor' => 1);
$ret = $c->{$m}($req['p']);
if ($this->_debug) {
CrabTools::myprint($ret, REQ_DATA_ROOT . $mypre . '.resp');
}
if (!$ret) {
$ret['s'] = "KO";
$ret['msg'] = "{$cn}::{$m} return null";
}
if ($ret['s'] == 'OK') {
if (array_key_exists($method, $log_method)) {
TTLog::record(array('m' => $method, 'p' => json_encode($params)));
}
}
return $ret;
}
开发者ID:uning,项目名称:backend_common,代码行数:42,代码来源:JsonServer.php
示例18: 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());
}
开发者ID:alachaum,项目名称:timetrex,代码行数:5,代码来源:HierarchyObjectTypeFactory.class.php
示例19: addLog
function addLog($log_action)
{
return TTLog::addEntry($this->getRecurringScheduleTemplateControl(), $log_action, TTi18n::getText('Recurring Schedule Week') . ': ' . $this->getWeek(), NULL, $this->getTable(), $this);
}
开发者ID:alachaum,项目名称:timetrex,代码行数:4,代码来源:RecurringScheduleTemplateFactory.class.php
示例20: 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();
开发者ID:alachaum,项目名称:timetrex,代码行数:31,代码来源:ProgressBar.php
注:本文中的TTLog类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论