diff --git a/htdocs/bookmarks/liste.php b/htdocs/bookmarks/liste.php index c5e64bf2e67..5f62d9675c6 100644 --- a/htdocs/bookmarks/liste.php +++ b/htdocs/bookmarks/liste.php @@ -73,7 +73,7 @@ print_fiche_titre($langs->trans("Bookmarks")); if ($mesg) print $mesg; $sql = "SELECT b.fk_soc as idp, ".$db->pdate("b.dateb")." as dateb, b.rowid as bid, b.fk_user, b.url, b.target, b.title, b.favicon,"; -$sql.= " u.name, u.firstname, u.code"; +$sql.= " u.login, u.name, u.firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b, ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE b.fk_user=u.rowid"; if (! $user->admin) $sql.= " AND (b.fk_user = ".$user->id." OR b.fk_user is NULL)"; @@ -151,7 +151,7 @@ if ($resql) print "\n"; // Auteur - print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->code."\n"; + print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->login."\n"; // Date creation print ''.dolibarr_print_date($obj->dateb) .""; diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php index c81f09d6c06..c49dcd7c8a4 100644 --- a/htdocs/comm/action/index.php +++ b/htdocs/comm/action/index.php @@ -65,7 +65,7 @@ llxHeader(); $sql = "SELECT s.nom as societe, s.idp as socid, s.client,"; $sql.= " a.id,".$db->pdate("a.datep")." as dp, a.fk_contact, a.note, a.label, a.percent as percent,"; $sql.= " c.code as acode, c.libelle,"; -$sql.= " u.code, u.rowid as userid"; +$sql.= " u.login, u.rowid as userid"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", sc.fk_soc, sc.fk_user"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."user as u"; if (!$user->rights->commercial->client->voir && !$socid) $sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -122,7 +122,7 @@ if ($resql) print_liste_field_titre($langs->trans("Title"),$_SERVER["PHP_SELF"],"a.label",$param,"","",$sortfield); print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom",$param,"","",$sortfield); print_liste_field_titre($langs->trans("Contact"),$_SERVER["PHP_SELF"],"a.fk_contact",$param,"","",$sortfield); - print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.code",$param,"","",$sortfield); + print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.login",$param,"","",$sortfield); print_liste_field_titre($langs->trans("Status"),$_SERVER["PHP_SELF"],"a.percent",$param,"",'align="right"',$sortfield); print "\n"; $var=true; @@ -201,7 +201,7 @@ if ($resql) print ''; // Auteur - print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''; + print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; // Status/Percent print ''.$actionstatic->LibStatut($obj->percent,5).''; diff --git a/htdocs/comm/action/rapport/rapport.pdf.php b/htdocs/comm/action/rapport/rapport.pdf.php index f7a7a82a021..64c691b1416 100644 --- a/htdocs/comm/action/rapport/rapport.pdf.php +++ b/htdocs/comm/action/rapport/rapport.pdf.php @@ -149,7 +149,7 @@ class CommActionRapport $pdf->SetFont('Arial','',8); $y=$pdf->GetY()+1; - $sql = "SELECT s.nom as societe, s.idp as socid, s.client, a.id,".$this->db->pdate("a.datea")." as da, a.datea, c.libelle, u.code, a.fk_contact, a.note, a.percent as percent"; + $sql = "SELECT s.nom as societe, s.idp as socid, s.client, a.id,".$this->db->pdate("a.datea")." as da, a.datea, c.libelle, u.login, a.fk_contact, a.note, a.percent as percent"; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE a.fk_soc = s.idp AND c.id=a.fk_action AND a.fk_user_author = u.rowid"; diff --git a/htdocs/comm/bookmark.php b/htdocs/comm/bookmark.php index 23ce2fabb13..448817137e2 100644 --- a/htdocs/comm/bookmark.php +++ b/htdocs/comm/bookmark.php @@ -92,7 +92,7 @@ if ($_GET["action"] == 'delete') print_fiche_titre($langs->trans("Bookmarks")); -$sql = "SELECT s.idp, s.nom, ".$db->pdate("b.dateb")." as dateb, b.rowid as bid, b.fk_user, b.url, b.target, u.name, u.firstname, u.code"; +$sql = "SELECT s.idp, s.nom, ".$db->pdate("b.dateb")." as dateb, b.rowid as bid, b.fk_user, b.url, b.target, u.name, u.firstname"; $sql.= " FROM ".MAIN_DB_PREFIX."bookmark as b, ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE b.fk_soc = s.idp AND b.fk_user=u.rowid"; if (! $user->admin) $sql.= " AND b.fk_user = ".$user->id; diff --git a/htdocs/comm/fiche.php b/htdocs/comm/fiche.php index 5a7ba9863b2..2e1d6a0e2c9 100644 --- a/htdocs/comm/fiche.php +++ b/htdocs/comm/fiche.php @@ -760,7 +760,7 @@ if ($socid > 0) $sql.= " ".$db->pdate("a.datep")." as dp,"; $sql.= " ".$db->pdate("a.datea")." as da,"; $sql.= " a.percent,"; - $sql.= " c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; + $sql.= " c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, fk_contact, u.login, u.rowid "; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; $sql.= " WHERE a.fk_soc = ".$objsoc->id; $sql.= " AND u.rowid = a.fk_user_author"; @@ -844,7 +844,7 @@ if ($socid > 0) print ' '; } - print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.''; + print ''.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.''; // Statut print ''.$actionstatic->LibStatut($obj->percent,3).''; @@ -883,7 +883,7 @@ if ($socid > 0) $sql.= " a.percent,"; $sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,"; $sql.= " c.code as acode, c.libelle,"; - $sql.= " u.code, u.rowid"; + $sql.= " u.login, u.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; $sql.= " WHERE a.fk_soc = ".$objsoc->id; $sql.= " AND u.rowid = a.fk_user_author"; @@ -977,7 +977,7 @@ if ($socid > 0) } // Auteur - print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''; + print ''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; // Statut print ''.$actionstatic->LibStatut($obj->percent,3).''; diff --git a/htdocs/comm/prospect/fiche.php b/htdocs/comm/prospect/fiche.php index c380c915626..fbdef715534 100644 --- a/htdocs/comm/prospect/fiche.php +++ b/htdocs/comm/prospect/fiche.php @@ -328,7 +328,7 @@ if ($socid > 0) print ''; print ''; - $sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; + $sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code as acode, c.libelle, u.login, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; $sql .= " WHERE a.fk_soc = ".$societe->id; $sql .= " AND u.rowid = a.fk_user_author"; @@ -410,7 +410,7 @@ if ($socid > 0) print ''; } - print ''; + print ''; print "\n"; $i++; } @@ -427,7 +427,7 @@ if ($socid > 0) print '
'.$langs->trans("ActionsToDo").' 
 '.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.''.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'
