diff --git a/htdocs/core/class/html.formmail.class.php b/htdocs/core/class/html.formmail.class.php index 29ccbde0f02..96c99ebba36 100644 --- a/htdocs/core/class/html.formmail.class.php +++ b/htdocs/core/class/html.formmail.class.php @@ -319,6 +319,10 @@ class FormMail extends Form // phpcs:enable global $conf, $langs, $user, $hookmanager, $form; + // Required to show preview of mail attachments + require_once DOL_DOCUMENT_ROOT.'/core/class/html.formfile.class.php'; + $formfile = new Formfile($this->db); + if (!is_object($form)) $form = new Form($this->db); // Load translation files required by the page @@ -845,7 +849,10 @@ class FormMail extends Form foreach ($listofpaths as $key => $val) { $out .= '
'; + // Preview of attachment + preg_match('#^(/)(\w+)(/)(.+)$#', substr($val, (strlen(DOL_DATA_ROOT)-strlen($val))), $formfile_params); $out .= img_mime($listofnames[$key]).' '.$listofnames[$key]; + $out .= $formfile->showPreview(array(), $formfile_params[2], $formfile_params[4]); if (!$this->withfilereadonly) { $out .= ' '; diff --git a/htdocs/modulebuilder/index.php b/htdocs/modulebuilder/index.php index be786a3b20a..cfb30f066c9 100644 --- a/htdocs/modulebuilder/index.php +++ b/htdocs/modulebuilder/index.php @@ -713,7 +713,7 @@ if ($dirins && $action == 'initobject' && $module && GETPOST('createtablearray', $notnull = ($obj->Null == 'YES' ? 0 : 1); if ($fieldname == 'fk_user_modif') $notnull = -1; // label - $label = preg_replace('/_/', ' ', ucfirst($fieldname)); + $label = preg_replace('/_/', '', ucfirst($fieldname)); if ($fieldname == 'rowid') $label = 'TechnicalID'; if ($fieldname == 'import_key') $label = 'ImportId'; if ($fieldname == 'fk_soc') $label = 'ThirdParty'; diff --git a/htdocs/takepos/admin/terminal.php b/htdocs/takepos/admin/terminal.php index 54e5de37a5c..49b99daf280 100644 --- a/htdocs/takepos/admin/terminal.php +++ b/htdocs/takepos/admin/terminal.php @@ -95,8 +95,8 @@ if (GETPOST('action', 'alpha') == 'set') $res = dolibarr_set_const($db, "TAKEPOS_ADDON".$terminaltouse, GETPOST('TAKEPOS_ADDON'.$terminaltouse, 'alpha'), 'chaine', 0, '', $conf->entity); // add free text on each terminal of cash desk - $res = dolibarr_set_const($db, 'TAKEPOS_HEADER'.$terminaltouse, GETPOST('TAKEPOS_HEADER'.$terminaltouse, 'none'), 'chaine', 0, '', $conf->entity); - $res = dolibarr_set_const($db, 'TAKEPOS_FOOTER'.$terminaltouse, GETPOST('TAKEPOS_FOOTER'.$terminaltouse, 'none'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TAKEPOS_HEADER'.$terminaltouse, GETPOST('TAKEPOS_HEADER'.$terminaltouse, 'restricthtml'), 'chaine', 0, '', $conf->entity); + $res = dolibarr_set_const($db, 'TAKEPOS_FOOTER'.$terminaltouse, GETPOST('TAKEPOS_FOOTER'.$terminaltouse, 'restricthtml'), 'chaine', 0, '', $conf->entity); dol_syslog("admin/cashdesk: level ".GETPOST('level', 'alpha'));