public static function getParameters($lang = null) { if ($lang === null) { $lang = Resources::getCurrentLocale(); } $themes = enumAvailableThemes(); $images = self::enumAvailableImages($lang); $departments = MapperFactory::getMapper('Department')->enumDepartments(Resources::getCurrentLocale()); $departmentsParam = array(array('key' => '', 'value' => Resources::Get('page.gen.anydepartment'))); foreach ($departments as $d) { $item = array(); $item['key'] = $d['departmentkey']; $item['value'] = $d['departmentname']; $departmentsParam[] = $item; } $locales = getAvailableLocalesForChat(); $localesParam = array(array('key' => 'N', 'value' => Resources::Get('page.gen.autolocale'))); // $localesParam = array(); foreach ($locales as $l) { $item = array(); $item['key'] = $l['localeid']; $item['value'] = $l['localename']; $localesParam[] = $item; } $params = array('button' => array('name_key' => 'page.gen.choose_image', 'type' => 'list', 'values' => self::listToArray($images), 'default' => 'webim'), 'theme' => array('name_key' => 'page.gen.choose_theme', 'type' => 'list', 'values' => self::listToArray($themes), 'default' => 'default'), 'include_host_url' => array('name_key' => 'page.gen.include_site_name', 'type' => 'checkbox', 'default' => 'N'), 'secure' => array('name_key' => 'page.gen.secure_links', 'type' => 'checkbox', 'default' => 'N'), 'add_track_code' => array('name_key' => 'page.gen.include_tracker_code', 'type' => 'checkbox', 'default' => 'N'), 'choose_department' => array('name_key' => 'page.gen.choosedepartment', 'type' => 'checkbox', 'default' => 'N'), 'department_key' => array('name_key' => 'page.gen.department', 'type' => 'list', 'values' => $departmentsParam, 'default' => ''), 'choose_operator' => array('name_key' => 'page.gen.chooseoperator', 'type' => 'list', 'values' => array(array('key' => 'N', 'value' => Resources::Get('choose_operator.no')), array('key' => 'optional', 'value' => Resources::Get('choose_operator.optional')), array('key' => 'mandatory', 'value' => Resources::Get('choose_operator.mandatory'))), 'default' => 'N'), 'chat_immediately' => array('name_key' => 'page.gen.chatimmediately', 'type' => 'checkbox', 'default' => 'N'), 'locale' => array('name_key' => 'page.gen.locale', 'type' => 'list', 'values' => $localesParam, 'default' => Resources::getCurrentLocale())); return $params; }
public static function getParameters($lang = NULL) { if ($lang === NULL) { $lang = Resources::getCurrentLocale(); } $themes = enumAvailableThemes(); $images = Button::enumAvailableImages($lang); $departments = MapperFactory::getMapper("Department")->enumDepartments(Resources::getCurrentLocale()); $departmentsParam = array(array('key' => '', 'value' => Resources::Get('page.gen.anydepartment'))); foreach ($departments as $d) { $item = array(); $item['key'] = $d['departmentkey']; $item['value'] = $d['departmentname']; $departmentsParam[] = $item; } $locales = getAvailableLocalesForChat(); $localesParam = array(array('key' => 'N', 'value' => Resources::Get('page.gen.autolocale'))); // $localesParam = array(); foreach ($locales as $l) { $item = array(); $item['key'] = $l['localeid']; $item['value'] = $l['localename']; $localesParam[] = $item; } $params = array("button" => array("name_key" => 'page.gen.choose_image', "type" => "list", "values" => Button::listToArray($images), "default" => "webim"), "theme" => array("name_key" => 'page.gen.choose_theme', "type" => "list", "values" => Button::listToArray($themes), "default" => "default"), "include_host_url" => array("name_key" => 'page.gen.include_site_name', "type" => "checkbox", "default" => "N"), "secure" => array("name_key" => 'page.gen.secure_links', "type" => "checkbox", "default" => "N"), "add_track_code" => array("name_key" => 'page.gen.include_tracker_code', "type" => "checkbox", "default" => "N"), "choose_department" => array("name_key" => 'page.gen.choosedepartment', "type" => "checkbox", "default" => "N"), "department_key" => array("name_key" => 'page.gen.department', "type" => "list", "values" => $departmentsParam, "default" => ""), "choose_operator" => array("name_key" => 'page.gen.chooseoperator', "type" => "list", "values" => array(array('key' => 'N', 'value' => Resources::Get('choose_operator.no')), array('key' => 'optional', 'value' => Resources::Get('choose_operator.optional')), array('key' => 'mandatory', 'value' => Resources::Get('choose_operator.mandatory'))), "default" => "N"), "chat_immediately" => array("name_key" => 'page.gen.chatimmediately', "type" => "checkbox", "default" => "N"), "locale" => array("name_key" => 'page.gen.locale', "type" => "list", "values" => $localesParam, "default" => Resources::getCurrentLocale())); return $params; }
$tmlPage['formendday'] = date('d', $currTime); $tmlPage['formendmonth'] = date('m.y', $currTime); } } // // This function should be defined before it's used otherwise on // some PHP verions it can fail with Fatal error: Call to undefined function // function get_operators_list() { $operators = Operator::getInstance()->GetAllAccessedOperators(); $result = array(); $result[''] = Resources::Get('search.any.operator'); if (!empty($operators)) { foreach ($operators as $op) { $result[$op['operatorid']] = $op['fullname']; } } return $result; } $tmlPage['availableDays'] = range(1, 31); $currTime = getCurrentTime(); $tmlPage['availableMonth'] = get_month_selection($currTime - 400 * 24 * 60 * 60, $currTime); $tmlPage['operatorList'] = get_operators_list(); $TML->assign('departments', Operator::getInstance()->enumAvailableDepartmentsForOperator($operator['operatorid'], Resources::getCurrentLocale())); $TML->assign('locales', getAvailableLocalesForChat()); $tmlPage['show_empty'] = $show_empty; $TML->assign('page_settings', $tmlPage); $TML->assign('advanced', true); $TML->display('thread_search.tpl'); require_once dirname(__FILE__) . '/inc/admin_epilog.php';
*/ $TITLE_KEY = 'statistics.title'; require_once dirname(__FILE__) . '/inc/admin_prolog.php'; require_once '../classes/functions.php'; require_once '../classes/class.thread.php'; require_once '../classes/class.operator.php'; require_once '../classes/class.smartyclass.php'; Operator::getInstance()->IsCurrentUserAdminOrRedirect(); $tmlPage = null; $TML = new SmartyClass($TITLE_KEY); $tmlPage['availableDays'] = range(1, 31); $currTime = getCurrentTime(); $tmlPage['availableMonth'] = get_month_selection($currTime - 400 * 24 * 60 * 60, $currTime + 50 * 24 * 60 * 60); $tmlPage['showresults'] = false; $tmlPage['departments'] = MapperFactory::getMapper("Department")->enumDepartments(Resources::getCurrentLocale()); $tmlPage['locales'] = getAvailableLocalesForChat(); Operator::getInstance()->ensureOperatorsAreInLastAccess(); $errors = array(); if (isset($_GET['startday'])) { $startday = verify_param("startday", "/^\\d+\$/"); $startmonth = verify_param("startmonth", "/^\\d{2}.\\d{2}\$/"); $endday = verify_param("endday", "/^\\d+\$/"); $endmonth = verify_param("endmonth", "/^\\d{2}.\\d{2}\$/"); $start = get_form_date($startday, $startmonth); $end = get_form_date($endday, $endmonth) + 24 * 60 * 60; $locale = verify_param("locale", "/^(en|ru)\$/"); $departmentid = verify_param("departmentid", "/^\\d+\$/"); if ($start > $end) { $errors[] = Resources::Get("statistics.wrong.dates"); } Operator::getInstance()->loadOnlineStatsIntoDB();
function setAllLocales() { global $TML; $TML->assign("locales", getAvailableLocalesForChat()); }