function computePath() { if (!$this->pere_id) { return $this->_path = "{$this->code}-"; } $this->loadParent(); return $this->_path = $this->_ref_pere->computePath() . $this->code . "-"; }
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"; /** @var CChapitreDoc[] $listChapitres */ $listChapitres = $chapitre->loadlist($where, $order); foreach ($listChapitres as $_chapitre) { $_chapitre->loadChapsDeep(); } // Création du template $smarty = new CSmartyDP(); $smarty->assign("theme_id", $theme_id); $smarty->assign("chapitre_id", $chapitre_id); $smarty->assign("listThemes", $listThemes); $smarty->assign("listChapitres", $listChapitres);
$sort_by = CValue::getOrSession("sort_by", "date"); $sort_way = CValue::getOrSession("sort_way", "DESC"); $keywords = CValue::get("keywords"); $first = intval(CValue::get("first", 0)); $group = CGroups::loadCurrent(); // Procédure active et non annulée $where = array(); $where[] = "annule = '0' OR annule IS NULL"; $where[] = "doc_ged.group_id = '{$group->_id}' OR doc_ged.group_id IS NULL"; $where["actif"] = "= '1'"; $where[] = "date = (SELECT max(date) FROM doc_ged_suivi d1 WHERE d1.doc_ged_id = doc_ged.doc_ged_id AND actif = '1')"; if ($theme_id) { $where["doc_theme_id"] = "= '{$theme_id}'"; } if ($chapitre_id) { $chapitre = new CChapitreDoc(); $chapitre->load($chapitre_id); $chapitre->loadChapsDeep(); $where["doc_ged.doc_chapitre_id"] = CSQLDataSource::prepareIn($chapitre->_chaps_and_subchaps); } if ($keywords) { $where["doc_ged.titre"] = "LIKE '%{$keywords}%'"; } $ljoin = array(); $ljoin["doc_ged_suivi"] = "doc_ged.doc_ged_id = doc_ged_suivi.doc_ged_id"; $ljoin["doc_categories"] = "doc_ged.doc_categorie_id = doc_categories.doc_categorie_id"; $ljoin["doc_chapitres"] = "doc_ged.doc_chapitre_id = doc_chapitres.doc_chapitre_id"; $group = "doc_ged.doc_ged_id"; if ($sort_by == 'ref') { $sort_way = "ASC"; if (CAppUI::conf("dPqualite CDocGed _reference_doc")) {
$where["group_id"] = $etablissement ? "= '{$etablissement}'" : "IS NULL"; $listThemes = $listThemes->loadList($where); // Création du Template $smarty->assign("theme", $theme); $smarty->assign("listThemes", $listThemes); $smarty->display("vw_edit_themes.tpl"); } else { $maxDeep = CAppUI::conf("dPqualite CChapitreDoc profondeur") - 2; // Chargement du chapitre demandé $doc_chapitre_id = CValue::getOrSession("doc_chapitre_id", null); $chapitre = new CChapitreDoc(); $chapitre->load($doc_chapitre_id); $chapitre->loadRefsFwd(); // Chargement du chapitre de navigation $nav_chapitre_id = CValue::getOrSession("nav_chapitre_id", null); $nav_chapitre = new CChapitreDoc(); $nav_chapitre->load($nav_chapitre_id); $nav_chapitre->loadRefsFwd(); if ($nav_chapitre->_id) { $nav_chapitre->computeLevel(); $nav_chapitre->computePath(); } else { $nav_chapitre->_level = -1; } // Liste des Chapitres $listChapitres = new CChapitreDoc(); $where = array(); $where["group_id"] = $etablissement ? "= '{$etablissement}'" : "IS NULL"; $where["pere_id"] = $nav_chapitre->_id ? "= '{$nav_chapitre->_id}'" : "IS NULL"; $listChapitres = $listChapitres->loadList($where); // Création du Template
$docGed->loadLastActif(); $docGed->loadRefs(); // Liste des Catégories $categorie = new CCategorieDoc(); $listCategories = $categorie->loadlist(null, "code"); // Liste des Thèmes $theme = new CThemeDoc(); $where = array(); if ($docGed->group_id) { $where[] = "group_id = '{$docGed->group_id}' OR group_id IS NULL"; } else { $where["group_id"] = "IS NULL"; } $listThemes = $theme->loadlist($where, "group_id, nom"); // Liste des Chapitres $chapitre = new CChapitreDoc(); $where = array(); $where["pere_id"] = "IS NULL"; if ($docGed->group_id) { $where[] = "group_id = '{$docGed->group_id}' OR group_id IS NULL"; } else { $where["group_id"] = "IS NULL"; } /** @var CChapitreDoc[] $listChapitres */ $listChapitres = $chapitre->loadlist($where, "group_id, code"); foreach ($listChapitres as &$_chapitre) { $_chapitre->loadChapsDeep(); } } $docGed->loadLastEntry(); // Procédure en Cours de demande