예제 #1
0
        // 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";
/** @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);
예제 #2
0
    $docGed = new CDocGed();
} else {
    $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();
    }
}