Merge branch '3.1' of ssh://git@github.com/Dolibarr/dolibarr.git into 3.1
This commit is contained in:
commit
5fa04fd6ec
@ -27,8 +27,11 @@ include_once(DOL_DOCUMENT_ROOT.'/lib/files.lib.php');
|
|||||||
|
|
||||||
$langs->load("admin");
|
$langs->load("admin");
|
||||||
|
|
||||||
if (! $user->admin)
|
$action=GETPOST('action');
|
||||||
accessforbidden();
|
$confirm=GETPOST('confirm');
|
||||||
|
$choice=GETPOST('choice');
|
||||||
|
|
||||||
|
if (! $user->admin) accessforbidden();
|
||||||
|
|
||||||
if ($_GET["msg"]) $message='<div class="error">'.$_GET["msg"].'</div>';
|
if ($_GET["msg"]) $message='<div class="error">'.$_GET["msg"].'</div>';
|
||||||
|
|
||||||
@ -44,11 +47,11 @@ if ($conf->syslog->enabled)
|
|||||||
/*
|
/*
|
||||||
* Actions
|
* Actions
|
||||||
*/
|
*/
|
||||||
if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice"]) && ($_REQUEST["choice"] != 'allfiles' || $_REQUEST["confirm"] == 'yes') )
|
if ($action=='purge' && ! preg_match('/^confirm/i',$choice) && ($choice != 'allfiles' || $confirm == 'yes') )
|
||||||
{
|
{
|
||||||
$filesarray=array();
|
$filesarray=array();
|
||||||
|
|
||||||
if ($_REQUEST["choice"]=='tempfiles')
|
if ($choice=='tempfiles')
|
||||||
{
|
{
|
||||||
// Delete temporary files
|
// Delete temporary files
|
||||||
if ($dolibarr_main_data_root)
|
if ($dolibarr_main_data_root)
|
||||||
@ -57,16 +60,16 @@ if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST["choice"]=='allfiles')
|
if ($choice=='allfiles')
|
||||||
{
|
{
|
||||||
// Delete all files
|
// Delete all files
|
||||||
if ($dolibarr_main_data_root)
|
if ($dolibarr_main_data_root)
|
||||||
{
|
{
|
||||||
$filesarray=dol_dir_list($dolibarr_main_data_root,"all",0);
|
$filesarray=dol_dir_list($dolibarr_main_data_root,"all",0,'','install\.lock$');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($_REQUEST["choice"]=='logfile')
|
if ($choice=='logfile')
|
||||||
{
|
{
|
||||||
$filesarray[]=array('fullname'=>$filelog,'type'=>'file');
|
$filesarray[]=array('fullname'=>$filelog,'type'=>'file');
|
||||||
}
|
}
|
||||||
@ -85,7 +88,7 @@ if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice
|
|||||||
elseif ($filesarray[$key]['type'] == 'file')
|
elseif ($filesarray[$key]['type'] == 'file')
|
||||||
{
|
{
|
||||||
// If (file that is not logfile) or (if logfile with option logfile)
|
// If (file that is not logfile) or (if logfile with option logfile)
|
||||||
if ($filesarray[$key]['fullname'] != $filelog || $_POST["choice"]=='logfile')
|
if ($filesarray[$key]['fullname'] != $filelog || $choice=='logfile')
|
||||||
{
|
{
|
||||||
$count+=dol_delete_file($filesarray[$key]['fullname']);
|
$count+=dol_delete_file($filesarray[$key]['fullname']);
|
||||||
}
|
}
|
||||||
@ -93,7 +96,7 @@ if ($_REQUEST["action"]=='purge' && ! preg_match('/^confirm/i',$_REQUEST["choice
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update cachenbofdoc
|
// Update cachenbofdoc
|
||||||
if ($conf->ecm->enabled && $_REQUEST["choice"]=='allfiles')
|
if ($conf->ecm->enabled && $choice=='allfiles')
|
||||||
{
|
{
|
||||||
require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
|
require_once(DOL_DOCUMENT_ROOT."/ecm/class/ecmdirectory.class.php");
|
||||||
$ecmdirstatic = new ECMDirectory($db);
|
$ecmdirstatic = new ECMDirectory($db);
|
||||||
@ -133,21 +136,21 @@ print '<tr class="border"><td style="padding: 4px">';
|
|||||||
if ($conf->syslog->enabled)
|
if ($conf->syslog->enabled)
|
||||||
{
|
{
|
||||||
print '<input type="radio" name="choice" value="logfile"';
|
print '<input type="radio" name="choice" value="logfile"';
|
||||||
print ($_REQUEST["choice"] && $_REQUEST["choice"]=='logfile') ? ' checked="true"' : '';
|
print ($choice && $choice=='logfile') ? ' checked="checked"' : '';
|
||||||
print '> '.$langs->trans("PurgeDeleteLogFile",$filelog).'<br><br>';
|
print '> '.$langs->trans("PurgeDeleteLogFile",$filelog).'<br><br>';
|
||||||
}
|
}
|
||||||
|
|
||||||
print '<input type="radio" name="choice" value="tempfiles"';
|
print '<input type="radio" name="choice" value="tempfiles"';
|
||||||
print (! $_REQUEST["choice"] || $_REQUEST["choice"]=='tempfiles' || $_REQUEST["choice"]=='allfiles') ? ' checked="true"' : '';
|
print (! $choice || $choice=='tempfiles' || $choice=='allfiles') ? ' checked="checked"' : '';
|
||||||
print '> '.$langs->trans("PurgeDeleteTemporaryFiles").'<br><br>';
|
print '> '.$langs->trans("PurgeDeleteTemporaryFiles").'<br><br>';
|
||||||
|
|
||||||
print '<input type="radio" name="choice" value="confirm_allfiles"';
|
print '<input type="radio" name="choice" value="confirm_allfiles"';
|
||||||
print ($_REQUEST["choice"] && $_REQUEST["choice"]=='confirm_allfiles') ? ' checked="true"' : '';
|
print ($choice && $choice=='confirm_allfiles') ? ' checked="checked"' : '';
|
||||||
print '> '.$langs->trans("PurgeDeleteAllFilesInDocumentsDir",$dolibarr_main_data_root).'<br>';
|
print '> '.$langs->trans("PurgeDeleteAllFilesInDocumentsDir",$dolibarr_main_data_root).'<br>';
|
||||||
|
|
||||||
print '</td></tr></table>';
|
print '</td></tr></table>';
|
||||||
|
|
||||||
if ($_REQUEST['choice'] != 'confirm_allfiles')
|
if ($choice != 'confirm_allfiles')
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
print '<center><input class="button" type="submit" value="'.$langs->trans("PurgeRunNow").'"></center>';
|
print '<center><input class="button" type="submit" value="'.$langs->trans("PurgeRunNow").'"></center>';
|
||||||
@ -162,7 +165,7 @@ if ($message)
|
|||||||
print "\n";
|
print "\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
if (preg_match('/^confirm/i',$_REQUEST["choice"]))
|
if (preg_match('/^confirm/i',$choice))
|
||||||
{
|
{
|
||||||
print '<br>';
|
print '<br>';
|
||||||
$formquestion=array();
|
$formquestion=array();
|
||||||
|
|||||||
@ -3,6 +3,7 @@ CHARSET=UTF-8
|
|||||||
WarehouseCard=Fitxa magatzem
|
WarehouseCard=Fitxa magatzem
|
||||||
Warehouse=Magatzem
|
Warehouse=Magatzem
|
||||||
NewWarehouse=Nou magatzem o zona d'emmagatzematge
|
NewWarehouse=Nou magatzem o zona d'emmagatzematge
|
||||||
|
WarehouseEdit=Edició magatzem
|
||||||
MenuNewWarehouse=Nou magatzem
|
MenuNewWarehouse=Nou magatzem
|
||||||
WarehouseOpened=Magatzem obert
|
WarehouseOpened=Magatzem obert
|
||||||
WarehouseClosed=Magatzem tancat
|
WarehouseClosed=Magatzem tancat
|
||||||
|
|||||||
@ -3,6 +3,7 @@ CHARSET=UTF-8
|
|||||||
WarehouseCard=Ficha almacén
|
WarehouseCard=Ficha almacén
|
||||||
Warehouse=Almacén
|
Warehouse=Almacén
|
||||||
NewWarehouse=Nuevo almacén o zona de almacenaje
|
NewWarehouse=Nuevo almacén o zona de almacenaje
|
||||||
|
WarehouseEdit=Edición almacén
|
||||||
MenuNewWarehouse=Nuevo almacén
|
MenuNewWarehouse=Nuevo almacén
|
||||||
WarehouseOpened=almacén abierto
|
WarehouseOpened=almacén abierto
|
||||||
WarehouseClosed=almacén cerrado
|
WarehouseClosed=almacén cerrado
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user