From a1ce8272acbbbb72f0aee83ddf740a0ca49b9fd7 Mon Sep 17 00:00:00 2001 From: "Laurent Destailleur (aka Eldy)" Date: Wed, 12 Feb 2025 22:46:09 +0100 Subject: [PATCH] Fix warning --- htdocs/compta/facture/class/facture.class.php | 14 ++--- htdocs/core/lib/company.lib.php | 47 ++++++++++++++- htdocs/public/onlinesign/newonlinesign.php | 59 +------------------ 3 files changed, 55 insertions(+), 65 deletions(-) diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 311c8df539a..53867a36681 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -2555,12 +2555,12 @@ class Facture extends CommonInvoice if (isset($this->retained_warranty)) { $this->retained_warranty = (float) $this->retained_warranty; } - if (!isset($this->fk_user_author) && isset($this->user_author) ) { - $this->fk_user_author = $this->user_author; + if (!isset($this->user_creation_id) && isset($this->fk_user_author) ) { + $this->user_creation_id = $this->fk_user_author; + } + if (!isset($this->user_validation_id) && isset($this->fk_user_valid) ) { + $this->user_validation_id = $this->fk_user_valid; } - - // Check parameters - // Put here code to add control on parameters values // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET"; @@ -2585,8 +2585,8 @@ class Facture extends CommonInvoice $sql .= " total_ttc=".(isset($this->total_ttc) ? (float) $this->total_ttc : "null").","; $sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (float) $this->revenuestamp : "null").","; $sql .= " fk_statut=".(isset($this->status) ? (int) $this->status : "null").","; - $sql .= " fk_user_author=".(isset($this->fk_user_author) ? ((int) $this->fk_user_author) : "null").","; - $sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? (int) $this->fk_user_valid : "null").","; + $sql .= " fk_user_author=".(isset($this->user_creation_id) ? ((int) $this->user_creation_id) : "null").","; + $sql .= " fk_user_valid=".(isset($this->user_validation_id) ? (int) $this->user_validation_id : "null").","; $sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? (int) $this->fk_facture_source : "null").","; $sql .= " fk_projet=".(isset($this->fk_project) ? (int) $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? (int) $this->cond_reglement_id : "null").","; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index ba8b55c69d7..eb1b72a3846 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2659,9 +2659,54 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj) } +/** + * Show header of company in HTML public pages + * + * @param Societe $mysoc Third party + * @param Translate $langs Output language + * @return void + */ +function htmlPrintOnlineHeader($mysoc, $langs) +{ + global $conf; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { + print ''; + } + print '
'; + } + + if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { + print '
'; + print ''; + print '
'; + } + + print '
'; +} + /** - * Show footer of company in HTML pages + * Show footer of company in HTML public pages * * @param Societe $fromcompany Third party * @param Translate $langs Output language diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 641e5413771..566b45618cc 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -185,62 +185,6 @@ $hookmanager->initHooks(array('onlinesign')); $error = 0; -/** - * Show header for online signature - * - * @param string $title Title - * @param string $head Head array - * @param int $disablejs More content into html header - * @param int $disablehead More content into html header - * @param string[]|string $arrayofjs Array of complementary js files - * @param string[]|string $arrayofcss Array of complementary css files - * @return void - */ -function llxHeaderVierge($title, $head = "", $disablejs = 0, $disablehead = 0, $arrayofjs = [], $arrayofcss = []) -{ - global $conf, $langs, $mysoc; - - top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss); // Show html headers - - print ''; - - // Define urllogo - $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; - - if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); - } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { - $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); - } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { - $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; - } - - print '
'; - - // Output html code for logo - if ($urllogo) { - print '
'; - print '
'; - print ''; - print '
'; - if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { - print ''; - } - print '
'; - } - - if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { - print '
'; - print ''; - print '
'; - } - - print '
'; - - print '
'; -} - - /* * Actions @@ -303,7 +247,7 @@ $title = $langs->trans("OnlineSignature"); $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; llxHeader($head, $title, '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); -llxHeaderVierge($title); +htmlPrintOnlineHeader($mysoc, $langs); if ($action == 'refusepropal') { print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY).(isModEnabled('multicompany') ? '&entity='.$entity : ''), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); @@ -923,6 +867,7 @@ if ($action == "dosign" && empty($cancel)) { } print ''."\n"; print ''."\n"; + print ''."\n"; print '
'."\n"; print '
';