Add more img templates for medias dir
|
Before Width: | Height: | Size: 365 KiB |
|
Before Width: | Height: | Size: 230 KiB After Width: | Height: | Size: 230 KiB |
|
Before Width: | Height: | Size: 376 KiB After Width: | Height: | Size: 376 KiB |
|
Before Width: | Height: | Size: 329 KiB After Width: | Height: | Size: 329 KiB |
|
Before Width: | Height: | Size: 386 KiB After Width: | Height: | Size: 386 KiB |
|
Before Width: | Height: | Size: 360 KiB After Width: | Height: | Size: 360 KiB |
@ -421,13 +421,15 @@ if (! $error && $db->connected && $action == "set")
|
||||
}
|
||||
|
||||
// Les documents sont en dehors de htdocs car ne doivent pas pouvoir etre telecharges en passant outre l'authentification
|
||||
$dir[0] = $main_data_dir."/mycompany";
|
||||
$dir[1] = $main_data_dir."/users";
|
||||
$dir[2] = $main_data_dir."/facture";
|
||||
$dir[3] = $main_data_dir."/propale";
|
||||
$dir[4] = $main_data_dir."/ficheinter";
|
||||
$dir[5] = $main_data_dir."/produit";
|
||||
$dir[6] = $main_data_dir."/doctemplates";
|
||||
$dir=array();
|
||||
$dir[] = $main_data_dir."/mycompany";
|
||||
$dir[] = $main_data_dir."/medias";
|
||||
$dir[] = $main_data_dir."/users";
|
||||
$dir[] = $main_data_dir."/facture";
|
||||
$dir[] = $main_data_dir."/propale";
|
||||
$dir[] = $main_data_dir."/ficheinter";
|
||||
$dir[] = $main_data_dir."/produit";
|
||||
$dir[] = $main_data_dir."/doctemplates";
|
||||
|
||||
// Boucle sur chaque repertoire de dir[] pour les creer s'ils nexistent pas
|
||||
$num=count($dir);
|
||||
@ -455,6 +457,13 @@ if (! $error && $db->connected && $action == "set")
|
||||
}
|
||||
}
|
||||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
|
||||
// Copy directory medias
|
||||
$srcroot=$main_dir.'/install/medias';
|
||||
$destroot=$main_data_dir.'/medias';
|
||||
dolCopyDir($srcroot, $destroot, 0, 0);
|
||||
|
||||
if ($error)
|
||||
{
|
||||
print "<tr><td>".$langs->trans("ErrorDirDoesNotExists",$main_data_dir);
|
||||
@ -467,19 +476,22 @@ if (! $error && $db->connected && $action == "set")
|
||||
else
|
||||
{
|
||||
//ODT templates
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
$srcroot=$main_dir.'/install/doctemplates';
|
||||
$destroot=$main_data_dir.'/doctemplates';
|
||||
$docs=array('contracts' => 'contract'
|
||||
, 'thirdparties' => 'thirdparty'
|
||||
, 'products' => 'product'
|
||||
, 'proposals' => 'proposal'
|
||||
, 'orders' => 'order'
|
||||
, 'invoices' => 'invoice'
|
||||
, 'projects' => 'project'
|
||||
, 'tasks' => 'task_summary'
|
||||
, 'users' => 'user'
|
||||
, 'usergroups' => 'usergroups'
|
||||
$docs=array(
|
||||
'contracts' => 'contract',
|
||||
'invoices' => 'invoice',
|
||||
'orders' => 'order',
|
||||
'products' => 'product',
|
||||
'projects' => 'project',
|
||||
'proposals' => 'proposal',
|
||||
'shipment' => 'shipment',
|
||||
'supplier_proposal' => 'supplier_proposal',
|
||||
'tasks' => 'task_summary',
|
||||
'thirdparties' => 'thirdparty',
|
||||
'usergroups' => 'usergroups',
|
||||
'users' => 'user',
|
||||
'usergroups' => 'usergroups',
|
||||
);
|
||||
foreach($docs as $cursordir => $cursorfile)
|
||||
{
|
||||
@ -516,10 +528,6 @@ if (! $error && $db->connected && $action == "set")
|
||||
$error+=write_conf_file($conffile);
|
||||
}
|
||||
|
||||
// Write main.inc.php and master.inc.php into documents/custom dir
|
||||
//$error+=write_main_file($main_data_dir.'/custom/main.inc.php',$main_dir);
|
||||
//$error+=write_master_file($main_data_dir.'/custom/master.inc.php',$main_dir);
|
||||
|
||||
// Create database and admin user database
|
||||
if (! $error)
|
||||
{
|
||||
|
||||
@ -243,9 +243,9 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
|
||||
|
||||
migrate_restore_missing_links($db,$langs,$conf);
|
||||
|
||||
migrate_directories($db,$langs,$conf,'/compta','/banque');
|
||||
migrate_rename_directories($db,$langs,$conf,'/compta','/banque');
|
||||
|
||||
migrate_directories($db,$langs,$conf,'/societe','/mycompany');
|
||||
migrate_rename_directories($db,$langs,$conf,'/societe','/mycompany');
|
||||
}
|
||||
|
||||
// Script for VX (X<2.8) -> V2.8
|
||||
@ -302,7 +302,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
|
||||
$beforeversionarray=explode('.','3.1.9');
|
||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
||||
{
|
||||
migrate_directories($db,$langs,$conf,'/rss','/externalrss');
|
||||
migrate_rename_directories($db,$langs,$conf,'/rss','/externalrss');
|
||||
|
||||
migrate_actioncomm_element($db,$langs,$conf);
|
||||
}
|
||||
@ -351,7 +351,7 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
|
||||
$beforeversionarray=explode('.','4.0.9');
|
||||
if (versioncompare($versiontoarray,$afterversionarray) >= 0 && versioncompare($versiontoarray,$beforeversionarray) <= 0)
|
||||
{
|
||||
migrate_directories($db,$langs,$conf,'/fckeditor','/medias');
|
||||
migrate_rename_directories($db,$langs,$conf,'/fckeditor','/medias');
|
||||
}
|
||||
|
||||
// Scripts for last version
|
||||
@ -470,13 +470,20 @@ if (! GETPOST('action','aZ09') || preg_match('/upgrade/i',GETPOST('action','aZ09
|
||||
$db->commit();
|
||||
$db->close();
|
||||
|
||||
|
||||
// Copy directory medias
|
||||
$srcroot=DOL_DOCUMENT_ROOT.'/install/medias';
|
||||
$destroot=DOL_DATA_ROOT.'/medias';
|
||||
dolCopyDir($srcroot, $destroot, 0, 0);
|
||||
|
||||
|
||||
// Actions for all versions (no database change, delete files and directories)
|
||||
migrate_delete_old_files($db, $langs, $conf);
|
||||
migrate_delete_old_dir($db, $langs, $conf);
|
||||
// Actions for all versions (no database change, create directories)
|
||||
dol_mkdir(DOL_DATA_ROOT.'/bank');
|
||||
// Actions for all versions (no database change, rename directories)
|
||||
migrate_directories($db, $langs, $conf, '/banque/bordereau', '/bank/checkdeposits');
|
||||
migrate_rename_directories($db, $langs, $conf, '/banque/bordereau', '/bank/checkdeposits');
|
||||
|
||||
print '<div><br>'.$langs->trans("MigrationFinished").'</div>';
|
||||
}
|
||||
@ -3979,13 +3986,13 @@ function migrate_remise_except_entity($db,$langs,$conf)
|
||||
* @param string $newname New name (relative to DOL_DATA_ROOT)
|
||||
* @return void
|
||||
*/
|
||||
function migrate_directories($db,$langs,$conf,$oldname,$newname)
|
||||
function migrate_rename_directories($db,$langs,$conf,$oldname,$newname)
|
||||
{
|
||||
dolibarr_install_syslog("upgrade2::migrate_directories");
|
||||
dolibarr_install_syslog("upgrade2::migrate_rename_directories");
|
||||
|
||||
if (is_dir(DOL_DATA_ROOT.$oldname) && ! file_exists(DOL_DATA_ROOT.$newname))
|
||||
{
|
||||
dolibarr_install_syslog("upgrade2::migrate_directories move " . DOL_DATA_ROOT . $oldname . ' into ' . DOL_DATA_ROOT . $newname);
|
||||
dolibarr_install_syslog("upgrade2::migrate_rename_directories move " . DOL_DATA_ROOT . $oldname . ' into ' . DOL_DATA_ROOT . $newname);
|
||||
@rename(DOL_DATA_ROOT.$oldname,DOL_DATA_ROOT.$newname);
|
||||
}
|
||||
}
|
||||
|
||||