/** * A partir d'un noeud (node_type/node_id), détermine le type d'agenda. Utile notamment à la création d'un agenda, pour bien positionner le champ type dans la BDD * @author Christophe Beyer <*****@*****.**> * @param string $node_type Type du noeud de rattachement * @param integer $node_id Id du noeud * @return integer Type correspondant */ public function getAgendaTypeForNode($node_type, $node_id) { switch ($node_type) { case "USER_ELE": case "USER_RES": case "USER_EXT": case "USER_ENS": case "USER_VIL": $agendaType = AgendaType::getPersonnal(); break; case "BU_CLASSE": $agendaType = AgendaType::getClassRoom(); break; case "BU_ECOLE": $agendaType = AgendaType::getSchool(); break; case "CLUB": $agendaType = AgendaType::getWorkGroups(); break; default: $agendaType = AgendaType::getOthers(); break; } return $agendaType; }
/** * Récupère de la session la liste des agendas à afficher * Si rien en session, revoie l'agenda personnel * @author Audrey Vassal <*****@*****.**> * @since 2006/07/28 * @return array $arAgendaAffiches agendas à afficher */ public function getAgendaAffiches() { if (_sessionGet('modules|agenda|affiches')) { return _sessionGet('modules|agenda|affiches'); } else { $listAgendas = AgendaService::getAvailableAgenda(); //print_r($listAgendas); $arAgendaAffiches = array(); foreach ($listAgendas as $agenda) { if ($agenda->type_agenda == AgendaType::getPersonnal()) { $arAgendaAffiches[$agenda->id_agenda] = $agenda->id_agenda; } } AgendaService::setAgendaAffiches($arAgendaAffiches); return $arAgendaAffiches; } }