Ejemplo n.º 1
0
}

/*
 *  Supprime une ligne d'intervention AVEC confirmation
 */
if ($action == 'confirm_deleteline' && $_REQUEST['confirm'] == 'yes')
{
    if ($user->rights->ficheinter->creer)
    {
        $fichinterline = new FichinterLigne($db);
        if ($fichinterline->fetch($_GET['ligne']) <= 0)
        {
            dol_print_error($db);
            exit;
        }
        $result=$fichinterline->deleteline();
        $object = new Fichinter($db);
        if ($object->fetch($fichinterline->fk_fichinter) <= 0)
        {
            dol_print_error($db);
            exit;
        }

        // Define output language
        $outputlangs = $langs;
        $newlang='';
        if ($conf->global->MAIN_MULTILANGS && empty($newlang) && ! empty($_REQUEST['lang_id'])) $newlang=$_REQUEST['lang_id'];
        if ($conf->global->MAIN_MULTILANGS && empty($newlang)) $newlang=$object->client->default_lang;
        if (! empty($newlang))
        {
            $outputlangs = new Translate("",$conf);
Ejemplo n.º 2
0
         $outputlangs = new Translate("", $conf);
         $outputlangs->setDefaultLang($newlang);
     }
     if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) {
         fichinter_create($db, $object, $object->modelpdf, $outputlangs);
     }
     header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
     exit;
 } else {
     if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->ficheinter->creer) {
         $objectline = new FichinterLigne($db);
         if ($objectline->fetch($lineid) <= 0) {
             dol_print_error($db);
             exit;
         }
         $result = $objectline->deleteline($user);
         if ($object->fetch($objectline->fk_fichinter) <= 0) {
             dol_print_error($db);
             exit;
         }
         // Define output language
         $outputlangs = $langs;
         $newlang = '';
         if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'alpha')) {
             $newlang = GETPOST('lang_id', 'alpha');
         }
         if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
             $newlang = $object->client->default_lang;
         }
         if (!empty($newlang)) {
             $outputlangs = new Translate("", $conf);
Ejemplo n.º 3
0
     }
     if (!empty($newlang)) {
         $outputlangs = new Translate("", $conf);
         $outputlangs->setDefaultLang($newlang);
     }
     fichinter_create($db, $object, $object->modelpdf, $outputlangs);
     Header('Location: ' . $_SERVER["PHP_SELF"] . '?id=' . $object->id);
     exit;
 } else {
     if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->ficheinter->creer) {
         $objectline = new FichinterLigne($db);
         if ($objectline->fetch(GETPOST('line_id', 'int')) <= 0) {
             dol_print_error($db);
             exit;
         }
         $result = $objectline->deleteline();
         if ($object->fetch($objectline->fk_fichinter) <= 0) {
             dol_print_error($db);
             exit;
         }
         // Define output language
         $outputlangs = $langs;
         $newlang = '';
         if ($conf->global->MAIN_MULTILANGS && empty($newlang) && GETPOST('lang_id', 'alpha')) {
             $newlang = GETPOST('lang_id', 'alpha');
         }
         if ($conf->global->MAIN_MULTILANGS && empty($newlang)) {
             $newlang = $object->client->default_lang;
         }
         if (!empty($newlang)) {
             $outputlangs = new Translate("", $conf);