Ejemplo n.º 1
0
    echo $fiche_def->input_detail();
    echo $retour;
    return;
}
/*******************************************************************************************/
// Save a new category of card
/*******************************************************************************************/
if (isset($_POST['add_modele'])) {
    $single = new Tool_Uos("dup");
    if ($single->get_count() == 0) {
        $single->save();
        $fiche_def = new Fiche_Def($cn);
        /**
         * Check if we have all needed information
         */
        if ($fiche_def->Add($_POST) == 0) {
            echo $fiche_def->input_detail();
            echo $retour;
            return;
        } else {
            $fiche_def->input_new();
            echo $retour;
            return;
        }
    } else {
        alert(_('Doublon'));
    }
}
$fiche_def = new Fiche_def($cn);
$fiche_def->Display();
$dossier = Dossier::id();
Ejemplo n.º 2
0
 case 'scc':
     /*----------------------------------------------------------------------
      * Save card Category into the database and return a ok message
      *
      *----------------------------------------------------------------------*/
     $html = '';
     if ($g_user->check_action(FICCAT) == 1) {
         $script = create_script("removeDiv('{$ctl}')");
         $html .= $script;
         if (strlen(trim($_GET['nom_mod'])) != 0) {
             $array = array("FICHE_REF" => $cat, "nom_mod" => $_GET['nom_mod'], "class_base" => $_GET['class_base'], "fd_description" => $_GET['fd_description']);
             if (isset($_POST['create'])) {
                 $array['create'] = 1;
             }
             $catcard = new Fiche_Def($cn);
             if ($catcard->Add($array) == -1) {
                 $script = "alert_box('" . _('Catégorie existe déjà') . "')";
             } else {
                 $script = "alert_box('" . _('Catégorie sauvée') . "')";
             }
             $html .= create_script($script);
         } else {
             $script = "alert_box('" . _("Le nom ne peut pas être vide") . "')";
             $html .= create_script($script);
             $invalid = 1;
         }
     } else {
         $html = alert(_('Action interdite'), true);
     }
     break;
 case 'upc':