diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 6a69b33f2b5..ea63fa2fcb3 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -120,16 +120,17 @@ if (!function_exists('str_contains')) { /** - * Return the full path of the directory where a module (or an object of a module) stores its files. + * Return the full path of the directory where a module (or an object of a module) stores its files, * Path may depends on the entity if a multicompany module is enabled. * * @param CommonObject $object Dolibarr common object * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' + * @param int $forobject Return the more complete path for the given object instead of for the module only. * @param string $mode 'output' or 'temp' or 'version' * @return string|null The path of the relative directory of the module * @since Dolibarr V18 */ -function getMultidirOutput($object, $module = '', $mode = 'output') +function getMultidirOutput($object, $module = '', $forobject = 0, $mode = 'output') { global $conf; @@ -148,7 +149,11 @@ function getMultidirOutput($object, $module = '', $mode = 'output') // Get the relative path of directory if ($mode == 'output' || $mode == 'version') { if (isset($conf->$module) && property_exists($conf->$module, 'multidir_output')) { - return $conf->$module->multidir_output[(empty($object->entity) ? $conf->entity : $object->entity)]; + $s = $conf->$module->multidir_output[(empty($object->entity) ? $conf->entity : $object->entity)]; + if ($forobject && $object->id > 0) { + $s .= '/'.get_exdir(0, 0, 0, 0, $object); + } + return $s; } else { return 'error-diroutput-not-defined-for-this-object='.$module; } @@ -167,26 +172,28 @@ function getMultidirOutput($object, $module = '', $mode = 'output') * Return the full path of the directory where a module (or an object of a module) stores its temporary files. * Path may depends on the entity if a multicompany module is enabled. * - * @param CommonObject $object Dolibarr common object - * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' - * @return string|null The path of the relative temp directory of the module + * @param CommonObject $object Dolibarr common object + * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' + * @param int $forobject Return the more complete path for the given object instead of for the module only. + * @return string|null The path of the relative temp directory of the module */ -function getMultidirTemp($object, $module = '') +function getMultidirTemp($object, $module = '', $forobject = 0) { - return getMultiDirOutput($object, $module, 'temp'); + return getMultiDirOutput($object, $module, $forobject, 'temp'); } /** * Return the full path of the directory where a module (or an object of a module) stores its versioned files. * Path may depends on the entity if a multicompany module is enabled. * - * @param CommonObject $object Dolibarr common object - * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' - * @return string|null The path of the relative version directory of the module + * @param CommonObject $object Dolibarr common object + * @param string $module Override object element, for example to use 'mycompany' instead of 'societe' + * @param int $forobject Return the more complete path for the given object instead of for the module only. + * @return string|null The path of the relative version directory of the module */ -function getMultidirVersion($object, $module = '') +function getMultidirVersion($object, $module = '', $forobject = 0) { - return getMultiDirOutput($object, $module, 'version'); + return getMultiDirOutput($object, $module, $forobject, 'version'); } diff --git a/htdocs/webportal/class/html.formcardwebportal.class.php b/htdocs/webportal/class/html.formcardwebportal.class.php index 9e4a5a5c43c..b167cfda4e0 100644 --- a/htdocs/webportal/class/html.formcardwebportal.class.php +++ b/htdocs/webportal/class/html.formcardwebportal.class.php @@ -458,19 +458,21 @@ class FormCardWebPortal $html .= '
'; // Left block - begin - $html .= '
'; + $html .= '
'; $html .= '
'; + // logo or photo $form = new Form($this->db); + $html .= '
'; + $html .= '
'; $html .= $form->showphoto('memberphoto', $object, 0, 0, 0, 'photowithmargin photoref', 'small', 1, 0, 1); //include DOL_DOCUMENT_ROOT.'/core/lib/website.lib.php'; //$html .= getImagePublicURLOfObject($object, 1, '_small'); - - // logo or photo - $html .= '
'; + $html .= '
'; + $html .= '
'; // main information - begin - $html .= '
'; + $html .= '
'; // ref $html .= '
' . $langs->trans("Ref").' : '.dol_escape_htmltag($object->ref) . '
'; // full name @@ -510,7 +512,7 @@ class FormCardWebPortal // Left block - end // Right block - begin - $html .= '
'; + $html .= '
'; // show status $htmlStatus = $object->getLibStatut(6); if (empty($htmlStatus) || $htmlStatus == $object->getLibStatut(3)) {