diff --git a/htdocs/compta/hrm.php b/htdocs/compta/hrm.php index cd2d2b60f7e..c0b2afd38c8 100644 --- a/htdocs/compta/hrm.php +++ b/htdocs/compta/hrm.php @@ -1,7 +1,7 @@ - * Copyright (C) 2013-2014 Laurent Destailleur - * Copyright (C) 2012 Regis Houssin +/* Copyright (C) 2011 Dimitri Mouillard + * Copyright (C) 2013-2014 Laurent Destailleur + * Copyright (C) 2012-2014 Regis Houssin * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -117,7 +117,7 @@ if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAI $sql.= " WHERE u.rowid = d.fk_user"; $sql.= " AND d.entity = ".$conf->entity; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= " AND d.fk_soc = s. rowid AND s.rowid = sc.fk_soc AND sc.fk_user = " .$user->id; -if ($socid) $sql.= " AND d.fk_soc = ".$socid; +if (!empty($socid)) $sql.= " AND d.fk_soc = ".$socid; // FIXME $socid is not defined $sql.= $db->order("d.tms","DESC"); $sql.= $db->plimit($max, 0);