* @version $Revision$ */ CCanDo::checkRead(); $start = CValue::get("start", 0); CView::enforceSlave(); $filter = new CUserLog(); $filter->date = CValue::get("date", CMbDT::dateTime()); $filter->_date_max = CMbDT::dateTime($filter->date); $filter->_date_min = CMbDT::dateTime("-1 week", $filter->date); $filter->user_id = CValue::get("user_id"); $filter->ip_address = CValue::get("ip_address", "255.255.255.255"); $order_col = CValue::getOrSession("order_col", "date_max"); $order_way = CValue::getOrSession("order_way", "DESC"); $order_way_alt = $order_way == "ASC" ? "DESC" : "ASC"; $user = new CMediusers(); $listUsers = $user->loadUsers(); $where = array("ip_address IS NOT NULL AND ip_address != ''"); $where[] = "date >= '{$filter->_date_min}'"; $where[] = "date <= '{$filter->_date_max}'"; $where[] = "user_id " . CSQLDataSource::prepareIn(array_keys($listUsers), $filter->user_id); $order = "{$order_col} {$order_way}"; $group = "ip_address"; $total_list_count = $filter->countMultipleList($where, $order, $group, null, array("ip_address", "MAX(date) AS date_max, GROUP_CONCAT(DISTINCT user_id SEPARATOR '|') AS user_list")); foreach ($total_list_count as $key => $_log) { if (inet_ntop($_log["ip_address"]) != inet_ntop($_log["ip_address"] & inet_pton($filter->ip_address))) { unset($total_list_count[$key]); } } $total_list = array_slice($total_list_count, $start, 30); foreach ($total_list as &$_log) { $_log["ip"] = inet_ntop($_log["ip_address"]);
} $can_edit = CCanDo::edit(); $planning->guid = $user->_guid; $planning->hour_min = "07"; $planning->hour_max = "20"; $planning->pauses = array("07", "12", "19"); $planning->dragndrop = $planning->resizable = $can_edit ? 1 : 0; $planning->hour_divider = 60 / CAppUI::conf("dPcabinet CPlageconsult minutes_interval"); $planning->no_dates = 0; $plage = new CPlageconsult(); $whereHP["plageop_id"] = " IS NULL"; $users = array(); $conges_day = array(); if ($user->_id) { $muser = new CMediusers(); $users = $muser->loadUsers(PERM_READ, $user->function_id); } for ($i = 0; $i < $nbDays; $i++) { $jour = CMbDT::date("+{$i} day", $debut); $is_holiday = array_key_exists($jour, $bank_holidays); $planning->addDayLabel($jour, '<span style="font-size: 1.4em">' . CMbDT::format($jour, "%a %d %b") . '</span>'); // conges dans le header if (count($users)) { if (CModule::getActive("dPpersonnel")) { $_conges = CPlageConge::loadForIdsForDate(array_keys($users), $jour); foreach ($_conges as $key => $_conge) { $_conge->loadRefUser(); $conges_day[$i][] = $_conge->_ref_user->_shortview; } } }
/** @var CMediusers $object */ $object = new CMediusers(); $user = CMediusers::get(); $use_edit = CAppUI::pref("useEditAutocompleteUsers"); if (!$edit && $use_edit) { $edit = 1; } // Droits sur les utilisateurs retournés $permType = $edit ? PERM_EDIT : PERM_READ; // Récupération de la liste des utilisateurs if ($rdv) { $listUsers = $object->loadProfessionnelDeSanteByPref($permType, null, $keywords); } elseif ($praticiens) { $listUsers = $object->loadPraticiens($permType, null, $keywords); } else { $listUsers = $object->loadUsers($permType, null, $keywords); } if ($compta) { $listUsersCompta = CConsultation::loadPraticiensCompta(); foreach ($listUsers as $_user) { if (!isset($listUsersCompta[$_user->_id])) { unset($listUsers[$_user->_id]); } } } $template = $object->getTypedTemplate("autocomplete"); // Création du template $smarty = new CSmartyDP(); $smarty->assign('matches', $listUsers); $smarty->assign('field', $field); $smarty->assign('view_field', $view_field);
<?php /** * $Id$ * * @category Drawing * @package Mediboard * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision$ * @link http://www.mediboard.org */ CCanDo::checkAdmin(); // users $user = new CMediusers(); $users = $user->loadUsers(PERM_EDIT); // functions $function = new CFunctions(); $functions = $function->loadListWithPerms(PERM_EDIT); // smarty $smarty = new CSmartyDP(); $smarty->assign("users", $users); $smarty->assign("functions", $functions); $smarty->display("vw_categories.tpl");