2
0
forked from Wavyzz/dolibarr

Merge branch 'develop' of git@github.com:Dolibarr/dolibarr.git into

develop

Conflicts:
	htdocs/core/lib/functions2.lib.php
	htdocs/install/lib/repair.lib.php
	htdocs/install/mysql/migration/3.2.0-3.3.0.sql
This commit is contained in:
Laurent Destailleur
2012-07-25 12:20:45 +02:00
84 changed files with 2932 additions and 3005 deletions

View File

@@ -2,7 +2,7 @@
/* Copyright (C) 2003-2007 Rodolphe Quiedeville <rodolphe@quiedeville.org>
* Copyright (C) 2004-2008 Laurent Destailleur <eldy@users.sourceforge.net>
* Copyright (C) 2005 Marc Barilley / Ocebo <marc@ocebo.com>
* Copyright (C) 2005-2011 Regis Houssin <regis@dolibarr.fr>
* Copyright (C) 2005-2012 Regis Houssin <regis@dolibarr.fr>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -40,13 +40,6 @@ $confirm = GETPOST('confirm');
$id = GETPOST('id','int');
$ref = GETPOST('ref');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
if ($user->societe_id)
{
@@ -74,7 +67,7 @@ $object = new Commande($db);
*/
// Envoi fichier
if ($_POST["sendit"] && ! empty($conf->global->MAIN_UPLOAD_DOC))
if (GETPOST('sendit') && ! empty($conf->global->MAIN_UPLOAD_DOC))
{
if ($object->fetch($id))
{
@@ -129,7 +122,7 @@ else if ($action == 'confirm_deletefile' && $confirm == 'yes')
$upload_dir = $conf->commande->dir_output . "/" . dol_sanitizeFileName($object->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file,0,0,0,$object);
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
$_SESSION['dol_message'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
}

File diff suppressed because it is too large Load Diff

View File

@@ -62,7 +62,7 @@ if ($action == 'create')
{
if (! is_array($selected))
{
$mesg='<div class="error">'.$langs->trans('Error_OrderNotChecked').'</div>';
$mesgs[]='<div class="error">'.$langs->trans('Error_OrderNotChecked').'</div>';
}
else
{
@@ -80,9 +80,9 @@ $htmlother = new FormOther($db);
/*
* Actions
*/
*/
if (($action == 'create' || $action == 'add') && ! $mesg )
if (($action == 'create' || $action == 'add') && empty($mesgs))
{
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
require_once(DOL_DOCUMENT_ROOT."/core/class/html.formother.class.php");
@@ -92,8 +92,10 @@ if (($action == 'create' || $action == 'add') && ! $mesg )
require_once(DOL_DOCUMENT_ROOT."/core/lib/functions2.lib.php");
require_once(DOL_DOCUMENT_ROOT.'/core/lib/invoice.lib.php');
require_once(DOL_DOCUMENT_ROOT."/core/lib/date.lib.php");
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
if ($conf->projet->enabled) require_once(DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php');
if (! empty($conf->projet->enabled)) {
require_once(DOL_DOCUMENT_ROOT.'/projet/class/project.class.php');
require_once(DOL_DOCUMENT_ROOT.'/core/lib/project.lib.php');
}
$langs->load('bills');
$langs->load('products');
$langs->load('main');
@@ -117,7 +119,6 @@ if (($action == 'create' || $action == 'add') && ! $mesg )
$_POST['originid']=$orders_id[0];
}
if (GETPOST('mesg','int',1) && isset($_SESSION['message'])) $mesg=$_SESSION['message'];
$sall=isset($_GET['sall'])?trim($_GET['sall']):trim($_POST['sall']);
$projectid=isset($_GET['projectid'])?$_GET['projectid']:0;
$id =(GETPOST('id')?GETPOST("id"):GETPOST("facid")); // For backward compatibility
@@ -242,7 +243,7 @@ if (($action == 'create' || $action == 'add') && ! $mesg )
}
else
{
$mesg=$discount->error;
$mesgs[]=$discount->error;
$error++;
break;
}
@@ -310,7 +311,7 @@ if (($action == 'create' || $action == 'add') && ! $mesg )
}
else
{
$mesg=$srcobject->error;
$mesgs[]=$srcobject->error;
$error++;
}
$ii++;
@@ -318,7 +319,7 @@ if (($action == 'create' || $action == 'add') && ! $mesg )
}
else
{
$mesg=$object->error;
$mesgs[]=$object->error;
$error++;
}
}
@@ -338,7 +339,7 @@ if (($action == 'create' || $action == 'add') && ! $mesg )
$action='create';
$_GET["origin"]=$_POST["origin"];
$_GET["originid"]=$_POST["originid"];
if (! $mesg) $mesg='<div class="error">'.$object->error.'</div>';
$mesgs[]='<div class="error">'.$object->error.'</div>';
}
}
@@ -354,9 +355,10 @@ if (($action == 'create' || $action == 'add') && ! $mesg )
if ($action == 'create')
{
$facturestatic=new Facture($db);
llxHeader();
print_fiche_titre($langs->trans('NewBill'));
dol_htmloutput_mesg($mesg);
$soc = new Societe($db);
if ($socid) $res=$soc->fetch($socid);
if ($res)
@@ -474,7 +476,6 @@ if (($action == 'create' || $action == 'add') && ! $mesg )
print "</form>\n";
}
//Mode liste
else
{
@@ -669,8 +670,8 @@ else
}
$db->close();
dol_htmloutput_mesg($mesg);
llxFooter();
dol_htmloutput_mesg($mesg,$mesgs);
llxFooter();
$db->close();
?>