New: Add option MAIN_DISABLE_PDF_AUTOUPDATE

This commit is contained in:
Laurent Destailleur 2011-10-14 16:44:22 +02:00
parent d0738e5d7b
commit 15db353eb4
10 changed files with 1329 additions and 1326 deletions

View File

@ -161,7 +161,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes')
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit; exit;
@ -191,7 +191,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->propale
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
else else
{ {
@ -343,7 +343,7 @@ if ($_POST['action'] == 'add' && $user->rights->propale->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit; exit;
@ -602,7 +602,7 @@ if ($action == 'modif' && $user->rights->propale->creer)
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
if ($_POST['action'] == "setabsolutediscount" && $user->rights->propale->creer) if ($_POST['action'] == "setabsolutediscount" && $user->rights->propale->creer)
@ -726,22 +726,22 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
{ {
// Insert line // Insert line
$result=$object->addline( $result=$object->addline(
$_POST["id"], $_POST["id"],
$desc, $desc,
$pu_ht, $pu_ht,
$_POST['qty'], $_POST['qty'],
$tva_tx, $tva_tx,
$localtax1_tx, $localtax1_tx,
$localtax2_tx, $localtax2_tx,
$_POST['idprod'], $_POST['idprod'],
$_POST['remise_percent'], $_POST['remise_percent'],
$price_base_type, $price_base_type,
$pu_ttc, $pu_ttc,
$info_bits, $info_bits,
$type, $type,
-1, -1,
0, 0,
$_POST['fk_parent_line'] $_POST['fk_parent_line']
); );
if ($result > 0) if ($result > 0)
@ -756,7 +756,7 @@ if ($_POST['action'] == "addline" && $user->rights->propale->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
unset($_POST['qty']); unset($_POST['qty']);
unset($_POST['type']); unset($_POST['type']);
@ -814,18 +814,19 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
} }
else else
{ {
$result = $object->updateline($_POST['lineid'], $result = $object->updateline(
$up_ht, $_POST['lineid'],
$_POST['qty'], $up_ht,
$_POST['remise_percent'], $_POST['qty'],
$vat_rate, $_POST['remise_percent'],
$localtax1_rate, $vat_rate,
$localtax2_rate, $localtax1_rate,
$_POST['desc'], $localtax2_rate,
'HT', $_POST['desc'],
$info_bits, 'HT',
$special_code, $info_bits,
$_POST['fk_parent_line'] $special_code,
$_POST['fk_parent_line']
); );
// Define output language // Define output language
@ -838,7 +839,7 @@ if ($_POST['action'] == 'updateligne' && $user->rights->propale->creer && $_POST
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
} }
@ -951,7 +952,7 @@ if ($action == 'up' && $user->rights->propale->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid'));
exit; exit;
@ -973,7 +974,7 @@ if ($action == 'down' && $user->rights->propale->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid'));
exit; exit;

View File

@ -158,7 +158,7 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes')
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
else else
{ {
@ -260,25 +260,25 @@ if ($action == 'add' && $user->rights->commande->creer)
} }
$result = $object->addline( $result = $object->addline(
$object_id, $object_id,
$desc, $desc,
$lines[$i]->subprice, $lines[$i]->subprice,
$lines[$i]->qty, $lines[$i]->qty,
$lines[$i]->tva_tx, $lines[$i]->tva_tx,
$lines[$i]->localtax1_tx, $lines[$i]->localtax1_tx,
$lines[$i]->localtax2_tx, $lines[$i]->localtax2_tx,
$lines[$i]->fk_product, $lines[$i]->fk_product,
$lines[$i]->remise_percent, $lines[$i]->remise_percent,
$lines[$i]->info_bits, $lines[$i]->info_bits,
$lines[$i]->fk_remise_except, $lines[$i]->fk_remise_except,
'HT', 'HT',
0, 0,
$datestart, $datestart,
$dateend, $dateend,
$product_type, $product_type,
$lines[$i]->rang, $lines[$i]->rang,
$lines[$i]->special_code, $lines[$i]->special_code,
$fk_parent_line $fk_parent_line
); );
if ($result < 0) if ($result < 0)
@ -579,25 +579,25 @@ if ($action == 'addline' && $user->rights->commande->creer)
{ {
// Insert line // Insert line
$result = $object->addline( $result = $object->addline(
$id, $id,
$desc, $desc,
$pu_ht, $pu_ht,
$_POST['qty'], $_POST['qty'],
$tva_tx, $tva_tx,
$localtax1_tx, $localtax1_tx,
$localtax2_tx, $localtax2_tx,
$_POST['idprod'], $_POST['idprod'],
$_POST['remise_percent'], $_POST['remise_percent'],
$info_bits, $info_bits,
0, 0,
$price_base_type, $price_base_type,
$pu_ttc, $pu_ttc,
$date_start, $date_start,
$date_end, $date_end,
$type, $type,
-1, -1,
'', '',
$_POST['fk_parent_line'] $_POST['fk_parent_line']
); );
if ($result > 0) if ($result > 0)
@ -612,7 +612,7 @@ if ($action == 'addline' && $user->rights->commande->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
unset($_POST['qty']); unset($_POST['qty']);
unset($_POST['type']); unset($_POST['type']);
@ -692,20 +692,21 @@ if ($action == 'updateligne' && $user->rights->commande->creer && $_POST['save']
if ($result >= 0) if ($result >= 0)
{ {
$result = $object->updateline($_POST['lineid'], $result = $object->updateline(
$description, $_POST['lineid'],
$up_ht, $description,
$_POST['qty'], $up_ht,
$_POST['remise_percent'], $_POST['qty'],
$vat_rate, $_POST['remise_percent'],
$localtax1_rate, $vat_rate,
$localtax2_rate, $localtax1_rate,
'HT', $localtax2_rate,
$info_bits, 'HT',
$date_start, $info_bits,
$date_end, $date_start,
$type, $date_end,
$_POST['fk_parent_line'] $type,
$_POST['fk_parent_line']
); );
if ($result >= 0) if ($result >= 0)
@ -720,7 +721,7 @@ if ($action == 'updateligne' && $user->rights->commande->creer && $_POST['save']
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
else else
{ {
@ -754,7 +755,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->command
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
} }
@ -794,7 +795,7 @@ if ($action == 'modif' && $user->rights->commande->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
} }
@ -819,7 +820,7 @@ if ($action == 'up' && $user->rights->commande->creer)
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.$_GET['rowid']); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.$_GET['rowid']);
exit; exit;
@ -841,7 +842,7 @@ if ($action == 'down' && $user->rights->commande->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.$_GET['rowid']); Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.$_GET['rowid']);
exit; exit;

View File

@ -169,8 +169,8 @@ if ($action == 'confirm_deleteline' && $confirm == 'yes')
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result=facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
if ($result > 0) if ($result >= 0)
{ {
Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id);
exit; exit;
@ -330,7 +330,7 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->facture->v
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
else else
{ {
@ -387,7 +387,7 @@ if ($action == 'modif' && ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) && $us
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
} }
@ -759,28 +759,28 @@ if ($action == 'add' && $user->rights->facture->creer)
} }
$result = $object->addline( $result = $object->addline(
$id, $id,
$desc, $desc,
$lines[$i]->subprice, $lines[$i]->subprice,
$lines[$i]->qty, $lines[$i]->qty,
$lines[$i]->tva_tx, $lines[$i]->tva_tx,
$lines[$i]->localtax1_tx, $lines[$i]->localtax1_tx,
$lines[$i]->localtax2_tx, $lines[$i]->localtax2_tx,
$lines[$i]->fk_product, $lines[$i]->fk_product,
$lines[$i]->remise_percent, $lines[$i]->remise_percent,
$date_start, $date_start,
$date_end, $date_end,
0, 0,
$lines[$i]->info_bits, $lines[$i]->info_bits,
$lines[$i]->fk_remise_except, $lines[$i]->fk_remise_except,
'HT', 'HT',
0, 0,
$product_type, $product_type,
$lines[$i]->rang, $lines[$i]->rang,
$lines[$i]->special_code, $lines[$i]->special_code,
$object->origin, $object->origin,
$lines[$i]->rowid, $lines[$i]->rowid,
$fk_parent_line $fk_parent_line
); );
if ($result > 0) if ($result > 0)
@ -978,28 +978,28 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
{ {
// Insert line // Insert line
$result = $object->addline( $result = $object->addline(
$id, $id,
$desc, $desc,
$pu_ht, $pu_ht,
$_POST['qty'], $_POST['qty'],
$tva_tx, $tva_tx,
$localtax1_tx, $localtax1_tx,
$localtax2_tx, $localtax2_tx,
$_POST['idprod'], $_POST['idprod'],
$_POST['remise_percent'], $_POST['remise_percent'],
$date_start, $date_start,
$date_end, $date_end,
0, 0,
$info_bits, $info_bits,
'', '',
$price_base_type, $price_base_type,
$pu_ttc, $pu_ttc,
$type, $type,
-1, -1,
0, 0,
'', '',
0, 0,
GETPOST('fk_parent_line') GETPOST('fk_parent_line')
); );
} }
} }
@ -1017,7 +1017,7 @@ if (($action == 'addline' || $action == 'addline_predef') && $user->rights->fact
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
unset($_POST['qty']); unset($_POST['qty']);
unset($_POST['type']); unset($_POST['type']);
@ -1089,20 +1089,21 @@ if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save']
// Update line // Update line
if ($result >= 0) if ($result >= 0)
{ {
$result = $object->updateline(GETPOST('lineid'), $result = $object->updateline(
$description, GETPOST('lineid'),
$up_ht, $description,
GETPOST('qty'), $up_ht,
GETPOST('remise_percent'), GETPOST('qty'),
$date_start, GETPOST('remise_percent'),
$date_end, $date_start,
$vat_rate, $date_end,
$localtax1_rate, $vat_rate,
$localtax2_rate, $localtax1_rate,
'HT', $localtax2_rate,
$info_bits, 'HT',
$type, $info_bits,
GETPOST('fk_parent_line') $type,
GETPOST('fk_parent_line')
); );
// Define output language // Define output language
@ -1115,7 +1116,7 @@ if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['save']
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
} }
} }
@ -1143,7 +1144,7 @@ if ($action == 'up' && $user->rights->facture->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']); Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']);
exit; exit;
@ -1165,7 +1166,7 @@ if ($action == 'down' && $user->rights->facture->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, '', $object->modelpdf, $outputlangs, GETPOST('hidedetails'), GETPOST('hidedesc'), GETPOST('hideref'), $hookmanager);
Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']); Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']);
exit; exit;

View File

@ -112,7 +112,7 @@ if ($action == 'confirm_valide' && GETPOST('confirm') == 'yes' && $user->rights-
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
facture_pdf_create($db, $fac, '', $fac->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $fac, '', $fac->modelpdf, $outputlangs, $hookmanager);
} }
Header('Location: fiche.php?id='.$paiement->id); Header('Location: fiche.php?id='.$paiement->id);

View File

@ -94,7 +94,7 @@ if ($_REQUEST['action'] == 'confirm_valide' && $_REQUEST['confirm'] == 'yes' &&
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
facture_pdf_create($db, $fac, '', $fac->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $fac, '', $fac->modelpdf, $outputlangs, $hookmanager);
} }
Header('Location: fiche.php?id='.$paiement->id); Header('Location: fiche.php?id='.$paiement->id);

View File

@ -297,19 +297,19 @@ if ($action == 'addline' && $user->rights->contrat->creer)
{ {
// Insert line // Insert line
$result = $object->addline( $result = $object->addline(
$desc, $desc,
$pu_ht, $pu_ht,
$_POST["pqty"], $_POST["pqty"],
$tva_tx, $tva_tx,
$localtax1_tx, $localtax1_tx,
$localtax2_tx, $localtax2_tx,
$_POST["idprod"], $_POST["idprod"],
$_POST["premise"], $_POST["premise"],
$date_start, $date_start,
$date_end, $date_end,
$price_base_type, $price_base_type,
$pu_ttc, $pu_ttc,
$info_bits $info_bits
); );
} }
@ -326,7 +326,7 @@ if ($action == 'addline' && $user->rights->contrat->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
contrat_pdf_create($db, $object->id, $object->modelpdf, $outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) contrat_pdf_create($db, $object->id, $object->modelpdf, $outputlangs);
*/ */
} }
else else
@ -1044,7 +1044,7 @@ else
{ {
$product=new Product($db); $product=new Product($db);
$product->fetch($objp->fk_product); $product->fetch($objp->fk_product);
$dateactend = dol_time_plus_duree (time(), $product->duration_value, $product->duration_unit); $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit);
} }
} }
@ -1093,7 +1093,7 @@ else
{ {
$product=new Product($db); $product=new Product($db);
$product->fetch($objp->fk_product); $product->fetch($objp->fk_product);
$dateactend = dol_time_plus_duree (time(), $product->duration_value, $product->duration_unit); $dateactend = dol_time_plus_duree(time(), $product->duration_value, $product->duration_unit);
} }
} }
$now=mktime(); $now=mktime();

