diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index b313b0c5aac..cd1c9ecfd1b 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -61,8 +61,14 @@ $originid=GETPOST('originid','int'); $confirm = GETPOST('confirm', 'alpha'); $fulldayevent=GETPOST('fullday'); -$datep=dol_mktime($fulldayevent?'00':GETPOST("aphour"), $fulldayevent?'00':GETPOST("apmin"), 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear")); -$datef=dol_mktime($fulldayevent?'23':GETPOST("p2hour"), $fulldayevent?'59':GETPOST("p2min"), $fulldayevent?'59':'0', GETPOST("p2month"), GETPOST("p2day"), GETPOST("p2year")); + +$aphour = GETPOST('aphour'); +$apmin = GETPOST('apmin'); +$p2hour = GETPOST('p2hour'); +$p2min = GETPOST('p2min'); + +$datep=dol_mktime($fulldayevent?'00':$aphour, $fulldayevent?'00':$apmin, 0, GETPOST("apmonth"), GETPOST("apday"), GETPOST("apyear")); +$datef=dol_mktime($fulldayevent?'23':$p2hour, $fulldayevent?'59':$p2min, $fulldayevent?'59':'0', GETPOST("p2month"), GETPOST("p2day"), GETPOST("p2year")); // Security check $socid = GETPOST('socid','int'); @@ -92,7 +98,6 @@ $extralabels=$extrafields->fetch_name_optionals_label($object->table_element); // Initialize technical object to manage hooks of thirdparties. Note that conf->hooks_modules contains array array $hookmanager->initHooks(array('actioncard','globalcard')); - /* * Actions */ diff --git a/htdocs/don/card.php b/htdocs/don/card.php index e770e2a146c..8614220e8c0 100644 --- a/htdocs/don/card.php +++ b/htdocs/don/card.php @@ -743,9 +743,9 @@ if (! empty($id) && $action != 'edit') // Delete if ($user->rights->don->supprimer) { - if ($don->statut == -1 || $don->statut == 0) + if ($object->statut == -1 || $object->statut == 0) { - print '
'.$langs->trans("Delete")."
"; + print '
'.$langs->trans("Delete")."
"; } else { @@ -783,4 +783,4 @@ if (! empty($id) && $action != 'edit') } llxFooter(); -$db->close(); \ No newline at end of file +$db->close(); diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index 69262715b31..2dc50975abe 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3467,17 +3467,17 @@ class Societe extends CommonObject * Because this function is meant to be executed within a transaction, we won't take care of it. */ $sql = 'SELECT rowid -FROM llx_societe_commerciaux +FROM '.MAIN_DB_PREFIX.'societe_commerciaux WHERE fk_soc = '.(int) $dest_id.' AND fk_user IN ( SELECT fk_user - FROM llx_societe_commerciaux + FROM '.MAIN_DB_PREFIX.'societe_commerciaux WHERE fk_soc = '.(int) $origin_id.' );'; $query = $db->query($sql); while ($result = $db->fetch_object($query)) { - $db->query('DELETE FROM llx_societe_commerciaux WHERE rowid = '.$result->rowid); + $db->query('DELETE FROM '.MAIN_DB_PREFIX.'societe_commerciaux WHERE rowid = '.$result->rowid); } /**