diff --git a/htdocs/comm/projet/index.php3 b/htdocs/comm/projet/index.php3 index ee3646bcab2..a97a5abb5c3 100644 --- a/htdocs/comm/projet/index.php3 +++ b/htdocs/comm/projet/index.php3 @@ -64,7 +64,7 @@ if ($action == 'create') { */ if ($sortfield == "") { - $sortfield="lower(p.label)"; + $sortfield="lower(s.nom)"; } if ($sortorder == "") { @@ -87,7 +87,7 @@ $pagenext = $page + 1; print "

"; $sql = "SELECT s.nom, s.idp, p.rowid as projectid, p.ref, p.title,".$db->pdate("p.dateo")." as do"; -$sql .= " FROM societe as s, llx_projet as p"; +$sql .= " FROM llx_societe as s, llx_projet as p"; $sql .= " WHERE p.fk_soc = s.idp"; if ($socidp) @@ -95,6 +95,8 @@ if ($socidp) $sql .= " AND s.idp = $socidp"; } +$sql .= " ORDER BY $sortfield $sortorder " . $db->plimit($conf->liste_limit, $offset); + if ( $db->query($sql) ) { $num = $db->num_rows(); @@ -103,10 +105,11 @@ if ( $db->query($sql) ) print ''; print ""; - print_liste_field_titre("Société",$PHP_SELF,"s.nom"); + print_liste_field_titre("Titre",$PHP_SELF,"p.title"); print ""; - print "RéfTitre"; - print "\n"; + print "Réf"; + print_liste_field_titre("Société",$PHP_SELF,"s.nom"); + print "\n"; while ($i < $num) { @@ -114,9 +117,9 @@ if ( $db->query($sql) ) $var=!$var; print ""; - print "idp\">$objp->nom\n"; - print "projectid\">$objp->ref\n"; print "projectid\">$objp->title\n"; + print "projectid\">$objp->ref\n"; + print "idp\">$objp->nom\n"; print "\n"; $i++; diff --git a/htdocs/compta/index.php3 b/htdocs/compta/index.php3 index 15157ea2aed..29abccbb5fb 100644 --- a/htdocs/compta/index.php3 +++ b/htdocs/compta/index.php3 @@ -169,7 +169,7 @@ print "
"; * */ $sql = "SELECT s.idp, s.nom,b.rowid as bid"; -$sql .= " FROM societe as s, llx_bookmark as b"; +$sql .= " FROM llx_societe as s, llx_bookmark as b"; $sql .= " WHERE b.fk_soc = s.idp AND b.fk_user = ".$user->id; $sql .= " ORDER BY lower(s.nom) ASC"; diff --git a/htdocs/fichinter/index.php3 b/htdocs/fichinter/index.php3 index bf99c10d7eb..2450f814d65 100644 --- a/htdocs/fichinter/index.php3 +++ b/htdocs/fichinter/index.php3 @@ -44,7 +44,7 @@ if ($sortfield == "") print_titre("Liste des fiches d'intervention"); $sql = "SELECT s.nom,s.idp, f.ref,".$db->pdate("f.datei")." as dp, f.rowid as fichid, f.fk_statut, f.duree"; -$sql .= " FROM societe as s, llx_fichinter as f "; +$sql .= " FROM llx_societe as s, llx_fichinter as f "; $sql .= " WHERE f.fk_soc = s.idp "; if ($user->societe_id > 0) {