diff --git a/htdocs/core/boxes/box_last_modified_knowledgerecord.php b/htdocs/core/boxes/box_last_modified_knowledgerecord.php index c41d141d5e8..a160bf482c4 100644 --- a/htdocs/core/boxes/box_last_modified_knowledgerecord.php +++ b/htdocs/core/boxes/box_last_modified_knowledgerecord.php @@ -1,9 +1,9 @@ - * Copyright (C) 2016 Christophe Battarel - * Copyright (C) 2018-2023 Frédéric France - * Copyright (C) 2024 MDW + * Copyright (C) 2013-2016 Jean-François FERRY + * Copyright (C) 2016 Christophe Battarel + * Copyright (C) 2018-2025 Frédéric France + * Copyright (C) 2024 MDW * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -91,8 +91,9 @@ class box_last_modified_knowledgerecord extends ModeleBoxes ); if ($user->hasRight('knowledgemanagement', 'knowledgerecord', 'read')) { - $sql = 'SELECT k.rowid as id, k.date_creation, k.ref, k.lang, k.question, k.status as status'; + $sql = 'SELECT k.rowid as id, k.date_creation, GREATEST(k.tms, kef.tms) as date_modification, k.ref, k.lang, k.question, k.status as status'; $sql .= " FROM ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord as k"; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."knowledgemanagement_knowledgerecord_extrafields as kef ON kef.fk_object = k.rowid"; $sql .= " WHERE k.entity IN (".getEntity('knowledgemanagement').")"; if ($user->socid) { @@ -101,7 +102,7 @@ class box_last_modified_knowledgerecord extends ModeleBoxes $sql .= " AND k.status > 0"; - $sql .= " ORDER BY k.tms DESC, k.rowid DESC "; + $sql .= " ORDER BY date_modification DESC, k.rowid DESC "; $sql .= $this->db->plimit($max, 0); $resql = $this->db->query($sql); @@ -114,10 +115,12 @@ class box_last_modified_knowledgerecord extends ModeleBoxes $objp = $this->db->fetch_object($resql); $datec = $this->db->jdate($objp->date_creation); + $datem = $this->db->jdate($objp->date_modification); $knowledgerecord = new KnowledgeRecord($this->db); $knowledgerecord->id = $objp->id; $knowledgerecord->date_creation = $objp->date_creation; + $knowledgerecord->date_modification = $objp->date_modification; $knowledgerecord->ref = $objp->ref; $knowledgerecord->status = $objp->status; $knowledgerecord->question = $objp->question; @@ -151,8 +154,8 @@ class box_last_modified_knowledgerecord extends ModeleBoxes // Date creation $this->info_box_contents[$i][$r] = array( - 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateCreation").': '.dol_print_date($datec, 'dayhour', 'tzuserrel')).'"', - 'text' => dol_print_date($datec, 'dayhour', 'tzuserrel'), + 'td' => 'class="center nowraponall" title="'.dol_escape_htmltag($langs->trans("DateModification").': '.dol_print_date($datem, 'dayhour', 'tzuserrel')).'"', + 'text' => dol_print_date($datem, 'dayhour', 'tzuserrel'), ); $r++; diff --git a/htdocs/holiday/define_holiday.php b/htdocs/holiday/define_holiday.php index 0e41928f721..35933bed6d3 100644 --- a/htdocs/holiday/define_holiday.php +++ b/htdocs/holiday/define_holiday.php @@ -3,7 +3,7 @@ * Copyright (C) 2011 Dimitri Mouillard * Copyright (C) 2013 Marcos García * Copyright (C) 2016 Regis Houssin - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * Copyright (C) 2024 Alexandre Spangaro * Copyright (C) 2024-2025 MDW * @@ -530,7 +530,7 @@ if (count($typeleaves) == 0) { print ''."\n"; print ''; - print ''.img_picto($langs->trans('MenuLogCP'), 'list-alt').''; + print ''.img_picto($langs->trans('MenuLogCP'), 'list-alt').''; print ''; // Action column diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index 0bd9a4d500d..ff4d3582079 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -159,10 +159,12 @@ class KnowledgeRecord extends CommonObject * @var string */ public $url; + /** - * @var int + * @var ?int */ public $status; + /** * @var string */ @@ -772,7 +774,7 @@ class KnowledgeRecord extends CommonObject $nofetch = !empty($params['nofetch']); $datas['picto'] = img_picto('', $this->picto).' '.$langs->trans("KnowledgeRecord").''; - if (isset($this->statut)) { + if (isset($this->status)) { $datas['picto'] .= ' '.$this->getLibStatut(5); } $datas['label'] = '
'.$langs->trans('Ref').': '.$this->ref; @@ -965,9 +967,10 @@ class KnowledgeRecord extends CommonObject */ public function info($id) { - $sql = 'SELECT rowid, date_creation as datec, tms as datem,'; - $sql .= ' fk_user_creat, fk_user_modif'; + $sql = 'SELECT t.rowid, t.date_creation as datec, GREATEST(t.tms, kef.tms) as datem,'; + $sql .= ' t.fk_user_creat, t.fk_user_modif'; $sql .= ' FROM '.MAIN_DB_PREFIX.$this->table_element.' as t'; + $sql .= " LEFT JOIN ".MAIN_DB_PREFIX.$this->table_element."_extrafields as kef ON kef.fk_object = t.rowid"; $sql .= ' WHERE t.rowid = '.((int) $id); $result = $this->db->query($sql); if ($result) { @@ -978,7 +981,7 @@ class KnowledgeRecord extends CommonObject $this->user_creation_id = $obj->fk_user_creat; $this->user_modification_id = $obj->fk_user_modif; - $this->date_creation = $this->db->jdate($obj->datec); + $this->date_creation = $this->db->jdate($obj->datec); $this->date_modification = empty($obj->datem) ? '' : $this->db->jdate($obj->datem); } diff --git a/htdocs/knowledgemanagement/knowledgerecord_card.php b/htdocs/knowledgemanagement/knowledgerecord_card.php index d7331dc767b..77278834407 100644 --- a/htdocs/knowledgemanagement/knowledgerecord_card.php +++ b/htdocs/knowledgemanagement/knowledgerecord_card.php @@ -1,7 +1,7 @@ * Copyright (C) 2024-2025 MDW - * Copyright (C) 2024 Frédéric France + * Copyright (C) 2024-2025 Frédéric France * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -496,7 +496,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea } else { $langs->load("errors"); //print dolGetButtonAction($langs->trans('Validate'), '', 'default', $_SERVER['PHP_SELF'].'?id='.$object->id.'&action=confirm_validate&confirm=yes', '', 0); - print ''.$langs->trans("Reply").''; + print ''.$langs->trans("Validate").''; } }