QUAL replace $conf->XXX->dir_output by getMultidiroutput (#34455)
* replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput * replace $conf->XXX->dir output by GetMultidir0utput --------- Co-authored-by: Theobald <f.moreau@theobald-groupe.com> Co-authored-by: Laurent Destailleur <eldy@destailleur.fr>
This commit is contained in:
parent
e8cb259d05
commit
bcbc940cb6
8 changed files with 16 additions and 13 deletions
|
|
@ -85,7 +85,7 @@ if (!$sortorder) {
|
|||
// Initialize a technical objects
|
||||
$object = new BOM($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$diroutputmassaction = getMultidirOutput($object) . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomagenda', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
|
|
|
|||
|
|
@ -64,7 +64,7 @@ $hideref = (GETPOSTINT('hideref') ? GETPOSTINT('hideref') : (getDolGlobalString(
|
|||
// Initialize a technical objects
|
||||
$object = new BOM($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$diroutputmassaction = getMultidirOutput($object) . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomcard', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
|
|
@ -811,7 +811,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Documents
|
||||
$objref = dol_sanitizeFileName($object->ref);
|
||||
$relativepath = $objref.'/'.$objref.'.pdf';
|
||||
$filedir = $conf->bom->dir_output.'/'.$objref;
|
||||
$filedir = getMultidirOutput($object) . '/'.$objref;
|
||||
$urlsource = $_SERVER["PHP_SELF"]."?id=".$object->id;
|
||||
$genallowed = $user->hasRight('bom', 'read'); // If you can read, you can build the PDF to read content
|
||||
$delallowed = $user->hasRight('bom', 'write'); // If you can create/edit, you can remove a file on card
|
||||
|
|
@ -848,7 +848,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
|
|||
// Presend form
|
||||
$modelmail = 'bom';
|
||||
$defaulttopic = 'InformationMessage';
|
||||
$diroutput = $conf->bom->dir_output;
|
||||
$diroutput = getMultidirOutput($object);
|
||||
$trackid = 'bom'.$object->id;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php';
|
||||
|
|
|
|||
|
|
@ -76,7 +76,7 @@ if (!$sortfield) {
|
|||
// Initialize a technical objects
|
||||
$object = new BOM($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$diroutputmassaction = getMultidirOutput($object) . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomdocument', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
|
|
|||
|
|
@ -74,7 +74,7 @@ $pagenext = $page + 1;
|
|||
// Initialize a technical objects
|
||||
$object = new BOM($db);
|
||||
$extrafields = new ExtraFields($db);
|
||||
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$diroutputmassaction = getMultidirOutput($object) . '/temp/massgeneration/'.$user->id;
|
||||
$hookmanager->initHooks(array('bomlist')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
|
|
@ -143,10 +143,13 @@ if ($user->socid > 0) {
|
|||
}
|
||||
$result = restrictedArea($user, 'bom');
|
||||
|
||||
$uploaddir = getMultidirOutput($object);
|
||||
|
||||
|
||||
/*
|
||||
* Actions
|
||||
*/
|
||||
|
||||
$error = 0;
|
||||
|
||||
if (GETPOST('cancel', 'alpha')) {
|
||||
|
|
@ -191,7 +194,7 @@ if (empty($reshook)) {
|
|||
// Mass actions
|
||||
$objectclass = 'BOM';
|
||||
$objectlabel = 'BillOfMaterials';
|
||||
$uploaddir = $conf->bom->dir_output;
|
||||
|
||||
include DOL_DOCUMENT_ROOT.'/core/actions_massactions.inc.php';
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -61,7 +61,7 @@ $extrafields = new ExtraFields($db);
|
|||
$hookmanager->initHooks(array('bomnetneeds')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Massaction
|
||||
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$diroutputmassaction = getMultidirOutput($object) . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ $extrafields = new ExtraFields($db);
|
|||
$hookmanager->initHooks(array('bomnote', 'globalcard')); // Note that conf->hooks_modules contains array
|
||||
|
||||
// Massactions
|
||||
$diroutputmassaction = $conf->bom->dir_output.'/temp/massgeneration/'.$user->id;
|
||||
$diroutputmassaction = getMultidirOutput($object) . '/temp/massgeneration/'.$user->id;
|
||||
|
||||
// Fetch optionals attributes and labels
|
||||
$extrafields->fetch_name_optionals_label($object->table_element);
|
||||
|
|
|
|||
|
|
@ -987,15 +987,15 @@ class BOM extends CommonObject
|
|||
// We rename directory ($this->ref = old ref, $num = new ref) in order not to lose the attachments
|
||||
$oldref = dol_sanitizeFileName($this->ref);
|
||||
$newref = dol_sanitizeFileName($num);
|
||||
$dirsource = $conf->bom->dir_output.'/'.$oldref;
|
||||
$dirdest = $conf->bom->dir_output.'/'.$newref;
|
||||
$dirsource = getMultidirOutput($this) . '/'.$oldref;
|
||||
$dirdest = getMultidirOutput($this) . '/'.$newref;
|
||||
if (!$error && file_exists($dirsource)) {
|
||||
dol_syslog(get_class($this)."::validate() rename dir ".$dirsource." into ".$dirdest);
|
||||
|
||||
if (@rename($dirsource, $dirdest)) {
|
||||
dol_syslog("Rename ok");
|
||||
// Rename docs starting with $oldref with $newref
|
||||
$listoffiles = dol_dir_list($conf->bom->dir_output.'/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
|
||||
$listoffiles = dol_dir_list(getMultidirOutput($this) . '/'.$newref, 'files', 1, '^'.preg_quote($oldref, '/'));
|
||||
foreach ($listoffiles as $fileentry) {
|
||||
$dirsource = $fileentry['name'];
|
||||
$dirdest = preg_replace('/^'.preg_quote($oldref, '/').'/', $newref, $dirsource);
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ function bomPrepareHead($object)
|
|||
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/lib/files.lib.php';
|
||||
require_once DOL_DOCUMENT_ROOT.'/core/class/link.class.php';
|
||||
$upload_dir = $conf->bom->dir_output."/".dol_sanitizeFileName($object->ref);
|
||||
$upload_dir = getMultidirOutput($object) . "/".dol_sanitizeFileName($object->ref);
|
||||
$nbFiles = count(dol_dir_list($upload_dir, 'files', 0, '', '(\.meta|_preview.*\.png)$'));
|
||||
$nbLinks = Link::count($db, $object->element, $object->id);
|
||||
$head[$h][0] = DOL_URL_ROOT.'/bom/bom_document.php?id='.$object->id;
|
||||
|
|
|
|||
Loading…
Reference in a new issue