From c3d75cbfd22d92c9da314513e126cf3477c5c346 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20FRANCE?= Date: Tue, 27 Jun 2023 13:40:57 +0200 Subject: [PATCH 1/3] fetch proje-c-t extraparams --- htdocs/core/class/commonobject.class.php | 5 +++++ htdocs/projet/class/project.class.php | 3 ++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 31c3ae24d52..cdc03d99b16 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -640,6 +640,11 @@ abstract class CommonObject */ public $output; + /** + * @var array extraparams + */ + public $extraparams = array(); + /** * @var array List of child tables. To test if we can delete object. */ diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index 31bac71a1d8..f9b0c011019 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -673,7 +673,7 @@ class Project extends CommonObject $sql = "SELECT rowid, entity, ref, title, description, public, datec, opp_amount, budget_amount,"; $sql .= " tms, dateo as date_start, datee as date_end, date_close, fk_soc, fk_user_creat, fk_user_modif, fk_user_close, fk_statut as status, fk_opp_status, opp_percent,"; $sql .= " note_private, note_public, model_pdf, usage_opportunity, usage_task, usage_bill_time, usage_organize_event, email_msgid,"; - $sql .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth, max_attendees, date_start_event, date_end_event, location"; + $sql .= " accept_conference_suggestions, accept_booth_suggestions, price_registration, price_booth, max_attendees, date_start_event, date_end_event, location, extraparams"; $sql .= " FROM ".MAIN_DB_PREFIX."projet"; if (!empty($id)) { $sql .= " WHERE rowid = ".((int) $id); @@ -736,6 +736,7 @@ class Project extends CommonObject $this->date_end_event = $this->db->jdate($obj->date_end_event); $this->location = $obj->location; $this->email_msgid = $obj->email_msgid; + $this->extraparams = !empty($obj->extraparams) ? (array) json_decode($obj->extraparams, true) : array(); $this->db->free($resql); From 498daacf51dffe276613a4d0678f740a30165276 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Tue, 27 Jun 2023 14:47:57 +0200 Subject: [PATCH 2/3] Fix #25195 : mysql fatal error on ficheinterstat.class.php --- htdocs/fichinter/class/fichinterstats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index f6fbdb8d305..df02c1e7566 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -73,7 +73,7 @@ class FichinterStats extends Stats //$this->where.= " AND c.fk_statut > 0"; // Not draft and not cancelled } if (empty($user->rights->societe->client->voir) && !$this->socid) { - $this->where .= " AND c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); + $this->where .= ($this->where ? ' AND ' : '')." c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $this->where .= ($this->where ? ' AND ' : '')."c.entity IN (".getEntity('fichinter').')'; From e551005992f701d111167d761ca205a78ce06954 Mon Sep 17 00:00:00 2001 From: Hystepik Date: Tue, 27 Jun 2023 14:48:32 +0200 Subject: [PATCH 3/3] add secure !empty() --- htdocs/fichinter/class/fichinterstats.class.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/htdocs/fichinter/class/fichinterstats.class.php b/htdocs/fichinter/class/fichinterstats.class.php index df02c1e7566..8146c5272ee 100644 --- a/htdocs/fichinter/class/fichinterstats.class.php +++ b/htdocs/fichinter/class/fichinterstats.class.php @@ -73,7 +73,7 @@ class FichinterStats extends Stats //$this->where.= " AND c.fk_statut > 0"; // Not draft and not cancelled } if (empty($user->rights->societe->client->voir) && !$this->socid) { - $this->where .= ($this->where ? ' AND ' : '')." c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); + $this->where .= (!empty($this->where) ? ' AND ' : '')." c.fk_soc = sc.fk_soc AND sc.fk_user = ".((int) $user->id); } $this->where .= ($this->where ? ' AND ' : '')."c.entity IN (".getEntity('fichinter').')';