本文整理汇总了PHP中Cron::TicketMonitor方法的典型用法代码示例。如果您正苦于以下问题:PHP Cron::TicketMonitor方法的具体用法?PHP Cron::TicketMonitor怎么用?PHP Cron::TicketMonitor使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Cron
的用法示例。
在下文中一共展示了Cron::TicketMonitor方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
function run()
{
//called by outside cron NOT autocron
Cron::MailFetcher();
Cron::TicketMonitor();
cron::PurgeLogs();
}
示例2: updatePref
function updatePref($var, &$errors)
{
if (!$var || $errors) {
return false;
}
$f = array();
$f['helpdesk_url'] = array('type' => 'string', 'required' => 1, 'error' => 'Assistência técnica URlnecessário');
//TODO: Add url validation
$f['helpdesk_title'] = array('type' => 'string', 'required' => 1, 'error' => 'Título da Assistência Técnica exigido');
$f['default_dept_id'] = array('type' => 'int', 'required' => 1, 'error' => 'Departamento Padrão necessário');
$f['default_email_id'] = array('type' => 'int', 'required' => 1, 'error' => 'E-mail padrão exigido');
$f['default_template_id'] = array('type' => 'int', 'required' => 1, 'error' => 'Você deve selecionar modelo.');
$f['staff_session_timeout'] = array('type' => 'int', 'required' => 1, 'error' => 'Digite tempo inativo em minutos');
$f['client_session_timeout'] = array('type' => 'int', 'required' => 1, 'error' => 'Digite tempo inativo em minutos');
$f['time_format'] = array('type' => 'string', 'required' => 1, 'error' => 'Formato de tempo necessário');
//TODO: Add date format validation
$f['date_format'] = array('type' => 'string', 'required' => 1, 'error' => 'Formato da data requerida');
$f['datetime_format'] = array('type' => 'string', 'required' => 1, 'error' => 'Formato de data e hora necessária');
$f['daydatetime_format'] = array('type' => 'string', 'required' => 1, 'error' => 'Formato dia, data e hora necessária');
$f['admin_email'] = array('type' => 'email', 'required' => 1, 'error' => 'E-mail válido necessário');
$f['autolock_minutes'] = array('type' => 'int', 'required' => 1, 'error' => 'Digite o tempo de bloqueio em minutos');
//TODO: check option fields for validity.
//do the validation.
$val = new Validator();
$val->setFields($f);
if (!$val->validate($var)) {
$errors = array_merge($errors, $val->errors());
}
if ($var['ticket_alert_active'] && (!isset($var['ticket_alert_admin']) && !isset($var['ticket_alert_dept_manager']) && !isset($var['ticket_alert_dept_members']))) {
$errors['ticket_alert_active'] = 'Sem destinatário(s) selecionado';
}
if ($var['message_alert_active'] && (!isset($var['message_alert_laststaff']) && !isset($var['message_alert_assigned']) && !isset($var['message_alert_dept_manager']))) {
$errors['message_alert_active'] = 'Sem destinatário(s) selecionado';
}
if ($var['note_alert_active'] && (!isset($var['note_alert_laststaff']) && !isset($var['note_alert_assigned']) && !isset($var['note_alert_dept_manager']))) {
$errors['note_alert_active'] = 'Sem destinatário(s) selecionado';
}
if ($var['strip_quoted_reply'] && !$var['reply_separator']) {
$errors['reply_separator'] = 'Separador de resposta necessário (?)';
}
if ($var['enable_captcha']) {
if (!extension_loaded('gd')) {
$errors['enable_captcha'] = 'Extensão GD necessária';
} elseif (!function_exists('imagepng')) {
$errors['enable_captcha'] = 'Suporte PNG necessário para a imagem captcha';
}
}
if (!$errors['admin_email'] && Email::getIdByEmail($var['admin_email'])) {
//Make sure admin email is not also a system email.
$errors['admin_email'] = 'E-mail já está configurado como e-mail do sistema';
}
if ($errors) {
return false;
}
//No go!
//We are good to go...blanket update!
$sql = 'UPDATE ' . CONFIG_TABLE . ' SET isonline=' . db_input($var['isonline']) . ',timezone_offset=' . db_input($var['timezone_offset']) . ',enable_daylight_saving=' . db_input(isset($var['enable_daylight_saving']) ? 1 : 0) . ',staff_ip_binding=' . db_input(isset($var['staff_ip_binding']) ? 1 : 0) . ',staff_max_logins=' . db_input($var['staff_max_logins']) . ',staff_login_timeout=' . db_input($var['staff_login_timeout']) . ',staff_session_timeout=' . db_input($var['staff_session_timeout']) . ',client_max_logins=' . db_input($var['client_max_logins']) . ',client_login_timeout=' . db_input($var['client_login_timeout']) . ',client_session_timeout=' . db_input($var['client_session_timeout']) . ',max_page_size=' . db_input($var['max_page_size']) . ',log_level=' . db_input($var['log_level']) . ',log_graceperiod=' . db_input($var['log_graceperiod']) . ',max_open_tickets=' . db_input($var['max_open_tickets']) . ',autolock_minutes=' . db_input($var['autolock_minutes']) . ',overdue_grace_period=' . db_input($var['overdue_grace_period']) . ',alert_email_id=' . db_input($var['alert_email_id']) . ',default_email_id=' . db_input($var['default_email_id']) . ',default_dept_id=' . db_input($var['default_dept_id']) . ',default_priority_id=' . db_input($var['default_priority_id']) . ',default_template_id=' . db_input($var['default_template_id']) . ',default_smtp_id=' . db_input($var['default_smtp_id']) . ',spoof_default_smtp=' . db_input($var['default_smtp'] && isset($var['spoof_default_smtp']) ? 1 : 0) . ',clickable_urls=' . db_input(isset($var['clickable_urls']) ? 1 : 0) . ',allow_priority_change=' . db_input(isset($var['allow_priority_change']) ? 1 : 0) . ',use_email_priority=' . db_input(isset($var['use_email_priority']) ? 1 : 0) . ',enable_captcha=' . db_input(isset($var['enable_captcha']) ? 1 : 0) . ',enable_auto_cron=' . db_input(isset($var['enable_auto_cron']) ? 1 : 0) . ',enable_mail_fetch=' . db_input(isset($var['enable_mail_fetch']) ? 1 : 0) . ',enable_email_piping=' . db_input(isset($var['enable_email_piping']) ? 1 : 0) . ',send_sql_errors=' . db_input(isset($var['send_sql_errors']) ? 1 : 0) . ',send_login_errors=' . db_input(isset($var['send_login_errors']) ? 1 : 0) . ',save_email_headers=' . db_input(isset($var['save_email_headers']) ? 1 : 0) . ',strip_quoted_reply=' . db_input(isset($var['strip_quoted_reply']) ? 1 : 0) . ',log_ticket_activity=' . db_input(isset($var['log_ticket_activity']) ? 1 : 0) . ',ticket_autoresponder=' . db_input($var['ticket_autoresponder']) . ',message_autoresponder=' . db_input($var['message_autoresponder']) . ',ticket_notice_active=' . db_input($var['ticket_notice_active']) . ',ticket_alert_active=' . db_input($var['ticket_alert_active']) . ',ticket_alert_admin=' . db_input(isset($var['ticket_alert_admin']) ? 1 : 0) . ',ticket_alert_dept_manager=' . db_input(isset($var['ticket_alert_dept_manager']) ? 1 : 0) . ',ticket_alert_dept_members=' . db_input(isset($var['ticket_alert_dept_members']) ? 1 : 0) . ',message_alert_active=' . db_input($var['message_alert_active']) . ',message_alert_laststaff=' . db_input(isset($var['message_alert_laststaff']) ? 1 : 0) . ',message_alert_assigned=' . db_input(isset($var['message_alert_assigned']) ? 1 : 0) . ',message_alert_dept_manager=' . db_input(isset($var['message_alert_dept_manager']) ? 1 : 0) . ',note_alert_active=' . db_input($var['note_alert_active']) . ',note_alert_laststaff=' . db_input(isset($var['note_alert_laststaff']) ? 1 : 0) . ',note_alert_assigned=' . db_input(isset($var['note_alert_assigned']) ? 1 : 0) . ',note_alert_dept_manager=' . db_input(isset($var['note_alert_dept_manager']) ? 1 : 0) . ',overdue_alert_active=' . db_input($var['overdue_alert_active']) . ',overdue_alert_assigned=' . db_input(isset($var['overdue_alert_assigned']) ? 1 : 0) . ',overdue_alert_dept_manager=' . db_input(isset($var['overdue_alert_dept_manager']) ? 1 : 0) . ',overdue_alert_dept_members=' . db_input(isset($var['overdue_alert_dept_members']) ? 1 : 0) . ',auto_assign_reopened_tickets=' . db_input(isset($var['auto_assign_reopened_tickets']) ? 1 : 0) . ',show_assigned_tickets=' . db_input(isset($var['show_assigned_tickets']) ? 1 : 0) . ',show_answered_tickets=' . db_input(isset($var['show_answered_tickets']) ? 1 : 0) . ',hide_staff_name=' . db_input(isset($var['hide_staff_name']) ? 1 : 0) . ',overlimit_notice_active=' . db_input($var['overlimit_notice_active']) . ',random_ticket_ids=' . db_input($var['random_ticket_ids']) . ',time_format=' . db_input($var['time_format']) . ',date_format=' . db_input($var['date_format']) . ',datetime_format=' . db_input($var['datetime_format']) . ',daydatetime_format=' . db_input($var['daydatetime_format']) . ',reply_separator=' . db_input(trim($var['reply_separator'])) . ',admin_email=' . db_input($var['admin_email']) . ',helpdesk_title=' . db_input($var['helpdesk_title']) . ',helpdesk_url=' . db_input($var['helpdesk_url']) . ' WHERE id=' . $this->getId();
//echo $sql;
if (db_query($sql)) {
if (db_affected_rows()) {
//Something actually changed!!!!
$this->reload();
//Reload the new info.
require_once INCLUDE_DIR . 'class.cron.php';
Sys::purgeLogs();
//Cleanup the logs --- too bad if it was a mistaken config.
Cron::TicketMonitor();
//Age & cleanup
}
return true;
}
return false;
}
示例3: ob_end_clean
// Agent can call cron once every 3 minutes.
if ($sec < 180 || !$ost || $ost->isUpgradePending())
ob_end_clean();
require_once(INCLUDE_DIR.'class.cron.php');
// Clear staff obj to avoid false credit internal notes & auto-assignment
$thisstaff = null;
// Release the session to prevent locking a future request while this is
// running
$_SESSION['lastcroncall'] = time();
session_write_close();
// Age tickets: We're going to age tickets regardless of cron settings.
Cron::TicketMonitor();
// Run file purging about every 20 cron runs (1h40 on a five minute cron)
if (mt_rand(1, 20) == 4)
Cron::CleanOrphanedFiles();
if($cfg && $cfg->isAutoCronEnabled()) { //ONLY fetch tickets if autocron is enabled!
Cron::MailFetcher(); //Fetch mail.
$ost->logDebug(_S('Auto Cron'), sprintf(_S('Mail fetcher cron call [%s]'), $caller));
}
$data = array('autocron'=>true);
Signal::send('cron', $data);
ob_end_clean();
?>
示例4: updateMailPref
function updateMailPref($var, &$errors)
{
if (!$var || $errors) {
return false;
}
if ($var['allow_attachments'] or $_POST['upload_dir']) {
if ($var['upload_dir']) {
//get the real path.
$var['upload_dir'] = realpath($_POST['upload_dir']);
}
if (!$var['upload_dir'] or !is_writable($_POST['upload_dir'])) {
$errors['upload_dir'] = _('Directory must be valid and writeable');
if ($var['allow_attachments']) {
$errors['allow_attachments'] = _('Invalid upload dir');
}
} elseif (!ini_get('file_uploads')) {
$errors['allow_attachments'] = _('The \'file_uploads\' directive is disabled in php.ini');
}
if (!is_numeric($_POST['max_file_size'])) {
$errors['max_file_size'] = _('Maximum file size required');
}
if (!$var['allowed_filetypes']) {
$errors['allowed_filetypes'] = _('Allowed file extentions required');
}
}
if ($errors) {
return false;
}
//No go!
$sql = 'UPDATE ' . CONFIG_TABLE . ' SET allow_attachments=' . db_input(isset($var['allow_attachments']) ? 1 : 0) . ',upload_dir=' . db_input($var['upload_dir']) . ',max_file_size=' . db_input($var['max_file_size']) . ',allowed_filetypes=' . db_input(strtolower(preg_replace("/\n\r|\r\n|\n|\r/", '', trim($var['allowed_filetypes'])))) . ',email_attachments=' . db_input(isset($var['email_attachments']) ? 1 : 0) . ',allow_email_attachments=' . db_input(isset($var['allow_email_attachments']) ? 1 : 0) . ',allow_online_attachments=' . db_input(isset($var['allow_online_attachments']) ? 1 : 0) . ',allow_online_attachments_onlogin=' . db_input(isset($var['allow_online_attachments_onlogin']) ? 1 : 0) . ' WHERE id=' . $this->getId();
if (db_query($sql)) {
if (db_affected_rows()) {
//Something actually changed
$this->reload();
//Reload the new info.
require_once INCLUDE_DIR . 'class.cron.php';
Sys::purgeLogs();
//Cleanup the logs
Cron::TicketMonitor();
//Age & cleanup
}
return true;
}
return false;
}