diff --git a/dev/initdemo/mysqldump_dolibarr_19.0.0.sql b/dev/initdemo/mysqldump_dolibarr_19.0.0.sql index 78a4358879e..536991aa19d 100644 --- a/dev/initdemo/mysqldump_dolibarr_19.0.0.sql +++ b/dev/initdemo/mysqldump_dolibarr_19.0.0.sql @@ -2999,7 +2999,7 @@ DROP TABLE IF EXISTS `llx_c_type_contact`; /*!40101 SET @saved_cs_client = @@character_set_client */; /*!40101 SET character_set_client = utf8 */; CREATE TABLE `llx_c_type_contact` ( - `rowid` int(11) NOT NULL, + `rowid` int(11) NOT NULL AUTO_INCREMENT, `element` varchar(30) NOT NULL, `source` varchar(8) NOT NULL DEFAULT 'external', `code` varchar(32) NOT NULL, diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index 3a9356a495a..7f3882d5874 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -770,11 +770,11 @@ if (empty($reshook) && $action == 'update') { if ($fulldayevent) { $tzforfullday = getDolGlobalString('MAIN_STORE_FULL_EVENT_IN_GMT'); // For "full day" events, we must store date in GMT (It must be viewed as same moment everywhere) - $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), $tzforfullday ? $tzforfullday : 'tzuserrel'); - $datef = dol_mktime($fulldayevent ? '23' : GETPOSTINT("p2hour"), $fulldayevent ? '59' : GETPOSTINT("p2min"), $fulldayevent ? '59' : GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datep = dol_mktime('00', '00', '00', GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); + $datef = dol_mktime('23', '59', '59', GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), $tzforfullday ? $tzforfullday : 'tzuserrel'); } else { - $datep = dol_mktime($fulldayevent ? '00' : GETPOSTINT("aphour"), $fulldayevent ? '00' : GETPOSTINT("apmin"), $fulldayevent ? '00' : GETPOSTINT("apsec"), GETPOSTINT("apmonth"), GETPOSTINT("apday"), GETPOSTINT("apyear"), 'tzuserrel'); - $datef = dol_mktime($fulldayevent ? '23' : GETPOSTINT("p2hour"), $fulldayevent ? '59' : GETPOSTINT("p2min"), $fulldayevent ? '59' : GETPOSTINT("apsec"), GETPOSTINT("p2month"), GETPOSTINT("p2day"), GETPOSTINT("p2year"), 'tzuserrel'); + $datep = dol_mktime(GETPOST("aphour", 'int'), GETPOST("apmin", 'int'), GETPOST("apsec", 'int'), GETPOST("apmonth", 'int'), GETPOST("apday", 'int'), GETPOST("apyear", 'int'), 'tzuserrel'); + $datef = dol_mktime(GETPOST("p2hour", 'int'), GETPOST("p2min", 'int'), GETPOST("apsec", 'int'), GETPOST("p2month", 'int'), GETPOST("p2day", 'int'), GETPOST("p2year", 'int'), 'tzuserrel'); } if ($object->elementtype == 'ticket') { // code should be TICKET_MSG, TICKET_MSG_PRIVATE, TICKET_MSG_SENTBYMAIL, TICKET_MSG_PRIVATE_SENTBYMAIL