Fix: Can delete and downlaod backup files
This commit is contained in:
parent
8336befb25
commit
48d0fd00e9
@ -28,15 +28,14 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
|||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
|
$action=GETPOST('action');
|
||||||
|
|
||||||
$sortfield = GETPOST("sortfield");
|
$sortfield = GETPOST("sortfield");
|
||||||
$sortorder = GETPOST("sortorder");
|
$sortorder = GETPOST("sortorder");
|
||||||
$page = GETPOST("page");
|
$page = GETPOST("page");
|
||||||
|
if (! $sortorder) $sortorder="DESC";
|
||||||
if (! $sortorder) $sortorder="ASC";
|
if (! $sortfield) $sortfield="date";
|
||||||
if (! $sortfield) $sortfield="p.name";
|
if ($page < 0) { $page = 0; }
|
||||||
if ($page < 0) {
|
|
||||||
$page = 0;
|
|
||||||
}
|
|
||||||
$limit = $conf->liste_limit;
|
$limit = $conf->liste_limit;
|
||||||
$offset = $limit * $page;
|
$offset = $limit * $page;
|
||||||
|
|
||||||
@ -48,8 +47,11 @@ if (! $user->admin) accessforbidden();
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// None
|
if ($action == 'delete')
|
||||||
|
{
|
||||||
|
dol_delete_file($conf->admin->dir_output.'/backup/'.GETPOST('urlfile'),1);
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -384,7 +386,8 @@ print "\n";
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
$filearray=dol_dir_list($conf->admin->dir_output.'/backup','files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
$filearray=dol_dir_list($conf->admin->dir_output.'/backup','files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
||||||
$result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'',1,0,'',0,$langs->trans("PreviousDumpFiles"));
|
$result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'backup/',1,0,$langs->trans("NoBackupFileAvailable"),0,$langs->trans("PreviousDumpFiles"));
|
||||||
|
print '<br>';
|
||||||
|
|
||||||
|
|
||||||
llxFooter();
|
llxFooter();
|
||||||
|
|||||||
@ -28,6 +28,7 @@ require_once(DOL_DOCUMENT_ROOT."/core/class/html.formfile.class.php");
|
|||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
|
$action=GETPOST('action');
|
||||||
$what=GETPOST("what");
|
$what=GETPOST("what");
|
||||||
$export_type=GETPOST("export_type");
|
$export_type=GETPOST("export_type");
|
||||||
$file=GETPOST('filename_template');
|
$file=GETPOST('filename_template');
|
||||||
@ -55,7 +56,11 @@ if ($file && ! $what)
|
|||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
|
|
||||||
// None
|
if ($action == 'delete')
|
||||||
|
{
|
||||||
|
dol_delete_file($conf->admin->dir_output.'/backup/'.GETPOST('urlfile'),1);
|
||||||
|
$action='';
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -347,13 +352,7 @@ if ($what)
|
|||||||
}
|
}
|
||||||
|
|
||||||
$filearray=dol_dir_list($conf->admin->dir_output.'/backup','files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
$filearray=dol_dir_list($conf->admin->dir_output.'/backup','files',0,'','',$sortfield,(strtolower($sortorder)=='asc'?SORT_ASC:SORT_DESC),1);
|
||||||
$result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'',1,0,'',0,$langs->trans("PreviousDumpFiles"));
|
$result=$formfile->list_of_documents($filearray,null,'systemtools','',1,'backup/',1,0,($langs->trans("NoBackupFileAvailable").'<br>'.$langs->trans("ToBuildBackupFileClickHere",DOL_URL_ROOT.'/admin/tools/dolibarr_export.php')),0,$langs->trans("PreviousDumpFiles"));
|
||||||
|
|
||||||
if ($result == 0)
|
|
||||||
{
|
|
||||||
print $langs->trans("NoBackupFileAvailable").'<br>';
|
|
||||||
print $langs->trans("ToBuildBackupFileClickHere",DOL_URL_ROOT.'/admin/tools/dolibarr_export.php').'<br>';
|
|
||||||
}
|
|
||||||
|
|
||||||
print '<br>';
|
print '<br>';
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user