[ bug #1231 ] PDF always generated in interventions

This commit is contained in:
Laurent Destailleur 2014-02-08 02:46:05 +01:00
parent aad7885bca
commit 5b89bc18f5
2 changed files with 25 additions and 17 deletions

View File

@ -15,6 +15,10 @@ Fix: Link to paypal was invalid into email text.
Fix: ref and date of supplier invoice. Fix: ref and date of supplier invoice.
Fix: Check on bank account. Fix: Check on bank account.
Fix: Problem with file upload and download. Fix: Problem with file upload and download.
Fix: Page load not ending when large number of thirdparies. We
added option MAIN_DISABLE_AJAX_COMBOX to disable javascript
combo feature that is root cause of problem.
Fix: [ bug #1231 ] PDF always generated in interventions
***** ChangeLog for 3.5 compared to 3.4.* ***** ***** ChangeLog for 3.5 compared to 3.4.* *****
For users: For users:

View File

@ -109,7 +109,8 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->fichein
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result=fichinter_create($db, $object, GETPOST('model','alpha'), $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, GETPOST('model','alpha'), $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;
} }
@ -134,7 +135,8 @@ else if ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->fich
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->model:GETPOST('model','apha'), $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->model:GETPOST('model','apha'), $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;
} }
@ -459,7 +461,7 @@ else if ($action == "addline" && $user->rights->ficheinter->creer)
{ {
$db->commit(); $db->commit();
fichinter_create($db, $object, $object->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;
} }
@ -529,7 +531,7 @@ else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST(
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
fichinter_create($db, $object, $object->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;
@ -564,7 +566,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
fichinter_create($db, $object, $object->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);
} }
/* /*
@ -585,7 +587,8 @@ else if ($action == 'up' && $user->rights->ficheinter->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
fichinter_create($db, $object, $object->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int')); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
exit; exit;
} }
@ -604,7 +607,8 @@ else if ($action == 'down' && $user->rights->ficheinter->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
fichinter_create($db, $object, $object->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) fichinter_create($db, $object, $object->modelpdf, $outputlangs);
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int')); header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
exit; exit;
} }