'; print ''; - $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, fk_contact, u.code, u.rowid "; + $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, c.code as acode, c.libelle, a.propalrowid, a.fk_user_author, fk_contact, u.login, u.rowid "; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; $sql .= " WHERE a.fk_soc = ".$societe->id; $sql .= " AND u.rowid = a.fk_user_author"; @@ -499,7 +499,7 @@ if ($socid > 0) print ''; } - print ''; + print ''; print "\n"; $i++; } diff --git a/htdocs/comm/remise.php b/htdocs/comm/remise.php index 6723833f676..1190b845d8e 100644 --- a/htdocs/comm/remise.php +++ b/htdocs/comm/remise.php @@ -134,7 +134,7 @@ if ($_socid > 0) * Liste de l'historique des avoirs */ $sql = "SELECT rc.rowid,rc.remise_client,rc.note,".$db->pdate("rc.datec")." as dc,"; - $sql.= " u.rowid as user_id, u.code"; + $sql.= " u.login, u.rowid as user_id"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise as rc, ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE rc.fk_soc =". $objsoc->id; $sql.= " AND u.rowid = rc.fk_user_author"; @@ -162,7 +162,7 @@ if ($_socid > 0) print ''; print ''; print ''; - print ''; + print ''; print ''; $i++; } diff --git a/htdocs/comm/remx.php b/htdocs/comm/remx.php index c48ee73099a..c4e3b50f585 100644 --- a/htdocs/comm/remx.php +++ b/htdocs/comm/remx.php @@ -176,7 +176,7 @@ if ($_socid > 0) * Liste remises fixes restant en cours */ $sql = "SELECT rc.rowid, rc.amount_ht,".$db->pdate("rc.datec")." as dc, rc.description,"; - $sql.= " u.code, u.rowid as user_id"; + $sql.= " u.login, u.rowid as user_id"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc, ".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE rc.fk_soc =". $objsoc->id; $sql.= " AND u.rowid = rc.fk_user AND rc.fk_facture IS NULL"; @@ -205,7 +205,7 @@ if ($_socid > 0) print ''; print ''; print ''; - print ''; + print ''; if ($obj->user_id == $user->id) print ''; else print ''; print ''; @@ -225,7 +225,7 @@ if ($_socid > 0) * Liste ristournes appliquées */ $sql = "SELECT rc.rowid, rc.amount_ht,".$db->pdate("rc.datec")." as dc, rc.description, rc.fk_facture,"; - $sql.= " u.code, u.rowid as user_id,"; + $sql.= " u.login, u.rowid as user_id,"; $sql.= " f.rowid, f.facnumber"; $sql.= " FROM ".MAIN_DB_PREFIX."societe_remise_except as rc"; $sql.= " , ".MAIN_DB_PREFIX."user as u"; @@ -262,7 +262,7 @@ if ($_socid > 0) print ''; print ''; print ''; - print ''; + print ''; print ''; print ''; $i++; diff --git a/htdocs/compta/facture/prelevement.php b/htdocs/compta/facture/prelevement.php index 4a98690467d..856169e3195 100644 --- a/htdocs/compta/facture/prelevement.php +++ b/htdocs/compta/facture/prelevement.php @@ -171,7 +171,7 @@ if ($_GET["facid"] > 0) $sql = "SELECT pfd.rowid, pfd.traite,".$db->pdate("pfd.date_demande")." as date_demande"; $sql .= " ,".$db->pdate("pfd.date_traite")." as date_traite"; $sql .= " , pfd.amount"; - $sql .= " , u.rowid as user_id, u.name, u.firstname, u.code"; + $sql .= " , u.rowid as user_id, u.name, u.firstname, u.login"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE fk_facture = ".$fac->id; @@ -227,7 +227,7 @@ if ($_GET["facid"] > 0) print ''; print ''; print ''; - print ''; + print ''; print ''; print '\n"; - print ''; + print ''; print ''; print ''; diff --git a/htdocs/compta/fiche.php b/htdocs/compta/fiche.php index 151bbdcabbe..0ed40caf537 100644 --- a/htdocs/compta/fiche.php +++ b/htdocs/compta/fiche.php @@ -456,7 +456,7 @@ if ($socid > 0) print ''; $sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, a.percent,"; - $sql.= " c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; + $sql.= " c.code as acode, c.libelle, u.login, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; $sql.= " WHERE a.fk_soc = ".$societe->id; $sql.= " AND u.rowid = a.fk_user_author"; @@ -540,7 +540,7 @@ if ($socid > 0) } // Auteur - print ''; + print ''; // Statut print ''; @@ -568,7 +568,7 @@ if ($socid > 0) $sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da, a.percent,"; $sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,"; $sql.= " c.code as acode, c.libelle,"; - $sql.= " u.code, u.rowid"; + $sql.= " u.login, u.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; $sql.= " WHERE a.fk_soc = ".$societe->id; $sql.= " AND u.rowid = a.fk_user_author"; @@ -654,7 +654,7 @@ if ($socid > 0) } // Auteur - print ''; + print ''; // Statut print ''; diff --git a/htdocs/compta/recap-compta.php b/htdocs/compta/recap-compta.php index af4c824fbb7..a62e6c219e9 100644 --- a/htdocs/compta/recap-compta.php +++ b/htdocs/compta/recap-compta.php @@ -93,7 +93,7 @@ if ($socid > 0) $sql = "SELECT s.nom, s.idp, f.facnumber, f.amount, ".$db->pdate("f.datef")." as df,"; $sql.= " f.paye as paye, f.fk_statut as statut, f.rowid as facid,"; - $sql.= " u.code, u.rowid as userid"; + $sql.= " u.login, u.rowid as userid"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s,".MAIN_DB_PREFIX."facture as f,".MAIN_DB_PREFIX."user as u"; $sql.= " WHERE f.fk_soc = s.idp AND s.idp = ".$societe->id; $sql.= " AND f.fk_user_valid = u.rowid"; @@ -150,13 +150,13 @@ if ($socid > 0) print '\n"; // Auteur - print ''; + print ''; print "\n"; // Paiements $sql = "SELECT p.rowid,".$db->pdate("p.datep")." as dp, pf.amount, p.statut,"; - $sql.= " p.fk_user_creat, u.code, u.rowid as userid"; + $sql.= " p.fk_user_creat, u.login, u.rowid as userid"; $sql.= " FROM ".MAIN_DB_PREFIX."paiement_facture as pf,"; $sql.= " ".MAIN_DB_PREFIX."paiement as p"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u ON p.fk_user_creat = u.rowid"; @@ -185,7 +185,7 @@ if ($socid > 0) print '\n"; // Auteur - print ''; + print ''; print ''; diff --git a/htdocs/contact/fiche.php b/htdocs/contact/fiche.php index 714d8d0b21a..25fd5e6fb09 100644 --- a/htdocs/contact/fiche.php +++ b/htdocs/contact/fiche.php @@ -620,7 +620,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit') // Recherche histo sur actioncomm $sql = "SELECT a.id, ".$db->pdate("a.datea")." as da, a.note, a.percent as percent,"; $sql.= " c.code as acode, c.libelle,"; - $sql.= " u.rowid as user_id, u.code"; + $sql.= " u.rowid as user_id, u.login"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; $sql.= " WHERE fk_contact = ".$contact->id; $sql.= " AND u.rowid = a.fk_user_author"; @@ -638,7 +638,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit') $obj = $db->fetch_object($resql); $histo[$numaction]=array('type'=>'action','id'=>$obj->id,'date'=>$obj->da,'note'=>$obj->note,'percent'=>$obj->percent, 'acode'=>$obj->acode,'libelle'=>$obj->libelle, - 'userid'=>$obj->user_id,'code'=>$obj->code); + 'userid'=>$obj->user_id,'login'=>$obj->login); $numaction++; $i++; } @@ -651,7 +651,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit') // Recherche histo sur mailing $sql = "SELECT m.rowid as id, ".$db->pdate("mc.date_envoi")." as da, m.titre as note, '100' as percent,"; $sql.= " 'AC_EMAILING' as acode,"; - $sql.= " u.rowid as user_id, u.code"; + $sql.= " u.rowid as user_id, u.login"; $sql.= " FROM ".MAIN_DB_PREFIX."mailing as m, ".MAIN_DB_PREFIX."mailing_cibles as mc, ".MAIN_DB_PREFIX."user as u "; $sql.= " WHERE mc.email = '".addslashes($contact->email)."'"; $sql.= " AND mc.statut = 1"; @@ -670,7 +670,7 @@ if ($_GET["id"] && $_GET["action"] != 'edit') $obj = $db->fetch_object($resql); $histo[$numaction]=array('type'=>'mailing','id'=>$obj->id,'date'=>$obj->da,'note'=>$obj->note,'percent'=>$obj->percent, 'acode'=>$obj->acode,'libelle'=>$obj->libelle, - 'userid'=>$obj->user_id,'code'=>$obj->code); + 'userid'=>$obj->user_id,'login'=>$obj->login); $numaction++; $i++; } @@ -724,9 +724,9 @@ if ($_GET["id"] && $_GET["action"] != 'edit') // Author print '"; diff --git a/htdocs/fourn/commande/history.php b/htdocs/fourn/commande/history.php index e0871d0da8b..ab9e26dec2c 100644 --- a/htdocs/fourn/commande/history.php +++ b/htdocs/fourn/commande/history.php @@ -129,7 +129,7 @@ if ($_GET["id"] > 0) print ''; print ''; - $sql = "SELECT l.fk_statut, ".$db->pdate("l.datelog") ."as dl, u.rowid, u.code, u.firstname, u.name"; + $sql = "SELECT l.fk_statut, ".$db->pdate("l.datelog") ."as dl, u.rowid, u.login, u.firstname, u.name"; $sql .= " FROM ".MAIN_DB_PREFIX."commande_fournisseur_log as l "; $sql .= " , ".MAIN_DB_PREFIX."user as u "; $sql .= " WHERE l.fk_commande = ".$commande->id." AND u.rowid = l.fk_user"; @@ -156,7 +156,7 @@ if ($_GET["id"] > 0) // User print ''; + print img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''; print ''; diff --git a/htdocs/fourn/fiche.php b/htdocs/fourn/fiche.php index c8563e03a91..65776010098 100644 --- a/htdocs/fourn/fiche.php +++ b/htdocs/fourn/fiche.php @@ -367,7 +367,7 @@ if ( $societe->fetch($socid) ) print '
'.$langs->trans("ActionsDone").'
 '.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'
