diff --git a/htdocs/comm/fiche.php3 b/htdocs/comm/fiche.php3 index c45e9038785..0a1454a5671 100644 --- a/htdocs/comm/fiche.php3 +++ b/htdocs/comm/fiche.php3 @@ -97,9 +97,13 @@ if ($mode == 'search') { $db->free(); } } - - - +/* + * Sécurité si un client essaye d'accéder à une autre fiche que la sienne + */ +if ($user->societe_id > 0) +{ + $socid = $user->societe_id; +} /* * * Mode fiche @@ -107,9 +111,9 @@ if ($mode == 'search') { * */ if ($socid > 0) { + $societe = new Societe($db, $socid); - $sql = "SELECT s.idp, s.nom, ".$db->pdate("s.datec")." as dc, s.tel, s.fax, st.libelle as stcomm, s.fk_stcomm, s.url,s.address,s.cp,s.ville, s.note, t.libelle as typent, e.libelle as effectif, s.siren, s.prefix_comm, s.services,s.parent, s.description FROM societe as s, c_stcomm as st, c_typent as t, c_effectif as e "; $sql .= " WHERE s.fk_stcomm=st.id AND s.fk_typent = t.id AND s.fk_effectif = e.id"; @@ -137,14 +141,19 @@ if ($socid > 0) { print "\n"; print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print ""; - print "
Fiche client : $objsoc->nom
idp\">Comptaidp&action=add_bookmark\">[Bookmark]idp\">docidp&action=create\">[Projet]idp&action=create\">[Propal]idp\">Notes[idp&action=edit\">Editer]
"; + + if ($user->societe_id == 0) + { + + print "idp\">Compta"; + print "idp&action=add_bookmark\">[Bookmark]"; + print "idp\">doc"; + print "idp&action=create\">[Projet]"; + print "idp&action=create\">[Propal]"; + print "idp\">Notes"; + print "[idp&action=edit\">Editer]"; + } + print ""; /* * * @@ -212,7 +221,6 @@ if ($socid > 0) { $db->free(); } - /* * * Liste des projets associés @@ -388,11 +396,6 @@ if ($socid > 0) { } print ""; - - - - - /* * * Listes des actions effectuees