diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 817713f221b..aefdad868b5 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -6583,10 +6583,19 @@ abstract class CommonObject $out .= 'attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired'; - $out .= '">'; - if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); - else $out .= $labeltoshow; + // BUG #11554 : For public page, use red dot for required fields, instead of bold label + $context = isset($params["context"]) ? $params["context"] : "none"; + if ($context=="public") { // Public page : red dot instead of bold ble characters + $out .= '">'; + if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + else $out .= $labeltoshow; + if ($mode != 'view' && ! empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' *'; + } else { + if ($mode != 'view' && ! empty($extrafields->attributes[$this->table_element]['required'][$key])) $out .= ' fieldrequired'; + $out .= '">'; + if (! empty($extrafields->attributes[$this->table_element]['help'][$key])) $out .= $form->textwithpicto($labeltoshow, $extrafields->attributes[$this->table_element]['help'][$key]); + else $out .= $labeltoshow; + } $out .= ''; $html_id = !empty($this->id) ? $this->element.'_extras_'.$key.'_'.$this->id : ''; diff --git a/htdocs/core/tpl/extrafields_add.tpl.php b/htdocs/core/tpl/extrafields_add.tpl.php index f4f74d35428..7e146b63fe0 100644 --- a/htdocs/core/tpl/extrafields_add.tpl.php +++ b/htdocs/core/tpl/extrafields_add.tpl.php @@ -41,7 +41,8 @@ $parameters = array(); $reshook = $hookmanager->executeHooks('formObjectOptions', $parameters, $object, $action); // Note that $action and $object may have been modified by hook print $hookmanager->resPrint; if (empty($reshook)) { - print $object->showOptionals($extrafields, 'edit'); + $params = isset($tpl_context) ? array('context' => $tpl_context) : array(); // BUG #11554 : Add context in params + print $object->showOptionals($extrafields, 'edit', $params); // BUG #11554 : Add context in params } ?> diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index 873a6858a1a..2abbd60aa68 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -645,6 +645,7 @@ print ''.$langs->trans("URLPhoto").''."\n"; // Other attributes +$tpl_context = 'public'; //BUG #11554 : define templae context to public include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_add.tpl.php'; // Comments print '';