本文整理汇总了PHP中set_user_config_option函数 的典型用法代码示例。如果您正苦于以下问题:PHP set_user_config_option函数的具体用法?PHP set_user_config_option怎么用?PHP set_user_config_option使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了set_user_config_option函数 的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的PHP代码示例。
示例1: enable_all_context_help
function enable_all_context_help()
{
$context_help_options = UserWsConfigOptions::getOptionsByCategoryName('context help', true);
foreach ($context_help_options as $option) {
set_user_config_option($option->getName(), true, logged_user()->getId());
}
ajx_current("empty");
flash_success(lang('success enable all context help'));
}
开发者ID:pnagaraju25, 项目名称:fengoffice, 代码行数:9, 代码来源:HelpController.class.php
示例2: show_context_help
function show_context_help()
{
$show_context_help = array_var($_GET, 'show_context_help');
set_user_config_option('show_context_help', $show_context_help, logged_user()->getId());
ajx_current("empty");
if ($show_context_help == 'until_close') {
flash_success(lang('success enable context help'));
} else {
flash_success(lang('success disable context help'));
}
}
开发者ID:abhinay100, 项目名称:feng_app, 代码行数:11, 代码来源:HelpController.class.php
示例3: index
function index()
{
$tasksUserId = array_var($_GET, 'tu');
if (is_null($tasksUserId)) {
$tasksUserId = user_config_option('TM tasks user filter', logged_user()->getId());
} else {
if (user_config_option('TM tasks user filter') != $tasksUserId) {
set_user_config_option('TM tasks user filter', $tasksUserId, logged_user()->getId());
}
}
$timeslotsUserId = array_var($_GET, 'tsu');
if (is_null($timeslotsUserId)) {
$timeslotsUserId = user_config_option('TM user filter', 0);
} else {
if (user_config_option('TM user filter') != $timeslotsUserId) {
set_user_config_option('TM user filter', $timeslotsUserId, logged_user()->getId());
}
}
$showTimeType = array_var($_GET, 'stt');
if (is_null($showTimeType)) {
$showTimeType = user_config_option('TM show time type', 0);
} else {
if (user_config_option('TM show time type') != $showTimeType) {
set_user_config_option('TM show time type', $showTimeType, logged_user()->getId());
}
}
$start = array_var($_GET, 'start', 0);
$limit = 20;
$tasksUser = Contacts::findById($tasksUserId);
$timeslotsUser = Contacts::findById($timeslotsUserId);
//Active tasks view
$open_timeslots = Timeslots::instance()->listing(array("extra_conditions" => " AND end_time = '" . EMPTY_DATETIME . "' AND contact_id = " . $tasksUserId))->objects;
$tasks = array();
foreach ($open_timeslots as $open_timeslot) {
$task = ProjectTasks::findById($open_timeslot->getRelObjectId());
if ($task instanceof ProjectTask && !$task->isCompleted() && !$task->isTrashed() && !$task->isArchived()) {
$tasks[] = $task;
}
}
ProjectTasks::populateTimeslots($tasks);
//Timeslots view
$total = 0;
switch ($showTimeType) {
case 0:
//Show only timeslots added through the time panel
$result = Timeslots::getGeneralTimeslots(active_context(), $timeslotsUser, $start, $limit);
$timeslots = $result->objects;
$total = $result->total;
break;
default:
throw new Error('Unrecognised TM show time type: ' . $showTimeType);
}
//Get Users Info
$users = array();
$context = active_context();
if (!can_manage_time(logged_user())) {
if (can_add(logged_user(), $context, Timeslots::instance()->getObjectTypeId())) {
$users = array(logged_user());
}
} else {
if (logged_user()->isMemberOfOwnerCompany()) {
$users = Contacts::getAllUsers();
} else {
$users = logged_user()->getCompanyId() > 0 ? Contacts::getAllUsers(" AND `company_id` = " . logged_user()->getCompanyId()) : array(logged_user());
}
$tmp_users = array();
foreach ($users as $user) {
if (can_add($user, $context, Timeslots::instance()->getObjectTypeId())) {
$tmp_users[] = $user;
}
}
$users = $tmp_users;
}
//Get Companies Info
if (logged_user()->isMemberOfOwnerCompany() || logged_user()->isAdminGroup()) {
$companies = Contacts::getCompaniesWithUsers();
} else {
$companies = array();
if (logged_user()->getCompanyId() > 0) {
$companies[] = logged_user()->getCompany();
}
}
$required_dimensions = DimensionObjectTypeContents::getRequiredDimensions(Timeslots::instance()->getObjectTypeId());
$draw_inputs = !$required_dimensions || count($required_dimensions) == 0;
if (!$draw_inputs) {
$ts_ots = DimensionObjectTypeContents::getDimensionObjectTypesforObject(Timeslots::instance()->getObjectTypeId());
$context = active_context();
foreach ($context as $sel) {
if ($sel instanceof Member) {
foreach ($ts_ots as $ts_ot) {
if ($sel->getDimensionId() == $ts_ot->getDimensionId() && $sel->getObjectTypeId() == $ts_ot->getDimensionObjectTypeId()) {
$draw_inputs = true;
break;
}
}
if ($draw_inputs) {
break;
}
}
}
//.........这里部分代码省略.........
开发者ID:rorteg, 项目名称:fengoffice, 代码行数:101, 代码来源:TimeController.class.php
示例4: reset_password
function reset_password()
{
$tok = array_var($_GET, 't');
$uid = array_var($_GET, 'uid');
if (!$tok || !$uid) {
flash_error(lang('invalid parameters'));
$this->redirectTo('access', 'login');
}
$user = Users::findById($uid);
if (!$user instanceof User) {
flash_error(lang('user dnx'));
$this->redirectTo('access', 'login');
}
$stok = user_config_option('reset_password', null, $user->getId());
if (!$stok) {
flash_error(lang('reset password expired', lang('forgot password')));
$this->redirectTo('access', 'login');
}
$split = explode(";", $stok);
if (count($split) < 2) {
flash_error(lang('reset password expired', lang('forgot password')));
$this->redirectTo('access', 'login');
}
$token = $split[0];
$timestamp = $split[1];
if ($timestamp < time()) {
set_user_config_option('reset_password', '', $user->getId());
flash_error(lang('reset password expired', lang('forgot password')));
$this->redirectTo('access', 'login');
}
if ($token != $tok) {
flash_error(lang('reset password expired', lang('forgot password')));
$this->redirectTo('access', 'login');
}
tpl_assign('token', $token);
tpl_assign('user', $user);
$new_password = array_var($_POST, 'new_password');
if ($new_password) {
$repeat_password = array_var($_POST, 'repeat_password');
if ($new_password != $repeat_password) {
flash_error(lang('passwords dont match'));
return;
}
$user_password = new UserPassword();
$user_password->setUserId($user->getId());
$user_password->password_temp = $new_password;
$user_password->setPasswordDate(DateTimeValueLib::now());
$user_password->setPassword(cp_encrypt($new_password, $user_password->getPasswordDate()->getTimestamp()));
$user_password->save();
$user->setPassword($new_password);
$user->setUpdatedOn(DateTimeValueLib::now());
$user->save();
set_user_config_option('reset_password', '', $user->getId());
flash_success(lang('success reset password'));
$this->redirectTo('access', 'login');
}
}
开发者ID:pnagaraju25, 项目名称:fengoffice, 代码行数:57, 代码来源:AccessController.class.php
示例5: update_user_preference
function update_user_preference()
{
ajx_current("empty");
$option_name = array_var($_GET, 'name');
$option_value = array_var($_GET, 'value');
if ($option_name != '') {
try {
DB::beginWork();
set_user_config_option($option_name, $option_value, logged_user()->getId());
DB::commit();
} catch (Exception $e) {
DB::rollback();
flash_error($e->getMessage());
ajx_current("empty");
}
}
}
开发者ID:rorteg, 项目名称:fengoffice, 代码行数:17, 代码来源:AccountController.class.php
示例6: get_list_of_locales
return;
}
/* get a list of locale settings */
$lang2locale = get_list_of_locales();
/* determine whether or not we can support the language */
/* user requests another language */
if (isset($_GET['language']) && isset($lang2locale[$_GET['language']])) {
$cacti_locale = $_GET['language'];
$cacti_country = $lang2locale[$_GET['language']]['country'];
$_SESSION['language'] = $cacti_locale;
/* save customized language setting (authenticated users only) */
set_user_config_option('language', $cacti_locale);
/* language definition stored in the SESSION */
}elseif (isset($_SESSION['language']) && isset($lang2locale[$_SESSION['language']])){
$cacti_locale = $_SESSION['language'];
$cacti_country = $lang2locale[$_SESSION['language']]['country'];
/* look up for user customized language setting stored in Cacti DB */
}elseif ($user_locale = read_user_config_option('language')) {
if(isset($lang2locale[$user_locale])) {
$cacti_locale = $user_locale;
$cacti_country = $lang2locale[$cacti_locale]['country'];
$_SESSION['language'] = $cacti_locale;
}
/* detect browser settings if auto detection is enabled */
开发者ID:songchin, 项目名称:Cacti, 代码行数:31, 代码来源:global_language.php
示例7: getEmails
/**
* Returns a list of emails according to the requested parameters
*
* @param string $action
* @param string $tag
* @param array $attributes
* @param Project $project
* @return array
*/
private function getEmails($tag, $attributes, $project = null, $start = null, $limit = null, $order_by = 'sent_date', $dir = 'ASC', &$totalCount = 0)
{
// Return if no emails should be displayed
if (!isset($attributes["viewType"]) || $attributes["viewType"] != "all" && $attributes["viewType"] != "emails") {
return null;
}
$account = array_var($attributes, "accountId");
$classif_filter = array_var($attributes, 'classifType');
$read_filter = array_var($attributes, 'readType');
set_user_config_option('mails account filter', $account, logged_user()->getId());
set_user_config_option('mails classification filter', $classif_filter, logged_user()->getId());
set_user_config_option('mails read filter', $read_filter, logged_user()->getId());
$state = array_var($attributes, 'stateType');
list($objects, $pagination) = MailContents::getEmails($tag, $account, $state, $read_filter, $classif_filter, $project, $start, $limit, $order_by, $dir);
$totalCount = $pagination->getTotalItems();
//if standed in "All" check if all workspaces related to the email have been archived.. and if so, dont show them
if (active_project() == null) {
$aux = array();
foreach ($objects as $mail) {
$check = WorkspaceObjects::getWorkspacesByObject('MailContents', $mail->getId());
$archived = true;
foreach ($check as $wsobject) {
$ws = Projects::findById($wsobject->getId());
if ($ws->getCompletedById() != '0') {
continue;
}
$archived = false;
break;
}
if (!$archived || $check == null) {
$aux[] = $mail;
}
}
return $aux;
}
return $objects;
}
开发者ID:pnagaraju25, 项目名称:fengoffice, 代码行数:46, 代码来源:MailController.class.php
示例8: new_list_tasks
function new_list_tasks()
{
//load config options into cache for better performance
load_user_config_options_by_category_name('task panel');
// get query parameters, save user preferences if necessary
$status = array_var($_GET, 'status', null);
if (is_null($status) || $status == '') {
$status = user_config_option('task panel status', 2);
} else {
if (user_config_option('task panel status') != $status) {
set_user_config_option('task panel status', $status, logged_user()->getId());
}
}
$previous_filter = user_config_option('task panel filter', 'assigned_to');
$filter = array_var($_GET, 'filter');
if (is_null($filter) || $filter == '') {
$filter = user_config_option('task panel filter', 'assigned_to');
} else {
if (user_config_option('task panel filter') != $filter) {
set_user_config_option('task panel filter', $filter, logged_user()->getId());
}
}
if ($filter != 'no_filter') {
$filter_value = array_var($_GET, 'fval');
if (is_null($filter_value) || $filter_value == '') {
$filter_value = user_config_option('task panel filter value', logged_user()->getCompanyId() . ':' . logged_user()->getId());
set_user_config_option('task panel filter value', $filter_value, logged_user()->getId());
$filter = $previous_filter;
set_user_config_option('task panel filter', $filter, logged_user()->getId());
} else {
if (user_config_option('task panel filter value') != $filter_value) {
set_user_config_option('task panel filter value', $filter_value, logged_user()->getId());
}
}
}
$isJson = array_var($_GET, 'isJson', false);
if ($isJson) {
ajx_current("empty");
}
$project = active_project();
$tag = active_tag();
$template_condition = "`is_template` = 0 ";
//Get the task query conditions
$task_filter_condition = "";
switch ($filter) {
case 'assigned_to':
$assigned_to = explode(':', $filter_value);
$assigned_to_user = array_var($assigned_to, 1, 0);
$assigned_to_company = array_var($assigned_to, 0, 0);
if ($assigned_to_user > 0) {
$task_filter_condition = " AND (`assigned_to_user_id` = " . $assigned_to_user . " OR (`assigned_to_company_id` = " . $assigned_to_company . " AND `assigned_to_user_id` = 0)) ";
} else {
if ($assigned_to_company > 0) {
$task_filter_condition = " AND `assigned_to_company_id` = " . $assigned_to_company . " AND `assigned_to_user_id` = 0";
} else {
if ($assigned_to_company == -1 && $assigned_to_user == -1) {
$task_filter_condition = " AND `assigned_to_company_id` = 0 AND `assigned_to_user_id` = 0 ";
}
}
}
break;
case 'assigned_by':
if ($filter_value != 0) {
$task_filter_condition = " AND `assigned_by_id` = " . $filter_value . " ";
}
break;
case 'created_by':
if ($filter_value != 0) {
$task_filter_condition = " AND `created_by_id` = " . $filter_value . " ";
}
break;
case 'completed_by':
if ($filter_value != 0) {
$task_filter_condition = " AND `completed_by_id` = " . $filter_value . " ";
}
break;
case 'milestone':
$task_filter_condition = " AND `milestone_id` = " . $filter_value . " ";
break;
case 'priority':
$task_filter_condition = " AND `priority` = " . $filter_value . " ";
break;
case 'subtype':
if ($filter_value != 0) {
$task_filter_condition = " AND `object_subtype` = " . $filter_value . " ";
}
break;
case 'no_filter':
$task_filter_condition = "";
break;
default:
flash_error(lang('task filter criteria not recognised', $filter));
}
if ($project instanceof Project) {
$pids = $project->getAllSubWorkspacesQuery(true);
$projectstr = " AND " . ProjectTasks::getWorkspaceString($pids);
} else {
$pids = "";
$projectstr = "";
}
//.........这里部分代码省略.........
开发者ID:pnagaraju25, 项目名称:fengoffice, 代码行数:101, 代码来源:TaskController.class.php
示例9: print_tasks_list
function print_tasks_list()
{
$this->setLayout("html");
$request_conditions = $this->get_tasks_request_conditions();
$conditions = $request_conditions['conditions'];
$groupId = array_var($_REQUEST, 'groupId', null);
$start = 0;
$limit = null;
$show_more_conditions = array("groupId" => $groupId, "start" => $start, "limit" => $limit);
//Groups
$groupBy = array_var($_REQUEST, 'tasksGroupBy', user_config_option('tasksGroupBy'));
if (array_var($_REQUEST, 'tasksOrderBy', false)) {
set_user_config_option('tasksOrderBy', array_var($_REQUEST, 'tasksOrderBy'), logged_user()->getId());
}
$groups = $this->getGroups($groupBy, $conditions, $show_more_conditions);
if (is_null($groups)) {
$groups = array();
}
// Get subtasks
$subtasks = array();
foreach ($groups as $group) {
foreach ($group['group_tasks'] as $task) {
if (count(array_var($task, 'subtasksIds')) > 0) {
$t = ProjectTasks::findById($task['id']);
$all_subtasks_info = $t->getAllSubtaskInfoInHierarchy();
$subtasks[$task['id']] = $all_subtasks_info;
}
}
}
// reorder tasks, put subtasks below the parent task
if (count($subtasks) > 0) {
foreach ($groups as &$group) {
$old_tasks = $group['group_tasks'];
$group['group_tasks'] = array();
foreach ($old_tasks as $t) {
$group['group_tasks'][] = $t;
if (isset($subtasks[$t['id']])) {
foreach ($subtasks[$t['id']] as $subt) {
$group['group_tasks'][] = $subt;
}
}
}
}
}
// ----------------------
$draw_options = json_decode(array_var($_REQUEST, 'draw_options'), true);
$tasks_list_cols = json_decode(array_var($_REQUEST, 'tasks_list_cols'), true);
$row_total_cols = json_decode(array_var($_REQUEST, 'row_total_cols'), true);
tpl_assign('draw_options', $draw_options);
tpl_assign('tasks_list_cols', $tasks_list_cols);
tpl_assign('row_total_cols', $row_total_cols);
tpl_assign('groups', $groups);
}
开发者ID:abhinay100, 项目名称:feng_app, 代码行数:53, 代码来源:TaskController.class.php
示例10: set_user_config_option_value
function set_user_config_option_value()
{
ajx_current("empty");
if (!logged_user() instanceof Contact) {
return;
}
$name = array_var($_GET, 'config_option_name');
$value = array_var($_GET, 'config_option_value');
set_user_config_option($name, $value, logged_user()->getId());
}
开发者ID:abhinay100, 项目名称:feng_app, 代码行数:10, 代码来源:ObjectController.class.php
示例11: create_user
function create_user($user_data, $permissionsString)
{
$user = new User();
$user->setUsername(array_var($user_data, 'username'));
$user->setDisplayName(array_var($user_data, 'display_name'));
$user->setEmail(array_var($user_data, 'email'));
$user->setCompanyId(array_var($user_data, 'company_id'));
$user->setType(array_var($user_data, 'type'));
$user->setTimezone(array_var($user_data, 'timezone'));
if (!logged_user() instanceof User || can_manage_security(logged_user())) {
$user->setCanEditCompanyData(array_var($user_data, 'can_edit_company_data'));
$user->setCanManageSecurity(array_var($user_data, 'can_manage_security'));
$user->setCanManageWorkspaces(array_var($user_data, 'can_manage_workspaces'));
$user->setCanManageConfiguration(array_var($user_data, 'can_manage_configuration'));
$user->setCanManageContacts(array_var($user_data, 'can_manage_contacts'));
$user->setCanManageTemplates(array_var($user_data, 'can_manage_templates'));
$user->setCanManageReports(array_var($user_data, 'can_manage_reports'));
$user->setCanManageTime(array_var($user_data, 'can_manage_time'));
$user->setCanAddMailAccounts(array_var($user_data, 'can_add_mail_accounts'));
$other_permissions = array();
Hook::fire('add_user_permissions', $user, $other_permissions);
foreach ($other_permissions as $k => $v) {
$user->setColumnValue($k, array_var($user_data, $k));
}
}
if (array_var($user_data, 'password_generator', 'random') == 'random') {
// Generate random password
$password = UserPasswords::generateRandomPassword();
} else {
// Validate input
$password = array_var($user_data, 'password');
if (trim($password) == '') {
throw new Error(lang('password value required'));
}
// if
if ($password != array_var($user_data, 'password_a')) {
throw new Error(lang('passwords dont match'));
}
// if
}
// if
$user->setPassword($password);
$user->save();
$user_password = new UserPassword();
$user_password->setUserId($user->getId());
$user_password->setPasswordDate(DateTimeValueLib::now());
$user_password->setPassword(cp_encrypt($password, $user_password->getPasswordDate()->getTimestamp()));
$user_password->password_temp = $password;
$user_password->save();
if (array_var($user_data, 'autodetect_time_zone', 1) == 1) {
set_user_config_option('autodetect_time_zone', 1, $user->getId());
}
if ($user->getType() == 'admin') {
if ($user->getCompanyId() != owner_company()->getId() || logged_user() instanceof User && !can_manage_security(logged_user())) {
// external users can't be admins or logged user has no rights to create admins => set as Normal
$user->setType('normal');
} else {
$user->setAsAdministrator(true);
}
}
/* create contact for this user*/
if (array_var($user_data, 'create_contact', 1)) {
// if contact with same email exists take it, else create new
$contact = Contacts::getByEmail($user->getEmail(), true);
if (!$contact instanceof Contact) {
$contact = new Contact();
$contact->setEmail($user->getEmail());
} else {
if ($contact->isTrashed()) {
$contact->untrash();
}
}
$contact->setFirstname($user->getDisplayName());
$contact->setUserId($user->getId());
$contact->setTimezone($user->getTimezone());
$contact->setCompanyId($user->getCompanyId());
$contact->save();
} else {
$contact_id = array_var($user_data, 'contact_id');
$contact = Contacts::findById($contact_id);
if ($contact instanceof Contact) {
// user created from a contact
$contact->setUserId($user->getId());
$contact->save();
} else {
// if contact with same email exists use it as user's contact, without changing it
$contact = Contacts::getByEmail($user->getEmail(), true);
if ($contact instanceof Contact) {
$contact->setUserId($user->getId());
if ($contact->isTrashed()) {
$contact->untrash();
}
$contact->save();
}
}
}
$contact = $user->getContact();
if ($contact instanceof Contact) {
// update contact data with data entered for this user
$contact->setCompanyId($user->getCompanyId());
//.........这里部分代码省略.........
开发者ID:pnagaraju25, 项目名称:fengoffice, 代码行数:101, 代码来源:functions.php
示例12: send_notification
function send_notification($user_data, $contact_id)
{
$contact = Contacts::findById($contact_id);
//$contact->getId()
$password = '';
// Send notification
try {
if (array_var($user_data, 'send_email_notification') && $contact->getEmailAddress()) {
if (array_var($user_data, 'password_generator', 'link') == 'link') {
// Generate link password
$user = Contacts::getByEmail(array_var($user_data, 'email'));
$token = sha1(gen_id() . (defined('SEED') ? SEED : ''));
$timestamp = time() + 60 * 60 * 24;
set_user_config_option('reset_password', $token . ";" . $timestamp, $user->getId());
Notifier::newUserAccountLinkPassword($contact, $password, $token);
} else {
$password = array_var($user_data, 'password');
Notifier::newUserAccount($contact, $password);
}
}
} catch (Exception $e) {
Logger::log($e->getTraceAsString());
}
// try
}
开发者ID:abhinay100, 项目名称:feng_app, 代码行数:25, 代码来源:functions.php
示例13: define
*/
/* detect system time zone */
define("CACTI_SYSTEM_TIME_ZONE", date("e"));
/* return to main if time zone support has been deactivated */
if (read_config_option("i18n_timezone_support") == 0) {
define("CACTI_CUSTOM_TIME_ZONE", CACTI_SYSTEM_TIME_ZONE);
return;
}
/* determine whether or not we can support a different time zone */
/* user requests another timezone (Validation is not required!)*/
if (isset($_GET['time_zone'])) {
if(init_time_zone($_GET['time_zone'])) {
set_user_config_option('time_zone', $_GET['time_zone']);
$_SESSION['time_zone'] = $_GET['time_zone'];
}
/* time zone definition is stored in the SESSION */
}elseif (isset($_SESSION['time_zone'])) {
init_time_zone($_SESSION['time_zone']);
/* look up for user customized time zone stored in Cacti DB */
}elseif ($time_zone = read_user_config_option('time_zone')) {
if(init_time_zone($time_zone)) {
$_SESSION['time_zone'] = $time_zone;
};
/* use the default time zone defined under "general" or fall back to sytsem time zone*/
}else {
开发者ID:songchin, 项目名称:Cacti, 代码行数:31, 代码来源:global_timezones.php
示例14: index
function index()
{
if (!can_manage_time(logged_user(), true)) {
flash_error(lang('no access permissions'));
ajx_current("empty");
return;
}
$tasksUserId = array_var($_GET, 'tu');
if (is_null($tasksUserId)) {
$tasksUserId = user_config_option('TM tasks user filter', logged_user()->getId());
} else {
if (user_config_option('TM tasks user filter') != $tasksUserId) {
set_user_config_option('TM tasks user filter', $tasksUserId, logged_user()->getId());
}
}
$timeslotsUserId = array_var($_GET, 'tsu');
if (is_null($timeslotsUserId)) {
$timeslotsUserId = user_config_option('TM user filter', 0);
} else {
if (user_config_option('TM user filter') != $timeslotsUserId) {
set_user_config_option('TM user filter', $timeslotsUserId, logged_user()->getId());
}
}
$showTimeType = array_var($_GET, 'stt');
if (is_null($showTimeType)) {
$showTimeType = user_config_option('TM show time type', 0);
} else {
if (user_config_option('TM show time type') != $showTimeType) {
set_user_config_option('TM show time type', $showTimeType, logged_user()->getId());
}
}
$start = array_var($_GET, 'start', 0);
$limit = 20;
$tasksUser = Users::findById($tasksUserId);
$timeslotsUser = Users::findById($timeslotsUserId);
//Active tasks view
$tasks = ProjectTasks::getOpenTimeslotTasks($tasksUser, logged_user());
ProjectTasks::populateData($tasks);
$tasks_array = array();
//Timeslots view
$total = 0;
switch ($showTimeType) {
case 0:
//Show only timeslots added through the time panel
$timeslots = Timeslots::getProjectTimeslots(logged_user()->getWorkspacesQuery(), $timeslotsUser, active_project(), $start, $limit);
$total = Timeslots::countProjectTimeslots(logged_user()->getWorkspacesQuery(), $timeslotsUser, active_project());
break;
case 1:
//Show only timeslots added through the tasks panel / tasks
throw new Error('not yet implemented' . $showTimeType);
/*if (active_project() instanceof Project){
$workspacesCSV = active_project()->getAllSubWorkspacesQuery(false,logged_user());
} else {
$workspacesCSV = logged_user()->getWorkspacesQuery();
}
$taskTimeslots = Timeslots::getTaskTimeslots(null, $timeslotsUser, $workspacesCSV, null , null, null, null,0,20);*/
//break;
/*if (active_project() instanceof Project){
$workspacesCSV = active_project()->getAllSubWorkspacesQuery(false,logged_user());
} else {
$workspacesCSV = logged_user()->getWorkspacesQuery();
}
$taskTimeslots = Timeslots::getTaskTimeslots(null, $timeslotsUser, $workspacesCSV, null , null, null, null,0,20);*/
//break;
case 2:
//Show timeslots added through both the time and tasks panel / tasks
throw new Error('not yet implemented' . $showTimeType);
//break;
//break;
default:
throw new Error('Unrecognised TM show time type: ' . $showTimeType);
}
//Get Users Info
if (logged_user()->isMemberOfOwnerCompany()) {
$users = Users::getAll();
} else {
$users = logged_user()->getCompany()->getUsers();
}
//Get Companies Info
if (logged_user()->isMemberOfOwnerCompany()) {
$companies = Companies::getCompaniesWithUsers();
} else {
$companies = array(logged_user()->getCompany());
}
tpl_assign('timeslots', $timeslots);
tpl_assign('tasks', $tasks);
tpl_assign('users', $users);
tpl_assign('start', $start);
tpl_assign('limit', $limit);
tpl_assign('total', $total);
tpl_assign('companies', $companies);
ajx_set_no_toolbar(true);
}
开发者ID:pnagaraju25, 项目名称:fengoffice, 代码行数:93, 代码来源:TimeController.class.php
示例15: getEmails
/**
* Returns a list of emails according to the requested parameters
*
* @param string $action
* @param string $tag
* @param array $attributes
* @param Project $project
* @return array
*/
private function getEmails($attributes, $context = null, $start = null, $limit = null, $order_by = 'sent_date', $dir = 'ASC',$join_params = null) {
// Return if no emails should be displayed
if (!isset($attributes["viewType"]) || ($attributes["viewType"] != "all" && $attributes["viewType"] != "emails")) return null;
$account = array_var($attributes, "accountId");
$classif_filter = array_var($attributes, 'classifType');
$read_filter = array_var($attributes, 'readType');
set_user_config_option('mails account filter', $account, logged_user()->getId());
set_user_config_option('mails classification filter', $classif_filter, logged_user()->getId());
set_user_config_option('mails read filter', $read_filter, logged_user()->getId());
$state = array_var($attributes, 'stateType');
$result = MailContents::getEmails($account, $state, $read_filter, $classif_filter, $context, $start, $limit, $order_by, $dir, $join_params);
return $result;
}
开发者ID:Jtgadbois, 项目名称:Pedadida, 代码行数:28, 代码来源:MailController.class.php
示例16: getUserPreferences
function getUserPreferences(&$view_type = null, &$user_filter = null, &$status_filter = null, &$task_filter = null) {
$view_type = array_var($_GET,'view_type');
if (is_null($view_type) || $view_type == '') {
$view_type = user_config_option('calendar view type', 'viewweek');
}
if (user_config_option('calendar view type', '') != $view_type)
set_user_config_option('calendar view type', $view_type, logged_user()->getId());
$user_filter = array_var($_GET,'user_filter');
if (is_null($user_filter) || $user_filter == '') {
$user_filter = user_config_option('calendar user filter', 0);
}
if ($user_filter == 0) $user_filter = logged_user()->getId();
if (user_config_option('calendar user filter', '') != $user_filter)
set_user_config_option('calendar user filter', $user_filter, logged_user()->getId());
$status_filter = array_var($_GET,'status_filter');
if (is_null($status_filter)) {
$status_filter = user_config_option('calendar status filter', ' 0 1 3');
}
if (user_config_option('calendar status filter', '') != $status_filter)
set_user_config_option('calendar status filter', $status_filter, logged_user()->getId());
$task_filter = array_var($_GET,'task_filter');
if (is_null($task_filter) || $task_filter == '') {
$task_filter = user_config_option('calendar task filter', "pending");
}
if (user_config_option('calendar task filter', '') != $task_filter)
set_user_config_option('calendar task filter', $task_filter, logged_user()->getId());
}
开发者ID:Jtgadbois, 项目名称:Pedadida, 代码行数:30, 代码来源:EventController.class.php
示例17: updateCookieChanges
function updateCookieChanges() {
if (isset($_SESSION["sess_user_id"]) && $_SESSION["sess_user_id"] != read_config_option("guest_user")) {
if (sizeof($_COOKIE)) {
foreach($_COOKIE as $key => $data) {
if ($key == "menu" || $key == "formvis" || substr($key, 0, 3) == "ui_") {
if ((!isset($_SESSION["sess_cacti_ui_" . $key])) ||
($data != $_SESSION["sess_cacti_ui_" . $key])) {
set_user_config_option("sess_cacti_ui_" . $key, $data);
$_SESSION["sess_cacti_ui_" . $key] = $data;
}
}
}
}
}
}
开发者ID:songchin, 项目名称:Cacti, 代码行数:15, 代码来源:functions.php
示例18: set_settings_closed
function set_settings_closed()
{
ajx_current("empty");
set_user_config_option('settings_closed', 1, logged_user()->getId());
}
开发者ID:abhinay100, 项目名称:feng_app, 代码行数:5, 代码来源:MoreController.class.php
示例19: add_mail
//.........这里部分代码省略.........
FileRepository::deleteFile($data[2]);
}
}
}
}
FileRepository::deleteFile($mail->getContentFileId());
}
}
$mail->setContentFileId($repository_id);
}
$mail->setHasAttachments(is_array($attachments) && count($attachments) > 0 ? 1 : 0);
$mail->setAccountEmail($account->getEmailAddress());
$mail->setSentDate(DateTimeValueLib::now());
$mail->setReceivedDate(DateTimeValueLib::now());
DB::beginWork();
$msg_id = MailUtilities::generateMessageId($account->getEmailAddress());
$conversation_id = array_var($mail_data, 'conversation_id');
$in_reply_to_id = array_var($mail_data, 'in_reply_to_id');
if ($conversation_id) {
$in_reply_to = MailContents::findById(array_var($mail_data, 'original_id'));
if ($in_reply_to instanceof MailContent && $in_reply_to->getSubject() && strpos(strtolower($mail->getSubject()), strtolower($in_reply_to->getSubject())) === false) {
$conversation_id = null;
$in_reply_to_id = '';
}
}
if (!$conversation_id) {
$conversation_id = MailContents::getNextConversationId($account->getId());
}
$mail->setMessageId($msg_id);
$mail->setConversationId($conversation_id);
$mail->setInReplyToId($in_reply_to_id);
$mail->setUid(gen_id());
$mail->setState($isDraft && !$sendBtnClick ? 2 : 200);
set_user_config_option('last_mail_format', array_var($mail_data, 'format', 'plain'), logged_user()->getId());
$body = utf8_safe($body);
if (array_var($mail_data, 'format') == 'html') {
$body = preg_replace("/<body*[^>]*>/i", '<body>', $body);
// commented because sometimes brokes the html and leaves the body in blank
//$body = convert_to_links(preg_replace("/<body*[^>]*>/i",'<body>', $body));
$mail->setBodyHtml($body);
$mail->setBodyPlain(utf8_safe(html_to_text($body)));
} else {
$mail->setBodyPlain($body);
$mail->setBodyHtml('');
}
$mail->setFrom($account->getEmailAddress());
if ($accountUser->getIsDefault() && $accountUser->getSenderName() == "") {
$mail->setFromName(logged_user()->getObjectName());
} else {
$mail->setFromName($accountUser->getSenderName());
}
$mail->save();
//$mail->setIsRead(logged_user()->getId(), true);
if (Plugins::instance()->isActivePlugin('mail_rules')) {
if (array_var($mail_data, 'format') == 'html') {
$img = MailTracks::get_track_mark_img($mail->getId());
$body = $body . $img;
$mail->setBodyHtml($body);
$mail->setBodyPlain(utf8_safe(html_to_text($body)));
$mail->save();
}
}
foreach ($project_files_attachments as $pfatt) {
if ($pfatt instanceof ProjectFile) {
$pfatt->setMailId($mail->getId());
$pfatt->save();
开发者ID:abhinay100, 项目名称:fengoffice_app, 代码行数:67, 代码来源:MailController.class.php
The Bold Page Builder WordPress plugin before 4.3.3 does not sanitise and escape
阅读:673| 2022-07-29
bradtraversy/iweather: Ionic 3 mobile weather app
阅读:1578| 2022-08-30
singhateh/Laravel-Library-Management-system: Laravel-Library-Management-system
阅读:3136| 2022-08-15
joaomh/curso-de-matlab
阅读:1145| 2022-08-17
魔兽世界怀旧服已经开启两个多月了,但作为一个猎人玩家,抓到“断牙”,已经成为了一
阅读:1001| 2022-11-06
rugk/mastodon-simplified-federation: Simplifies following and interacting with r
阅读:1077| 2022-08-17
Tangshitao/Dense-Scene-Matching: Learning Camera Localization via Dense Scene Ma
阅读:755| 2022-08-16
openshift/library: Examples and Components for deploying into OpenShift
阅读:488| 2022-08-14
相信不少果粉在对自己的设备进行某些操作时,都会碰到Respring,但这个 Respring 到底
阅读:360| 2022-11-06
lightningtgc/MProgress.js: Material Progress —Google Material Design Progress l
阅读:403| 2022-08-17
请发表评论