Example #1
0
$classes = array_flip(CApp::getInstalledClasses());
// Chargement des classes possibles pour les aides à la saisie
foreach ($classes as $class => &$infos) {
    $object = new $class();
    $infos = array();
    foreach ($object->_specs as $field => $spec) {
        if (!isset($spec->helped)) {
            continue;
        }
        $info =& $infos[$field];
        if (!is_array($spec->helped)) {
            $info = null;
        }
    }
}
CMbArray::removeValue(array(), $classes);
$filtre->loadRefUser();
$filtre->loadRefFunction();
$module = CModule::getActive("dPcompteRendu");
$is_admin = $module && $module->canAdmin();
$access_function = $is_admin || CAppUI::conf("compteRendu CAideSaisie access_function");
// Création du template
$smarty = new CSmartyDP();
$smarty->assign("filtre", $filtre);
$smarty->assign("access_function", $access_function);
$smarty->assign("classes", $classes);
$smarty->assign("start", $start);
$smarty->assign("keywords", $keywords);
$smarty->assign("order_col_aide", $order_col_aide);
$smarty->assign("order_way", $order_way);
$smarty->display("vw_idx_aides.tpl");
Example #2
0
}
$whereClause .= ")";
$where[] = $whereClause;
$orderby = "name";
$aides = $aidebis->loadList($where, $orderby);
$aide = new CAideSaisie();
$aide->load($aide_id);
if ($aide->_id) {
    if ($aide->function_id && !$access_function) {
        CAppUI::redirect("m=system&a=access_denied");
    }
    if ($aide->group_id && !$access_group) {
        CAppUI::redirect("m=system&a=access_denied");
    }
    $aide->loadRefUser();
    $aide->loadRefFunction();
    $aide->loadRefGroup();
} else {
    // Nouvelle Aide à la saisie
    $aide->class = $class;
    $aide->field = $field;
    $text = stripslashes($text);
    $name = implode(" ", array_slice(explode(" ", $text), 0, 3));
    $aide->name = $name;
    $aide->text = $text;
    $aide->depend_value_1 = $depend_value_1;
    $aide->depend_value_2 = $depend_value_2;
    //switch(CAppUI::pref("choicepratcab")) {
    /*case "prat":*/
    $aide->user_id = $user_id;
    //break;