/**
  * Detail d'une procedure
  *
  * @author Christophe Beyer <*****@*****.**>
  * @since 2008/01/30
  * @param object $rFiche Recordset de la procedure
  */
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $rFiche = $this->getParam('rFiche');
     $errors = $this->getParam('errors');
     $ok = $this->getParam('ok');
     $print = $this->getParam('print');
     //var_dump($rFiche);
     //$daoType = & _dao ('type');
     //$tpl->assign ('arTypes', $daoType->findAll ());
     $arResponsables = preg_split('/[\\s,]+/', $rFiche->responsables);
     $rFiche->tabResponsables = $arResponsables;
     $mondroit = $this->getParam('mondroit');
     $rEcole = Kernel::getNodeInfo('BU_ECOLE', $rFiche->idetabliss, false);
     //var_dump($rEcole);
     $rFiche->ecole_nom = $rEcole['ALL']->eco_nom;
     $rFiche->ecole_type = $rEcole['ALL']->eco_type;
     $rFiche->ecole_tel = $rEcole['ALL']->eco_tel;
     $rFiche->ecole_dir = AnnuaireService::getDirecteurInEcole($rFiche->idetabliss);
     $daoType =& _dao('teleprocedures|type');
     if ($tmp = $daoType->get($rFiche->idtype)) {
         $rFiche->idtype_nom = $tmp->nom;
     }
     $daoStatu =& _dao('teleprocedures|statu');
     if ($tmp = $daoStatu->get($rFiche->idstatu)) {
         $rFiche->idstatu_nom = $tmp->nom;
     }
     $canDelegue = TeleproceduresService::canMakeInTelep('DELEGUE', $mondroit, array('idinter' => $rFiche->idinter));
     $tpl->assign('canDelegue', $canDelegue);
     $tpl->assign('canViewDelai', TeleproceduresService::canMakeInTelep('VIEW_DELAI', $mondroit));
     $tpl->assign('rFiche', $rFiche);
     $tpl->assign('errors', $errors);
     $tpl->assign('ok', $ok);
     $tpl->assign('print', $print);
     $tplFiche = $tpl->fetch('fiche-zone.tpl');
     $toReturn = $tplFiche;
     return true;
 }
 /**
  * Detail d'une ecole
  *
  * @author Christophe Beyer <*****@*****.**>
  * @since 2008/09/03
  * @param object $rEcole Recordset de l'ecole
  * @param object $rFiche Recordset de la fiche ecole
  */
 public function _createContent(&$toReturn)
 {
     $tpl = new CopixTpl();
     $rEcole = $this->getParam('rEcole');
     $rFiche = $this->getParam('rFiche');
     $arClasses = AnnuaireService::getClassesInEcole($rEcole->numero, array('forceCanViewEns' => true, 'withNiveaux' => true));
     usort($arClasses, array("ZoneFiche", "_usortClasses"));
     //var_dump($arClasses);
     $canModify = FichesEcolesService::canMakeInFicheEcole($rEcole->numero, 'MODIFY');
     $blog = getNodeBlog('BU_ECOLE', $rEcole->numero, array('is_public' => 1));
     //var_dump($blog);
     $arClassesBlogs = false;
     if ($blog) {
         $rEcole->blog = $blog;
     } else {
         // Si pas de blog, on regarde s'il y a des blogs publics de classes
         $arClassesBlogs = AnnuaireService::getClassesInEcole($rEcole->numero, array('onlyWithBlog' => true, 'onlyWithBlogIsPublic' => 1, 'enseignant' => false));
     }
     //Kernel::deb($arClassesBlogs);
     $rEcole->directeur = AnnuaireService::getDirecteurInEcole($rEcole->numero);
     //var_dump($rEcole);
     $matrix =& enic::get('matrixCache');
     $nodeVocabularyCatalogDAO = _ioDAO('kernel|kernel_i18n_node_vocabularycatalog');
     $vocabularyCatalog = $nodeVocabularyCatalogDAO->getCatalogForNode('BU_ECOLE', $rEcole->numero);
     $tpl->assign('rEcole', $rEcole);
     $tpl->assign('rFiche', $rFiche);
     $tpl->assign('arClasses', $arClasses);
     $tpl->assign('arClassesBlogs', $arClassesBlogs);
     $tpl->assign('canModify', $canModify);
     $_right = $matrix->ecole($rEcole->numero)->_right;
     $tpl->assign('canViewDir', $_right->USER_DIR->voir);
     $tpl->assign('canWriteDir', $_right->USER_DIR->communiquer);
     $tpl->assign('canViewEns', $_right->USER_ENS->voir);
     $tpl->assign('canWriteEns', $_right->USER_ENS->communiquer);
     $tpl->assign('id_vc', $vocabularyCatalog->id_vc);
     $toReturn = $tpl->fetch('fiche.tpl');
     return true;
 }
 function getAllEcoles($cond = '')
 {
     $query = 'SELECT e.numero AS id, e.type AS type, e.nom AS nom, e.web AS web, e.id_ville AS ville, v.nom AS ville_nom FROM kernel_bu_ecole AS e JOIN kernel_bu_ville AS v ON e.id_ville = v.id_vi' . $cond;
     $ecolesList = $this->db->query($query)->toArray();
     foreach ($ecolesList as $key => $ecole) {
         $ecolesList[$key]['directeur'] = isset($params['directeur']) && $params['directeur'] ? AnnuaireService::getDirecteurInEcole($ecole['id']) : NULL;
     }
     //utf8 !
     foreach ($ecolesList as $key => $ecole) {
         foreach ($ecole as $keyi => $item) {
             $ecolesList[$key][$keyi] = utf8_encode($item);
         }
     }
     usort($ecolesList, array('AnnuaireService', 'usort_nom'));
     return $ecolesList;
 }