. * * @filesource welcome.php * @package controllers * Page d'acceuil */ class Welcome extends CI_Controller { function __construct() { parent::__construct(); // Check if user is logged in or not $this->dx_auth->check_login(); if ($this->config->item('calendar_id')) { gvv_debug('google account = ' . $this->config->item('calendar_id')); $this->load->library('GoogleCal'); } $this->load->helper('validation'); // Store current URL to reload it after the certificate is granted $this->session->set_userdata('return_url', current_url()); $this->lang->load('welcome'); } function nyi() { $data = array (); $data ['title'] = $this->lang->line("welcome_nyi_title"); $data ['text'] = $this->lang->line("welcome_nyi_text"); load_last_view('message', $data); } /** * Page d'acceuil du comptable */ public function compta() { if (! $this->dx_auth->is_role('tresorier')) { $this->dx_auth->deny_access(); } load_last_view('welcome/compta', array ()); } /** * Change l'année courante * * @param unknown_type $year */ public function new_year($year) { $this->session->set_userdata('year', $year); redirect("welcome/ca"); } /** * Page d'acceuil du comptable */ public function ca() { if (! $this->dx_auth->is_role('ca')) { $this->dx_auth->deny_access(); } $year = $this->session->userdata('year'); if (! $year) { $year = Date("Y"); $this->session->set_userdata('year', $year); } $data = array (); $this->load->model('ecritures_model'); $data ['year'] = $year; $data ['controller'] = 'welcome'; $data ['year_selector'] = $this->ecritures_model->getYearSelector("date_op"); load_last_view('welcome/ca', $data); } } /* End of file welcome.php */ /* Location: ./application/controllers/welcome.php */