diff --git a/htdocs/commande/stats/commandestats.class.php b/htdocs/commande/stats/commandestats.class.php index 2368ab9a0dd..7d80f3308f0 100644 --- a/htdocs/commande/stats/commandestats.class.php +++ b/htdocs/commande/stats/commandestats.class.php @@ -58,8 +58,8 @@ class CommandeStats { $sql .= " AND fk_soc = ".$this->socidp; } - $sql .= " GROUP BY dm DESC"; - + //pas un group by mais un ORDER// $sql .= " GROUP BY dm DESC"; + $sql .= " ORDER BY dm DESC"; if ($this->db->query($sql)) { $num = $this->db->num_rows(); diff --git a/htdocs/societe/notify/fiche.php b/htdocs/societe/notify/fiche.php index d2d699b8d18..3ef0034cded 100644 --- a/htdocs/societe/notify/fiche.php +++ b/htdocs/societe/notify/fiche.php @@ -28,6 +28,8 @@ if ($user->societe_id > 0) { $socid = $user->societe_id; } + +$socid = $_GET["socid"]; llxHeader(); @@ -36,7 +38,7 @@ if ($_POST["action"] == 'add') $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; $sql .= " WHERE fk_soc=".$socid." AND fk_contact=".$_POST["contactid"]." AND fk_action=".$_POST["actionid"]; if ($db->query($sql)) - { + { $sql = "INSERT INTO ".MAIN_DB_PREFIX."notify_def (datec,fk_soc, fk_contact, fk_action)"; $sql .= " VALUES (now(),$socid,".$_POST["contactid"].",".$_POST["actionid"].")"; @@ -55,11 +57,11 @@ if ($_POST["action"] == 'add') } } -if ($action == "delete") +if ($_GET["action"] == 'delete') { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def"; - $sql .= " WHERE rowid = $actid"; - + $sql = "DELETE FROM ".MAIN_DB_PREFIX."notify_def where rowid=".$_GET["actid"].";"; + $db->query($sql); + if ($db->query($sql)) { // TODO ajouter une sécu pour la suppression @@ -72,6 +74,7 @@ if ($action == "delete") */ $soc = new Societe($db); $soc->id = $_GET["socid"]; + if ( $soc->fetch($soc->id) ) { @@ -149,7 +152,6 @@ if ( $soc->fetch($soc->id) ) { $sortfield="c.name"; } - print ''; print ''; print_liste_field_titre_new ("Contact","fiche.php","c.name","","&socid=$socid",'',$sortfield); @@ -171,7 +173,9 @@ if ( $soc->fetch($soc->id) ) print ''; print ''; - print '
'.$obj->firstname . " ".$obj->name.''.$obj->titre.''.img_delete().''; + print' + '.img_delete().''; + $i++; $var = !$var; } diff --git a/htdocs/user.class.php b/htdocs/user.class.php index e2c2a9f2b24..df873e57cc4 100644 --- a/htdocs/user.class.php +++ b/htdocs/user.class.php @@ -42,7 +42,7 @@ class User { var $db; - + var $id; var $fullname; var $nom; @@ -55,6 +55,7 @@ class User var $pass; var $comm; var $compta; + var $societe_id; var $webcal_login; var $errorstr; var $userpref_limite_liste; @@ -729,8 +730,6 @@ class User $sql = "SELECT login FROM ".MAIN_DB_PREFIX."user WHERE login ='$this->login' AND rowid <> $this->id;"; - $sql = "SELECT login FROM ".MAIN_DB_PREFIX."user WHERE login ='bennybe' AND - email = '$this->id';"; if ($this->db->query($sql)) {