$docGed = new CDocGed(); if (!$docGed->load($doc_ged_id)) { // Ce document n'est pas valide $doc_ged_id = null; CValue::setSession("doc_ged_id"); $docGed = new CDocGed(); } else { $docGed->loadLastActif(); if (!$docGed->_lastactif->doc_ged_suivi_id || $docGed->annule) { // Ce document n'est pas Terminé ou est suspendu $doc_ged_id = null; CValue::setSession("doc_ged_id"); $docGed = new CDocGed(); } else { $docGed->_lastactif->loadFile(); $docGed->loadRefs(); } } $group = CGroups::loadCurrent(); // Liste des Thèmes $theme = new CThemeDoc(); $where = array(); $where[] = "group_id = '{$group->_id}' OR group_id IS NULL"; /** @var CThemeDoc[] $listThemes */ $listThemes = $theme->loadlist($where, "nom"); // Liste des chapitres $chapitre = new CChapitreDoc(); $order = "group_id, nom"; $where = array(); $where["pere_id"] = "IS NULL"; $where[] = "group_id = '{$group->_id}' OR group_id IS NULL";