Revert "Fix: stock message in session and reload the page for avoid url problem with jQuery fileupload"

This reverts commit 4deeb20dd8.
This commit is contained in:
Laurent Destailleur 2012-06-01 02:06:53 +02:00
parent 73f1d8ee99
commit f9bda74e22
8 changed files with 11 additions and 80 deletions

View File

@ -39,13 +39,7 @@ $langs->load('other');
$id=GETPOST('id','int');
$action=GETPOST('action','alpha');
$confirm=GETPOST('confirm','alpha');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
$mesg = "";
// Security check
if ($user->societe_id > 0)
@ -120,9 +114,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$langs->load("other");
$file = $upload_dir . "/" . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file);
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
}

View File

@ -39,13 +39,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)
{
@ -127,9 +120,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$upload_dir = $conf->propal->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>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
}
}

View File

@ -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)
{
@ -66,6 +59,7 @@ $pagenext = $page + 1;
if (! $sortorder) $sortorder="ASC";
if (! $sortfield) $sortfield="name";
$object = new Commande($db);
@ -129,9 +123,7 @@ 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>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
}
}

View File

@ -43,13 +43,6 @@ $confirm = GETPOST('confirm');
$id = GETPOST('facid','int');
$ref = GETPOST('ref');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
if ($user->societe_id)
{
@ -132,9 +125,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$upload_dir = $conf->facture->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>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
}
}

View File

@ -41,13 +41,6 @@ $langs->load('deliveries');
$langs->load('products');
$langs->load('stocks');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
$id=empty($_GET['id']) ? 0 : intVal($_GET['id']);
$action=empty($_GET['action']) ? (empty($_POST['action']) ? '' : $_POST['action']) : $_GET['action'];
@ -126,9 +119,7 @@ if ($action=='delete')
$upload_dir = $conf->fournisseur->dir_output . "/commande/" . dol_sanitizeFileName($commande->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file);
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
}

View File

@ -38,13 +38,6 @@ $mine = $_REQUEST['mode']=='mine' ? 1 : 0;
$id = GETPOST('id','int');
$ref= GETPOST('ref');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
$project = new Project($db);
if (! $project->fetch($id,$ref) > 0)
{
@ -122,9 +115,7 @@ if ($action == 'confirm_delete' && $_REQUEST['confirm'] == 'yes' && $user->right
$upload_dir = $conf->projet->dir_output . "/" . dol_sanitizeFileName($project->ref);
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file);
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
}

View File

@ -44,13 +44,6 @@ $ref= GETPOST('ref','alpha');
$withproject=GETPOST('withproject','int');
$project_ref = GETPOST('project_ref','alpha');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
$socid=0;
if ($user->societe_id > 0) $socid = $user->societe_id;
@ -123,9 +116,7 @@ if ($action=='delete')
$langs->load("other");
$file = $upload_dir . '/' . GETPOST('urlfile'); // Do not use urldecode here ($_GET and $_REQUEST are already decoded by PHP).
dol_delete_file($file);
$_SESSION['DolMessage'] = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$id);
exit;
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
}
// Retreive First Task ID of Project if withprojet is on to allow project prev next to work

View File

@ -33,19 +33,13 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
$langs->load("companies");
$langs->load('other');
$mesg='';
$action=GETPOST('action');
$confirm=GETPOST('confirm');
$id=(GETPOST('socid','int') ? GETPOST('socid','int') : GETPOST('id','int'));
$ref = GETPOST('ref', 'alpha');
$mesg='';
if (isset($_SESSION['DolMessage']))
{
$mesg=$_SESSION['DolMessage'];
unset($_SESSION['DolMessage']);
}
// Security check
if ($user->societe_id > 0)
{
@ -131,9 +125,7 @@ if ($action == 'confirm_deletefile' && $confirm == 'yes')
$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>';
Header('Location: '.$_SERVER["PHP_SELF"].'?id='.$object->id);
exit;
$mesg = '<div class="ok">'.$langs->trans("FileWasRemoved",GETPOST('urlfile')).'</div>';
}
}