'.dolibarr_print_date($obj->dc,"%d %B %Y %H:%M").''.$obj->remise_client.' %'.$obj->note.''.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'
'.dolibarr_print_date($obj->dc).''.$obj->description.''.price($obj->amount_ht).''.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'rowid.'">'.img_delete($langs->trans("RemoveDiscount")).' 
'.img_object($langs->trans("ShowBill"),'bill').' '.$obj->facnumber.''.$obj->description.''.price($obj->amount_ht).''.$obj->code.''.$obj->login.' 
En attente de traitement'.price($obj->amount).'-'.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.' '; print ''; @@ -247,7 +247,7 @@ if ($_GET["facid"] > 0) $sql = "SELECT pfd.rowid, pfd.traite,".$db->pdate("pfd.date_demande")." as date_demande"; $sql .= " ,".$db->pdate("pfd.date_traite")." as date_traite"; $sql .= " , pfd.fk_prelevement_bons, pfd.amount"; - $sql .= " , u.rowid as user_id, u.name, u.firstname, u.code"; + $sql .= " , u.rowid as user_id, u.name, u.firstname, u.login"; $sql .= " FROM ".MAIN_DB_PREFIX."prelevement_facture_demande as pfd"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE fk_facture = ".$fac->id; @@ -278,7 +278,7 @@ if ($_GET["facid"] > 0) print ''.$obj->fk_prelevement_bons."'.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'  
'.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.''.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.''.$actionstatic->LibStatut($obj->percent,3).''.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.''.$actionstatic->LibStatut($obj->percent,3).''.price($solde)."'.img_object($langs->trans("ShowUser"),'user').' '.$objf->code.''.img_object($langs->trans("ShowUser"),'user').' '.$objf->login.'
'.price($solde)."'.img_object($langs->trans("ShowUser"),'user').' '.$objp->code.''.img_object($langs->trans("ShowUser"),'user').' '.$objp->login.'
'; - if ($histo[$key]['code']) + if ($histo[$key]['login']) { - print ''.img_object($langs->trans("ShowUser"),'user').' '.$histo[$key]['code'].''; + print ''.img_object($langs->trans("ShowUser"),'user').' '.$histo[$key]['login'].''; } else print " "; print "'.$langs->trans("Author").'
'; - print img_object($langs->trans("ShowUser"),'user').' '.$obj->code.'
'; print ''; - $sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code as acode, c.libelle, u.code, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; + $sql = "SELECT a.id, a.label, ".$db->pdate("a.datep")." as dp, c.code as acode, c.libelle, u.login, a.propalrowid, a.fk_user_author, fk_contact, u.rowid "; $sql .= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; $sql .= " WHERE a.fk_soc = ".$societe->id; $sql .= " AND u.rowid = a.fk_user_author"; @@ -450,7 +450,7 @@ if ( $societe->fetch($socid) ) } // Auteur - print ''; + print ''; print "\n"; $i++; } @@ -470,7 +470,7 @@ if ( $societe->fetch($socid) ) $sql = "SELECT a.id, a.label, ".$db->pdate("a.datea")." as da,"; $sql.= " a.propalrowid, a.fk_facture, a.fk_user_author, a.fk_contact,"; $sql.= " c.code as acode, c.libelle,"; - $sql.= " u.code, u.rowid"; + $sql.= " u.login, u.rowid"; $sql.= " FROM ".MAIN_DB_PREFIX."actioncomm as a, ".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."user as u "; $sql.= " WHERE a.fk_soc = ".$societe->id; $sql.= " AND u.rowid = a.fk_user_author"; @@ -558,7 +558,7 @@ if ( $societe->fetch($socid) ) } // Auteur - print ''; + print ''; print "\n"; $i++; } diff --git a/htdocs/includes/modules/modUser.class.php b/htdocs/includes/modules/modUser.class.php index b4c20f98082..368af3128a9 100644 --- a/htdocs/includes/modules/modUser.class.php +++ b/htdocs/includes/modules/modUser.class.php @@ -147,9 +147,9 @@ class modUser extends DolibarrModules $r++; $this->export_code[$r]=$this->id.'_'.$r; $this->export_label[$r]='Liste des utilisateurs Dolibarr et attributs'; - $this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.code'=>"Code",'u.login'=>"Login",'u.name'=>"Lastname",'u.firstname'=>"Firstname",'u.office_phone'=>'Tel','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Admin",'u.statut'=>'Status','u.fk_socpeople'=>"IdContact",'u.fk_societe'=>"IdCompany",'u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion'); - $this->export_entities_array[$r]=array('u.rowid'=>"user",'u.code'=>"user",'u.login'=>"user",'u.name'=>"user",'u.firstname'=>"user",'u.office_phone'=>'user','u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.fk_socpeople'=>"contact",'u.fk_societe'=>"company",'u.note'=>"user",'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user'); - $this->export_alias_array[$r]=array('u.rowid'=>"rowid",'u.code'=>"code",'u.login'=>"login",'u.name'=>"name",'u.firstname'=>"firstname",'u.office_phone'=>'tel','u.office_fax'=>'fax','u.email'=>'email','u.datec'=>"datecreation",'u.tms'=>"datelastmodification",'u.admin'=>"admin",'u.statut'=>'status','u.fk_socpeople'=>"idcontact",'u.fk_societe'=>"idcompany",'u.note'=>"note",'u.datelastlogin'=>'datelastlogin','u.datepreviouslogin'=>'datepreviouslogin'); + $this->export_fields_array[$r]=array('u.rowid'=>"Id",'u.login'=>"Login",'u.name'=>"Lastname",'u.firstname'=>"Firstname",'u.office_phone'=>'Tel','u.office_fax'=>'Fax','u.email'=>'EMail','u.datec'=>"DateCreation",'u.tms'=>"DateLastModification",'u.admin'=>"Admin",'u.statut'=>'Status','u.fk_socpeople'=>"IdContact",'u.fk_societe'=>"IdCompany",'u.note'=>"Note",'u.datelastlogin'=>'LastConnexion','u.datepreviouslogin'=>'PreviousConnexion'); + $this->export_entities_array[$r]=array('u.rowid'=>"user",'u.login'=>"user",'u.name'=>"user",'u.firstname'=>"user",'u.office_phone'=>'user','u.office_fax'=>'user','u.email'=>'user','u.datec'=>"user",'u.tms'=>"user",'u.admin'=>"user",'u.statut'=>'user','u.fk_socpeople'=>"contact",'u.fk_societe'=>"company",'u.note'=>"user",'u.datelastlogin'=>'user','u.datepreviouslogin'=>'user'); + $this->export_alias_array[$r]=array('u.rowid'=>"rowid",'u.login'=>"login",'u.name'=>"name",'u.firstname'=>"firstname",'u.office_phone'=>'tel','u.office_fax'=>'fax','u.email'=>'email','u.datec'=>"datecreation",'u.tms'=>"datelastmodification",'u.admin'=>"admin",'u.statut'=>'status','u.fk_socpeople'=>"idcontact",'u.fk_societe'=>"idcompany",'u.note'=>"note",'u.datelastlogin'=>'datelastlogin','u.datepreviouslogin'=>'datepreviouslogin'); $this->export_sql[$r]="select "; $i=0; foreach ($this->export_alias_array[$r] as $key => $value) diff --git a/htdocs/projet/tasks/task.php b/htdocs/projet/tasks/task.php index 49452a608cd..1ad567ba213 100644 --- a/htdocs/projet/tasks/task.php +++ b/htdocs/projet/tasks/task.php @@ -69,7 +69,7 @@ if ($_GET["id"] > 0) /* Liste des tâches */ - $sql = "SELECT t.task_date, t.task_duration, t.fk_user, u.code"; + $sql = "SELECT t.task_date, t.task_duration, t.fk_user, u.login"; $sql .= " FROM ".MAIN_DB_PREFIX."projet_task_time as t"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE t.fk_task =".$task->id; diff --git a/htdocs/societe/commerciaux.php b/htdocs/societe/commerciaux.php index 1a185cb4f41..86260bd0d21 100644 --- a/htdocs/societe/commerciaux.php +++ b/htdocs/societe/commerciaux.php @@ -222,7 +222,7 @@ if($_GET["socid"]) $langs->load("users"); $title=$langs->trans("ListOfUsers"); - $sql = "SELECT u.rowid, u.name, u.firstname, u.code"; + $sql = "SELECT u.rowid, u.name, u.firstname, u.login"; $sql .= " FROM ".MAIN_DB_PREFIX."user as u"; $sql .= " ORDER BY u.name ASC "; @@ -238,7 +238,7 @@ if($_GET["socid"]) print '
'.$langs->trans("ActionsToDoShort").' 
'.img_object($langs->trans("ShowUser"),"user").' '.$obj->code.''.img_object($langs->trans("ShowUser"),"user").' '.$obj->login.'
'.img_object($langs->trans("ShowUser"),'user').' '.$obj->code.''.img_object($langs->trans("ShowUser"),'user').' '.$obj->login.'
'; print ''; print ''; - print ''; + print ''; print ''; print "\n"; @@ -253,7 +253,7 @@ if($_GET["socid"]) print img_object($langs->trans("ShowUser"),"user").' '; print stripslashes($obj->firstname)." " .stripslashes($obj->name)."\n"; print ''; - print ''; + print ''; print ''; print ''."\n"; diff --git a/htdocs/telephonie/client/commentaires.php b/htdocs/telephonie/client/commentaires.php index 20e137678f3..c0ce8c844b5 100644 --- a/htdocs/telephonie/client/commentaires.php +++ b/htdocs/telephonie/client/commentaires.php @@ -135,7 +135,7 @@ if ($_GET["id"]) /* Commentaires */ - $sql = "SELECT c.commentaire, u.firstname, u.name, u.code, c.rowid, c.fk_user"; + $sql = "SELECT c.commentaire, u.firstname, u.name, u.login, c.rowid, c.fk_user"; $sql .= " , ".$db->pdate("c.datec") ." as datec"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_commentaire as c"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; @@ -156,7 +156,7 @@ if ($_GET["id"]) print "\n"; print '\n"; - print '\n"; + print '\n"; print '\n"; } - print '\n"; + print '\n"; print ''; $i++; diff --git a/htdocs/telephonie/contrat/info.php b/htdocs/telephonie/contrat/info.php index 9bed6fe406a..2386d9826de 100644 --- a/htdocs/telephonie/contrat/info.php +++ b/htdocs/telephonie/contrat/info.php @@ -125,13 +125,12 @@ if ($_GET["id"]) $sql = "SELECT s.idp, s.nom, p.fk_contrat, p.montant, p.avance_duree, p.avance_pourcent"; $sql .= ", p.rem_pour_prev, p.rem_pour_autr, p.mode_paiement"; - $sql .= ", u.name, u.firstname, uu.code"; + $sql .= ", u.name, u.firstname, u.login"; $sql .= " , ".$db->pdate("p.datepo") . " as datepo"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_contrat_priseordre as p"; $sql .= " , ".MAIN_DB_PREFIX."telephonie_contrat as c"; $sql .= " , ".MAIN_DB_PREFIX."societe as s"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; - $sql .= " , ".MAIN_DB_PREFIX."user as uu"; $sql .= " WHERE p.fk_commercial =u.rowid"; $sql .= " AND p.fk_user =uu.rowid"; @@ -179,7 +178,7 @@ if ($_GET["id"]) { print ''; } - print ''; + print ''; print "\n"; $i++; diff --git a/htdocs/telephonie/ligne/commentaires.php b/htdocs/telephonie/ligne/commentaires.php index 718a321a479..5bc65a94f79 100644 --- a/htdocs/telephonie/ligne/commentaires.php +++ b/htdocs/telephonie/ligne/commentaires.php @@ -173,7 +173,7 @@ if ($_GET["id"]) /* Commentaires */ - $sql = "SELECT c.commentaire, u.firstname, u.name, u.code, c.rowid, c.fk_user"; + $sql = "SELECT c.commentaire, u.firstname, u.name, u.login, c.rowid, c.fk_user"; $sql .= " , ".$db->pdate("c.datec") ." as datec"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne_comments as c"; $sql .= " , ".MAIN_DB_PREFIX."user as u"; @@ -194,7 +194,7 @@ if ($_GET["id"]) print "\n"; print '\n"; - print '\n"; + print '\n"; print '\n"; print "\n"; print "\n"; - print "\n"; + print "\n"; print "\n"; $i++; } diff --git a/htdocs/telephonie/tarifs/index.php b/htdocs/telephonie/tarifs/index.php index f74d56bdebc..0345b28a055 100644 --- a/htdocs/telephonie/tarifs/index.php +++ b/htdocs/telephonie/tarifs/index.php @@ -73,7 +73,7 @@ $offset = $conf->liste_limit * $page ; $sql = "SELECT d.rowid as grille, d.libelle as tarif_desc, d.type_tarif"; $sql .= " , t.libelle as tarif, t.rowid as tarif_id"; $sql .= " , m.temporel, m.fixe"; -$sql .= " , u.code"; +$sql .= " , u.login"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_tarif_grille as d"; $sql .= "," . MAIN_DB_PREFIX."telephonie_tarif_grille_rights as r"; $sql .= "," . MAIN_DB_PREFIX."telephonie_tarif_montant as m"; @@ -155,7 +155,7 @@ if ($resql) print "\n"; print "\n"; print '\n"; - print '\n"; + print '\n"; print "\n"; $i++; } diff --git a/htdocs/telephonie/tarifs/permissions.php b/htdocs/telephonie/tarifs/permissions.php index 32549c1f595..1f046d82998 100644 --- a/htdocs/telephonie/tarifs/permissions.php +++ b/htdocs/telephonie/tarifs/permissions.php @@ -174,7 +174,7 @@ $offset = $conf->liste_limit * $page ; */ $sql = "SELECT d.rowid as grille, d.libelle as tarif_desc, d.type_tarif"; -$sql .= " , u.code, u.name, u.firstname"; +$sql .= " , u.login, u.name, u.firstname"; $sql .= " , r.pread, r.pwrite"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_tarif_grille as d"; $sql .= "," . MAIN_DB_PREFIX."telephonie_tarif_grille_rights as r"; diff --git a/htdocs/user/group/fiche.php b/htdocs/user/group/fiche.php index 09c44216505..abfad1b0b24 100644 --- a/htdocs/user/group/fiche.php +++ b/htdocs/user/group/fiche.php @@ -274,7 +274,7 @@ else // On sélectionne les users qui ne sont pas déjà dans le groupe $uss = array(); - $sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.code, u.admin"; + $sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; # $sql .= " LEFT JOIN llx_usergroup_user ug ON u.rowid = ug.fk_user"; # $sql .= " WHERE ug.fk_usergroup IS NULL"; @@ -318,7 +318,7 @@ else /* * Membres du groupe */ - $sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.code, u.admin"; + $sql = "SELECT u.rowid, u.login, u.name, u.firstname, u.admin"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u,"; $sql.= " ".MAIN_DB_PREFIX."usergroup_user as ug"; $sql.= " WHERE ug.fk_user = u.rowid"; @@ -338,7 +338,6 @@ else print ''; print ''; print ''; - print ''; print "\n"; if ($num) { $var=True; @@ -354,7 +353,6 @@ else print ''; print ''; print ''; - print '
'.$langs->trans("Name").''.$langs->trans("Code").''.$langs->trans("Login").' 
'.$obj->code.''.$obj->login.''.$langs->trans("Add").'
".strftime("%d/%m/%y %H:%M",$obj->datec); print "'.nl2br(stripslashes($obj->commentaire))."'.$obj->code."'.$obj->login." '; if ($obj->fk_user == $user->id) { diff --git a/htdocs/telephonie/client/tarifs.php b/htdocs/telephonie/client/tarifs.php index 5b20b84e73c..e69ce753895 100644 --- a/htdocs/telephonie/client/tarifs.php +++ b/htdocs/telephonie/client/tarifs.php @@ -267,7 +267,7 @@ if ($_GET["id"]) /* Tarifs */ - $sql = "SELECT t.rowid , t.libelle, tc.temporel, tc.fixe, u.code, tc.rowid, u.code"; + $sql = "SELECT t.rowid , t.libelle, tc.temporel, tc.fixe, u.login, tc.rowid"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_tarif as t"; $sql .= "," . MAIN_DB_PREFIX."telephonie_tarif_client as tc"; $sql .= "," . MAIN_DB_PREFIX."societe as s"; @@ -304,7 +304,7 @@ if ($_GET["id"]) print ''; print img_delete()."'.$obj->code."'.$obj->login."
Autre'.$obj->code.''.$obj->login.'
".strftime("%d/%m/%y %H:%M",$obj->datec); print "'.nl2br(stripslashes($obj->commentaire))."'.$obj->code."'.$obj->login." '; if ($obj->fk_user == $user->id) { diff --git a/htdocs/telephonie/ligne/fiche.php b/htdocs/telephonie/ligne/fiche.php index a135b52e6a4..d167a612ac4 100644 --- a/htdocs/telephonie/ligne/fiche.php +++ b/htdocs/telephonie/ligne/fiche.php @@ -662,7 +662,7 @@ else } $sql = "SELECT ".$db->pdate("l.tms").", l.statut, l.fk_user"; - $sql .= ", u.code, u.code, l.comment, l.fk_fournisseur"; + $sql .= ", u.login, l.comment, l.fk_fournisseur"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_societe_ligne_statut as l"; $sql .= ",".MAIN_DB_PREFIX."user as u"; $sql .= " WHERE u.rowid = l.fk_user AND l.fk_ligne = ".$ligne->id; diff --git a/htdocs/telephonie/tarifs/grille.php b/htdocs/telephonie/tarifs/grille.php index b02a42b42bc..ba5ad3fd691 100644 --- a/htdocs/telephonie/tarifs/grille.php +++ b/htdocs/telephonie/tarifs/grille.php @@ -198,7 +198,7 @@ $offset = $conf->liste_limit * $page ; $sql = "SELECT d.libelle as tarif_desc, d.type_tarif"; $sql .= " , t.libelle as tarif"; $sql .= " , m.temporel, m.fixe, t.rowid"; -$sql .= " , u.code"; +$sql .= " , u.login"; $sql .= " FROM ".MAIN_DB_PREFIX."telephonie_tarif_grille as d"; $sql .= "," . MAIN_DB_PREFIX."telephonie_tarif_montant as m"; $sql .= "," . MAIN_DB_PREFIX."telephonie_tarif as t"; @@ -260,7 +260,7 @@ if ($result) print "".sprintf("%01.4f",$obj->temporel)."".sprintf("%01.4f",$obj->fixe)."".$obj->type_tarif."".$obj->code."".$obj->login."
".sprintf("%01.4f",$obj->temporel)."".sprintf("%01.4f",$obj->fixe)."'.$obj->type_tarif."'.$obj->code."'.$obj->login."
'.$langs->trans("Login").''.$langs->trans("Lastname").''.$langs->trans("Firstname").''.$langs->trans("Code").' 
'.ucfirst(stripslashes($obj->name)).''.ucfirst(stripslashes($obj->firstname)).''.$obj->code.''; if ($user->admin) { diff --git a/htdocs/user/home.php b/htdocs/user/home.php index 78313ba51b6..8e1fdab3c9b 100644 --- a/htdocs/user/home.php +++ b/htdocs/user/home.php @@ -80,7 +80,7 @@ print ''; */ $max=10; -$sql = "SELECT u.rowid, u.name, u.firstname, u.admin, u.login, u.code, u.fk_societe, ".$db->pdate("u.datec")." as datec,"; +$sql = "SELECT u.rowid, u.name, u.firstname, u.admin, u.login, u.fk_societe, ".$db->pdate("u.datec")." as datec,"; $sql.= " u.ldap_sid, s.nom"; $sql.= " FROM ".MAIN_DB_PREFIX."user as u"; $sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON u.fk_societe=s.idp"; diff --git a/htdocs/user/index.php b/htdocs/user/index.php index 5d8e962bc10..e9a30283e50 100644 --- a/htdocs/user/index.php +++ b/htdocs/user/index.php @@ -66,7 +66,7 @@ if ($_POST["search_user"]) { $sql.= " AND (u.name like '%".$_POST["search_user"]."%' OR u.firstname like '%".$_POST["search_user"]."%')"; } -if ($sall) $sql.= " AND (u.login like '%".$sall."%' OR u.name like '%".$sall."%' OR u.firstname like '%".$sall."%' OR u.code like '%".$sall."%' OR u.email like '%".$sall."%' OR u.note like '%".$sall."%')"; +if ($sall) $sql.= " AND (u.login like '%".$sall."%' OR u.name like '%".$sall."%' OR u.firstname like '%".$sall."%' OR u.email like '%".$sall."%' OR u.note like '%".$sall."%')"; if ($sortfield) $sql.=" ORDER BY $sortfield $sortorder"; $result = $db->query($sql); diff --git a/mysql/migration/2.0.0-2.1.0.sql b/mysql/migration/2.0.0-2.1.0.sql index e8ef1d5ec14..2abaa918f33 100644 --- a/mysql/migration/2.0.0-2.1.0.sql +++ b/mysql/migration/2.0.0-2.1.0.sql @@ -715,10 +715,9 @@ alter table llx_user add column office_fax varchar(20); alter table llx_user add column user_mobile varchar(20); alter table llx_user modify login varchar(24) NOT NULL; -alter table llx_user modify code varchar(4) NOT NULL; +alter table llx_user drop code; ALTER TABLE llx_user ADD UNIQUE uk_user_login (login); -ALTER TABLE llx_user ADD UNIQUE uk_user_code (code); alter table llx_boxes add column fk_user integer; diff --git a/mysql/tables/llx_user.key.sql b/mysql/tables/llx_user.key.sql index b38e9efeef0..e937ea04a41 100644 --- a/mysql/tables/llx_user.key.sql +++ b/mysql/tables/llx_user.key.sql @@ -1,6 +1,7 @@ -- ============================================================================ -- Copyright (C) 2003 Rodolphe Quiedeville -- Copyright (C) 2006 Laurent Destailleur +-- Copyright (C) 2007 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 @@ -22,6 +23,4 @@ -- =========================================================================== -ALTER TABLE llx_user ADD UNIQUE uk_user_login (login); -ALTER TABLE llx_user ADD UNIQUE uk_user_code (code); - +ALTER TABLE llx_user ADD UNIQUE uk_user_login (login); \ No newline at end of file diff --git a/mysql/tables/llx_user.sql b/mysql/tables/llx_user.sql index d5434d6fe1d..f29566192b5 100644 --- a/mysql/tables/llx_user.sql +++ b/mysql/tables/llx_user.sql @@ -1,6 +1,7 @@ -- ============================================================================ -- Copyright (C) 2001-2003 Rodolphe Quiedeville -- Copyright (C) 2006 Laurent Destailleur +-- Copyright (C) 2007 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 @@ -30,7 +31,6 @@ create table llx_user pass varchar(32), name varchar(50), firstname varchar(50), - code varchar(4) NOT NULL, office_phone varchar(20), office_fax varchar(20), user_mobile varchar(20),