From e6eff6511e03149d7ce2f96deed2686c6837b09d Mon Sep 17 00:00:00 2001 From: atm-greg Date: Thu, 24 Sep 2020 15:20:30 +0200 Subject: [PATCH] fix reminder offsetunit and display problems --- htdocs/comm/action/card.php | 8 +++++--- htdocs/install/mysql/migration/12.0.0-13.0.0.sql | 1 - 2 files changed, 5 insertions(+), 4 deletions(-) diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index be100a97656..5179b4c0ab1 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -397,7 +397,7 @@ if (empty($reshook) && $action == 'add') if ($addreminder == 'on'){ $actionCommReminder = new ActionCommReminder($db); - $dateremind = dol_time_plus_duree($datep, -$offsetvalue, 'i'); + $dateremind = dol_time_plus_duree($datep, -$offsetvalue, $offsetunit); $actionCommReminder->dateremind = $dateremind; $actionCommReminder->typeremind = $remindertype; @@ -1697,6 +1697,7 @@ if ($id > 0) print $langs->trans("Done"); print ' '; } + print '
'; } } } @@ -1985,7 +1986,7 @@ if ($id > 0) { $filtreuserid = $user->id; if ($user->rights->agenda->allactions->read) $filtreuserid = 0; - $object->loadReminders('', $filteruserid); + $object->loadReminders('', $filteruserid, false); print ''.$langs->trans("Reminders").''; @@ -1996,7 +1997,7 @@ if ($id > 0) print $TRemindTypes[$actioncommreminder->typeremind]; if ($actioncommreminder->fk_user > 0) { $tmpuserstatic->fetch($actioncommreminder->fk_user); - print ' ('.$tmpuser->getNomUrl(0, '', 0, 0, 16).')'; + print ' ('.$tmpuserstatic->getNomUrl(0, '', 0, 0, 16).')'; } print ' - '.$actioncommreminder->offsetvalue.' '.$TDurationTypes[$actioncommreminder->offsetunit]; if ($actioncommreminder->status == $actioncommreminder::STATUS_TODO) { @@ -2008,6 +2009,7 @@ if ($id > 0) print $langs->trans("Done"); print ' '; } + print '
'; } } diff --git a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql index 8e3d0e1ee69..1f7740de467 100644 --- a/htdocs/install/mysql/migration/12.0.0-13.0.0.sql +++ b/htdocs/install/mysql/migration/12.0.0-13.0.0.sql @@ -306,7 +306,6 @@ insert into llx_c_action_trigger (code,label,description,elementtype,rang) value ALTER TABLE llx_actioncomm_reminder ADD COLUMN entity integer NOT NULL DEFAULT 1; ALTER TABLE llx_actioncomm_reminder ADD COLUMN fk_actioncomm integer NOT NULL; ALTER TABLE llx_actioncomm_reminder ADD COLUMN fk_email_template integer; -ALTER TABLE llx_actioncomm_reminder CHANGE offsetunit offsetunit VARCHAR(10); ALTER TABLE llx_actioncomm_reminder DROP INDEX uk_actioncomm_reminder_unique; ALTER TABLE llx_actioncomm_reminder ADD UNIQUE uk_actioncomm_reminder_unique (fk_user, typeremind, offsetvalue, offsetunit, fk_actioncomm);