View File

@ -164,8 +164,8 @@ if ($action == 'confirm_valid' && $confirm == 'yes' && $user->rights->expedition
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=expedition_pdf_create($db,$object,$object->modelpdf,$outputlangs);
if ($result <= 0) if ($result < 0)
{ {
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;

File diff suppressed because it is too large Load Diff

View File

@ -291,20 +291,20 @@ if ($action == 'add' && $user->rights->fournisseur->facture->creer)
if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end; if ($lines[$i]->date_end) $date_end=$lines[$i]->date_end;
$result = $object->addline( $result = $object->addline(
$desc, $desc,
$lines[$i]->subprice, $lines[$i]->subprice,
$lines[$i]->tva_tx, $lines[$i]->tva_tx,
$lines[$i]->localtax1_tx, $lines[$i]->localtax1_tx,
$lines[$i]->localtax2_tx, $lines[$i]->localtax2_tx,
$lines[$i]->qty, $lines[$i]->qty,
$lines[$i]->fk_product, $lines[$i]->fk_product,
$lines[$i]->remise_percent, $lines[$i]->remise_percent,
$date_start, $date_start,
$date_end, $date_end,
0, 0,
$lines[$i]->info_bits, $lines[$i]->info_bits,
'HT', 'HT',
$product_type $product_type
); );
if ($result < 0) if ($result < 0)
@ -523,7 +523,7 @@ if ($action == 'addline')
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
//supplier_invoice_pdf_create($db, $fac->id, $fac->modelpdf, $outputlangs); //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs);
unset($_POST['qty']); unset($_POST['qty']);
unset($_POST['type']); unset($_POST['type']);
@ -592,7 +592,7 @@ if ($action == 'edit' && $user->rights->fournisseur->facture->creer)
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($_REQUEST['lang_id']); $outputlangs->setDefaultLang($_REQUEST['lang_id']);
} }
//supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs); //if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_invoice_pdf_create($db, $object->id, $object->modelpdf, $outputlangs);
} }
} }

View File

@ -117,11 +117,11 @@ if ($_REQUEST["action"] == 'confirm_valid' && $_REQUEST["confirm"] == 'yes' && $
$outputlangs = new Translate("",$conf); $outputlangs = new Translate("",$conf);
$outputlangs->setDefaultLang($newlang); $outputlangs->setDefaultLang($newlang);
} }
$result=delivery_order_pdf_create($db, $delivery,$_REQUEST['model'],$outputlangs); if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) $result=delivery_order_pdf_create($db, $delivery,$_REQUEST['model'],$outputlangs);
if ($result <= 0) if ($result < 0)
{ {
dol_print_error($db,$result); dol_print_error($db,$result);
exit; exit;
} }
} }