/** * @see parent::getPerm() */ function getPerm($permType) { if (!$this->_ref_employe) { $this->loadRefsFwd(); } return $this->_ref_employe->getPerm($permType); }
/** * Crée les employés du cabinet * * @return bool */ protected function createEmployes() { $param = new CParamsPaie(); $params = $param->loadList(); if (!is_array($params)) { return true; } foreach ($params as $key => $curr_param) { $user = new CMediusers(); $user->load($params[$key]->employecab_id); $employe = new CEmployeCab(); $employe->function_id = $user->function_id; $employe->nom = $user->_user_last_name; $employe->prenom = $user->_user_first_name; $employe->function = $user->_user_type; $employe->adresse = $user->_user_adresse; $employe->cp = $user->_user_cp; $employe->ville = $user->_user_ville; $employe->store(); $params[$key]->employecab_id = $employe->employecab_id; $params[$key]->store(); } return true; }
<?php /** * $Id: edit_params.php 19621 2013-06-20 20:40:45Z phenxdesign $ * * @package Mediboard * @subpackage GestionCab * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 19621 $ */ CCanDo::checkRead(); $employecab_id = CValue::getOrSession("employecab_id", null); $user = CMediusers::get(); $employe = new CEmployeCab(); $where = array(); $where["function_id"] = "= '{$user->function_id}'"; $listEmployes = $employe->loadList($where); if ($employecab_id) { $employe =& $listEmployes[$employecab_id]; } else { $employe->function_id = $user->function_id; } $paramsPaie = new CParamsPaie(); if ($employe->employecab_id) { $paramsPaie->loadFromUser($employe->employecab_id); $paramsPaie->loadRefsFwd(); } // Création du template $smarty = new CSmartyDP(); $smarty->assign("employe", $employe);
<?php /** * $Id: edit_paie.php 19621 2013-06-20 20:40:45Z phenxdesign $ * * @package Mediboard * @subpackage GestionCab * @author SARL OpenXtrem <*****@*****.**> * @license GNU General Public License, see http://www.gnu.org/licenses/gpl.html * @version $Revision: 19621 $ */ CCanDo::checkRead(); $user = CMediusers::get(); $employecab_id = CValue::getOrSession("employecab_id", null); $fiche_paie_id = CValue::getOrSession("fiche_paie_id", null); $employe = new CEmployeCab(); $where = array(); $where["function_id"] = "= '{$user->function_id}'"; $listEmployes = $employe->loadList($where); if (!count($listEmployes)) { CAppUI::setMsg("Vous devez avoir au moins un employé", UI_MSG_ERROR); CAppUI::redirect("m=dPgestionCab&tab=edit_params"); } if ($employecab_id) { $employe =& $listEmployes[$employecab_id]; } else { $employe = reset($listEmployes); } $paramsPaie = new CParamsPaie(); $paramsPaie->loadFromUser($employe->employecab_id); $fichePaie = new CFichePaie();