From eb26e189ad0a0103012323b69b734203b9beefe5 Mon Sep 17 00:00:00 2001 From: Bate Date: Tue, 9 Jul 2013 09:50:32 +0000 Subject: [PATCH] #23 Un possible fix + des logs --- comptoir/include/comptoir.inc.php | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/comptoir/include/comptoir.inc.php b/comptoir/include/comptoir.inc.php index e463385d7..72e62de5e 100644 --- a/comptoir/include/comptoir.inc.php +++ b/comptoir/include/comptoir.inc.php @@ -278,6 +278,7 @@ class comptoir extends stdentity if ( $req->lines == 0 ) // rien n'a été affecté, donc on re-crée une entrée { + _log($this->dbrw, "Entree de tracking absente", serialize(debug_backtrace()), "Comptoir", $Op); $req = new insert ($this->dbrw, "cpt_tracking", array( @@ -387,6 +388,15 @@ class comptoir extends stdentity $_SESSION["Comptoirs"][$this->id]["operateurs"][] = $user->id; + // On ferme toute entree precedente + $req = new requete ($this->dbrw, + "UPDATE `cpt_tracking` SET `closed_time`='".date("Y-m-d H:i:s")."' + WHERE `closed_time` IS NULL + AND `id_utilisateur` = '".mysql_real_escape_string($user->id)."' + AND `id_comptoir` = '".mysql_real_escape_string($this->id)."'"); + + if ( $req->lines != 0 ) // Ca ne devrait pas arriver + _log($this->dbrw, "Reconnexion de barman", serialize(debug_backtrace()), "Comptoir", $user); // crée l'entrée de tracking pour le barman $req = new insert ($this->dbrw, "cpt_tracking", -- GitLab