Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into develop
This commit is contained in:
commit
f64e6ced25
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -552,7 +552,7 @@ if ($user->rights->adherent->supprimer && $action == 'confirm_delete' && $confir
|
||||
}
|
||||
else
|
||||
{
|
||||
Header("Location: liste.php");
|
||||
header("Location: liste.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
*/
|
||||
|
||||
@ -125,7 +125,7 @@ if ($action == 'add')
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
Header("Location: boxes.php");
|
||||
header("Location: boxes.php");
|
||||
$db->commit();
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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
|
||||
|
||||
@ -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;
|
||||
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -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 {
|
||||
|
||||
@ -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;
|
||||
|
||||
@ -77,17 +77,17 @@ if (! empty($conf->margin->enabled)) {
|
||||
<td align="right">
|
||||
<?php
|
||||
if ($seller->tva_assuj == "0") echo '<input type="hidden" name="np_tva_tx" value="0">0';
|
||||
else echo $form->load_tva('np_tva_tx', (isset($_POST["np_tva_tx"])?$_POST["np_tva_tx"]:-1), $seller, $buyer);
|
||||
else echo $form->load_tva('tva_tx', (isset($_POST["tva_tx"])?$_POST["tva_tx"]:-1), $seller, $buyer);
|
||||
?>
|
||||
</td>
|
||||
<td align="right"><input type="text" size="5" name="np_price" value="<?php echo (isset($_POST["np_price"])?$_POST["np_price"]:''); ?>"></td>
|
||||
<td align="right"><input type="text" size="5" name="price_ht" value="<?php echo (isset($_POST["price_ht"])?$_POST["price_ht"]:''); ?>"></td>
|
||||
<td align="right"><input type="text" size="2" name="qty" value="<?php echo (isset($_POST["qty"])?$_POST["qty"]:1); ?>"></td>
|
||||
<td align="right" nowrap><input type="text" size="1" value="<?php echo $buyer->remise_client; ?>" name="remise_percent">%</td>
|
||||
<?php
|
||||
$colspan = 4;
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right"><input type="text" size="5" name="np_buying_price" value="<?php echo (isset($_POST["np_buying_price"])?$_POST["np_buying_price"]:''); ?>"></td>
|
||||
<td align="right"><input type="text" size="5" name="buying_price" value="<?php echo (isset($_POST["buying_price"])?$_POST["buying_price"]:''); ?>"></td>
|
||||
<?php
|
||||
if($conf->global->DISPLAY_MARGIN_RATES)
|
||||
$colspan++;
|
||||
|
||||
@ -26,14 +26,14 @@
|
||||
*/
|
||||
?>
|
||||
|
||||
<!-- BEGIN PHP TEMPLATE freeproductline_create.tpl.php -->
|
||||
<!-- BEGIN PHP TEMPLATE objectline_add.tpl.php -->
|
||||
<tr class="liste_titre nodrag nodrop">
|
||||
<td<?php echo (! empty($conf->global->MAIN_VIEW_LINE_NUMBER) ? ' colspan="2"' : ''); ?>><div id="add"></div><?php echo $langs->trans('AddNewLine'); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('VAT'); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('PriceUHT'); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('PriceUTTC'); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('Qty'); ?></td>
|
||||
<td align="right"><?php echo $langs->trans('ReductionShort'); ?></td>
|
||||
<td align="right" width="50"><?php echo $langs->trans('VAT'); ?></td>
|
||||
<td align="right" width="80"><?php echo $langs->trans('PriceUHT'); ?></td>
|
||||
<td align="right" width="80"><?php echo $langs->trans('PriceUTTC'); ?></td>
|
||||
<td align="right" width="50"><?php echo $langs->trans('Qty'); ?></td>
|
||||
<td align="right" width="50"><?php echo $langs->trans('ReductionShort'); ?></td>
|
||||
<?php
|
||||
$colspan = 4;
|
||||
$colspan2 = 12;
|
||||
@ -522,4 +522,4 @@ $("#idprod").change(function() {
|
||||
});
|
||||
</script>
|
||||
<?php } ?>
|
||||
<!-- END PHP TEMPLATE freeproductline_create.tpl.php -->
|
||||
<!-- END PHP TEMPLATE objectline_add.tpl.php -->
|
||||
|
||||
@ -96,8 +96,8 @@ $colspan = 4;
|
||||
if (! empty($conf->margin->enabled)) {
|
||||
?>
|
||||
<td align="right">
|
||||
<select id="np_fournprice" name="np_fournprice" style="display: none;"></select>
|
||||
<input type="text" size="5" id="np_buying_price" name="np_buying_price" value="<?php echo (isset($_POST["np_buying_price"])?$_POST["np_buying_price"]:''); ?>">
|
||||
<select id="fournprice" name="fournprice" style="display: none;"></select>
|
||||
<input type="text" size="5" id="buying_price" name="buying_price" value="<?php echo (isset($_POST["buying_price"])?$_POST["buying_price"]:''); ?>">
|
||||
</td>
|
||||
<?php
|
||||
if($conf->global->DISPLAY_MARGIN_RATES)
|
||||
|
||||
@ -88,7 +88,7 @@ if ($action == 'add' && $user->rights->ecm->setup)
|
||||
{
|
||||
if (! empty($_POST["cancel"]))
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager');
|
||||
header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager');
|
||||
exit;
|
||||
}
|
||||
$ecmdir->ref = trim($_POST["ref"]);
|
||||
@ -111,7 +111,7 @@ if ($action == 'add' && $user->rights->ecm->setup)
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager');
|
||||
header("Location: ".DOL_URL_ROOT.'/ecm/index.php?action=file_manager');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -148,7 +148,7 @@ if ($action == 'add' && $user->rights->ecm->setup)
|
||||
$id = $ecmdir->create($user);
|
||||
if ($id > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -81,7 +81,7 @@ if ($action == 'addcontact' && $user->rights->expedition->creer)
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -111,7 +111,7 @@ else if ($action == 'deleteline' && $user->rights->expedition->creer)
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -158,7 +158,7 @@ if ($action == 'add')
|
||||
if (! $error)
|
||||
{
|
||||
$db->commit();
|
||||
Header("Location: fiche.php?id=".$object->id);
|
||||
header("Location: fiche.php?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -178,7 +178,7 @@ else if ($action == 'create_delivery' && $conf->livraison_bon->enabled && $user-
|
||||
$result = $object->create_delivery($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT.'/livraison/fiche.php?id='.$result);
|
||||
header("Location: ".DOL_URL_ROOT.'/livraison/fiche.php?id='.$result);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -223,7 +223,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expe
|
||||
$result = $object->delete();
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
|
||||
header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -281,7 +281,7 @@ else if ($action == 'settrackingnumber' || $action == 'settrackingurl'
|
||||
{
|
||||
if ($shipping->update($user) >= 0)
|
||||
{
|
||||
Header("Location: fiche.php?id=".$shipping->id);
|
||||
header("Location: fiche.php?id=".$shipping->id);
|
||||
exit;
|
||||
}
|
||||
$mesg=$shipping->error;
|
||||
@ -483,7 +483,7 @@ if ($action == 'send' && ! GETPOST('addfile','alpha') && ! GETPOST('removedfile'
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -59,7 +59,7 @@ if ($action == 'addcontact' && $user->rights->ficheinter->creer)
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -89,7 +89,7 @@ else if ($action == 'deletecontact' && $user->rights->ficheinter->creer)
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -90,7 +90,7 @@ if ($action == 'confirm_validate' && $confirm == 'yes' && $user->rights->fichein
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result=fichinter_create($db, $object, GETPOST('model','alpha'), $outputlangs);
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -118,7 +118,7 @@ else if ($action == 'confirm_modify' && $confirm == 'yes' && $user->rights->fich
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
$result=fichinter_create($db, $object, (!GETPOST('model','alpha'))?$object->model:GETPOST('model','apha'), $outputlangs);
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -237,7 +237,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fich
|
||||
$object->fetch_thirdparty();
|
||||
$object->delete($user);
|
||||
|
||||
Header('Location: '.DOL_URL_ROOT.'/fichinter/list.php?leftmenu=ficheinter');
|
||||
header('Location: '.DOL_URL_ROOT.'/fichinter/list.php?leftmenu=ficheinter');
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -307,7 +307,7 @@ else if ($action == "addline" && $user->rights->ficheinter->creer)
|
||||
$db->commit();
|
||||
|
||||
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -325,7 +325,7 @@ else if ($action == 'classifybilled' && $user->rights->ficheinter->creer)
|
||||
$result=$object->setBilled();
|
||||
if ($result > 0)
|
||||
{
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -379,7 +379,7 @@ else if ($action == 'updateline' && $user->rights->ficheinter->creer && GETPOST(
|
||||
}
|
||||
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
|
||||
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -436,7 +436,7 @@ else if ($action == 'up' && $user->rights->ficheinter->creer)
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -457,7 +457,7 @@ else if ($action == 'down' && $user->rights->ficheinter->creer)
|
||||
$outputlangs->setDefaultLang($newlang);
|
||||
}
|
||||
fichinter_create($db, $object, $object->modelpdf, $outputlangs);
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'#'.GETPOST('line_id','int'));
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -603,7 +603,7 @@ if ($action == 'send' && ! GETPOST('cancel','alpha') && (empty($conf->global->MA
|
||||
{
|
||||
// Redirect here
|
||||
// This avoid sending mail twice if going out and then back to page
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&msg='.urlencode($mesg));
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id.'&msg='.urlencode($mesg));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -662,7 +662,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
|
||||
@ -700,7 +700,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 {
|
||||
|
||||
@ -61,7 +61,7 @@ if ($action == 'addcontact' && $user->rights->fournisseur->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->fournisseur->commande->cre
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -87,7 +87,7 @@ if ($_POST["action"] == 'dispatch' && $user->rights->fournisseur->commande->rece
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: dispatch.php?id=".$_GET["id"]);
|
||||
header("Location: dispatch.php?id=".$_GET["id"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -93,7 +93,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;
|
||||
}
|
||||
}
|
||||
@ -196,7 +196,7 @@ if ($object->id > 0)
|
||||
}
|
||||
else
|
||||
{
|
||||
Header('Location: index.php');
|
||||
header('Location: index.php');
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -157,7 +157,7 @@ else if ($action == 'reopen' && $user->rights->fournisseur->commande->approuver)
|
||||
$result = $order->setStatus($user,$newstatus);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_REQUEST['id']);
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$_REQUEST['id']);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -406,7 +406,7 @@ else if ($action == 'confirm_deleteproductline' && $confirm == 'yes' && $user->r
|
||||
|
||||
if (! $error)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -467,7 +467,7 @@ else if ($action == 'confirm_approve' && $confirm == 'yes' && $user->rights->fou
|
||||
$result = $object->approve($user, $idwarehouse);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -483,7 +483,7 @@ else if ($action == 'confirm_refuse' && $confirm == 'yes' && $user->rights->four
|
||||
$result = $object->refuse($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -498,7 +498,7 @@ else if ($action == 'confirm_commande' && $confirm == 'yes' && $user->rights->fo
|
||||
$result = $object->commande($user, $_REQUEST["datecommande"], $_REQUEST["methode"], $_REQUEST['comment']);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -515,7 +515,7 @@ else if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->four
|
||||
$result=$object->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT.'/fourn/commande/liste.php');
|
||||
header("Location: ".DOL_URL_ROOT.'/fourn/commande/liste.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -536,7 +536,7 @@ else if ($action == 'livraison' && $user->rights->fournisseur->commande->recepti
|
||||
$result = $object->Livraison($user, $date_liv, $_POST["type"], $_POST["comment"]);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else if($result == -3)
|
||||
@ -561,7 +561,7 @@ else if ($action == 'confirm_cancel' && $confirm == 'yes' && $user->rights->four
|
||||
$result = $object->cancel($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -583,7 +583,7 @@ else if ($action == 'up' && $user->rights->fournisseur->commande->creer)
|
||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
|
||||
exit;
|
||||
}
|
||||
else if ($action == 'down' && $user->rights->fournisseur->commande->creer)
|
||||
@ -598,7 +598,7 @@ else if ($action == 'down' && $user->rights->fournisseur->commande->creer)
|
||||
$outputlangs->setDefaultLang($_REQUEST['lang_id']);
|
||||
}
|
||||
if (empty($conf->global->MAIN_DISABLE_PDF_AUTOUPDATE)) supplier_order_pdf_create($db, $object, $object->modelpdf, $outputlangs, $hidedetails, $hidedesc, $hideref);
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id.(empty($conf->global->MAIN_JUMP_TAG)?'':'#'.$_GET['rowid']));
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -629,7 +629,7 @@ else if ($action == 'builddoc' && $user->rights->fournisseur->commande->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;
|
||||
}
|
||||
}
|
||||
@ -832,7 +832,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;
|
||||
}
|
||||
}
|
||||
@ -890,7 +890,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
|
||||
@ -928,7 +928,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 {
|
||||
|
||||
@ -61,7 +61,7 @@ if ($action == 'addcontact' && $user->rights->fournisseur->facture->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->fournisseur->facture->cree
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else {
|
||||
|
||||
@ -88,7 +88,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;
|
||||
}
|
||||
}
|
||||
|
||||
@ -130,7 +130,7 @@ elseif ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fourn
|
||||
$result=$object->delete($id);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header('Location: index.php');
|
||||
header('Location: index.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -145,7 +145,7 @@ elseif ($action == 'confirm_deleteline' && $confirm == 'yes' && $user->rights->f
|
||||
$ret = $object->deleteline(GETPOST('lineid'));
|
||||
if ($ret > 0)
|
||||
{
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -601,7 +601,7 @@ elseif ($action == 'reopen' && $user->rights->fournisseur->facture->creer)
|
||||
$result = $object->set_unpaid($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
||||
header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -748,7 +748,7 @@ if ($action == 'send' && ! $_POST['addfile'] && ! $_POST['removedfile'] && ! $_P
|
||||
{
|
||||
// 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;
|
||||
}
|
||||
}
|
||||
@ -819,7 +819,7 @@ elseif ($action == 'builddoc')
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
@ -854,7 +854,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
|
||||
@ -892,7 +892,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 {
|
||||
|
||||
@ -161,7 +161,7 @@ if ($action == 'add_paiement')
|
||||
}
|
||||
if ($invoiceid > 0) $loc = DOL_URL_ROOT.'/fourn/facture/fiche.php?facid='.$invoiceid;
|
||||
else $loc = DOL_URL_ROOT.'/fourn/paiement/fiche.php?id='.$paiement_id;
|
||||
Header('Location: '.$loc);
|
||||
header('Location: '.$loc);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -73,7 +73,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->fournisse
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
Header('Location: '.DOL_URL_ROOT.'/fourn/facture/paiement.php');
|
||||
header('Location: '.DOL_URL_ROOT.'/fourn/facture/paiement.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -91,7 +91,7 @@ if ($action == 'confirm_valide' && $confirm == 'yes' && $user->rights->fournisse
|
||||
if ($object->valide() >= 0)
|
||||
{
|
||||
$db->commit();
|
||||
Header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
header('Location: '.$_SERVER['PHP_SELF'].'?id='.$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -143,7 +143,7 @@ if ($resql)
|
||||
if ($num == 1 && ( isset($_POST["sall"]) || $snom || $sref ) )
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
Header("Location: fiche.php?id=".$objp->rowid);
|
||||
header("Location: fiche.php?id=".$objp->rowid);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -136,7 +136,7 @@ if ($_POST["action"] == 'add' && $user->rights->ftp->setup)
|
||||
$id = $ecmdir->create($user);
|
||||
if ($id > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -79,19 +79,19 @@ if ($action == "set")
|
||||
{
|
||||
if ($_POST["pass"] <> $_POST["pass_verif"])
|
||||
{
|
||||
Header("Location: etape4.php?error=1&selectlang=$setuplang".(isset($_POST["login"])?'&login='.$_POST["login"]:''));
|
||||
header("Location: etape4.php?error=1&selectlang=$setuplang".(isset($_POST["login"])?'&login='.$_POST["login"]:''));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (dol_strlen(trim($_POST["pass"])) == 0)
|
||||
{
|
||||
Header("Location: etape4.php?error=2&selectlang=$setuplang".(isset($_POST["login"])?'&login='.$_POST["login"]:''));
|
||||
header("Location: etape4.php?error=2&selectlang=$setuplang".(isset($_POST["login"])?'&login='.$_POST["login"]:''));
|
||||
exit;
|
||||
}
|
||||
|
||||
if (dol_strlen(trim($_POST["login"])) == 0)
|
||||
{
|
||||
Header("Location: etape4.php?error=3&selectlang=$setuplang".(isset($_POST["login"])?'&login='.$_POST["login"]:''));
|
||||
header("Location: etape4.php?error=3&selectlang=$setuplang".(isset($_POST["login"])?'&login='.$_POST["login"]:''));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -88,5 +88,5 @@ MargeOrder=Márgenes (Pedidos validados)
|
||||
RecapAnnee=Recapitulación del año
|
||||
NoData=No hay datos
|
||||
StatusProsp=Estado prospección
|
||||
DraftPropals=Presupuetos borrador
|
||||
DraftPropals=Presupuestos borrador
|
||||
SearchPropal=Buscar un presupuesto
|
||||
@ -92,7 +92,7 @@ if ($action == 'add')
|
||||
if ($ret > 0)
|
||||
{
|
||||
$db->commit();
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$delivery->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$delivery->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -147,7 +147,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->expeditio
|
||||
if ($result > 0)
|
||||
{
|
||||
$db->commit();
|
||||
Header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
|
||||
header("Location: ".DOL_URL_ROOT.'/expedition/index.php');
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -240,7 +240,7 @@ if (! defined('NOREQUIREAJAX') && $conf->use_javascript_ajax) require_once DOL_D
|
||||
if (! empty($conf->global->MAIN_NOT_INSTALLED) || ! empty($conf->global->MAIN_NOT_UPGRADED))
|
||||
{
|
||||
dol_syslog("main.inc: A previous install or upgrade was not complete. Redirect to install page.", LOG_WARNING);
|
||||
Header("Location: ".DOL_URL_ROOT."/install/index.php");
|
||||
header("Location: ".DOL_URL_ROOT."/install/index.php");
|
||||
exit;
|
||||
}
|
||||
// If an upgrade process is required, we call the install page.
|
||||
@ -255,7 +255,7 @@ if ((! empty($conf->global->MAIN_VERSION_LAST_UPGRADE) && ($conf->global->MAIN_V
|
||||
if ($rescomp > 0) // Programs have a version higher than database. We did not add "&& $rescomp < 3" because we want upgrade process for build upgrades
|
||||
{
|
||||
dol_syslog("main.inc: database version ".$versiontocompare." is lower than programs version ".DOL_VERSION.". Redirect to install page.", LOG_WARNING);
|
||||
Header("Location: ".DOL_URL_ROOT."/install/index.php");
|
||||
header("Location: ".DOL_URL_ROOT."/install/index.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -761,7 +761,7 @@ if (! empty($conf->multicompany->enabled) && GETPOST('action') == 'switchentity'
|
||||
{
|
||||
if ($mc->switchEntity(GETPOST('entity','int')) > 0)
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT.'/');
|
||||
header("Location: ".DOL_URL_ROOT.'/');
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -42,7 +42,7 @@ if (preg_match('/set_(.*)/',$action,$reg))
|
||||
$code=$reg[1];
|
||||
if (dolibarr_set_const($db, $code, 1, 'yesno', 0, '', $conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -56,7 +56,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
|
||||
|
||||
@ -50,7 +50,7 @@ if ($action == 'setcodeproduct')
|
||||
{
|
||||
if (dolibarr_set_const($db, "PRODUCT_CODEPRODUCT_ADDON",$value,'chaine',0,'',$conf->entity) > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -111,7 +111,7 @@ $cancel <> $langs->trans("Cancel") &&
|
||||
if ($cancel == $langs->trans("Cancel"))
|
||||
{
|
||||
$action = '';
|
||||
Header("Location: fiche.php?id=".$_POST["id"]);
|
||||
header("Location: fiche.php?id=".$_POST["id"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -85,7 +85,7 @@ if ($action=='delete')
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
@ -94,7 +94,7 @@ if (empty($reshook))
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result = $object->setValueFrom('fk_product_type', GETPOST('fk_product_type'));
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -103,7 +103,7 @@ if (empty($reshook))
|
||||
{
|
||||
$object->fetch($id);
|
||||
$result = $object->setValueFrom('fk_barcode_type', GETPOST('fk_barcode_type'));
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -113,7 +113,7 @@ if (empty($reshook))
|
||||
$object->fetch($id);
|
||||
//Todo: ajout verification de la validite du code barre en fonction du type
|
||||
$result = $object->setValueFrom('barcode', GETPOST('barcode'));
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -225,7 +225,7 @@ if (empty($reshook))
|
||||
|
||||
if ($id > 0)
|
||||
{
|
||||
Header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
header("Location: ".$_SERVER['PHP_SELF']."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -334,7 +334,7 @@ if (empty($reshook))
|
||||
$db->commit();
|
||||
$db->close();
|
||||
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -384,7 +384,7 @@ if (empty($reshook))
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
Header('Location: '.DOL_URL_ROOT.'/product/liste.php?delprod='.urlencode($object->ref));
|
||||
header('Location: '.DOL_URL_ROOT.'/product/liste.php?delprod='.urlencode($object->ref));
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -470,7 +470,7 @@ if (empty($reshook))
|
||||
);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT."/comm/propal.php?id=".$propal->id);
|
||||
header("Location: ".DOL_URL_ROOT."/comm/propal.php?id=".$propal->id);
|
||||
return;
|
||||
}
|
||||
|
||||
@ -555,7 +555,7 @@ if (empty($reshook))
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT."/commande/fiche.php?id=".$commande->id);
|
||||
header("Location: ".DOL_URL_ROOT."/commande/fiche.php?id=".$commande->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -640,7 +640,7 @@ if (empty($reshook))
|
||||
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT."/compta/facture.php?facid=".$facture->id);
|
||||
header("Location: ".DOL_URL_ROOT."/compta/facture.php?facid=".$facture->id);
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -649,7 +649,7 @@ if (empty($reshook))
|
||||
if (GETPOST("cancel") == $langs->trans("Cancel"))
|
||||
{
|
||||
$action = '';
|
||||
Header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
header("Location: ".$_SERVER["PHP_SELF"]."?id=".$id);
|
||||
exit;
|
||||
}
|
||||
|
||||
@ -1280,7 +1280,7 @@ else
|
||||
}
|
||||
else if ($action != 'create')
|
||||
{
|
||||
Header("Location: index.php");
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
}
|
||||
|
||||
@ -179,7 +179,7 @@ if ($action == 'updateprice' && GETPOST('cancel') <> $langs->trans("Cancel"))
|
||||
if (GETPOST('cancel') == $langs->trans("Cancel"))
|
||||
{
|
||||
$action = '';
|
||||
Header("Location: fournisseurs.php?id=".$_GET["id"]);
|
||||
header("Location: fournisseurs.php?id=".$_GET["id"]);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -165,7 +165,7 @@ else
|
||||
if ($num == 1 && ($sall || $snom || $sref || $sbarcode) && $action != 'list')
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
Header("Location: fiche.php?id=".$objp->rowid);
|
||||
header("Location: fiche.php?id=".$objp->rowid);
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -171,7 +171,7 @@ if ($resql)
|
||||
if ($num == 1 && ($sall or $snom or $sref))
|
||||
{
|
||||
$objp = $db->fetch_object($resql);
|
||||
Header("Location: fiche.php?id=$objp->rowid");
|
||||
header("Location: fiche.php?id=$objp->rowid");
|
||||
exit;
|
||||
}
|
||||
|
||||
|
||||
@ -82,7 +82,7 @@ class Project extends CommonObject
|
||||
if (!trim($this->ref))
|
||||
{
|
||||
$this->error = 'ErrorFieldsRequired';
|
||||
dol_syslog(get_class($this)."::Create error -1 ref null", LOG_ERR);
|
||||
dol_syslog(get_class($this)."::create error -1 ref null", LOG_ERR);
|
||||
return -1;
|
||||
}
|
||||
|
||||
@ -139,7 +139,7 @@ class Project extends CommonObject
|
||||
{
|
||||
$this->error = $this->db->lasterror();
|
||||
$this->errno = $this->db->lasterrno();
|
||||
dol_syslog(get_class($this)."::Create error -2 " . $this->error, LOG_ERR);
|
||||
dol_syslog(get_class($this)."::create error -2 " . $this->error, LOG_ERR);
|
||||
$error++;
|
||||
}
|
||||
|
||||
@ -1204,17 +1204,18 @@ class Project extends CommonObject
|
||||
$this->error.=$task->error;
|
||||
}
|
||||
}
|
||||
|
||||
//print "$this->date_start + $tasktoshiftdate->date_start - $old_project_dt_start";exit;
|
||||
|
||||
//Calcultate new task start date with difference between old proj start date and origin task start date
|
||||
if (!empty($tasktoshiftdate->date_start))
|
||||
{
|
||||
$task->date_start = $this->date_start + ($tasktoshiftdate->date_start - $old_project_dt_st);
|
||||
$task->date_start = $this->date_start + ($tasktoshiftdate->date_start - $old_project_dt_start);
|
||||
}
|
||||
|
||||
//Calcultate new task end date with difference between origin proj end date and origin task end date
|
||||
if (!empty($tasktoshiftdate->date_end))
|
||||
{
|
||||
$task->date_end = $this->date_start + ($tasktoshiftdate->date_end - $old_project_dt_st);
|
||||
$task->date_end = $this->date_start + ($tasktoshiftdate->date_end - $old_project_dt_start);
|
||||
}
|
||||
|
||||
if ($to_update)
|
||||
|
||||
@ -67,7 +67,7 @@ if ($_POST["action"] == 'addcontact' && $user->rights->projet->creer)
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
Header("Location: contact.php?id=".$project->id);
|
||||
header("Location: contact.php?id=".$project->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -105,7 +105,7 @@ if ($_GET["action"] == 'deleteline' && $user->rights->projet->creer)
|
||||
|
||||
if ($result >= 0)
|
||||
{
|
||||
Header("Location: contact.php?id=".$project->id);
|
||||
header("Location: contact.php?id=".$project->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
|
||||
@ -84,7 +84,7 @@ if ($action == 'confirm_delete' && $confirm == 'yes' && $user->rights->projet->s
|
||||
$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;
|
||||
}
|
||||
|
||||
|
||||
@ -61,6 +61,9 @@ if ($object->id > 0)
|
||||
$object->fetch_thirdparty();
|
||||
}
|
||||
|
||||
$date_start=dol_mktime(0,0,0,GETPOST('projectmonth','int'),GETPOST('projectday','int'),GETPOST('projectyear','int'));
|
||||
$date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendday','int'),GETPOST('projectendyear','int'));;
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
@ -74,7 +77,7 @@ if (GETPOST("cancel") && ! empty($backtopage))
|
||||
$result=$object->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: index.php");
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -93,7 +96,7 @@ if (GETPOST("cancel") && (GETPOST("comefromclone")==1))
|
||||
$result=$object->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: index.php");
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -129,8 +132,8 @@ if ($action == 'add' && $user->rights->projet->creer)
|
||||
$object->description = GETPOST('description','alpha');
|
||||
$object->public = GETPOST('public','alpha');
|
||||
$object->datec=dol_now();
|
||||
$object->date_start=dol_mktime(0,0,0,GETPOST('projectmonth','int'),GETPOST('projectday','int'),GETPOST('projectyear','int'));
|
||||
$object->date_end=dol_mktime(0,0,0,GETPOST('projectendmonth','int'),GETPOST('projectendday','int'),GETPOST('projectendyear','int'));
|
||||
$object->date_start=$date_start;
|
||||
$object->date_end=$date_end;
|
||||
|
||||
$result = $object->create($user);
|
||||
if ($result > 0)
|
||||
@ -155,7 +158,7 @@ if ($action == 'add' && $user->rights->projet->creer)
|
||||
{
|
||||
$db->commit();
|
||||
|
||||
Header("Location:fiche.php?id=".$object->id);
|
||||
header("Location:fiche.php?id=".$object->id);
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -193,13 +196,13 @@ if ($action == 'update' && ! $_POST["cancel"] && $user->rights->projet->creer)
|
||||
|
||||
$old_start_date = $object->date_start;
|
||||
|
||||
$object->ref = GETPOST('ref','alpha');
|
||||
$object->title = GETPOST('title','alpha');
|
||||
$object->socid = GETPOST('socid','int');
|
||||
$object->description = GETPOST('description','alpha');
|
||||
$object->public = GETPOST('public','alpha');
|
||||
$object->date_start = empty($_POST["project"])?'':dol_mktime(0,0,0,GETPOST('projectmonth'),GETPOST('projectday'),GETPOST('projectyear'));
|
||||
$object->date_end = empty($_POST["projectend"])?'':dol_mktime(0,0,0,GETPOST('projectendmonth'),GETPOST('projectendday'),GETPOST('projectendyear'));
|
||||
$object->ref = GETPOST('ref','alpha');
|
||||
$object->title = GETPOST('title','alpha');
|
||||
$object->socid = GETPOST('socid','int');
|
||||
$object->description = GETPOST('description','alpha');
|
||||
$object->public = GETPOST('public','alpha');
|
||||
$object->date_start = empty($_POST["project"])?'':$date_start;
|
||||
$object->date_end = empty($_POST["projectend"])?'':$date_end;
|
||||
|
||||
$result=$object->update($user);
|
||||
|
||||
@ -241,7 +244,7 @@ if ($action == 'builddoc' && $user->rights->projet->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;
|
||||
}
|
||||
}
|
||||
@ -296,7 +299,7 @@ if ($action == 'confirm_delete' && GETPOST("confirm") == "yes" && $user->rights-
|
||||
$result=$object->delete($user);
|
||||
if ($result > 0)
|
||||
{
|
||||
Header("Location: index.php");
|
||||
header("Location: index.php");
|
||||
exit;
|
||||
}
|
||||
else
|
||||
@ -387,12 +390,12 @@ if ($action == 'create' && $user->rights->projet->creer)
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||
print $form->select_date('','project');
|
||||
print $form->select_date(($date_start?$date_start:''),'project');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
print '<tr><td>'.$langs->trans("DateEnd").'</td><td>';
|
||||
print $form->select_date(-1,'projectend');
|
||||
print $form->select_date(($date_end?$date_end:-1),'projectend');
|
||||
print '</td></tr>';
|
||||
|
||||
// Description
|
||||
@ -519,10 +522,10 @@ else
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||
print $form->select_date($object->date_start,'project');
|
||||
print '<input type="checkbox" name="reportdate" value="yes" ';
|
||||
print $form->select_date($object->date_start?$object->date_start:-1,'project');
|
||||
print ' <input type="checkbox" name="reportdate" value="yes" ';
|
||||
if ($comefromclone){print ' checked="checked" ';}
|
||||
print '/>'. $langs->trans("ProjectReportDate");
|
||||
print '/> '. $langs->trans("ProjectReportDate");
|
||||
print '</td></tr>';
|
||||
|
||||
// Date end
|
||||
|
||||
@ -1,6 +1,6 @@
|
||||
<?php
|
||||
/* Copyright (C) 2005 Rodolphe Quiedeville <rodolphe@quiedeville.org>
|
||||
* Copyright (C) 2004-2011 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2004-2012 Laurent Destailleur <eldy@users.sourceforge.net>
|
||||
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
|
||||
*
|
||||
* This program is free software; you can redistribute it and/or modify
|
||||
@ -124,12 +124,12 @@ if ($action == 'createtask' && $user->rights->projet->creer)
|
||||
{
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
Header("Location: ".$backtopage);
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else if (empty($projectid))
|
||||
{
|
||||
Header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($mode)?'':'?mode='.$mode));
|
||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($mode)?'':'?mode='.$mode));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -138,13 +138,13 @@ if ($action == 'createtask' && $user->rights->projet->creer)
|
||||
{
|
||||
if (! empty($backtopage))
|
||||
{
|
||||
Header("Location: ".$backtopage);
|
||||
header("Location: ".$backtopage);
|
||||
exit;
|
||||
}
|
||||
else if (empty($id))
|
||||
{
|
||||
// We go back on task list
|
||||
Header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($mode)?'':'?mode='.$mode));
|
||||
header("Location: ".DOL_URL_ROOT.'/projet/tasks/index.php'.(empty($mode)?'':'?mode='.$mode));
|
||||
exit;
|
||||
}
|
||||
}
|
||||
@ -212,7 +212,10 @@ if ($id > 0 || ! empty($ref))
|
||||
else print $langs->trans('PrivateProject');
|
||||
print '</td></tr>';
|
||||
|
||||
// Date start
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
// Date start
|
||||
print '<tr><td>'.$langs->trans("DateStart").'</td><td>';
|
||||
print dol_print_date($object->date_start,'day');
|
||||
print '</td></tr>';
|
||||
@ -222,9 +225,6 @@ if ($id > 0 || ! empty($ref))
|
||||
print dol_print_date($object->date_end,'day');
|
||||
print '</td></tr>';
|
||||
|
||||
// Statut
|
||||
print '<tr><td>'.$langs->trans("Status").'</td><td>'.$object->getLibStatut(4).'</td></tr>';
|
||||
|
||||
print '</table>';
|
||||
|
||||
dol_fiche_end();
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue
Block a user