forked from Wavyzz/dolibarr
NEW Add function showValueWithClipboardCPButton() to add a copy/paste
button on a text.
This commit is contained in:
@@ -9248,7 +9248,7 @@ function readfileLowMemory($fullpath_original_file_osencoded, $method = -1)
|
||||
* @param int $showonlyonhover Show the copypaste button only on hover
|
||||
* @return string The string to print for the button
|
||||
*/
|
||||
function showValueWithCopyAndPasteButton($valuetoprint, $showonlyonhover = 1)
|
||||
function showValueWithClipboardCPButton($valuetoprint, $showonlyonhover = 1)
|
||||
{
|
||||
$result = '<span class="clipboardCP'.($showonlyonhover ? ' clipboardCPShowOnHover' : '').'"><span class="clipboardCPValue">'.$valuetoprint.'</span><span class="clipboardCPButton far fa-clipboard opacitymedium paddingleft paddingright"></span><span class="clipboardCPText opacitymedium"></span></span>';
|
||||
return $result;
|
||||
|
||||
@@ -2415,7 +2415,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
// Prefix
|
||||
if (!empty($conf->global->SOCIETE_USEPREFIX)) // Old not used prefix field
|
||||
{
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td>'.$object->prefix_comm.'</td>';
|
||||
print '<tr><td>'.$langs->trans('Prefix').'</td><td>'.dol_escape_htmltag($object->prefix_comm).'</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
|
||||
@@ -2426,7 +2426,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
print $langs->trans('CustomerCode');
|
||||
print '</td>';
|
||||
print '<td>';
|
||||
print showValueWithCopyAndPasteButton($object->code_client);
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
|
||||
print '</td>';
|
||||
$tmpcheck = $object->check_codeclient();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
@@ -2441,7 +2441,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
{
|
||||
print '<tr><td>';
|
||||
print $langs->trans('SupplierCode').'</td><td>';
|
||||
print $object->code_fournisseur;
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_fournisseur));
|
||||
$tmpcheck = $object->check_codefournisseur();
|
||||
if ($tmpcheck != 0 && $tmpcheck != -5) {
|
||||
print ' <font class="error">('.$langs->trans("WrongSupplierCode").')</font>';
|
||||
@@ -2454,7 +2454,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
if (!empty($conf->barcode->enabled))
|
||||
{
|
||||
print '<tr><td>';
|
||||
print $langs->trans('Gencod').'</td><td>'.dol_escape_htmltag($object->barcode);
|
||||
print $langs->trans('Gencod').'</td><td>'.showValueWithClipboardCPButton(dol_escape_htmltag($object->barcode));
|
||||
print '</td>';
|
||||
print '</tr>';
|
||||
}
|
||||
@@ -2470,7 +2470,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action))
|
||||
print '<tr>';
|
||||
print '<td>'.$idprof.'</td><td>';
|
||||
$key = 'idprof'.$i;
|
||||
print $object->$key;
|
||||
print showValueWithClipboardCPButton(dol_escape_htmltag($object->$key));
|
||||
if ($object->$key)
|
||||
{
|
||||
if ($object->id_prof_check($i, $object) > 0) print ' '.$object->id_prof_url($i, $object);
|
||||
|
||||
Reference in New Issue
Block a user