From aee6f408b255d40db1d46ad87a33ff88e6c15fe5 Mon Sep 17 00:00:00 2001 From: kamel Date: Wed, 11 May 2022 09:30:39 +0200 Subject: [PATCH 01/11] FIX: Set datec when add time spent on a project task --- htdocs/projet/class/task.class.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 8d9f91afaca..cda8494682b 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -1144,6 +1144,7 @@ class Task extends CommonObject dol_syslog(get_class($this)."::addTimeSpent", LOG_DEBUG); $ret = 0; + $now = dol_now(); // Check parameters if (!is_object($user)) { @@ -1169,6 +1170,7 @@ class Task extends CommonObject $sql .= ", task_duration"; $sql .= ", fk_user"; $sql .= ", note"; + $sql .= ", datec"; $sql .= ") VALUES ("; $sql .= $this->id; $sql .= ", '".$this->db->idate($this->timespent_date)."'"; @@ -1177,6 +1179,7 @@ class Task extends CommonObject $sql .= ", ".$this->timespent_duration; $sql .= ", ".$this->timespent_fk_user; $sql .= ", ".(isset($this->timespent_note) ? "'".$this->db->escape($this->timespent_note)."'" : "null"); + $sql .= ", '".$this->db->idate($now)."'"; $sql .= ")"; $resql = $this->db->query($sql); From 270ce3d169c7b232bb14d476e63371ea5c923bba Mon Sep 17 00:00:00 2001 From: Quentin VIAL-GOUTEYRON Date: Wed, 11 May 2022 15:07:39 +0200 Subject: [PATCH 02/11] FIX missing hook for row ordering --- htdocs/core/ajax/row.php | 8 ++++++-- htdocs/core/tpl/ajaxrow.tpl.php | 1 - 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php index 8b16cd4699c..7e9adcc570e 100644 --- a/htdocs/core/ajax/row.php +++ b/htdocs/core/ajax/row.php @@ -48,7 +48,7 @@ if (!defined('NOREQUIRETRAN')) { require '../../main.inc.php'; require_once DOL_DOCUMENT_ROOT.'/core/class/genericobject.class.php'; - +$hookmanager->initHooks(array('rowinterface')); // Security check // This is done later into view. @@ -116,7 +116,11 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3) $perm = 1; } } - + $parameters = array('roworder'=> &$roworder, 'table_element_line' => &$table_element_line, 'fk_element' => &$fk_element, 'element_id' => &$element_id, 'perm' => &$perm); + $reshook = $hookmanager->executeHooks('checkRowPerms', $parameters, $this, $action); + if ($reshook > 0) { + $perm = $hookmanager->resArray['perm']; + } if (! $perm) { // We should not be here. If we are not allowed to reorder rows, feature should not be visible on script. // If we are here, it is a hack attempt, so we report a warning. diff --git a/htdocs/core/tpl/ajaxrow.tpl.php b/htdocs/core/tpl/ajaxrow.tpl.php index 61428170f50..0be260194c2 100644 --- a/htdocs/core/tpl/ajaxrow.tpl.php +++ b/htdocs/core/tpl/ajaxrow.tpl.php @@ -43,7 +43,6 @@ $forcereloadpage = empty($conf->global->MAIN_FORCE_RELOAD_PAGE) ? 0 : 1; $tagidfortablednd = (empty($tagidfortablednd) ? 'tablelines' : $tagidfortablednd); $filepath = (empty($filepath) ? '' : $filepath); - if (GETPOST('action', 'aZ09') != 'editline' && $nboflines > 1 && $conf->browser->layout != 'phone') { ?>