diff --git a/core/triggers/interface_99_modDolisirh_DolisirhTriggers.class.php b/core/triggers/interface_99_modDolisirh_DolisirhTriggers.class.php index a5b11ae..af956b9 100644 --- a/core/triggers/interface_99_modDolisirh_DolisirhTriggers.class.php +++ b/core/triggers/interface_99_modDolisirh_DolisirhTriggers.class.php @@ -98,7 +98,7 @@ public function runTrigger($action, $object, User $user, Translate $langs, Conf $result = $ticket->fetch($object->fk_element); dol_syslog(var_export($ticket, true), LOG_DEBUG); if ($result > 0 && ($ticket->id) > 0) { - if (is_array($ticket->array_options) && array_key_exists('options_fk_task', $ticket->array_options) && $ticket->array_options['options_fk_task']>0) { + if (is_array($ticket->array_options) && array_key_exists('options_fk_task', $ticket->array_options) && $ticket->array_options['options_fk_task']>0 && !empty(GETPOST('timespent', 'int'))) { require_once DOL_DOCUMENT_ROOT .'/projet/class/task.class.php'; $task = new Task($this->db); $result = $task->fetch($ticket->array_options['options_fk_task']); diff --git a/view/timespent_list.php b/view/timespent_list.php index 342459e..efc14bb 100644 --- a/view/timespent_list.php +++ b/view/timespent_list.php @@ -256,6 +256,8 @@ } $sql .= ' AND ptt.task_duration IS NOT NULL'; +if (GETPOST('custonly')) $sql .= ' AND s.rowid IS NOT NULL'; + foreach ($search as $key => $val) { if (preg_match('/(_dtstart|_dtend)$/', $key) && $search[$key] != '') { if (preg_match('/_dtstart$/', $key)) { @@ -401,6 +403,8 @@ $moreforfilter .= $formcategory->getFilterBox(Categorie::TYPE_PROJECT, $search_category_array); } +$moreforfilter .= 'Client seulement : '; + if (!empty($moreforfilter)) { print '