diff --git a/COPYRIGHT b/COPYRIGHT
index 62a925d436f..e06586aa7c2 100644
--- a/COPYRIGHT
+++ b/COPYRIGHT
@@ -36,7 +36,7 @@ jQuery blockUI 2.43 GPL and MIT Licence Yes JS libra
jQuery jPicker 1.1.00 GPL and MIT Licence Yes JS library for color picker with not defined list of colors
jQuery Layout 1.3.0 GPL and MIT Licence Yes JS library plugin Layout (RC-29.15)
jQuery TableDnD 0.5 GPL and MIT Licence Yes JS library plugin TableDnD (to reorder table rows)
-jQuery Mobile 1.0rc2 GPL and MIT Licence Yes JS library for smartphone (not used)
+jQuery Mobile 1.3 GPL and MIT Licence Yes JS library for smartphone (not used)
jQuery Tiptip 1.3 GPL and MIT Licence Yes JS library for tooltips
JSGantt 1.2 BSD Licence Yes JS library (to build Gantt reports)
diff --git a/ChangeLog b/ChangeLog
index 8a7c97adf97..9509d17c800 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -30,6 +30,8 @@ For developers:
- Add hook getFormMail.
- Function plimit of databases drivers accept -1 as value (it means default value set
into conf->liste_limit).
+- New: Add option dol_hide_topmenu and dol_hide_leftmenu onto login page.
+
For translators:
- Update language files.
diff --git a/dev/test/testdiv.php b/dev/test/testdiv.php
new file mode 100644
index 00000000000..2d6a42ebc14
--- /dev/null
+++ b/dev/test/testdiv.php
@@ -0,0 +1,71 @@
+
+
+
+
+
+
';
diff --git a/htdocs/adherents/stats/geo.php b/htdocs/adherents/stats/geo.php
index 3ea61e50e35..fcb421e14fe 100755
--- a/htdocs/adherents/stats/geo.php
+++ b/htdocs/adherents/stats/geo.php
@@ -100,12 +100,12 @@ if ($mode)
$tab='statstown';
$data = array();
- $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.ville as label2";
+ $sql.="SELECT COUNT(d.rowid) as nb, MAX(d.datevalid) as lastdate, p.code, p.libelle as label, d.town as label2";
$sql.=" FROM ".MAIN_DB_PREFIX."adherent as d";
$sql.=" LEFT JOIN ".MAIN_DB_PREFIX."c_pays as p on d.pays = p.rowid";
$sql.=" WHERE d.entity IN (".getEntity().")";
$sql.=" AND d.statut = 1";
- $sql.=" GROUP BY p.libelle, p.code, d.ville";
+ $sql.=" GROUP BY p.libelle, p.code, d.town";
//print $sql;
}
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index eaddb4866c4..f4a60f55cd9 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -35,7 +35,7 @@ $langs->load("members");
$rowid = GETPOST('rowid','int');
$action = GETPOST('action','alpha');
-$search_lastname = GETPOST('search_nom','alpha');
+$search_lastname = GETPOST('search_lastname','alpha');
$search_login = GETPOST('search_login','alpha');
$search_email = GETPOST('search_email','alpha');
$type = GETPOST('type','alpha');
@@ -49,7 +49,7 @@ $offset = $conf->liste_limit * $page ;
$pageprev = $page - 1;
$pagenext = $page + 1;
if (! $sortorder) { $sortorder="DESC"; }
-if (! $sortfield) { $sortfield="d.nom"; }
+if (! $sortfield) { $sortfield="d.lastname"; }
// Security check
$result=restrictedArea($user,'adherent',$rowid,'adherent_type');
@@ -405,7 +405,7 @@ if ($rowid > 0)
$now=dol_now();
- $sql = "SELECT d.rowid, d.login, d.prenom as firstname, d.nom as lastname, d.societe, ";
+ $sql = "SELECT d.rowid, d.login, d.firstname, d.lastname, d.societe, ";
$sql.= " d.datefin,";
$sql.= " d.email, d.fk_adherent_type as type_id, d.morphy, d.statut,";
$sql.= " t.libelle as type, t.cotisation";
@@ -415,9 +415,9 @@ if ($rowid > 0)
$sql.= " AND t.rowid = ".$adht->id;
if ($sall)
{
- $sql.= " AND (d.prenom LIKE '%".$sall."%' OR d.nom LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
+ $sql.= " AND (d.firstname LIKE '%".$sall."%' OR d.lastname LIKE '%".$sall."%' OR d.societe LIKE '%".$sall."%'";
$sql.= " OR d.email LIKE '%".$sall."%' OR d.login LIKE '%".$sall."%' OR d.address LIKE '%".$sall."%'";
- $sql.= " OR d.ville LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
+ $sql.= " OR d.town LIKE '%".$sall."%' OR d.note LIKE '%".$sall."%')";
}
if ($status != '')
{
@@ -427,12 +427,12 @@ if ($rowid > 0)
{
if (isset($_POST['search']) && $_POST['search'] != '')
{
- $sql.= " AND (d.prenom LIKE '%".$_POST['search']."%' OR d.nom LIKE '%".$_POST['search']."%')";
+ $sql.= " AND (d.firstname LIKE '%".$_POST['search']."%' OR d.lastname LIKE '%".$_POST['search']."%')";
}
}
if (! empty($search_lastname))
{
- $sql.= " AND (d.prenom LIKE '%".$search_lastname."%' OR d.nom LIKE '%".$search_lastname."%')";
+ $sql.= " AND (d.firstname LIKE '%".$search_lastname."%' OR d.lastname LIKE '%".$search_lastname."%')";
}
if (! empty($search_login))
{
@@ -492,8 +492,8 @@ if ($rowid > 0)
$param="&rowid=".$rowid;
if (! empty($status)) $param.="&status=".$status;
- if (! empty($search_lastname)) $param.="&search_nom=".$search_lastname;
- if (! empty($search_firstname)) $param.="&search_prenom=".$search_firstname;
+ if (! empty($search_lastname)) $param.="&search_lastname=".$search_lastname;
+ if (! empty($search_firstname)) $param.="&search_firstname=".$search_firstname;
if (! empty($search_login)) $param.="&search_login=".$search_login;
if (! empty($search_email)) $param.="&search_email=".$search_email;
if (! empty($filter)) $param.="&filter=".$filter;
@@ -508,7 +508,7 @@ if ($rowid > 0)
print '
';
diff --git a/htdocs/admin/confexped.php b/htdocs/admin/confexped.php
index d9be768461f..6653badfb36 100644
--- a/htdocs/admin/confexped.php
+++ b/htdocs/admin/confexped.php
@@ -84,6 +84,10 @@ $head[$h][1] = $langs->trans("Setup");
$hselected=$h;
$h++;
+$head[$h][0] = DOL_URL_ROOT."/admin/carrier.php";
+$head[$h][1] = $langs->trans("Carriers");
+$h++;
+
if (! empty($conf->global->MAIN_SUBMODULE_EXPEDITION))
{
$head[$h][0] = DOL_URL_ROOT."/admin/expedition.php";
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index d5fe7846714..4bd5a1029c8 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -128,20 +128,20 @@ $tablib[24]= "DictionnaryAccountancysystem";
// Requete pour extraction des donnees des dictionnaires
$tabsql=array();
-$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as pays_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
-$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as pays_code, p.libelle as pays, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1";
-$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1";
+$tabsql[1] = "SELECT f.rowid as rowid, f.code, f.libelle, p.code as country_code, p.libelle as pays, f.active FROM ".MAIN_DB_PREFIX."c_forme_juridique as f, ".MAIN_DB_PREFIX."c_pays as p WHERE f.fk_pays=p.rowid";
+$tabsql[2] = "SELECT d.rowid as rowid, d.code_departement as code, d.nom as libelle, d.fk_region as region_id, r.nom as region, p.code as country_code, p.libelle as pays, d.active FROM ".MAIN_DB_PREFIX."c_departements as d, ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE d.fk_region=r.code_region and r.fk_pays=p.rowid and r.active=1 and p.active=1";
+$tabsql[3] = "SELECT r.rowid as rowid, code_region as code, nom as libelle, r.fk_pays as country_id, p.code as country_code, p.libelle as pays, r.active FROM ".MAIN_DB_PREFIX."c_regions as r, ".MAIN_DB_PREFIX."c_pays as p WHERE r.fk_pays=p.rowid and p.active=1";
$tabsql[4] = "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_pays";
$tabsql[5] = "SELECT c.rowid as rowid, c.code as code, c.civilite AS libelle, c.active FROM ".MAIN_DB_PREFIX."c_civilite AS c";
$tabsql[6] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.type, a.active, a.module, a.position FROM ".MAIN_DB_PREFIX."c_actioncomm AS a";
-$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as pays_code, p.libelle as pays, a.fk_pays as pays_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
+$tabsql[7] = "SELECT a.id as rowid, a.code as code, a.libelle AS libelle, a.accountancy_code as accountancy_code, a.deductible, p.code as country_code, p.libelle as pays, a.fk_pays as country_id, a.active FROM ".MAIN_DB_PREFIX."c_chargesociales AS a, ".MAIN_DB_PREFIX."c_pays as p WHERE a.fk_pays=p.rowid and p.active=1";
$tabsql[8] = "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_typent";
$tabsql[9] = "SELECT code_iso as code, label, unicode, active FROM ".MAIN_DB_PREFIX."c_currencies";
-$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as pays_code, t.fk_pays as pays_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
+$tabsql[10]= "SELECT t.rowid, t.taux, t.localtax1_type, t.localtax1, t.localtax2_type, t.localtax2, p.libelle as pays, p.code as country_code, t.fk_pays as country_id, t.recuperableonly, t.note, t.active, t.accountancy_code_sell, t.accountancy_code_buy FROM ".MAIN_DB_PREFIX."c_tva as t, llx_c_pays as p WHERE t.fk_pays=p.rowid";
$tabsql[11]= "SELECT t.rowid as rowid, element, source, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_contact AS t";
$tabsql[12]= "SELECT c.rowid as rowid, code, sortorder, c.libelle, c.libelle_facture, nbjour, fdm, decalage, active FROM ".MAIN_DB_PREFIX.'c_payment_term AS c';
$tabsql[13]= "SELECT id as rowid, code, c.libelle, type, active FROM ".MAIN_DB_PREFIX."c_paiement AS c";
-$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1";
+$tabsql[14]= "SELECT e.rowid as rowid, e.code as code, e.libelle, e.price, e.organization, e.fk_pays as country_id, p.code as country_code, p.libelle as pays, e.active FROM ".MAIN_DB_PREFIX."c_ecotaxe AS e, ".MAIN_DB_PREFIX."c_pays as p WHERE e.fk_pays=p.rowid and p.active=1";
$tabsql[15]= "SELECT rowid as rowid, code, label as libelle, width, height, unit, active FROM ".MAIN_DB_PREFIX."c_paper_format";
$tabsql[16]= "SELECT code, label as libelle, active FROM ".MAIN_DB_PREFIX."c_prospectlevel";
$tabsql[17]= "SELECT id as rowid, code, libelle, active FROM ".MAIN_DB_PREFIX."c_type_fees";
@@ -151,7 +151,7 @@ $tabsql[20]= "SELECT rowid as rowid, code, libelle, active FROM ".MAIN_DB_PREF
$tabsql[21]= "SELECT c.rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_availability AS c";
$tabsql[22]= "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFIX."c_input_reason";
$tabsql[23]= "SELECT rowid as rowid, fk_pcg_version, pcg_type, pcg_subtype, account_number as accountancy_code, account_parent, label, active FROM ".MAIN_DB_PREFIX."accountingaccount";
-$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as pays_id, p.code as pays_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1";
+$tabsql[24]= "SELECT s.rowid as rowid, pcg_version, s.fk_pays as country_id, p.code as country_code, p.libelle as pays, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s, ".MAIN_DB_PREFIX."c_pays as p WHERE s.fk_pays=p.rowid and p.active=1";
// Critere de tri du dictionnaire
$tabsqlsort=array();
@@ -183,19 +183,19 @@ $tabsqlsort[24]="pcg_version ASC";
// Nom des champs en resultat de select pour affichage du dictionnaire
$tabfield=array();
$tabfield[1] = "code,libelle,pays";
-$tabfield[2] = "code,libelle,region_id,region,pays"; // "code,libelle,region,pays_code-pays"
-$tabfield[3] = "code,libelle,pays_id,pays";
+$tabfield[2] = "code,libelle,region_id,region,pays"; // "code,libelle,region,country_code-pays"
+$tabfield[3] = "code,libelle,country_id,pays";
$tabfield[4] = "code,libelle";
$tabfield[5] = "code,libelle";
$tabfield[6] = "code,libelle,type,position";
-$tabfield[7] = "code,libelle,pays_id,pays,accountancy_code,deductible";
+$tabfield[7] = "code,libelle,country_id,pays,accountancy_code,deductible";
$tabfield[8] = "code,libelle";
$tabfield[9] = "code,label,unicode";
$tabfield[10]= "pays_id,pays,taux,recuperableonly,localtax1_type,localtax1,localtax2_type,localtax2,accountancy_code_sell,accountancy_code_buy,note";
$tabfield[11]= "element,source,code,libelle";
$tabfield[12]= "code,libelle,libelle_facture,nbjour,fdm,decalage";
$tabfield[13]= "code,libelle,type";
-$tabfield[14]= "code,libelle,price,organization,pays_id,pays";
+$tabfield[14]= "code,libelle,price,organization,country_id,pays";
$tabfield[15]= "code,libelle,width,height,unit";
$tabfield[16]= "code,libelle";
$tabfield[17]= "code,libelle";
@@ -205,7 +205,7 @@ $tabfield[20]= "code,libelle";
$tabfield[21]= "code,label";
$tabfield[22]= "code,label";
$tabfield[23]= "fk_pcg_version,accountancy_code,account_parent,pcg_type,pcg_subtype,label";
-$tabfield[24]= "pcg_version,pays_id,pays,label";
+$tabfield[24]= "pcg_version,country_id,pays,label";
// Nom des champs d'edition pour modification d'un enregistrement
$tabfieldvalue=array();
@@ -673,8 +673,8 @@ if ($id)
if ($sortfield)
{
- // If sort order is "pays", we use pays_code instead
- if ($sortfield == 'pays') $sortfield='pays_code';
+ // If sort order is "pays", we use country_code instead
+ if ($sortfield == 'pays') $sortfield='country_code';
$sql.= " ORDER BY ".$sortfield;
if ($sortorder)
{
@@ -739,7 +739,7 @@ if ($id)
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
- if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $valuetoshow=''; }
+ if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $valuetoshow=''; }
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); }
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); }
@@ -853,7 +853,7 @@ if ($id)
if ($fieldlist[$field]=='width') { $valuetoshow=$langs->trans("Width"); }
if ($fieldlist[$field]=='height') { $valuetoshow=$langs->trans("Height"); }
if ($fieldlist[$field]=='unit') { $valuetoshow=$langs->trans("MeasuringUnit"); }
- if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') { $showfield=0; }
+ if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') { $showfield=0; }
if ($fieldlist[$field]=='accountancy_code'){ $valuetoshow=$langs->trans("AccountancyCode"); }
if ($fieldlist[$field]=='accountancy_code_sell'){ $valuetoshow=$langs->trans("AccountancyCodeSell"); $sortable=0; }
if ($fieldlist[$field]=='accountancy_code_buy'){ $valuetoshow=$langs->trans("AccountancyCodeBuy"); $sortable=0; }
@@ -923,14 +923,14 @@ if ($id)
$valuetoshow=$langs->trans('All');
}
else if ($fieldlist[$field]=='pays') {
- if (empty($obj->pays_code))
+ if (empty($obj->country_code))
{
$valuetoshow='-';
}
else
{
- $key=$langs->trans("Country".strtoupper($obj->pays_code));
- $valuetoshow=($key != "Country".strtoupper($obj->pays_code)?$obj->pays_code." - ".$key:$obj->pays);
+ $key=$langs->trans("Country".strtoupper($obj->country_code));
+ $valuetoshow=($key != "Country".strtoupper($obj->country_code)?$obj->country_code." - ".$key:$obj->pays);
}
}
else if ($fieldlist[$field]=='recuperableonly' || $fieldlist[$field]=='fdm' || $fieldlist[$field] == 'deductible') {
@@ -1014,7 +1014,7 @@ if ($id)
$key = $langs->trans(strtoupper($obj->code));
$valuetoshow = ($obj->code && $key != strtoupper($obj->code) ? $key : $obj->$fieldlist[$field]);
}
- else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='pays_id') {
+ else if ($fieldlist[$field]=='region_id' || $fieldlist[$field]=='country_id') {
$showfield=0;
}
else if ($fieldlist[$field]=='unicode') {
@@ -1196,12 +1196,12 @@ function fieldList($fieldlist,$obj='',$tabname='')
if ($fieldlist[$field] == 'pays') {
if (in_array('region_id',$fieldlist)) { print '
'; continue; } // For region page, we do not show the country input
print '
";
// Country
if ($soc->pays)
@@ -407,12 +407,12 @@ else if ($id || $ref)
print '
'.$langs->trans("UserTitle").'
'.$member->getCivilityLabel().'
';
print '
';
- // Nom
- print '
'.$langs->trans("Lastname").'
'.$member->nom.'
';
+ // Lastname
+ print '
'.$langs->trans("Lastname").'
'.$member->lastname.'
';
print '
';
- // Prenom
- print '
'.$langs->trans("Firstname").'
'.$member->prenom.'
';
+ // Firstname
+ print '
'.$langs->trans("Firstname").'
'.$member->firstname.'
';
print '
';
// Status
diff --git a/htdocs/categories/viewcat.php b/htdocs/categories/viewcat.php
index 20bf2f81eff..f174f5f4a60 100644
--- a/htdocs/categories/viewcat.php
+++ b/htdocs/categories/viewcat.php
@@ -338,8 +338,8 @@ if ($object->type == 3)
print '
';
print $member->getNomUrl(1);
print "
\n";
- print '
'.$member->nom."
\n";
- print '
'.$member->prenom."
\n";
+ print '
'.$member->lastname."
\n";
+ print '
'.$member->firstname."
\n";
print "\n";
}
}
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index 43278dbaaa2..cf3be8898d7 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -287,7 +287,7 @@ class ActionComm extends CommonObject
$sql.= " a.priority, a.fulldayevent, a.location,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle,";
$sql.= " s.nom as socname,";
- $sql.= " u.firstname, u.name as lastname";
+ $sql.= " u.firstname, u.lastname as lastname";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."user as u on u.rowid = a.fk_user_author";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s on s.rowid = a.fk_soc";
@@ -874,7 +874,7 @@ class ActionComm extends CommonObject
$sql.= " a.fk_contact, a.percent as percentage,";
$sql.= " a.fk_element, a.elementtype,";
$sql.= " a.priority, a.fulldayevent, a.location,";
- $sql.= " u.firstname, u.name,";
+ $sql.= " u.firstname, u.lastname,";
$sql.= " s.nom as socname,";
$sql.= " c.id as type_id, c.code as type_code, c.libelle";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c, ".MAIN_DB_PREFIX."actioncomm as a)";
diff --git a/htdocs/comm/action/index.php b/htdocs/comm/action/index.php
index de55231f101..2a46dbbbae3 100644
--- a/htdocs/comm/action/index.php
+++ b/htdocs/comm/action/index.php
@@ -454,7 +454,7 @@ else
if ($showbirthday)
{
// Add events in array
- $sql = 'SELECT sp.rowid, sp.name, sp.firstname, sp.birthday';
+ $sql = 'SELECT sp.rowid, sp.lastname, sp.firstname, sp.birthday';
$sql.= ' FROM '.MAIN_DB_PREFIX.'socpeople as sp';
$sql.= ' WHERE (priv=0 OR (priv=1 AND fk_user_creat='.$user->id.'))';
$sql.= " AND sp.entity IN (".getEntity('societe', 1).")";
diff --git a/htdocs/comm/action/listactions.php b/htdocs/comm/action/listactions.php
index b25a955abd0..7648c3db989 100644
--- a/htdocs/comm/action/listactions.php
+++ b/htdocs/comm/action/listactions.php
@@ -152,7 +152,7 @@ $sql.= " c.code as acode, c.libelle,";
$sql.= " ua.login as loginauthor, ua.rowid as useridauthor,";
$sql.= " ut.login as logintodo, ut.rowid as useridtodo,";
$sql.= " ud.login as logindone, ud.rowid as useriddone,";
-$sql.= " sp.name, sp.firstname";
+$sql.= " sp.lastname, sp.firstname";
$sql.= " FROM (".MAIN_DB_PREFIX."c_actioncomm as c,";
$sql.= " ".MAIN_DB_PREFIX.'user as u,';
$sql.= " ".MAIN_DB_PREFIX."actioncomm as a)";
diff --git a/htdocs/comm/address.php b/htdocs/comm/address.php
index d9169c85017..0c09c953d9d 100644
--- a/htdocs/comm/address.php
+++ b/htdocs/comm/address.php
@@ -205,7 +205,7 @@ if ($action == 'create')
$object->note = $_POST["note"];
}
- // On positionne pays_id, pays_code et libelle du pays choisi
+ // On positionne country_id, country_code et libelle du pays choisi
$object->country_id = (GETPOST('country_id','int') ? GETPOST('country_id','int') : $mysoc->country_id);
if ($object->country_id)
{
@@ -333,7 +333,7 @@ elseif ($action == 'edit')
$object->fax = $_POST["fax"];
$object->note = $_POST["note"];
- // On positionne country_id, pays_code et libelle du pays choisi
+ // On positionne country_id, country_code et libelle du pays choisi
if ($object->country_id)
{
$tmparray=getCountry($object->country_id,'all');
diff --git a/htdocs/comm/bookmark.php b/htdocs/comm/bookmark.php
index dedfcec4ddd..8baa4678510 100644
--- a/htdocs/comm/bookmark.php
+++ b/htdocs/comm/bookmark.php
@@ -87,7 +87,7 @@ if ($_GET["action"] == 'delete')
print_fiche_titre($langs->trans("Bookmarks"));
-$sql = "SELECT s.rowid, s.nom, b.dateb as dateb, b.rowid as bid, b.fk_user, b.url, b.target, u.name, u.firstname";
+$sql = "SELECT s.rowid, s.nom, b.dateb as dateb, b.rowid as bid, b.fk_user, b.url, b.target, u.lastname, 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.rowid AND b.fk_user=u.rowid";
if (! $user->admin) $sql.= " AND b.fk_user = ".$user->id;
@@ -108,7 +108,7 @@ if ($resql)
print "
";
//print "
";
print_liste_field_titre($langs->trans("Id"),$_SERVER["PHP_SELF"],"bid","","",'align="center"',$sortfield,$sortorder);
- print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.name","","","",$sortfield,$sortorder);
+ print_liste_field_titre($langs->trans("Author"),$_SERVER["PHP_SELF"],"u.lastname","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Date"),$_SERVER["PHP_SELF"],"b.dateb","","",'align="center"',$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Company"),$_SERVER["PHP_SELF"],"s.nom","","","",$sortfield,$sortorder);
print_liste_field_titre($langs->trans("Url"),$_SERVER["PHP_SELF"],"b.url","","",'',$sortfield,$sortorder);
diff --git a/htdocs/comm/contact.php b/htdocs/comm/contact.php
index 98f12489fea..e55f88de7aa 100644
--- a/htdocs/comm/contact.php
+++ b/htdocs/comm/contact.php
@@ -39,7 +39,7 @@ $offset = $limit * $page ;
$type=GETPOST('type', 'alpha');
$search_lastname=GETPOST('search_nom')?GETPOST('search_nom'):GETPOST('search_lastname'); // For backward compatibility
-$search_firstname=GETPOST('search_prenom')?GETPOST('search_prenom'):GETPOST('search_firstname'); // For backward compatibility
+$search_firstname=GETPOST('search_firstname')?GETPOST('search_firstname'):GETPOST('search_firstname'); // For backward compatibility
$search_company=GETPOST('search_societe')?GETPOST('search_societe'):GETPOST('search_company'); // For backward compatibility
$contactname=GETPOST('contactname');
diff --git a/htdocs/comm/list.php b/htdocs/comm/list.php
index fd7ea79f345..e7d6cd2811d 100755
--- a/htdocs/comm/list.php
+++ b/htdocs/comm/list.php
@@ -48,7 +48,7 @@ if (! $sortfield) $sortfield="s.nom";
$search_nom=GETPOST("search_nom");
$search_zipcode=GETPOST("search_zipcode");
-$search_ville=GETPOST("search_ville");
+$search_town=GETPOST("search_town");
$search_code=GETPOST("search_code");
$search_compta=GETPOST("search_compta");
@@ -77,7 +77,7 @@ if (GETPOST("button_removefilter_x"))
$socname="";
$search_nom="";
$search_zipcode="";
- $search_ville="";
+ $search_town="";
$search_idprof1='';
$search_idprof2='';
$search_idprof3='';
@@ -96,7 +96,7 @@ $thirdpartystatic=new Societe($db);
$help_url='EN:Module_Third_Parties|FR:Module_Tiers|ES:Empresas';
llxHeader('',$langs->trans("ThirdParty"),$help_url);
-$sql = "SELECT s.rowid, s.nom as name, s.client, s.cp as zip, s.ville, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
+$sql = "SELECT s.rowid, s.nom as name, s.client, s.zip, s.town, st.libelle as stcomm, s.prefix_comm, s.code_client, s.code_compta, s.status as status,";
$sql.= " s.datec, s.datea, s.canvas";
// We'll need these fields in order to filter by sale (including the case where the user can only see his prospects)
if ($search_sale) $sql .= ", sc.fk_soc, sc.fk_user";
@@ -116,8 +116,8 @@ if ($catid == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_categ > 0) $sql.= " AND cs.fk_categorie = ".$search_categ;
if ($search_categ == -2) $sql.= " AND cs.fk_categorie IS NULL";
if ($search_nom) $sql.= " AND s.nom LIKE '%".$db->escape($search_nom)."%'";
-if ($search_zipcode) $sql.= " AND s.cp LIKE '".$db->escape($search_zipcode)."%'";
-if ($search_ville) $sql.= " AND s.ville LIKE '%".$db->escape($search_ville)."%'";
+if ($search_zipcode) $sql.= " AND s.zip LIKE '".$db->escape($search_zipcode)."%'";
+if ($search_town) $sql.= " AND s.town LIKE '%".$db->escape($search_town)."%'";
if ($search_code) $sql.= " AND s.code_client LIKE '%".$db->escape($search_code)."%'";
if ($search_compta) $sql.= " AND s.code_compta LIKE '%".$db->escape($search_compta)."%'";
// Insert sale filter
@@ -142,7 +142,7 @@ if ($result)
{
$num = $db->num_rows($result);
- $param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_ville=".$search_ville;
+ $param = "&search_nom=".$search_nom."&search_code=".$search_code."&search_zipcode=".$search_zipcode."&search_town=".$search_town;
if ($search_categ != '') $param.='&search_categ='.$search_categ;
if ($search_sale != '') $param.='&search_sale='.$search_sale;
@@ -177,8 +177,8 @@ if ($result)
print '
';
diff --git a/htdocs/compta/prelevement/class/bonprelevement.class.php b/htdocs/compta/prelevement/class/bonprelevement.class.php
index 4182e66c919..0c0c55ebf57 100644
--- a/htdocs/compta/prelevement/class/bonprelevement.class.php
+++ b/htdocs/compta/prelevement/class/bonprelevement.class.php
@@ -540,7 +540,7 @@ class BonPrelevement extends CommonObject
$this->method_trans = $method;
$langs->load('withdrawals');
$subject = $langs->trans("InfoTransSubject", $this->ref);
- $message = $langs->trans("InfoTransMessage", $this->ref, $user->prenom, $user->nom);
+ $message = $langs->trans("InfoTransMessage", $this->ref, $user->firstname, $user->lastname);
$message .=$langs->trans("InfoTransData", price($this->amount), $this->methodes_trans[$this->method_trans], dol_print_date($date,'day'));
// TODO Call trigger to create a notification using notification module
diff --git a/htdocs/compta/stats/cabyuser.php b/htdocs/compta/stats/cabyuser.php
index dc33cd1aa14..a8bc8b56e64 100644
--- a/htdocs/compta/stats/cabyuser.php
+++ b/htdocs/compta/stats/cabyuser.php
@@ -135,7 +135,7 @@ report_header($nom,$nomlink,$period,$periodlink,$description,$builddate,$exportl
$catotal=0;
if ($modecompta == 'CREANCES-DETTES')
{
- $sql = "SELECT u.rowid as rowid, u.name as name, u.firstname as firstname, sum(f.total) as amount, sum(f.total_ttc) as amount_ttc";
+ $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(f.total) as amount, sum(f.total_ttc) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid";
$sql.= " WHERE f.fk_statut in (1,2)";
@@ -149,7 +149,7 @@ else
* Liste des paiements (les anciens paiements ne sont pas vus par cette requete car, sur les
* vieilles versions, ils n'etaient pas lies via paiement_facture. On les ajoute plus loin)
*/
- $sql = "SELECT u.rowid as rowid, u.name as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
+ $sql = "SELECT u.rowid as rowid, u.lastname as name, u.firstname as firstname, sum(pf.amount) as amount_ttc";
$sql.= " FROM ".MAIN_DB_PREFIX."user as u" ;
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."facture as f ON f.fk_user_author = u.rowid ";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."paiement_facture as pf ON pf.fk_facture = f.rowid";
@@ -159,7 +159,7 @@ else
}
$sql.= " AND f.entity = ".$conf->entity;
if ($socid) $sql.= " AND f.fk_soc = ".$socid;
-$sql .= " GROUP BY u.rowid, u.name, u.firstname";
+$sql .= " GROUP BY u.rowid, u.lastname, u.firstname";
$sql .= " ORDER BY u.rowid";
$result = $db->query($sql);
diff --git a/htdocs/contact/canvas/actions_contactcard_common.class.php b/htdocs/contact/canvas/actions_contactcard_common.class.php
index 1bb8a29ad5a..bc918816dc6 100644
--- a/htdocs/contact/canvas/actions_contactcard_common.class.php
+++ b/htdocs/contact/canvas/actions_contactcard_common.class.php
@@ -395,10 +395,10 @@ abstract class ActionsContactCardCommon
if ($action == 'create_user')
{
- // Full firstname and name separated with a dot : firstname.name
+ // Full firstname and lastname separated with a dot : firstname.lastname
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
- $login=dol_buildlogin($this->object->nom, $this->object->prenom);
+ $login=dol_buildlogin($this->object->lastname, $this->object->firstname);
$generated_password=getRandomPassword('');
$password=$generated_password;
@@ -459,7 +459,6 @@ abstract class ActionsContactCardCommon
{
dol_print_error($this->db);
}
- $this->object->pays_code = $obj->code;
$this->object->pays = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
$this->object->country_code = $obj->code;
$this->object->country = $langs->trans("Country".$obj->code)?$langs->trans("Country".$obj->code):$obj->libelle;
diff --git a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php
index 971388d62c8..d0ad081e92e 100644
--- a/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php
+++ b/htdocs/contact/canvas/default/tpl/contactcard_view.tpl.php
@@ -65,7 +65,7 @@ dol_htmloutput_errors($this->control->tpl['error'],$this->control->tpl['errors']
';
@@ -811,9 +810,9 @@ else
if ($action == 'create_user')
{
- // Full firstname and name separated with a dot : firstname.name
+ // Full firstname and lastname separated with a dot : firstname.lastname
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- $login=dol_buildlogin($object->nom,$object->prenom);
+ $login=dol_buildlogin($object->lastname,$object->firstname);
$generated_password='';
if (! $ldap_sid) // TODO ldap_sid ?
@@ -881,11 +880,11 @@ else
dol_print_address($object->address,'gmap','contact',$object->id);
print '';
- // Zip Town
+ // Zip/Town
print '
';
}
diff --git a/htdocs/contact/vcard.php b/htdocs/contact/vcard.php
index 0448bb519e0..be1b820cb60 100644
--- a/htdocs/contact/vcard.php
+++ b/htdocs/contact/vcard.php
@@ -54,8 +54,8 @@ $v->setPhoneNumber($contact->phone_pro, "PREF;WORK;VOICE");
$v->setPhoneNumber($contact->phone_mobile, "CELL;VOICE");
$v->setPhoneNumber($contact->fax, "WORK;FAX");
-$v->setAddress("", "", $contact->address, $contact->ville, "", $contact->cp, ($contact->pays_code?$contact->pays:''), "WORK;POSTAL");
-$v->setLabel("", "", $contact->address, $contact->ville, "", $contact->cp, ($contact->pays_code?$contact->pays:''), "WORK");
+$v->setAddress("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->pays:''), "WORK;POSTAL");
+$v->setLabel("", "", $contact->address, $contact->town, "", $contact->zip, ($contact->country_code?$contact->pays:''), "WORK");
$v->setEmail($contact->email,'internet,pref');
$v->setNote($contact->note);
@@ -67,7 +67,7 @@ if ($company->id)
$v->setURL($company->url, "WORK");
if (! $contact->phone_pro) $v->setPhoneNumber($company->tel, "WORK;VOICE");
if (! $contact->fax) $v->setPhoneNumber($company->fax, "WORK;FAX");
- if (! $contact->cp) $v->setAddress("", "", $company->address, $company->ville, "", $company->cp, $company->pays_code, "WORK;POSTAL");
+ if (! $contact->zip) $v->setAddress("", "", $company->address, $company->town, "", $company->zip, $company->country_code, "WORK;POSTAL");
if ($company->email != $contact->email) $v->setEmail($company->email,'internet');
// Si contact lie a un tiers non de type "particulier"
if ($contact->typent_code != 'TE_PRIVATE') $v->setOrg($company->nom);
diff --git a/htdocs/core/ajax/ziptown.php b/htdocs/core/ajax/ziptown.php
index e7dc07f99da..1f4b6acb6fb 100644
--- a/htdocs/core/ajax/ziptown.php
+++ b/htdocs/core/ajax/ziptown.php
@@ -77,16 +77,16 @@ if (! empty($_GET['zipcode']) || ! empty($_GET['town']))
}
else // Use table of third parties
{
- $sql = "SELECT DISTINCT s.cp as zip, s.ville as town, s.fk_departement as fk_county, s.fk_pays as fk_country";
+ $sql = "SELECT DISTINCT s.zip, s.town, s.fk_departement as fk_county, s.fk_pays as fk_country";
$sql.= ", p.code as country_code, p.libelle as country";
$sql.= ", d.code_departement as county_code , d.nom as county";
$sql.= " FROM ".MAIN_DB_PREFIX.'societe as s';
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX ."c_departements as d ON fk_departement = d.rowid";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX.'c_pays as p ON fk_pays = p.rowid';
$sql.= " WHERE";
- if ($zipcode) $sql.= " s.cp LIKE '".$db->escape($zipcode)."%'";
- if ($town) $sql.= " s.ville LIKE '%" . $db->escape($town) . "%'";
- $sql.= " ORDER BY s.fk_pays, s.cp, s.ville";
+ if ($zipcode) $sql.= " s.zip LIKE '".$db->escape($zipcode)."%'";
+ if ($town) $sql.= " s.town LIKE '%" . $db->escape($town) . "%'";
+ $sql.= " ORDER BY s.fk_pays, s.zip, s.town";
$sql.= $db->plimit(50); // Avoid pb with bad criteria
}
diff --git a/htdocs/core/antispamimage.php b/htdocs/core/antispamimage.php
index cbce684a88d..a8830a5a4eb 100644
--- a/htdocs/core/antispamimage.php
+++ b/htdocs/core/antispamimage.php
@@ -26,6 +26,7 @@ define('NOLOGIN',1);
if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER',1);
if (! defined('NOREQUIREDB')) define('NOREQUIREDB',1);
if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN',1);
+if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC',1);
if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php
index 4d9ec0e600c..817fec968da 100644
--- a/htdocs/core/boxes/box_comptes.php
+++ b/htdocs/core/boxes/box_comptes.php
@@ -76,7 +76,7 @@ class box_comptes extends ModeleBoxes
{
$sql = "SELECT rowid, ref, label, bank, number, courant, clos, rappro, url,";
$sql.= " code_banque, code_guichet, cle_rib, bic, iban_prefix,";
- $sql.= " domiciliation, proprio, adresse_proprio,";
+ $sql.= " domiciliation, proprio, owner_address,";
$sql.= " account_number, currency_code,";
$sql.= " min_allowed, min_desired, comment";
$sql.= " FROM ".MAIN_DB_PREFIX."bank_account";
diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php
index 2bbd8f8bf11..99f7560a15e 100755
--- a/htdocs/core/boxes/box_contacts.php
+++ b/htdocs/core/boxes/box_contacts.php
@@ -61,7 +61,7 @@ class box_contacts extends ModeleBoxes
if ($user->rights->societe->lire)
{
- $sql = "SELECT sp.rowid, sp.name, sp.firstname, sp.civilite, sp.datec, sp.tms, sp.fk_soc,";
+ $sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.civilite, sp.datec, sp.tms, sp.fk_soc,";
$sql.= " s.nom as socname";
$sql.= " FROM ".MAIN_DB_PREFIX."socpeople as sp";
$sql.= " LEFT JOIN ".MAIN_DB_PREFIX."societe as s ON sp.fk_soc = s.rowid";
diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php
index 1692abffe0a..7add5a76939 100755
--- a/htdocs/core/boxes/box_members.php
+++ b/htdocs/core/boxes/box_members.php
@@ -78,7 +78,7 @@ class box_members extends ModeleBoxes
if ($user->rights->societe->lire)
{
- $sql = "SELECT a.rowid, a.nom as lastname, a.prenom as firstname, a.societe as company, a.fk_soc,";
+ $sql = "SELECT a.rowid, a.lastname, a.firstname, a.societe as company, a.fk_soc,";
$sql.= " a.datec, a.tms, a.statut as status, a.datefin as date_end_subscription,";
$sql.= " t.cotisation";
$sql.= " FROM ".MAIN_DB_PREFIX."adherent as a, ".MAIN_DB_PREFIX."adherent_type as t";
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index a9337c87b8b..fd8e38ae3c4 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -85,8 +85,8 @@ class CMailFile
* CMailFile
*
* @param string $subject Topic/Subject of mail
- * @param string $to Recipients emails (RFC 2822: "Nom prenom [, ...]" ou "email[, ...]" ou "[, ...]")
- * @param string $from Sender email (RFC 2822: "Nom prenom [, ...]" ou "email[, ...]" ou "[, ...]")
+ * @param string $to Recipients emails (RFC 2822: "Nom firstname [, ...]" ou "email[, ...]" ou "[, ...]")
+ * @param string $from Sender email (RFC 2822: "Nom firstname [, ...]" ou "email[, ...]" ou "[, ...]")
* @param string $msg Message
* @param array $filename_list List of files to attach (full path of filename on file system)
* @param array $mimetype_list List of MIME type of attached files
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 8184e186999..764eb19b66e 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -64,7 +64,7 @@ abstract class CommonObject
$lastname=$this->lastname;
$firstname=$this->firstname;
if (empty($lastname)) $lastname=($this->name?$this->name:$this->nom);
- if (empty($firstname)) $firstname=$this->prenom;
+ if (empty($firstname)) $firstname=$this->firstname;
$ret='';
if ($option && $this->civilite_id)
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 685dfa93b9a..2ea053062b0 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -218,10 +218,10 @@ class Conf
$this->bank->cheque = new stdClass();
// Clean some variables
- if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD="eldy_backoffice.php";
- if (empty($this->global->MAIN_MENUFRONT_STANDARD)) $this->global->MAIN_MENUFRONT_STANDARD="eldy_frontoffice.php";
- if (empty($this->global->MAIN_MENU_SMARTPHONE)) $this->global->MAIN_MENU_SMARTPHONE="eldy_backoffice.php"; // Use eldy by default because smartphone does not work on all phones
- if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) $this->global->MAIN_MENUFRONT_SMARTPHONE="eldy_frontoffice.php"; // Ue eldy by default because smartphone does not work on all phones
+ if (empty($this->global->MAIN_MENU_STANDARD)) $this->global->MAIN_MENU_STANDARD="eldy_menu.php";
+ if (empty($this->global->MAIN_MENUFRONT_STANDARD)) $this->global->MAIN_MENUFRONT_STANDARD="eldy_menu.php";
+ if (empty($this->global->MAIN_MENU_SMARTPHONE)) $this->global->MAIN_MENU_SMARTPHONE="eldy_menu.php"; // Use eldy by default because smartphone does not work on all phones
+ if (empty($this->global->MAIN_MENUFRONT_SMARTPHONE)) $this->global->MAIN_MENUFRONT_SMARTPHONE="eldy_menu.php"; // Use eldy by default because smartphone does not work on all phones
// Variable globales LDAP
if (empty($this->global->LDAP_FIELD_FULLNAME)) $this->global->LDAP_FIELD_FULLNAME='';
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 2d46eec81dc..268a5d712d3 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -444,7 +444,7 @@ class Form
* @param string $htmloption Options html on select object
* @return void
*/
- function select_pays($selected='',$htmlname='pays_id',$htmloption='')
+ function select_pays($selected='',$htmlname='country_id',$htmloption='')
{
print $this->select_country($selected,$htmlname,$htmloption);
}
@@ -458,7 +458,7 @@ class Form
* @param string $maxlength Max length for labels (0=no limit)
* @return string HTML string with select
*/
- function select_country($selected='',$htmlname='pays_id',$htmloption='',$maxlength=0)
+ function select_country($selected='',$htmlname='country_id',$htmloption='',$maxlength=0)
{
global $conf,$langs;
@@ -825,11 +825,12 @@ class Form
* @param string $showsoc Add company into label
* @param int $forcecombo Force to use combo box
* @param array $event Event options. Example: array(array('method'=>'getContacts', 'url'=>dol_buildpath('/core/ajax/contacts.php',1), 'htmlname'=>'contactid', 'params'=>array('add-customer-contact'=>'disabled')))
+ * @param bool $options_only Return options only (for ajax treatment)
* @return int <0 if KO, Nb of contact in list if OK
*/
- function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $event=array())
+ function select_contacts($socid,$selected='',$htmlname='contactid',$showempty=0,$exclude='',$limitto='',$showfunction=0, $moreclass='', $showsoc=0, $forcecombo=0, $event=array(), $options_only=false)
{
- print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $showsoc, $forcecombo, $event);
+ print $this->selectcontacts($socid,$selected,$htmlname,$showempty,$exclude,$limitto,$showfunction, $moreclass, $options_only, $showsoc, $forcecombo, $event);
return $this->num;
}
@@ -859,7 +860,7 @@ class Form
$out='';
// On recherche les societes
- $sql = "SELECT sp.rowid, sp.name as name, sp.firstname, sp.poste";
+ $sql = "SELECT sp.rowid, sp.lastname, sp.firstname, sp.poste";
if ($showsoc > 0) {
$sql.= " , s.nom as company";
}
@@ -869,7 +870,7 @@ class Form
}
$sql.= " WHERE sp.entity IN (".getEntity('societe', 1).")";
if ($socid > 0) $sql.= " AND sp.fk_soc=".$socid;
- $sql.= " ORDER BY sp.name ASC";
+ $sql.= " ORDER BY sp.lastname ASC";
dol_syslog(get_class($this)."::select_contacts sql=".$sql);
$resql=$this->db->query($sql);
@@ -877,7 +878,7 @@ class Form
{
$num=$this->db->num_rows($resql);
- if ($conf->use_javascript_ajax && $conf->global->CONTACT_USE_SEARCH_TO_SELECT && ! $forcecombo)
+ if ($conf->use_javascript_ajax && $conf->global->CONTACT_USE_SEARCH_TO_SELECT && ! $forcecombo && ! $options_only)
{
$out.= ajax_combobox($htmlname, $event);
}
@@ -1004,7 +1005,7 @@ class Form
$out='';
// On recherche les utilisateurs
- $sql = "SELECT DISTINCT u.rowid, u.name as lastname, u.firstname, u.login, u.admin, u.entity";
+ $sql = "SELECT DISTINCT u.rowid, u.lastname as lastname, u.firstname, u.login, u.admin, u.entity";
if (! empty($conf->multicompany->enabled) && $conf->entity == 1 && $user->admin && ! $user->entity)
{
$sql.= ", e.label";
@@ -1032,7 +1033,7 @@ class Form
if (! empty($user->societe_id)) $sql.= " AND u.fk_societe = ".$user->societe_id;
if (is_array($exclude) && $excludeUsers) $sql.= " AND u.rowid NOT IN ('".$excludeUsers."')";
if (is_array($include) && $includeUsers) $sql.= " AND u.rowid IN ('".$includeUsers."')";
- $sql.= " ORDER BY u.name ASC";
+ $sql.= " ORDER BY u.lastname ASC";
dol_syslog(get_class($this)."::select_dolusers sql=".$sql);
$resql=$this->db->query($sql);
diff --git a/htdocs/core/class/html.formother.class.php b/htdocs/core/class/html.formother.class.php
index d07360a3503..e5c1f2e6a2f 100644
--- a/htdocs/core/class/html.formother.class.php
+++ b/htdocs/core/class/html.formother.class.php
@@ -299,7 +299,7 @@ class FormOther
$moreforfilter.='';
// Get list of users allowed to be viewed
- $sql_usr = "SELECT u.rowid, u.name as name, u.firstname, u.login";
+ $sql_usr = "SELECT u.rowid, u.lastname as name, u.firstname, u.login";
$sql_usr.= " FROM ".MAIN_DB_PREFIX."user as u";
$sql_usr.= " WHERE u.entity IN (0,".$conf->entity.")";
if (empty($user->rights->user->user->lire)) $sql_usr.=" AND u.fk_societe = ".($user->societe_id?$user->societe_id:0);
diff --git a/htdocs/core/class/ldap.class.php b/htdocs/core/class/ldap.class.php
index 08838321288..9f18a477bed 100644
--- a/htdocs/core/class/ldap.class.php
+++ b/htdocs/core/class/ldap.class.php
@@ -874,9 +874,10 @@ class Ldap
* @param string $useridentifier Name of key field (Ex: uid)
* @param array $attributeArray Array of fields required. Note this array must also contains field $useridentifier (Ex: sn,userPassword)
* @param int $activefilter 1=use field this->filter as filter instead of parameter $search
+ * @param array $attributeAsArray Array of fields wanted as an array not a string
* @return array Array of [id_record][ldap_field]=value
*/
- function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0)
+ function getRecords($search, $userDn, $useridentifier, $attributeArray, $activefilter=0, $attributeAsArray=array())
{
$fulllist=array();
@@ -955,7 +956,15 @@ class Ldap
}
else
{
- $fulllist[$recordid][$attributeArray[$j]] = $this->convToOutputCharset($info[$i][$keyattributelower][0],$this->ldapcharset);
+ if(in_array($attributeArray[$j], $attributeAsArray) && is_array($info[$i][$keyattributelower])) {
+ $valueTab = array();
+ foreach($info[$i][$keyattributelower] as $key => $value) {
+ $valueTab[$key] = $this->convToOutputCharset($value,$this->ldapcharset);
+ }
+ $fulllist[$recordid][$attributeArray[$j]] = $valueTab;
+ } else {
+ $fulllist[$recordid][$attributeArray[$j]] = $this->convToOutputCharset($info[$i][$keyattributelower][0],$this->ldapcharset);
+ }
}
}
}
diff --git a/htdocs/core/class/menubase.class.php b/htdocs/core/class/menubase.class.php
index 549b5b8f956..7ae947ee518 100644
--- a/htdocs/core/class/menubase.class.php
+++ b/htdocs/core/class/menubase.class.php
@@ -385,19 +385,16 @@ class Menubase
*/
function menuTopCharger($mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)
{
- global $langs, $user, $conf;
- global $mainmenu,$leftmenu; // To export to dol_eval function
+ global $langs, $user, $conf; // To export to dol_eval function
+ global $mainmenu,$leftmenu; // To export to dol_eval function
$mainmenu=$mymainmenu; // To export to dol_eval function
$leftmenu=$myleftmenu; // To export to dol_eval function
$newTabMenu=array();
- if (is_array($tabMenu))
+ foreach($tabMenu as $val)
{
- foreach($tabMenu as $val)
- {
- if ($val['type']=='top') $newTabMenu[]=$val;
- }
+ if ($val['type']=='top') $newTabMenu[]=$val;
}
return $newTabMenu;
@@ -411,80 +408,78 @@ class Menubase
* @param string $myleftmenu Value for leftmenu to filter menu to load (always '')
* @param int $type_user 0=Menu for backoffice, 1=Menu for front office
* @param string $menu_handler Filter on name of menu_handler used (auguria, eldy...)
- * @param array &$tabMenu If array with menu entries already loaded, we put this array here (in most cases, it's empty)
+ * @param array &$tabMenu Array with menu entries already loaded
* @return array Menu array for particular mainmenu value or full tabArray
*/
function menuLeftCharger($newmenu, $mymainmenu, $myleftmenu, $type_user, $menu_handler, &$tabMenu)
{
- global $langs, $user, $conf; // To export to dol_eval function
- global $mainmenu,$leftmenu; // To export to dol_eval function
-
- // We initialize newmenu with first already found menu entries
- $this->newmenu = $newmenu;
+ global $langs, $user, $conf; // To export to dol_eval function
+ global $mainmenu,$leftmenu; // To export to dol_eval function
$mainmenu=$mymainmenu; // To export to dol_eval function
$leftmenu=$myleftmenu; // To export to dol_eval function
- if (is_array($tabMenu))
+ // Detect what is top mainmenu id
+ $menutopid='';
+ foreach($tabMenu as $key => $val)
{
- $menutopid='';
- foreach($tabMenu as $key => $val)
- {
- // Define menutopid of mainmenu
- if (empty($menutopid) && $val['type'] == 'top' && $val['mainmenu'] == $mainmenu)
- {
- $menutopid=$val['rowid'];
- break;
- }
- }
+ // Define menutopid of mainmenu
+ if (empty($menutopid) && $val['type'] == 'top' && $val['mainmenu'] == $mainmenu)
+ {
+ $menutopid=$val['rowid'];
+ break;
+ }
+ }
- // Now edit this->newmenu->list to add entries found into tabMenu that are childs of mainmenu claimed, using the fk_menu link (old method)
- $this->recur($tabMenu, $menutopid, 1);
+ // We initialize newmenu with first already found menu entries
+ $this->newmenu = $newmenu;
- // Now update this->newmenu->list when fk_menu value is -1 (left menu added by modules with no top menu)
- foreach($tabMenu as $key => $val)
- {
- //var_dump($tabMenu);
- if ($val['fk_menu'] == -1 && $val['fk_mainmenu'] == $mainmenu) // We found a menu entry not linked to parent with good mainmenu
- {
- //print 'Try to add menu (current is mainmenu='.$mainmenu.' leftmenu='.$leftmenu.') for '.join(',',$val).' fk_mainmenu='.$val['fk_mainmenu'].' fk_leftmenu='.$val['fk_leftmenu'].' ';
- //var_dump($this->newmenu->liste);exit;
+ // Now edit this->newmenu->list to add entries found into tabMenu that are childs of mainmenu claimed, using the fk_menu link (old method)
+ $this->recur($tabMenu, $menutopid, 1);
- if (empty($val['fk_leftmenu']))
- {
- $this->newmenu->add($val['url'], $val['titre'], 0, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu']); // TODO Add position
- //var_dump($this->newmenu->liste);
- }
- else
- {
- // Search first menu with this couple (mainmenu,leftmenu)=(fk_mainmenu,fk_leftmenu)
- $searchlastsub=0;$lastid=0;$nextid=0;$found=0;
- foreach($this->newmenu->liste as $keyparent => $valparent)
- {
- //var_dump($valparent);
- if ($searchlastsub) // If we started to search for last submenu
- {
- if ($valparent['level'] >= $searchlastsub) $lastid=$keyparent;
- if ($valparent['level'] < $searchlastsub)
- {
- $nextid=$keyparent;
- break;
- }
- }
- if ($valparent['mainmenu'] == $val['fk_mainmenu'] && $valparent['leftmenu'] == $val['fk_leftmenu'])
- {
- //print "We found parent: keyparent='.$keyparent.' - level=".$valparent['level'].' - '.join(',',$valparent).' ';
- // Now we look to find last subelement of this parent (we add at end)
- $searchlastsub=($valparent['level']+1);
- $lastid=$keyparent;
- $found=1;
- }
- }
- //print 'We must insert menu entry between entry '.$lastid.' and '.$nextid.' ';
- if ($found) $this->newmenu->insert($lastid, $val['url'], $val['titre'], $searchlastsub, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu']);
- }
- }
- }
+ // Now update this->newmenu->list when fk_menu value is -1 (left menu added by modules with no top menu)
+ foreach($tabMenu as $key => $val)
+ {
+ //var_dump($tabMenu);
+ if ($val['fk_menu'] == -1 && $val['fk_mainmenu'] == $mainmenu) // We found a menu entry not linked to parent with good mainmenu
+ {
+ //print 'Try to add menu (current is mainmenu='.$mainmenu.' leftmenu='.$leftmenu.') for '.join(',',$val).' fk_mainmenu='.$val['fk_mainmenu'].' fk_leftmenu='.$val['fk_leftmenu'].' ';
+ //var_dump($this->newmenu->liste);exit;
+
+ if (empty($val['fk_leftmenu']))
+ {
+ $this->newmenu->add($val['url'], $val['titre'], 0, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu']); // TODO Add position
+ //var_dump($this->newmenu->liste);
+ }
+ else
+ {
+ // Search first menu with this couple (mainmenu,leftmenu)=(fk_mainmenu,fk_leftmenu)
+ $searchlastsub=0;$lastid=0;$nextid=0;$found=0;
+ foreach($this->newmenu->liste as $keyparent => $valparent)
+ {
+ //var_dump($valparent);
+ if ($searchlastsub) // If we started to search for last submenu
+ {
+ if ($valparent['level'] >= $searchlastsub) $lastid=$keyparent;
+ if ($valparent['level'] < $searchlastsub)
+ {
+ $nextid=$keyparent;
+ break;
+ }
+ }
+ if ($valparent['mainmenu'] == $val['fk_mainmenu'] && $valparent['leftmenu'] == $val['fk_leftmenu'])
+ {
+ //print "We found parent: keyparent='.$keyparent.' - level=".$valparent['level'].' - '.join(',',$valparent).' ';
+ // Now we look to find last subelement of this parent (we add at end)
+ $searchlastsub=($valparent['level']+1);
+ $lastid=$keyparent;
+ $found=1;
+ }
+ }
+ //print 'We must insert menu entry between entry '.$lastid.' and '.$nextid.' ';
+ if ($found) $this->newmenu->insert($lastid, $val['url'], $val['titre'], $searchlastsub, $val['perms'], $val['target'], $val['mainmenu'], $val['leftmenu']);
+ }
+ }
}
return $this->newmenu;
@@ -494,7 +489,7 @@ class Menubase
/**
* Load entries found in database into variable $tabMenu. Note that only "database menu entries" are loaded here, hardcoded will not be present into output.
*
- * @param string $mymainmenu Value for left that defined mainmenu
+ * @param string $mymainmenu Value for mainmenu that defined mainmenu
* @param string $myleftmenu Value for left that defined leftmenu
* @param int $type_user Looks for menu entry for 0=Internal users, 1=External users
* @param string $menu_handler Name of menu_handler used ('auguria', 'eldy'...)
@@ -584,7 +579,7 @@ class Menubase
}
//$tmp4=dol_microtime_float();
//print '>>> 3 '.($tmp4 - $tmp3).' ';
-
+
// We complete tabMenu
$tabMenu[$b]['rowid'] = $menu['rowid'];
$tabMenu[$b]['module'] = $menu['module'];
@@ -606,10 +601,10 @@ class Menubase
$tabMenu[$b]['fk_mainmenu'] = $menu['fk_mainmenu'];
$tabMenu[$b]['fk_leftmenu'] = $menu['fk_leftmenu'];
$tabMenu[$b]['position'] = $menu['position'];
-
+
$b++;
}
-
+
$a++;
}
$this->db->free($resql);
diff --git a/htdocs/core/class/translate.class.php b/htdocs/core/class/translate.class.php
index ae4e2fd2e8f..2110b68d388 100644
--- a/htdocs/core/class/translate.class.php
+++ b/htdocs/core/class/translate.class.php
@@ -61,7 +61,7 @@ class Translate
/**
* Set accessor for this->defaultlang
*
- * @param string $srclang Language to use
+ * @param string $srclang Language to use. If '' or 'auto', we use browser lang.
* @return void
*/
function setDefaultLang($srclang='en_US')
diff --git a/htdocs/core/getmenu_jmobile.php b/htdocs/core/getmenu_jmobile.php
new file mode 100644
index 00000000000..a0ab2e5728d
--- /dev/null
+++ b/htdocs/core/getmenu_jmobile.php
@@ -0,0 +1,97 @@
+
+ *
+ * This file is a modified version of datepicker.php from phpBSM to fix some
+ * bugs, to add new features and to dramatically increase speed.
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file htdocs/core/getmenu_jmobile.php
+ * \brief File to return menu
+ */
+
+//if (! defined('NOREQUIREUSER')) define('NOREQUIREUSER','1'); // Not disabled cause need to load personalized language
+//if (! defined('NOREQUIREDB')) define('NOREQUIREDB','1'); // Not disabled cause need to load personalized language
+//if (! defined('NOREQUIRESOC')) define('NOREQUIRESOC','1');
+//if (! defined('NOREQUIRETRAN')) define('NOREQUIRETRAN','1'); // Not disabled cause need to do translations
+if (! defined('NOCSRFCHECK')) define('NOCSRFCHECK',1);
+if (! defined('NOTOKENRENEWAL')) define('NOTOKENRENEWAL',1);
+//if (! defined('NOLOGIN')) define('NOLOGIN',1); // Not disabled cause need to load personalized language
+if (! defined('NOREQUIREMENU')) define('NOREQUIREMENU',1);
+if (! defined('NOREQUIREHTML')) define('NOREQUIREHTML',1);
+
+require_once '../main.inc.php';
+
+if (GETPOST('lang')) $langs->setDefaultLang(GETPOST('lang')); // If language was forced on URL by the main.inc.php
+$langs->load("main");
+$right=($langs->trans("DIRECTION")=='rtl'?'left':'right');
+$left=($langs->trans("DIRECTION")=='rtl'?'right':'left');
+
+//var_dump($langs->defaultlang);
+//var_dump($conf->format_date_short_java);
+//var_dump($langs->trans("FormatDateShortJava"));
+
+
+
+/*
+ * View
+ */
+
+// URL http://mydolibarr/core/getmenu_jmobime?mainmenu=mainmenu&leftmenu=leftmenu can be used for tests
+$arrayofjs=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.js');
+$arrayofcss=array('/includes/jquery/plugins/mobile/jquery.mobile-latest.min.css');
+top_htmlhead($head, $title, $disablejs, $disablehead, $arrayofjs, $arrayofcss);
+
+print ''."\n";
+
+if (empty($user->societe_id)) // If internal user or not defined
+{
+ $conf->standard_menu=(empty($conf->global->MAIN_MENU_STANDARD_FORCED)?(empty($conf->global->MAIN_MENU_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENU_STANDARD):$conf->global->MAIN_MENU_STANDARD_FORCED);
+ $conf->smart_menu=(empty($conf->global->MAIN_MENU_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENU_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENU_SMARTPHONE):$conf->global->MAIN_MENU_SMARTPHONE_FORCED);
+}
+else // If external user
+{
+ $conf->standard_menu=(empty($conf->global->MAIN_MENUFRONT_STANDARD_FORCED)?(empty($conf->global->MAIN_MENUFRONT_STANDARD)?'eldy_menu.php':$conf->global->MAIN_MENUFRONT_STANDARD):$conf->global->MAIN_MENUFRONT_STANDARD_FORCED);
+ $conf->smart_menu=(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED)?(empty($conf->global->MAIN_MENUFRONT_SMARTPHONE)?'smartphone_menu.php':$conf->global->MAIN_MENUFRONT_SMARTPHONE):$conf->global->MAIN_MENUFRONT_SMARTPHONE_FORCED);
+}
+
+// Load the menu manager (only if not already done)
+$file_menu=empty($conf->browser->phone)?$conf->standard_menu:$conf->smart_menu;
+if (GETPOST('menu')) $file_menu=GETPOST('menu'); // example: menu=eldy_menu.php
+if (! class_exists('MenuManager'))
+{
+ $menufound=0;
+ $dirmenus=array_merge(array("/core/menus/"),(array) $conf->modules_parts['menus']);
+ foreach($dirmenus as $dirmenu)
+ {
+ $menufound=dol_include_once($dirmenu."standard/".$file_menu);
+ if ($menufound) break;
+ }
+ if (! $menufound) // If failed to include, we try with standard
+ {
+ dol_syslog("You define a menu manager '".$file_menu."' that can not be loaded.", LOG_WARNING);
+ $file_menu='eldy_menu.php';
+ include_once DOL_DOCUMENT_ROOT."/core/menus/standard/".$file_menu;
+ }
+}
+$menumanager = new MenuManager($db, empty($user->societe_id)?0:1);
+
+$menumanager->showmenu('jmobile');
+
+print '