diff --git a/build/perl/virtualmin/dolibarr.pl b/build/perl/virtualmin/dolibarr.pl index fe166b8d09c..6441548bd28 100644 --- a/build/perl/virtualmin/dolibarr.pl +++ b/build/perl/virtualmin/dolibarr.pl @@ -362,7 +362,9 @@ sub script_dolibarr_check_latest { local ($ver) = @_; local @vers = &osdn_package_versions("dolibarr", - $ver >= 3 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.2 ? "dolibarr\\-(3\\.[0-9\\.]+)\\.tgz" : + $ver >= 3.1 ? "dolibarr\\-(3\\.1\\.[0-9\\.]+)\\.tgz" : + $ver >= 3 ? "dolibarr\\-(3\\.0\\.[0-9\\.]+)\\.tgz" : $ver >= 2.9 ? "dolibarr\\-(2\\.9\\.[0-9\\.]+)\\.tgz" : "dolibarr\\-(2\\.8\\.[0-9\\.]+)\\.tgz"); return "Failed to find versions" if (!@vers); @@ -380,4 +382,3 @@ return 2; } 1; - diff --git a/htdocs/adherents/document.php b/htdocs/adherents/document.php index 17b653d6a55..7e699ddd0ad 100644 --- a/htdocs/adherents/document.php +++ b/htdocs/adherents/document.php @@ -83,7 +83,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $ret=dol_delete_file($file); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit; } diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 6ad8d6abcc8..5647ae16839 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -552,7 +552,7 @@ if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confir } else { - Header("Location: liste.php"); + header("Location: liste.php"); exit; } } diff --git a/htdocs/adherents/fiche_subscription.php b/htdocs/adherents/fiche_subscription.php index b870ed6037a..02c9539d262 100644 --- a/htdocs/adherents/fiche_subscription.php +++ b/htdocs/adherents/fiche_subscription.php @@ -130,7 +130,7 @@ if ($_REQUEST["action"] == 'confirm_delete' && $_REQUEST["confirm"] == 'yes' && $result=$subscription->delete($user); if ($result > 0) { - Header("Location: card_subscriptions.php?rowid=".$subscription->fk_adherent); + header("Location: card_subscriptions.php?rowid=".$subscription->fk_adherent); exit; } else diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php index 3c5150fa7f5..503c4e2183b 100644 --- a/htdocs/adherents/type.php +++ b/htdocs/adherents/type.php @@ -83,7 +83,7 @@ if ($action == 'add' && $user->rights->adherent->configurer) $id=$adht->create($user->id); if ($id > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else @@ -114,7 +114,7 @@ if ($action == 'update' && $user->rights->adherent->configurer) $adht->update($user->id); - Header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$_POST["rowid"]); + header("Location: ".$_SERVER["PHP_SELF"]."?rowid=".$_POST["rowid"]); exit; } } @@ -123,7 +123,7 @@ if ($action == 'delete' && $user->rights->adherent->configurer) { $adht = new AdherentType($db); $adht->delete($rowid); - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php index b1112017b80..91c376a32f6 100644 --- a/htdocs/admin/barcode.php +++ b/htdocs/admin/barcode.php @@ -70,7 +70,7 @@ else if ($action == 'GENBARCODE_BARCODETYPE_THIRDPARTY') else if ($_POST["action"] == 'setproductusebarcode') { dolibarr_set_const($db, "PRODUIT_USE_BARCODE",$_POST["value"],'chaine',0,'',$conf->entity); - Header("Location: barcode.php"); + header("Location: barcode.php"); exit; } */ diff --git a/htdocs/admin/boxes.php b/htdocs/admin/boxes.php index e1ca04bb00e..5380e94aec3 100644 --- a/htdocs/admin/boxes.php +++ b/htdocs/admin/boxes.php @@ -125,7 +125,7 @@ if ($action == 'add') if (! $error) { - Header("Location: boxes.php"); + header("Location: boxes.php"); $db->commit(); exit; } diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php index 3cf7e1101ba..18d7aafe3f5 100644 --- a/htdocs/admin/company.php +++ b/htdocs/admin/company.php @@ -159,7 +159,7 @@ if ( ($action == 'update' && empty($_POST["cancel"])) if ($action != 'updateedit' && ! $message) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } } @@ -193,7 +193,7 @@ if ($action == 'addthumb') } else dol_syslog($imgThumbMini); - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php index f2cdf0bd22e..d6859188a25 100644 --- a/htdocs/admin/confexped.php +++ b/htdocs/admin/confexped.php @@ -40,13 +40,13 @@ $action=GETPOST('action','alpha'); if ($action == 'activate_sending') { dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); - Header("Location: confexped.php"); + header("Location: confexped.php"); exit; } else if ($action == 'disable_sending') { dolibarr_del_const($db, "MAIN_SUBMODULE_EXPEDITION",$conf->entity); - Header("Location: confexped.php"); + header("Location: confexped.php"); exit; } // Delivery note @@ -54,13 +54,13 @@ else if ($action == 'activate_delivery') { dolibarr_set_const($db, "MAIN_SUBMODULE_EXPEDITION", "1",'chaine',0,'',$conf->entity); // We must also enable this dolibarr_set_const($db, "MAIN_SUBMODULE_LIVRAISON", "1",'chaine',0,'',$conf->entity); - Header("Location: confexped.php"); + header("Location: confexped.php"); exit; } else if ($action == 'disable_delivery') { dolibarr_del_const($db, "MAIN_SUBMODULE_LIVRAISON",$conf->entity); - Header("Location: confexped.php"); + header("Location: confexped.php"); exit; } diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php index 7b978bb5c8d..856f5a412d9 100644 --- a/htdocs/admin/fckeditor.php +++ b/htdocs/admin/fckeditor.php @@ -73,13 +73,13 @@ foreach($modules as $const => $desc) { dolibarr_set_const($db, "FCKEDITOR_ENABLE_DETAILS", "1",'chaine',0,'',$conf->entity); } - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } if ($action == 'disable_'.strtolower($const)) { dolibarr_del_const($db, "FCKEDITOR_ENABLE_".$const,$conf->entity); - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } } diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php index 6227aa5fb72..0db18adcf80 100644 --- a/htdocs/admin/ihm.php +++ b/htdocs/admin/ihm.php @@ -78,7 +78,7 @@ if ($action == 'update') $_SESSION["mainmenu"]=""; // Le gestionnaire de menu a pu changer - Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } diff --git a/htdocs/admin/limits.php b/htdocs/admin/limits.php index 6fbb135955b..8f7369de21b 100644 --- a/htdocs/admin/limits.php +++ b/htdocs/admin/limits.php @@ -73,7 +73,7 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_ROUNDING_RULE_TOT", $_POST["MAIN_ROUNDING_RULE_TOT"],'chaine',0,'',$conf->entity); - Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } } diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index e3e822577ee..b2e924749a4 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -68,7 +68,7 @@ if ($action == 'update' && empty($_POST["cancel"])) dolibarr_set_const($db, "MAIN_MAIL_ERRORS_TO", GETPOST("MAIN_MAIL_ERRORS_TO"), 'chaine',0,'',$conf->entity); dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", GETPOST("MAIN_MAIL_AUTOCOPY_TO"),'chaine',0,'',$conf->entity); - Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } diff --git a/htdocs/admin/menus/index.php b/htdocs/admin/menus/index.php index 800f10a15d7..123d38f6382 100644 --- a/htdocs/admin/menus/index.php +++ b/htdocs/admin/menus/index.php @@ -185,7 +185,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes') { $db->commit(); - Header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler.'&mesg='.urlencode($langs->trans("MenuDeleted"))); + header("Location: ".DOL_URL_ROOT.'/admin/menus/index.php?menu_handler='.$menu_handler.'&mesg='.urlencode($langs->trans("MenuDeleted"))); exit ; } else diff --git a/htdocs/admin/menus/other.php b/htdocs/admin/menus/other.php index d9e6a2d8baf..617c1fe70b6 100644 --- a/htdocs/admin/menus/other.php +++ b/htdocs/admin/menus/other.php @@ -40,26 +40,26 @@ $action=GETPOST('action','alpha'); if ($action == 'activate_hidemenu') { dolibarr_set_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED", '1','chaine',0,'',$conf->entity); - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else if ($action == 'disable_hidemenu') { dolibarr_del_const($db, "MAIN_MENU_HIDE_UNAUTHORIZED",$conf->entity); - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } if ($action == 'activate_layoutmenu') { dolibarr_set_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT", '1','chaine',0,'',$conf->entity); - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else if ($action == 'disable_layoutmenu') { dolibarr_del_const($db, "MAIN_MENU_USE_JQUERY_LAYOUT",$conf->entity); - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php index c142bcde3ea..170e4ad0bce 100644 --- a/htdocs/admin/modules.php +++ b/htdocs/admin/modules.php @@ -47,7 +47,7 @@ if ($action == 'set' && $user->admin) $result=activateModule($_GET["value"]); $mesg=''; if ($result) $mesg=$result; - Header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg)); + header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg)); exit; } @@ -56,7 +56,7 @@ if ($action == 'reset' && $user->admin) $result=unActivateModule($_GET["value"]); $mesg=''; if ($result) $mesg=$result; - Header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg)); + header("Location: modules.php?mode=".$mode."&mesg=".urlencode($mesg)); exit; } diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php index be361ec177e..e1174df4f2b 100755 --- a/htdocs/admin/pdf.php +++ b/htdocs/admin/pdf.php @@ -63,7 +63,7 @@ if ($action == 'update') dolibarr_set_const($db, "MAIN_GENERATE_DOCUMENTS_HIDE_REF", $_POST["MAIN_GENERATE_DOCUMENTS_HIDE_REF"],'chaine',0,'',$conf->entity); } - Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php index ab8e3b898f3..bee489b5454 100644 --- a/htdocs/admin/prelevement.php +++ b/htdocs/admin/prelevement.php @@ -92,7 +92,7 @@ if ($action == "addnotif") $bon = new BonPrelevement($db); $bon->AddNotification($db,GETPOST('user','int'),$action); - Header("Location: prelevement.php"); + header("Location: prelevement.php"); exit; } @@ -101,7 +101,7 @@ if ($action == "deletenotif") $bon = new BonPrelevement($db); $bon->DeleteNotificationById(GETPOST('notif','int')); - Header("Location: prelevement.php"); + header("Location: prelevement.php"); exit; } diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php index 9acd06e091d..5d1c218f6a3 100644 --- a/htdocs/admin/security.php +++ b/htdocs/admin/security.php @@ -51,7 +51,7 @@ if ($action == 'setgeneraterule') } else { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } } @@ -102,7 +102,7 @@ if ($action == 'activate_encrypt') if (! $error) { $db->commit(); - Header("Location: security.php"); + header("Location: security.php"); exit; } else @@ -119,7 +119,7 @@ else if ($action == 'disable_encrypt') { dolibarr_del_const($db, "DATABASE_PWD_ENCRYPTED",$conf->entity); } - Header("Location: security.php"); + header("Location: security.php"); exit; } @@ -130,7 +130,7 @@ if ($action == 'activate_encryptdbpassconf') { // database value not required //dolibarr_set_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED", "1"); - Header("Location: security.php"); + header("Location: security.php"); exit; } else @@ -145,7 +145,7 @@ else if ($action == 'disable_encryptdbpassconf') { // database value not required //dolibarr_del_const($db, "MAIN_DATABASE_PWD_CONFIG_ENCRYPTED",$conf->entity); - Header("Location: security.php"); + header("Location: security.php"); exit; } else @@ -157,26 +157,26 @@ else if ($action == 'disable_encryptdbpassconf') if ($action == 'activate_pdfsecurity') { dolibarr_set_const($db, "PDF_SECURITY_ENCRYPTION", "1",'chaine',0,'',$conf->entity); - Header("Location: security.php"); + header("Location: security.php"); exit; } else if ($action == 'disable_pdfsecurity') { dolibarr_del_const($db, "PDF_SECURITY_ENCRYPTION",$conf->entity); - Header("Location: security.php"); + header("Location: security.php"); exit; } if ($action == 'activate_MAIN_SECURITY_DISABLEFORGETPASSLINK') { dolibarr_set_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK", '1','chaine',0,'',$conf->entity); - Header("Location: security.php"); + header("Location: security.php"); exit; } else if ($action == 'disable_MAIN_SECURITY_DISABLEFORGETPASSLINK') { dolibarr_del_const($db, "MAIN_SECURITY_DISABLEFORGETPASSLINK",$conf->entity); - Header("Location: security.php"); + header("Location: security.php"); exit; } diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php index 22f31b3ff67..2ba43a0aedf 100644 --- a/htdocs/admin/security_other.php +++ b/htdocs/admin/security_other.php @@ -49,26 +49,26 @@ if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC)) if ($_GET["action"] == 'activate_captcha') { dolibarr_set_const($db, "MAIN_SECURITY_ENABLECAPTCHA", '1','chaine',0,'',$conf->entity); - Header("Location: security_other.php"); + header("Location: security_other.php"); exit; } else if ($_GET["action"] == 'disable_captcha') { dolibarr_del_const($db, "MAIN_SECURITY_ENABLECAPTCHA",$conf->entity); - Header("Location: security_other.php"); + header("Location: security_other.php"); exit; } if ($_GET["action"] == 'activate_advancedperms') { dolibarr_set_const($db, "MAIN_USE_ADVANCED_PERMS", '1','chaine',0,'',$conf->entity); - Header("Location: security_other.php"); + header("Location: security_other.php"); exit; } else if ($_GET["action"] == 'disable_advancedperms') { dolibarr_del_const($db, "MAIN_USE_ADVANCED_PERMS",$conf->entity); - Header("Location: security_other.php"); + header("Location: security_other.php"); exit; } diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php index 34c74319b4f..0b4ea95f577 100755 --- a/htdocs/admin/sms.php +++ b/htdocs/admin/sms.php @@ -58,7 +58,7 @@ if ($action == 'update' && empty($_POST["cancel"])) dolibarr_set_const($db, "MAIN_MAIL_SMS_FROM", $_POST["MAIN_MAIL_SMS_FROM"],'chaine',0,'',$conf->entity); //dolibarr_set_const($db, "MAIN_MAIL_AUTOCOPY_TO", $_POST["MAIN_MAIL_AUTOCOPY_TO"],'chaine',0,'',$conf->entity); - Header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php index 8b002bd1409..bf9bec788d4 100644 --- a/htdocs/admin/user.php +++ b/htdocs/admin/user.php @@ -43,7 +43,7 @@ if (preg_match('/set_(.*)/',$action,$reg)) $code=$reg[1]; if (dolibarr_set_const($db, $code, 1, 'chaine', 0, '', $conf->entity) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else @@ -57,7 +57,7 @@ if (preg_match('/del_(.*)/',$action,$reg)) $code=$reg[1]; if (dolibarr_del_const($db, $code, $conf->entity) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else diff --git a/htdocs/comm/action/fiche.php b/htdocs/comm/action/fiche.php index 1a04f8f86a3..aec3b331d45 100644 --- a/htdocs/comm/action/fiche.php +++ b/htdocs/comm/action/fiche.php @@ -209,15 +209,15 @@ if ($action == 'add_action') if (! empty($backtopage)) { dol_syslog("Back to ".$backtopage); - Header("Location: ".$backtopage); + header("Location: ".$backtopage); } elseif($idaction) { - Header("Location: ".DOL_URL_ROOT.'/comm/action/fiche.php?id='.$idaction); + header("Location: ".DOL_URL_ROOT.'/comm/action/fiche.php?id='.$idaction); } else { - Header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'); + header("Location: ".DOL_URL_ROOT.'/comm/action/index.php'); } exit; } @@ -255,7 +255,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == 'yes') if ($result >= 0) { - Header("Location: index.php"); + header("Location: index.php"); exit; } else diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php index 6c36bb91774..8dff4d7178d 100644 --- a/htdocs/comm/address.php +++ b/htdocs/comm/address.php @@ -80,27 +80,27 @@ if ($action == 'add' || $action == 'update') { if (! empty($backtopage)) { - Header("Location: ".$backtopage); + header("Location: ".$backtopage); exit; } else if ($origin == 'commande') { - Header("Location: ../commande/contact.php?action=editdelivery_adress&socid=".$socid."&id=".$originid); + header("Location: ../commande/contact.php?action=editdelivery_adress&socid=".$socid."&id=".$originid); exit; } elseif ($origin == 'propal') { - Header("Location: ../comm/propal/contact.php?action=editdelivery_adress&socid=".$socid."&id=".$originid); + header("Location: ../comm/propal/contact.php?action=editdelivery_adress&socid=".$socid."&id=".$originid); exit; } elseif ($origin == 'shipment') { - Header("Location: ../expedition/fiche.php?id=".$originid); + header("Location: ../expedition/fiche.php?id=".$originid); exit; } else { - Header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid); + header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid); exit; } } @@ -120,27 +120,27 @@ if ($action == 'add' || $action == 'update') { if (! empty($backtopage)) { - Header("Location: ".$backtopage); + header("Location: ".$backtopage); exit; } else if ($origin == 'commande') { - Header("Location: ../commande/contact.php?id=".$originid); + header("Location: ../commande/contact.php?id=".$originid); exit; } elseif ($origin == 'propal') { - Header("Location: ../comm/propal/contact.php?id=".$originid); + header("Location: ../comm/propal/contact.php?id=".$originid); exit; } elseif ($origin == 'shipment') { - Header("Location: ../expedition/fiche.php?id=".$originid); + header("Location: ../expedition/fiche.php?id=".$originid); exit; } else { - Header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid); + header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid); exit; } } @@ -160,7 +160,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->soci if ($result == 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid); + header("Location: ".$_SERVER['PHP_SELF']."?socid=".$socid); exit ; } else diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php index 2ec4c39c1c7..fc9894caf6d 100644 --- a/htdocs/comm/mailing/cibles.php +++ b/htdocs/comm/mailing/cibles.php @@ -100,7 +100,7 @@ if ($action == 'add') if ($result > 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } if ($result == 0) @@ -120,7 +120,7 @@ if ($action == 'clear') $obj = new $classname($db); $obj->clear_target($id); - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } @@ -137,12 +137,12 @@ if ($action == 'delete') $obj = new $classname($db); $obj->update_nb($id); - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } else { - Header("Location: liste.php"); + header("Location: liste.php"); exit; } } diff --git a/htdocs/comm/mailing/fiche.php b/htdocs/comm/mailing/fiche.php index 96b21b1a192..4eeeb428128 100644 --- a/htdocs/comm/mailing/fiche.php +++ b/htdocs/comm/mailing/fiche.php @@ -448,7 +448,7 @@ if ($action == 'add') { if ($object->create($user) >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } $mesg=$object->error; @@ -475,7 +475,7 @@ if ($action == 'settitre' || $action == 'setemail_from' || $actino == 'setreplyt { if ($object->update($user) >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } $mesg=$object->error; @@ -533,7 +533,7 @@ if ($action == 'update' && empty($_POST["removedfile"]) && empty($_POST["cancel" { if ($object->update($user) >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } $mesg=$object->error; @@ -555,7 +555,7 @@ if ($action == 'confirm_valid' && $confirm == 'yes') { $object->valid($user); setEventMessage($langs->trans("MailingSuccessfullyValidated")); - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -580,7 +580,7 @@ if ($action == 'confirm_reset' && $confirm == 'yes') if ($result > 0) { $db->commit(); - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -601,7 +601,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes') if ($object->delete($object->id)) { $url= (! empty($urlfrom) ? $urlfrom : 'liste.php'); - Header("Location: ".$url); + header("Location: ".$url); exit; } } diff --git a/htdocs/comm/multiprix.php b/htdocs/comm/multiprix.php index a5e185690f5..7d31a897cb9 100644 --- a/htdocs/comm/multiprix.php +++ b/htdocs/comm/multiprix.php @@ -48,7 +48,7 @@ if ($_POST["action"] == 'setpricelevel') $soc->fetch($_GET["id"]); $soc->set_price_level($_POST["price_level"],$user); - Header("Location: multiprix.php?id=".$_GET["id"]); + header("Location: multiprix.php?id=".$_GET["id"]); exit; } diff --git a/htdocs/comm/propal.php b/htdocs/comm/propal.php index 97886d66fd3..84a6e6eb5ca 100644 --- a/htdocs/comm/propal.php +++ b/htdocs/comm/propal.php @@ -94,7 +94,7 @@ if ($id > 0 || ! empty($ref)) } else { - Header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); + header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); exit; } @@ -144,7 +144,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->prop $result=$object->delete($user); if ($result > 0) { - Header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); + header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); exit; } else @@ -177,7 +177,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } @@ -378,7 +378,7 @@ else if ($action == 'add' && $user->rights->propal->creer) } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit; } else @@ -556,7 +556,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G // This avoid sending mail twice if going out and then back to page $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); setEventMessage($mesg); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } else @@ -635,19 +635,14 @@ else if ($action == "addline" && $user->rights->propal->creer) $idprod=GETPOST('idprod', 'int'); $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); $price_ht = GETPOST('price_ht'); - $np_price = GETPOST('np_price'); + $tva_tx = GETPOST('tva_tx'); if (empty($idprod) && GETPOST('type') < 0) { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("Type")), 'errors'); $error++; } - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && empty($idprod) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); - $error++; - } - else if ($conf->global->MAIN_FEATURES_LEVEL < 2 && empty($idprod) && (!($np_price >= 0) || $np_price == '')) // Unit price can be 0 but not '' + if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); $error++; @@ -676,12 +671,13 @@ else if ($action == "addline" && $user->rights->propal->creer) $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); // If prices fields are update - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && isset($price_ht)) + if (GETPOST('usenewaddlineform')) { $pu_ht=price2num($price_ht, 'MU'); $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); - $tva_tx=str_replace('*','', GETPOST('tva_tx')); - $tva_npr=preg_match('/\*/', GETPOST('tva_tx'))?1:0; + $tva_npr=(preg_match('/\*/', $tva_tx)?1:0); + $tva_tx=str_replace('*','', $tva_tx); + $desc = $product_desc; } else { @@ -717,13 +713,6 @@ else if ($action == "addline" && $user->rights->propal->creer) $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); } } - } - - if ($conf->global->MAIN_FEATURES_LEVEL > 1) { - - $desc = $product_desc; - - } else { // Define output language if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) @@ -753,19 +742,18 @@ else if ($action == "addline" && $user->rights->propal->creer) } else { - $pu_ht=(isset($price_ht)?$price_ht:$np_price); - $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); - $rate=GETPOST('tva_tx')?GETPOST('tva_tx'):GETPOST('np_tva_tx'); - $tva_tx=str_replace('*','',$rate); - $tva_npr=preg_match('/\*/',$rate)?1:0; - $label=(GETPOST('product_label')?GETPOST('product_label'):''); - $desc=$product_desc; - $type=GETPOST('type'); + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr = (preg_match('/\*/', $tva_tx)?1:0); + $tva_tx = str_replace('*', '', $tva_tx); + $label = (GETPOST('product_label')?GETPOST('product_label'):''); + $desc = $product_desc; + $type = GETPOST('type'); } // Margin - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):(GETPOST('np_fournprice')?GETPOST('np_fournprice'):'')); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):(GETPOST('np_buying_price')?GETPOST('np_buying_price'):'')); + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); // Local Taxes $localtax1_tx= get_localtax($tva_tx, 1, $object->client); @@ -836,11 +824,8 @@ else if ($action == "addline" && $user->rights->propal->creer) unset($_POST['buying_price']); // old method - unset($_POST['np_price']); unset($_POST['np_desc']); unset($_POST['dp_desc']); - unset($_POST['np_fournprice']); - unset($_POST['np_buying_price']); } else { @@ -970,7 +955,7 @@ else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('sa else if ($action == 'updateligne' && $user->rights->propal->creer && GETPOST('cancel') == $langs->trans('Cancel')) { - Header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition + header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition exit; } @@ -1000,7 +985,7 @@ else if ($action == 'builddoc' && $user->rights->propal->creer) } else { - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); exit; } } @@ -1081,7 +1066,7 @@ else if ($action == 'up' && $user->rights->propal->creer) } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); exit; } @@ -1101,7 +1086,7 @@ else if ($action == 'down' && $user->rights->propal->creer) } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) propale_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.'#'.GETPOST('rowid')); exit; } @@ -1117,7 +1102,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal-> if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -1155,7 +1140,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB) && $user->rights->propal-> if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php index 9e45b637878..00c24c2951a 100644 --- a/htdocs/comm/propal/contact.php +++ b/htdocs/comm/propal/contact.php @@ -69,7 +69,7 @@ if (! $error) } else { - Header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); + header('Location: '.DOL_URL_ROOT.'/comm/propal/list.php'); exit; } @@ -88,7 +88,7 @@ if ($action == 'addcontact' && $user->rights->propale->creer) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -121,7 +121,7 @@ else if ($action == 'deletecontact' && $user->rights->propale->creer) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php index f0b78a81888..60520d33ab5 100644 --- a/htdocs/comm/propal/document.php +++ b/htdocs/comm/propal/document.php @@ -92,7 +92,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit; } } diff --git a/htdocs/comm/prospect/list.php b/htdocs/comm/prospect/list.php index 7dff9bcc60e..d24ac0c2e47 100755 --- a/htdocs/comm/prospect/list.php +++ b/htdocs/comm/prospect/list.php @@ -222,7 +222,7 @@ if ($resql) if ($num == 1 && $socname) { $obj = $db->fetch_object($resql); - Header("Location: fiche.php?socid=".$obj->rowid); + header("Location: fiche.php?socid=".$obj->rowid); exit; } else diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index 3550b5b50b5..3c47b38f2b9 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -46,7 +46,7 @@ $backtopage = GETPOST('backtopage','alpha'); if (GETPOST('cancel') && ! empty($backtopage)) { - Header("Location: ".$backtopage); + header("Location: ".$backtopage); exit; } @@ -60,12 +60,12 @@ if (GETPOST("action") == 'setremise') { if (! empty($backtopage)) { - Header("Location: ".$backtopage); + header("Location: ".$backtopage); exit; } else { - Header("Location: remise.php?id=".$_GET["id"]); + header("Location: remise.php?id=".$_GET["id"]); exit; } } diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index 7d66dfbfb65..1d811b0149c 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -49,7 +49,7 @@ if ($user->societe_id > 0) if (GETPOST('cancel') && ! empty($backtopage)) { - Header("Location: ".$backtopage); + header("Location: ".$backtopage); exit; } @@ -154,12 +154,12 @@ if ($action == 'setremise') { if (! empty($backtopage)) { - Header("Location: ".$backtopage.'&discountid='.$discountid); + header("Location: ".$backtopage.'&discountid='.$discountid); exit; } else { - Header("Location: remx.php?id=".$_GET["id"]); + header("Location: remx.php?id=".$_GET["id"]); exit; } } diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php index 0d8ec10ea73..0caf1c80d63 100644 --- a/htdocs/commande/contact.php +++ b/htdocs/commande/contact.php @@ -61,7 +61,7 @@ if ($action == 'addcontact' && $user->rights->commande->creer) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -99,7 +99,7 @@ else if ($action == 'deletecontact' && $user->rights->commande->creer) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php index aa6ff9914f7..5232b23862e 100644 --- a/htdocs/commande/document.php +++ b/htdocs/commande/document.php @@ -90,7 +90,7 @@ else if ($action == 'confirm_deletefile' && $confirm == 'yes') $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit; } } @@ -165,7 +165,7 @@ if ($id > 0 || ! empty($ref)) } else { - Header('Location: index.php'); + header('Location: index.php'); } diff --git a/htdocs/commande/fiche.php b/htdocs/commande/fiche.php index da69da4169b..cdd57372255 100644 --- a/htdocs/commande/fiche.php +++ b/htdocs/commande/fiche.php @@ -130,7 +130,7 @@ else if ($action == 'reopen' && $user->rights->commande->creer) $result = $object->set_reopen($user); if ($result > 0) { - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } else @@ -146,7 +146,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->comm $result=$object->delete($user); if ($result > 0) { - Header('Location: index.php'); + header('Location: index.php'); exit; } else @@ -177,7 +177,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); } - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } else @@ -383,7 +383,7 @@ else if ($action == 'add' && $user->rights->commande->creer) if ($object_id > 0 && ! $error) { $db->commit(); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object_id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object_id); exit; } else @@ -527,14 +527,9 @@ else if ($action == 'addline' && $user->rights->commande->creer) $idprod=GETPOST('idprod', 'int'); $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); $price_ht = GETPOST('price_ht'); - $np_price = GETPOST('np_price'); + $tva_tx = GETPOST('tva_tx'); - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && (empty($idprod) || GETPOST('update_price')) && ($price_ht < 0) && (GETPOST('qty') < 0)) - { - setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error = true; - } - else if ($conf->global->MAIN_FEATURES_LEVEL < 2 && empty($idprod) && ($np_price < 0) && (GETPOST('qty') < 0)) + if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && (GETPOST('qty') < 0)) { setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); $error = true; @@ -544,12 +539,7 @@ else if ($action == 'addline' && $user->rights->commande->creer) setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); $error = true; } - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && empty($idprod) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); - $error++; - } - else if ($conf->global->MAIN_FEATURES_LEVEL < 2 && empty($idprod) && (!($np_price >= 0) || $np_price == '')) // Unit price can be 0 but not '' + if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); $error++; @@ -585,12 +575,13 @@ else if ($action == 'addline' && $user->rights->commande->creer) $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); // Update if prices fields are defined - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && isset($price_ht)) + if (GETPOST('usenewaddlineform')) { $pu_ht=price2num($price_ht, 'MU'); $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); - $tva_tx=str_replace('*','', GETPOST('tva_tx')); - $tva_npr=preg_match('/\*/', GETPOST('tva_tx'))?1:0; + $tva_npr=(preg_match('/\*/', $tva_tx)?1:0); + $tva_tx=str_replace('*','', $tva_tx); + $desc = $product_desc; } else { @@ -626,13 +617,6 @@ else if ($action == 'addline' && $user->rights->commande->creer) $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); } } - } - - if ($conf->global->MAIN_FEATURES_LEVEL > 1) { - - $desc = $product_desc; - - } else { // Define output language if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) @@ -662,19 +646,18 @@ else if ($action == 'addline' && $user->rights->commande->creer) } else { - $pu_ht=($price_ht?$price_ht:$np_price); - $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); - $rate=GETPOST('tva_tx')?GETPOST('tva_tx'):GETPOST('np_tva_tx'); - $tva_tx=str_replace('*','',$rate); - $tva_npr=preg_match('/\*/',$rate)?1:0; - $label=(GETPOST('product_label')?GETPOST('product_label'):''); - $desc=$product_desc; - $type=GETPOST('type'); + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr = (preg_match('/\*/', $tva_tx)?1:0); + $tva_tx = str_replace('*', '', $tva_tx); + $label = (GETPOST('product_label')?GETPOST('product_label'):''); + $desc = $product_desc; + $type = GETPOST('type'); } // Margin - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):(GETPOST('np_fournprice')?GETPOST('np_fournprice'):'')); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):(GETPOST('np_buying_price')?GETPOST('np_buying_price'):'')); + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); // Local Taxes $localtax1_tx= get_localtax($tva_tx, 1, $object->client); @@ -750,11 +733,8 @@ else if ($action == 'addline' && $user->rights->commande->creer) unset($_POST['buying_price']); // old method - unset($_POST['np_price']); unset($_POST['np_desc']); unset($_POST['dp_desc']); - unset($_POST['np_fournprice']); - unset($_POST['np_buying_price']); } else { @@ -888,7 +868,7 @@ else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST(' else if ($action == 'updateligne' && $user->rights->commande->creer && GETPOST('cancel') == $langs->trans('Cancel')) { - Header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition + header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); // Pour reaffichage de la fiche en cours d'edition exit; } @@ -1016,7 +996,7 @@ else if ($action == 'up' && $user->rights->commande->creer) if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('rowid')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('rowid')); exit; } @@ -1036,7 +1016,7 @@ else if ($action == 'down' && $user->rights->commande->creer) } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) commande_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('rowid')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('rowid')); exit; } @@ -1071,7 +1051,7 @@ else if ($action == 'builddoc') // In get or post } else { - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); exit; } } @@ -1234,7 +1214,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G { // Redirect here // This avoid sending mail twice if going out and then back to page - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&mesg='.urlencode($mesg)); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&mesg='.urlencode($mesg)); exit; } } @@ -1290,7 +1270,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -1327,7 +1307,7 @@ if ($action == 'send' && ! GETPOST('addfile') && ! GETPOST('removedfile') && ! G if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { diff --git a/htdocs/commande/orderstoinvoice.php b/htdocs/commande/orderstoinvoice.php index 87dfe719398..c0ef16db6fb 100755 --- a/htdocs/commande/orderstoinvoice.php +++ b/htdocs/commande/orderstoinvoice.php @@ -331,7 +331,7 @@ if (($action == 'create' || $action == 'add') && empty($mesgs)) if ($id > 0 && ! $error) { $db->commit(); - Header('Location: '.DOL_URL_ROOT.'/compta/facture.php?facid='.$id); + header('Location: '.DOL_URL_ROOT.'/compta/facture.php?facid='.$id); exit; } else diff --git a/htdocs/compta/bank/account.php b/htdocs/compta/bank/account.php index bdd9d28ffbb..e215dbdcca2 100644 --- a/htdocs/compta/bank/account.php +++ b/htdocs/compta/bank/account.php @@ -97,7 +97,7 @@ if ($action == 'add' && $id && ! isset($_POST["cancel"]) && $user->rights->banqu $insertid = $object->addline($dateop, $operation, $label, $amount, $num_chq, $cat1, $user); if ($insertid > 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id."&action=addline"); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id."&action=addline"); exit; } else diff --git a/htdocs/compta/bank/admin/bank.php b/htdocs/compta/bank/admin/bank.php index 99ac5b91834..0c63f19dbb5 100644 --- a/htdocs/compta/bank/admin/bank.php +++ b/htdocs/compta/bank/admin/bank.php @@ -65,7 +65,7 @@ if ($action == 'setbankorder') { if (dolibarr_set_const($db, "BANK_SHOW_ORDER_OPTION",GETPOST('value','alpha'),'chaine',0,'',$conf->entity) > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else diff --git a/htdocs/compta/deplacement/fiche.php b/htdocs/compta/deplacement/fiche.php index 8de8ae47970..df453887ea1 100644 --- a/htdocs/compta/deplacement/fiche.php +++ b/htdocs/compta/deplacement/fiche.php @@ -65,7 +65,7 @@ if ($action == 'validate' && $user->rights->deplacement->creer) $result = $object->setStatut(1); if ($result > 0) { - Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); exit; } else @@ -95,7 +95,7 @@ else if ($action == 'unblock' && $user->rights->deplacement->unvalidate) if ($result > 0) { - Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); exit; } else @@ -110,7 +110,7 @@ else if ($action == 'confirm_delete' && $confirm == "yes" && $user->rights->depl $result=$object->delete($id); if ($result >= 0) { - Header("Location: index.php"); + header("Location: index.php"); exit; } else @@ -156,7 +156,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer) if ($id > 0) { - Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); exit; } else @@ -172,7 +172,7 @@ else if ($action == 'add' && $user->rights->deplacement->creer) } else { - Header("Location: index.php"); + header("Location: index.php"); exit; } } @@ -196,7 +196,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer) if ($result > 0) { - Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); exit; } else @@ -206,7 +206,7 @@ else if ($action == 'update' && $user->rights->deplacement->creer) } else { - Header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); + header("Location: " . $_SERVER["PHP_SELF"] . "?id=" . $id); exit; } } diff --git a/htdocs/compta/dons/fiche.php b/htdocs/compta/dons/fiche.php index 2ac166d5558..fb6c8de4f5a 100644 --- a/htdocs/compta/dons/fiche.php +++ b/htdocs/compta/dons/fiche.php @@ -63,7 +63,7 @@ if ($action == 'update') { if (! empty($cancel)) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } @@ -107,7 +107,7 @@ if ($action == 'update') if ($don->update($user) > 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$don->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$don->id); exit; } } @@ -117,7 +117,7 @@ if ($action == 'add') { if (! empty($cancel)) { - Header("Location: index.php"); + header("Location: index.php"); exit; } @@ -159,7 +159,7 @@ if ($action == 'add') if ($don->create($user) > 0) { - Header("Location: index.php"); + header("Location: index.php"); exit; } } @@ -168,7 +168,7 @@ if ($action == 'add') if ($action == 'delete') { $don->delete($id); - Header("Location: liste.php"); + header("Location: liste.php"); exit; } if ($action == 'commentaire') @@ -180,7 +180,7 @@ if ($action == 'valid_promesse') { if ($don->valid_promesse($id, $user->id) >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } else $mesg=$don->error; @@ -189,7 +189,7 @@ if ($action == 'set_cancel') { if ($don->set_cancel($id) >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } else $mesg=$don->error; @@ -198,7 +198,7 @@ if ($action == 'set_paid') { if ($don->set_paye($id, $modepaiement) >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } else $mesg=$don->error; @@ -207,7 +207,7 @@ if ($action == 'set_encaisse') { if ($don->set_encaisse($id) >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); exit; } else $mesg=$don->error; @@ -244,7 +244,7 @@ if ($action == 'builddoc') } else { - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$donation->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$donation->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); exit; } } diff --git a/htdocs/compta/facture.php b/htdocs/compta/facture.php index 88fc72f3ebf..4e928108813 100644 --- a/htdocs/compta/facture.php +++ b/htdocs/compta/facture.php @@ -144,7 +144,7 @@ else if ($action == 'reopen' && $user->rights->facture->creer) $result = $object->set_unpaid($user); if ($result > 0) { - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); exit; } else @@ -162,7 +162,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fact $result = $object->delete(); if ($result > 0) { - Header('Location: '.DOL_URL_ROOT.'/compta/facture/list.php'); + header('Location: '.DOL_URL_ROOT.'/compta/facture/list.php'); exit; } else @@ -197,7 +197,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> } if ($result >= 0) { - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); exit; } } @@ -247,7 +247,7 @@ else if ($action == 'set_thirdparty' && $user->rights->facture->creer) $object->fetch($id); $object->setValueFrom('fk_soc',$socid); - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); exit; } @@ -928,7 +928,7 @@ else if ($action == 'add' && $user->rights->facture->creer) if ($id > 0 && ! $error) { $db->commit(); - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); exit; } else @@ -950,14 +950,9 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $idprod=GETPOST('idprod', 'int'); $product_desc = (GETPOST('product_desc')?GETPOST('product_desc'):(GETPOST('np_desc')?GETPOST('np_desc'):(GETPOST('dp_desc')?GETPOST('dp_desc'):''))); $price_ht = GETPOST('price_ht'); - $np_price = GETPOST('np_price'); + $tva_tx = GETPOST('tva_tx'); - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && (empty($idprod) || GETPOST('update_price')) && ($price_ht < 0) && (GETPOST('qty') < 0)) - { - setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); - $error = true; - } - else if ($conf->global->MAIN_FEATURES_LEVEL < 2 && empty($idprod) && ($np_price < 0) && (GETPOST('qty') < 0)) + if ((empty($idprod) || GETPOST('usenewaddlineform')) && ($price_ht < 0) && (GETPOST('qty') < 0)) { setEventMessage($langs->trans('ErrorBothFieldCantBeNegative', $langs->transnoentitiesnoconv('UnitPriceHT'), $langs->transnoentitiesnoconv('Qty')), 'errors'); $error = true; @@ -967,12 +962,7 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- setEventMessage($langs->trans('ErrorFieldRequired', $langs->transnoentitiesnoconv('Type')), 'errors'); $error = true; } - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && empty($idprod) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' - { - setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); - $error++; - } - else if ($conf->global->MAIN_FEATURES_LEVEL < 2 && empty($idprod) && (!($np_price >= 0) || $np_price == '')) // Unit price can be 0 but not '' + if ((empty($idprod) || GETPOST('usenewaddlineform')) && (!($price_ht >= 0) || $price_ht == '')) // Unit price can be 0 but not '' { setEventMessage($langs->trans("ErrorFieldRequired",$langs->transnoentitiesnoconv("UnitPriceHT")), 'errors'); $error++; @@ -1016,12 +1006,13 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $label = ((GETPOST('product_label') && GETPOST('product_label')!=$prod->label)?GETPOST('product_label'):''); // Update if prices fields are defined - if ($conf->global->MAIN_FEATURES_LEVEL > 1 && isset($price_ht)) + if (GETPOST('usenewaddlineform')) { $pu_ht=price2num($price_ht, 'MU'); $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); - $tva_tx=str_replace('*','', GETPOST('tva_tx')); - $tva_npr=preg_match('/\*/', GETPOST('tva_tx'))?1:0; + $tva_npr=(preg_match('/\*/', $tva_tx)?1:0); + $tva_tx=str_replace('*','', $tva_tx); + $desc = $product_desc; } else { @@ -1057,13 +1048,6 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- $pu_ttc = price2num($pu_ht * (1 + ($tva_tx/100)), 'MU'); } } - } - - if ($conf->global->MAIN_FEATURES_LEVEL > 1) { - - $desc = $product_desc; - - } else { // Define output language if (! empty($conf->global->MAIN_MULTILANGS) && ! empty($conf->global->PRODUIT_TEXTS_IN_THIRDPARTY_LANGUAGE)) @@ -1103,19 +1087,18 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- } else { - $pu_ht=($price_ht?$price_ht:$np_price); - $pu_ttc=price2num(GETPOST('price_ttc'), 'MU'); - $rate=GETPOST('tva_tx')?GETPOST('tva_tx'):GETPOST('np_tva_tx'); - $tva_tx=str_replace('*','',$rate); - $tva_npr=preg_match('/\*/',$rate)?1:0; - $label=(GETPOST('product_label')?GETPOST('product_label'):''); - $desc=$product_desc; - $type=GETPOST('type'); + $pu_ht = price2num($price_ht, 'MU'); + $pu_ttc = price2num(GETPOST('price_ttc'), 'MU'); + $tva_npr = (preg_match('/\*/', $tva_tx)?1:0); + $tva_tx = str_replace('*', '', $tva_tx); + $label = (GETPOST('product_label')?GETPOST('product_label'):''); + $desc = $product_desc; + $type = GETPOST('type'); } // Margin - $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):(GETPOST('np_fournprice')?GETPOST('np_fournprice'):'')); - $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):(GETPOST('np_buying_price')?GETPOST('np_buying_price'):'')); + $fournprice=(GETPOST('fournprice')?GETPOST('fournprice'):''); + $buyingprice=(GETPOST('buying_price')?GETPOST('buying_price'):''); // Local Taxes $localtax1_tx= get_localtax($tva_tx, 1, $object->client); @@ -1192,11 +1175,8 @@ else if (($action == 'addline' || $action == 'addline_predef') && $user->rights- unset($_POST['buying_price']); // old method - unset($_POST['np_price']); unset($_POST['np_desc']); unset($_POST['dp_desc']); - unset($_POST['np_fournprice']); - unset($_POST['np_buying_price']); } else { @@ -1333,7 +1313,7 @@ else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['sa else if ($action == 'updateligne' && $user->rights->facture->creer && $_POST['cancel'] == $langs->trans('Cancel')) { - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // Pour reaffichage de la fiche en cours d'edition + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$id); // Pour reaffichage de la fiche en cours d'edition exit; } @@ -1356,7 +1336,7 @@ else if ($action == 'up' && $user->rights->facture->creer) } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']); exit; } // Modify line position (down) @@ -1378,7 +1358,7 @@ else if ($action == 'down' && $user->rights->facture->creer) } if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref, $hookmanager); - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.'#'.$_GET['rowid']); exit; } @@ -1539,7 +1519,7 @@ if (($action == 'send' || $action == 'relance') && ! $_POST['addfile'] && ! $_PO // This avoid sending mail twice if going out and then back to page $mesg=$langs->trans('MailSuccessfulySent',$mailfile->getValidAddress($from,2),$mailfile->getValidAddress($sendto,2)); setEventMessage($mesg); - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id); exit; } } @@ -1616,7 +1596,7 @@ else if ($action == 'builddoc') // En get ou en post } else { - Header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); + header('Location: '.$_SERVER["PHP_SELF"].'?facid='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); exit; } } @@ -1654,7 +1634,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -1692,7 +1672,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { diff --git a/htdocs/compta/facture/contact.php b/htdocs/compta/facture/contact.php index d3625faf622..91b56bac497 100644 --- a/htdocs/compta/facture/contact.php +++ b/htdocs/compta/facture/contact.php @@ -63,7 +63,7 @@ if ($action == 'addcontact' && $user->rights->facture->creer) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -101,7 +101,7 @@ else if ($action == 'deletecontact' && $user->rights->facture->creer) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { diff --git a/htdocs/compta/facture/document.php b/htdocs/compta/facture/document.php index f7394051b0d..df048419607 100644 --- a/htdocs/compta/facture/document.php +++ b/htdocs/compta/facture/document.php @@ -94,7 +94,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id); exit; } } diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 161a1a57705..f298fb1dff8 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -69,7 +69,7 @@ if ($action == "new") $result = $object->demande_prelevement($user); if ($result > 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -86,7 +86,7 @@ if ($action == "delete") $result = $object->demande_prelevement_delete($user, GETPOST('did')); if ($result == 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } } diff --git a/htdocs/compta/localtax/fiche.php b/htdocs/compta/localtax/fiche.php index 4d761366e9d..cccee441ac5 100644 --- a/htdocs/compta/localtax/fiche.php +++ b/htdocs/compta/localtax/fiche.php @@ -64,7 +64,7 @@ if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) if ($ret > 0) { $db->commit(); - Header("Location: reglement.php"); + header("Location: reglement.php"); exit; } else diff --git a/htdocs/compta/paiement.php b/htdocs/compta/paiement.php index 7e581061b8b..974b266354c 100644 --- a/htdocs/compta/paiement.php +++ b/htdocs/compta/paiement.php @@ -189,7 +189,7 @@ if ($action == 'confirm_paiement' && $confirm == 'yes') } if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/compta/facture.php?facid='.$invoiceid; else $loc = DOL_URL_ROOT.'/compta/paiement/fiche.php?id='.$paiement_id; - Header('Location: '.$loc); + header('Location: '.$loc); exit; } else diff --git a/htdocs/compta/paiement/cheque/fiche.php b/htdocs/compta/paiement/cheque/fiche.php index 3d2729d50d7..64a6c7d5228 100644 --- a/htdocs/compta/paiement/cheque/fiche.php +++ b/htdocs/compta/paiement/cheque/fiche.php @@ -111,7 +111,7 @@ if ($action == 'create' && $_POST["accountid"] > 0 && $user->rights->banque->che $result = $object->generatePdf($_POST["model"], $outputlangs); } - Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; } else @@ -132,7 +132,7 @@ if ($action == 'remove' && $id > 0 && $_GET["lineid"] > 0 && $user->rights->banq $result = $object->removeCheck($_GET["lineid"]); if ($result === 0) { - Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; } else @@ -147,7 +147,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->banque->c $result = $object->delete(); if ($result == 0) { - Header("Location: index.php"); + header("Location: index.php"); exit; } else @@ -174,7 +174,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->banque->c } $result = $object->generatePdf(GETPOST('model'), $outputlangs); - Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$object->id); exit; } else @@ -209,7 +209,7 @@ if ($action == 'builddoc' && $user->rights->banque->cheque) } else { - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#builddoc')); exit; } } diff --git a/htdocs/compta/paiement/fiche.php b/htdocs/compta/paiement/fiche.php index 535e3a013da..acd041cc5c3 100644 --- a/htdocs/compta/paiement/fiche.php +++ b/htdocs/compta/paiement/fiche.php @@ -79,7 +79,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->facture-> if ($result > 0) { $db->commit(); - Header("Location: liste.php"); + header("Location: liste.php"); exit; } else @@ -115,7 +115,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->facture-> if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) facture_pdf_create($db, $fac, $fac->modelpdf, $outputlangs, $hookmanager); } - Header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); + header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id); exit; } else diff --git a/htdocs/compta/paiement_charge.php b/htdocs/compta/paiement_charge.php index d10f051fba3..8539e828ac5 100755 --- a/htdocs/compta/paiement_charge.php +++ b/htdocs/compta/paiement_charge.php @@ -50,7 +50,7 @@ if ($_POST["action"] == 'add_payment') if ($_POST["cancel"]) { $loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid; - Header("Location: ".$loc); + header("Location: ".$loc); exit; } @@ -129,7 +129,7 @@ if ($_POST["action"] == 'add_payment') { $db->commit(); $loc = DOL_URL_ROOT.'/compta/sociales/charges.php?id='.$chid; - Header('Location: '.$loc); + header('Location: '.$loc); exit; } else diff --git a/htdocs/compta/payment_sc/fiche.php b/htdocs/compta/payment_sc/fiche.php index 01b5fe1bf01..de865468d60 100644 --- a/htdocs/compta/payment_sc/fiche.php +++ b/htdocs/compta/payment_sc/fiche.php @@ -61,7 +61,7 @@ if ($_REQUEST['action'] == 'confirm_delete' && $_REQUEST['confirm'] == 'yes' && if ($result > 0) { $db->commit(); - Header("Location: ".DOL_URL_ROOT."/compta/charges/index.php?mode=sconly"); + header("Location: ".DOL_URL_ROOT."/compta/charges/index.php?mode=sconly"); exit; } else @@ -97,7 +97,7 @@ if ($_REQUEST['action'] == 'confirm_valide' && $_REQUEST['confirm'] == 'yes' && 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); exit; } else diff --git a/htdocs/compta/prelevement/fiche.php b/htdocs/compta/prelevement/fiche.php index 3560d9ade29..cd99849de9c 100644 --- a/htdocs/compta/prelevement/fiche.php +++ b/htdocs/compta/prelevement/fiche.php @@ -52,7 +52,7 @@ if ( $action == 'confirm_credite' && GETPOST('confirm','alpha') == 'yes') $bon->id = $id; $bon->set_credite(); - Header("Location: fiche.php?id=".$id); + header("Location: fiche.php?id=".$id); exit; } @@ -74,7 +74,7 @@ if ($action == 'infotrans' && $user->rights->prelevement->bons->send) $bon->set_infotrans($user, $dt, GETPOST('methode','alpha')); } - Header("Location: fiche.php?id=".$id); + header("Location: fiche.php?id=".$id); exit; } else @@ -94,11 +94,11 @@ if ($action == 'infocredit' && $user->rights->prelevement->bons->credit) if ($error == 0) { - Header("Location: fiche.php?id=".$id); + header("Location: fiche.php?id=".$id); } else { - Header("Location: fiche.php?id=".$id."&error=$error"); + header("Location: fiche.php?id=".$id."&error=$error"); } exit; } diff --git a/htdocs/compta/prelevement/ligne.php b/htdocs/compta/prelevement/ligne.php index 934389d9dad..9e4373032db 100644 --- a/htdocs/compta/prelevement/ligne.php +++ b/htdocs/compta/prelevement/ligne.php @@ -63,21 +63,21 @@ if ($action == 'confirm_rejet') $rej->create($user, $id, GETPOST('motif','alpha'), $daterej, $lipre->bon_rowid, GETPOST('facturer','int')); - Header("Location: ligne.php?id=".$id); + header("Location: ligne.php?id=".$id); exit; } else { dol_syslog("Motif : ".GETPOST('motif','alpha')); dol_syslog("$daterej $time "); - Header("Location: ligne.php?id=".$id."&action=rejet"); + header("Location: ligne.php?id=".$id."&action=rejet"); exit; } } } else { - Header("Location: ligne.php?id=".$id); + header("Location: ligne.php?id=".$id); exit; } } diff --git a/htdocs/compta/sociales/charges.php b/htdocs/compta/sociales/charges.php index 4dc224c73b2..e08b736c7ad 100644 --- a/htdocs/compta/sociales/charges.php +++ b/htdocs/compta/sociales/charges.php @@ -68,7 +68,7 @@ if ($action == 'confirm_delete' && $_REQUEST["confirm"] == 'yes') $result=$chargesociales->delete($user); if ($result > 0) { - Header("Location: index.php"); + header("Location: index.php"); exit; } else diff --git a/htdocs/compta/tva/fiche.php b/htdocs/compta/tva/fiche.php index 90a0acff0d2..a5e1693c8f2 100644 --- a/htdocs/compta/tva/fiche.php +++ b/htdocs/compta/tva/fiche.php @@ -69,7 +69,7 @@ if ($_POST["action"] == 'add' && $_POST["cancel"] <> $langs->trans("Cancel")) if ($ret > 0) { $db->commit(); - Header("Location: reglement.php"); + header("Location: reglement.php"); exit; } else diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php index 6d37292f62f..c839f7a24e1 100644 --- a/htdocs/contact/canvas/actions_contactcard_common.class.php +++ b/htdocs/contact/canvas/actions_contactcard_common.class.php @@ -155,7 +155,7 @@ abstract class ActionsContactCardCommon $id = $this->object->create($user); if ($id > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id); exit; } else @@ -176,7 +176,7 @@ abstract class ActionsContactCardCommon $result = $this->object->delete(); if ($result > 0) { - Header("Location: list.php"); + header("Location: list.php"); exit; } else @@ -189,7 +189,7 @@ abstract class ActionsContactCardCommon { if ($_POST["cancel"]) { - Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$this->object->id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$this->object->id); exit; } @@ -211,7 +211,7 @@ abstract class ActionsContactCardCommon if ($result > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$this->object->id); + header("Location: ".$_SERVER["PHP_SELF"]."?id=".$this->object->id); exit; } else diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 77928e4d5a0..b1b6aae88fa 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -175,7 +175,7 @@ if (empty($reshook)) $db->commit(); if (! empty($backtopage)) $url=$backtopage; else $url='fiche.php?id='.$id; - Header("Location: ".$url); + header("Location: ".$url); exit; } else @@ -194,7 +194,7 @@ if (empty($reshook)) $result = $object->delete(); if ($result > 0) { - Header("Location: ".DOL_URL_ROOT.'/contact/list.php'); + header("Location: ".DOL_URL_ROOT.'/contact/list.php'); exit; } else diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php index 20a230be6ba..af8fb76f3b9 100644 --- a/htdocs/contact/vcard.php +++ b/htdocs/contact/vcard.php @@ -89,10 +89,10 @@ $filenameurlencoded = dol_sanitizeFileName(urlencode($filename)); //$filename = dol_sanitizeFileName($filename); -Header("Content-Disposition: attachment; filename=\"".$filename."\""); -Header("Content-Length: ".dol_strlen($output)); -Header("Connection: close"); -Header("Content-Type: text/x-vcard; name=\"".$filename."\""); +header("Content-Disposition: attachment; filename=\"".$filename."\""); +header("Content-Length: ".dol_strlen($output)); +header("Connection: close"); +header("Content-Type: text/x-vcard; name=\"".$filename."\""); print $output; diff --git a/htdocs/contrat/contact.php b/htdocs/contrat/contact.php index d68c87aaba5..c01106b7ccf 100644 --- a/htdocs/contrat/contact.php +++ b/htdocs/contrat/contact.php @@ -62,7 +62,7 @@ if ($action == 'addcontact' && $user->rights->contrat->creer) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -100,7 +100,7 @@ if ($action == 'deletecontact' && $user->rights->contrat->creer) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } } diff --git a/htdocs/contrat/document.php b/htdocs/contrat/document.php index 21e48a81467..4e6b5914fa9 100644 --- a/htdocs/contrat/document.php +++ b/htdocs/contrat/document.php @@ -92,7 +92,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes') $ret=dol_delete_file($file,0,0,0,$object); if ($ret) setEventMessage($langs->trans("FileWasRemoved", GETPOST('urlfile'))); else setEventMessage($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), 'errors'); - Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); + header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id); exit; } } diff --git a/htdocs/contrat/fiche.php b/htdocs/contrat/fiche.php index 1497dc40730..4c9ba902cd0 100644 --- a/htdocs/contrat/fiche.php +++ b/htdocs/contrat/fiche.php @@ -77,7 +77,7 @@ if ($action == 'confirm_active' && $confirm == 'yes' && $user->rights->contrat-> if ($result > 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { @@ -92,7 +92,7 @@ else if ($action == 'confirm_closeline' && $confirm == 'yes' && $user->rights->c if ($result > 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { @@ -183,7 +183,7 @@ if ($action == 'add' && $user->rights->contrat->creer) $result = $object->create($user,$langs,$conf); if ($result > 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { @@ -412,7 +412,7 @@ else if ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights-> if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -441,7 +441,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->cont $result=$object->delete($user); if ($result >= 0) { - Header("Location: index.php"); + header("Location: index.php"); return; } else @@ -460,7 +460,7 @@ else if ($action == 'confirm_move' && $confirm == 'yes' && $user->rights->contra $result=$contractline->update($user,1); if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$id); return; } else @@ -500,7 +500,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else @@ -538,7 +538,7 @@ if (! empty($conf->global->MAIN_DISABLE_CONTACTS_TAB)) if ($result >= 0) { - Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); + header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id); exit; } else { diff --git a/htdocs/core/admin_extrafields.inc.php b/htdocs/core/admin_extrafields.inc.php index e723cc2ac5b..3bd46c7abf0 100644 --- a/htdocs/core/admin_extrafields.inc.php +++ b/htdocs/core/admin_extrafields.inc.php @@ -53,7 +53,7 @@ if ($action == 'add') $result=$extrafields->addExtraField($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['pos'],$_POST['size'],$elementtype); if ($result > 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else @@ -105,7 +105,7 @@ if ($action == 'update') { $extrafields->update_label($_POST['attrname'],$_POST['label'],$_POST['type'],$_POST['size'],$elementtype); } - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else @@ -132,7 +132,7 @@ if ($action == 'delete') $result=$extrafields->delete($_GET["attrname"],$elementtype); if ($result >= 0) { - Header("Location: ".$_SERVER["PHP_SELF"]); + header("Location: ".$_SERVER["PHP_SELF"]); exit; } else $mesg=$extrafields->error; diff --git a/htdocs/core/tpl/freeproductline_create.tpl.php b/htdocs/core/tpl/freeproductline_create.tpl.php index c300208e5f8..013d6adb8c3 100644 --- a/htdocs/core/tpl/freeproductline_create.tpl.php +++ b/htdocs/core/tpl/freeproductline_create.tpl.php @@ -77,17 +77,17 @@ if (! empty($conf->margin->enabled)) {