Exemplo n.º 1
0
$category_id = CValue::getOrSession("category_id", CAppUI::conf('dPmedicament CBcbProduitLivretTherapeutique product_category_id'));
$listProduits = array();
// Chargement des functions
$function = new CFunctions();
$functions = $function->loadSpecialites(PERM_EDIT);
// Si on est admin ou que $functions contient plus d'un élément,
// on récupère la fonction en session
if (CAppUI::$user->isAdmin() || count($functions) > 1) {
    $function_guid = CValue::getOrSession("function_guid", reset($functions)->_guid);
} else {
    // Sinon, c'est la fonction de l'utilisateur
    $function_guid = "CFunctions-" . CAppUI::$user->function_id;
}
$function = CMbObject::loadFromGuid($function_guid);
// Chargement des produits du livret therapeutique
$produits_livret = CBcbProduit::loadRefLivretTherapeutique($function->_guid);
$tabLettre = range('A', 'Z');
// --- Chargement de l'arbre ATC ---
$codeATC = CValue::get("codeATC");
$classeATC = new CBcbClasseATC();
$chapitreATC = $codeATC ? $classeATC->getLibelle($codeATC) : '';
// Nom du chapitre selectionné
$arbreATC = $classeATC->loadArbre($codeATC);
// Chargements des sous chapitres
$categories = array();
if (CModule::getActive("dPstock")) {
    $category = new CProductCategory();
    $categories = $category->loadList(null, "name");
}
// Création du template
$smarty = new CSmartyDP();