diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index eb6ac7e882b..0f53f41e789 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -1724,6 +1724,18 @@ abstract class CommonObject return 0; } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the project with id $this->fk_project into this->project + * + * @return int <0 if KO, >=0 if OK + */ + public function fetch_project() + { + // phpcs:enable + return $this->fetch_projet(); + } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps /** * Load the project with id $this->fk_project into this->project diff --git a/htdocs/eventorganization/class/conferenceorboothattendee.class.php b/htdocs/eventorganization/class/conferenceorboothattendee.class.php index 1481d899599..7fb77b69b64 100644 --- a/htdocs/eventorganization/class/conferenceorboothattendee.class.php +++ b/htdocs/eventorganization/class/conferenceorboothattendee.class.php @@ -634,6 +634,31 @@ class ConferenceOrBoothAttendee extends CommonObject } } + // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps + /** + * Load the project with id $this->fk_project into this->project + * + * @return int <0 if KO, >=0 if OK + */ + public function fetch_projet() + { + // phpcs:enable + include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php'; + + if (empty($this->fk_project) && !empty($this->fk_projet)) { + $this->fk_project = $this->fk_projet; // For backward compatibility + } + if (empty($this->fk_project)) { + return 0; + } + + $project = new Project($this->db); + $result = $project->fetch($this->fk_project); + + $this->projet = $project; // deprecated + $this->project = $project; + return $result; + } /** * Set draft status diff --git a/htdocs/public/payment/newpayment.php b/htdocs/public/payment/newpayment.php index 9aef4c18ed2..2cd49838b78 100644 --- a/htdocs/public/payment/newpayment.php +++ b/htdocs/public/payment/newpayment.php @@ -1840,7 +1840,7 @@ if ($source == 'organizedeventregistration') { print ''."\n"; if (! is_object($attendee->project)) { - $text = 'ErrorProjectotFound'; + $text = 'ErrorProjectNotFound'; } else { $text = $langs->trans("PaymentEvent").' - '.$attendee->project->title; }