From 5e67e11eb3aa7e8afe04f9e2775c42c241a5d4b8 Mon Sep 17 00:00:00 2001 From: lmarcouiller Date: Thu, 21 Jan 2021 17:15:32 +0100 Subject: [PATCH] update societe/card.php clipboard copy in fonction --- htdocs/societe/card.php | 68 ++++++++++++++++++++++++++--------------- 1 file changed, 43 insertions(+), 25 deletions(-) diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index 75771f3d419..511bde61bcf 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2408,7 +2408,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) if (!empty($conf->fournisseur->enabled) || !empty($conf->supplier_proposal->enabled)) { print ''.$langs->trans('Supplier').''; - print yn($object->fournisseur); + print showValueWithCopyAndPasteButton(yn($object->fournisseur),'supplier',$langs); print ''; } @@ -2423,29 +2423,11 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) if ($object->client) { print ''; - print $langs->trans('CustomerCode').''; - print ""; - print ''; - print $object->code_client .''; + print $langs->trans('CustomerCode'); + print ''; + print ''; + print showValueWithCopyAndPasteButton($object->code_client, 'code_client',$langs); + print ''; $tmpcheck = $object->check_codeclient(); if ($tmpcheck != 0 && $tmpcheck != -5) { print ' ('.$langs->trans("WrongCustomerCode").')'; @@ -2957,7 +2939,43 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) include DOL_DOCUMENT_ROOT.'/core/tpl/card_presend.tpl.php'; } } - +/** + * @param string $valuetoprint the value to print + * @param string $spanid unique id for a span + * @param Translate $langs the $langs variable + * @return string the string to print for the button + */ +function showValueWithCopyAndPasteButton($valuetoprint,$spanid,$langs){ + $stringtoprint= ''; + $stringtoprint.= $valuetoprint .' '; + $stringtoprint.= ''; + $stringtoprint.=''; + $stringtoprint.=""; + return $stringtoprint; +} // End of page llxFooter(); $db->close(); +