diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php index c057dc2dee3..066d5cf8b7a 100644 --- a/htdocs/comm/action/card.php +++ b/htdocs/comm/action/card.php @@ -908,7 +908,7 @@ if ($action == 'create') $numproject=$formproject->select_projects((! empty($societe->id)?$societe->id:-1), $projectid, 'projectid', 0, 0, 1, 1); print '   '.$langs->trans("AddProject").''; - $urloption='?action=create'; + $urloption = '?action=create&donotclearsession=1'; $url = dol_buildpath('comm/action/card.php', 2).$urloption; // update task list @@ -1325,7 +1325,7 @@ if ($id > 0) { print ''; - $urloption='?action=create'; // we use create not edit for more flexibility + $urloption = '?action=create&donotclearsession=1'; // we use create not edit for more flexibility $url = DOL_URL_ROOT.'/comm/action/card.php'.$urloption; // update task list diff --git a/htdocs/comm/index.php b/htdocs/comm/index.php index 651d2c54ec7..6e14e565085 100644 --- a/htdocs/comm/index.php +++ b/htdocs/comm/index.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2015 Laurent Destailleur * Copyright (C) 2005-2012 Regis Houssin * Copyright (C) 2015 Jean-François Ferry + * Copyright (C) 2020 Pierre Ardoin * * 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 @@ -141,6 +142,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $sql = "SELECT p.rowid, p.ref, p.ref_client, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= ", s.code_client"; + $sql.= ", s.email"; + $sql.= ", s.entity"; + $sql.= ", s.code_compta"; $sql.= " FROM ".MAIN_DB_PREFIX."propal as p"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -184,6 +188,9 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $companystatic->client=$obj->client; $companystatic->code_client = $obj->code_client; $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->entity = $obj->entity; + $companystatic->email = $obj->email; + $companystatic->code_compta = $obj->code_compta; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1, 'customer', 16); print ''; @@ -226,6 +233,8 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos $sql = "SELECT p.rowid, p.ref, p.total_ht, p.tva as total_tva, p.total as total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= ", s.code_client"; + $sql.= ", s.entity"; + $sql.= ", s.email"; $sql.= " FROM ".MAIN_DB_PREFIX."supplier_proposal as p"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -268,6 +277,8 @@ if (! empty($conf->supplier_proposal->enabled) && $user->rights->supplier_propos $companystatic->client=$obj->client; $companystatic->code_client = $obj->code_client; $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->entity = $obj->entity; + $companystatic->email = $obj->email; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1, 'supplier', 16); print ''; @@ -308,6 +319,9 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $sql = "SELECT c.rowid, c.ref, c.ref_client, c.total_ht, c.tva as total_tva, c.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= ", s.code_client"; + $sql.= ", s.email"; + $sql.= ", s.entity"; + $sql.= ", s.code_compta"; $sql.= " FROM ".MAIN_DB_PREFIX."commande as c"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -350,6 +364,9 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $companystatic->client=$obj->client; $companystatic->code_client = $obj->code_client; $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->canvas=$obj->canvas; + $companystatic->email=$obj->email; + $companystatic->entity=$obj->entity; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1, 'customer', 16); print ''; @@ -398,6 +415,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande $sql = "SELECT cf.rowid, cf.ref, cf.ref_supplier, cf.total_ttc, s.rowid as socid, s.nom as name, s.client, s.canvas"; $sql.= ", s.code_client"; $sql.= ", s.code_fournisseur"; + $sql.= ", s.entity"; + $sql.= ", s.email"; $sql.= " FROM ".MAIN_DB_PREFIX."commande_fournisseur as cf"; $sql.= ", ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -441,6 +460,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->fournisseur->commande $companystatic->client=$obj->client; $companystatic->code_client = $obj->code_client; $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->entity=$obj->entity; + $companystatic->email=$obj->email; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1, 'supplier', 16); print ''; @@ -492,6 +513,9 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) $sql = "SELECT s.rowid, s.nom as name, s.client, s.datec, s.tms, s.canvas"; $sql.= ", s.code_client"; + $sql.= ", s.code_compta"; + $sql.= ", s.entity"; + $sql.= ", s.email"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.client IN (1, 2, 3)"; @@ -527,6 +551,9 @@ if (! empty($conf->societe->enabled) && $user->rights->societe->lire) $companystatic->client=$objp->client; $companystatic->code_client = $objp->code_client; $companystatic->code_fournisseur = $objp->code_fournisseur; + $companystatic->code_compta = $objp->code_compta; + $companystatic->entity = $objp->entity; + $companystatic->email = $objp->email; $companystatic->canvas=$objp->canvas; print ''; print ''.$companystatic->getNomUrl(1, 'customer', 48).''; @@ -556,6 +583,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) $sql = "SELECT s.nom as name, s.rowid, s.datec as dc, s.canvas, s.tms as dm"; $sql.= ", s.code_fournisseur"; + $sql.= ", s.entity"; + $sql.= ", s.email"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (! $user->rights->societe->client->voir && ! $user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fournisseur = 1"; @@ -586,6 +615,8 @@ if (! empty($conf->fournisseur->enabled) && $user->rights->societe->lire) $companystatic->name=$objp->name; $companystatic->code_client = $objp->code_client; $companystatic->code_fournisseur = $objp->code_fournisseur; + $companystatic->entity = $objp->entity; + $companystatic->email = $objp->email; $companystatic->canvas=$objp->canvas; print ''; print ''.$companystatic->getNomUrl(1, 'supplier', 44).''; @@ -632,6 +663,8 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO $sql = "SELECT s.nom as name, s.rowid, s.canvas, "; $sql.= ", s.code_client"; + $sql.= ", s.entity"; + $sql.= ", s.email"; $sql.= " c.statut, c.rowid as contratid, p.ref, c.mise_en_service as datemes, c.fin_validite as datefin, c.date_cloture as dateclo"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."contrat as c"; @@ -668,6 +701,8 @@ if (! empty($conf->contrat->enabled) && $user->rights->contrat->lire && 0) // TO $companystatic->name=$objp->name; $companystatic->code_client = $objp->code_client; $companystatic->code_fournisseur = $objp->code_fournisseur; + $companystatic->entity = $objp->entity; + $companystatic->email = $objp->email; $companystatic->canvas=$objp->canvas; print $companystatic->getNomUrl(1, 'customer', 44); print ''."\n"; @@ -693,6 +728,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $langs->load("propal"); $sql = "SELECT s.nom as name, s.rowid, s.code_client"; + $sql.= ", s.entity"; + $sql.= ", s.email"; $sql.= ", p.rowid as propalid, p.entity, p.total as total_ttc, p.total_ht, p.tva as total_tva, p.ref, p.ref_client, p.fk_statut, p.datep as dp, p.fin_validite as dfv"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; @@ -755,6 +792,8 @@ if (! empty($conf->propal->enabled) && $user->rights->propal->lire) $companystatic->client=$obj->client; $companystatic->code_client = $obj->code_client; $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->entity = $obj->entity; + $companystatic->email = $obj->email; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1, 'customer', 44); print ''; @@ -798,6 +837,8 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $sql = "SELECT s.nom as name, s.rowid, c.rowid as commandeid, c.total_ttc, c.total_ht, c.tva as total_tva, c.ref, c.ref_client, c.fk_statut, c.date_valid as dv, c.facture as billed"; $sql.= ", s.code_client"; + $sql.= ", s.entity"; + $sql.= ", s.email"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."commande as c"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -859,6 +900,8 @@ if (! empty($conf->commande->enabled) && $user->rights->commande->lire) $companystatic->client=$obj->client; $companystatic->code_client = $obj->code_client; $companystatic->code_fournisseur = $obj->code_fournisseur; + $companystatic->entity = $obj->entity; + $companystatic->email = $obj->email; $companystatic->canvas=$obj->canvas; print $companystatic->getNomUrl(1, 'customer', 44); print ''; diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index ea2a7814f14..bb5b7023264 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -95,7 +95,7 @@ class box_clients extends ModeleBoxes $sql.= ", s.code_compta_fournisseur"; $sql.= ", s.logo"; $sql.= ", s.email"; - $sql.= ", s.datec, s.tms, s.status"; + $sql.= ", s.datec, s.tms, s.status, s.entity"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.client IN (1, 3)"; @@ -127,6 +127,7 @@ class box_clients extends ModeleBoxes $thirdpartystatic->fournisseur = $objp->fournisseur; $thirdpartystatic->logo = $objp->logo; $thirdpartystatic->email = $objp->email; + $thirdpartystatic->entity = $objp->entity; $this->info_box_contents[$line][] = array( 'td' => '', diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index 01f62bc38c9..4922d9556c1 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -2,6 +2,7 @@ /* Copyright (C) 2004-2006 Destailleur Laurent * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015 Frederic France + * Copyright (C) 2020 Pierre Ardoin * * 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 @@ -86,7 +87,7 @@ class box_fournisseurs extends ModeleBoxes { $sql = "SELECT s.nom as name, s.rowid as socid, s.datec, s.tms, s.status,"; $sql.= " s.code_fournisseur,"; - $sql.= " s.logo"; + $sql.= " s.logo, s.email, s.code_compta_fournisseur, s.entity"; $sql .= " FROM ".MAIN_DB_PREFIX."societe as s"; if (!$user->rights->societe->client->voir && !$user->societe_id) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; $sql.= " WHERE s.fournisseur = 1"; @@ -111,6 +112,9 @@ class box_fournisseurs extends ModeleBoxes $thirdpartytmp->name = $objp->name; $thirdpartytmp->code_client = $objp->code_client; $thirdpartytmp->logo = $objp->logo; + $thirdpartytmp->email = $objp->email; + $thirdpartytmp->code_compta_fournisseur = $objp->code_compta_fournisseur; + $thirdpartytmp->entity = $objp->entity; $this->info_box_contents[$line][] = array( 'td' => '', diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 6bf6a2c2166..7e73166ed90 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -3,6 +3,7 @@ * Copyright (C) 2004-2007 Laurent Destailleur * Copyright (C) 2005-2009 Regis Houssin * Copyright (C) 2015 Frederic France + * Copyright (C) 2020 Pierre Ardoin * * 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 @@ -84,7 +85,7 @@ class box_propales extends ModeleBoxes if ($user->rights->propale->lire) { - $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client, s.logo,"; + $sql = "SELECT s.nom as name, s.rowid as socid, s.code_client, s.logo, s.entity, s.email,"; $sql.= " p.rowid, p.ref, p.fk_statut, p.datep as dp, p.datec, p.fin_validite, p.date_cloture, p.total_ht, p.tva as total_tva, p.total as total_ttc, p.tms"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; $sql.= ", ".MAIN_DB_PREFIX."propal as p"; @@ -121,6 +122,8 @@ class box_propales extends ModeleBoxes $societestatic->name = $objp->name; $societestatic->code_client = $objp->code_client; $societestatic->logo = $objp->logo; + $societestatic->entity = $objp->entity; + $societestatic->email = $objp->email; $late = ''; if ($objp->fk_statut == 1 && $dateterm < ($now - $conf->propal->cloture->warning_delay)) { diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php index 9208ebb9a6e..ed50e236ffe 100644 --- a/htdocs/core/lib/functions.lib.php +++ b/htdocs/core/lib/functions.lib.php @@ -1226,7 +1226,7 @@ function dol_get_fiche_head($links = array(), $active = '', $title = '', $notab $tabsname=str_replace("@", "", $picto); $out.='
'; $out.=''.$langs->trans("More").'... ('.$nbintab.')'; - $out.='
'; + $out.='
'; $out.=$outmore; $out.='
'; $out.='
'; diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php index 71d52f1bd9d..1a8045df014 100644 --- a/htdocs/core/lib/security.lib.php +++ b/htdocs/core/lib/security.lib.php @@ -122,7 +122,7 @@ function dol_hash($chain, $type = '0') } // Salt value - if (! empty($conf->global->MAIN_SECURITY_SALT)) $chain=$conf->global->MAIN_SECURITY_SALT.$chain; + if (! empty($conf->global->MAIN_SECURITY_SALT) && $type != '4' && $type !== 'md5openldap') $chain = $conf->global->MAIN_SECURITY_SALT.$chain; if ($type == '1' || $type == 'sha1') return sha1($chain); elseif ($type == '2' || $type == 'sha1md5') return sha1(md5($chain)); diff --git a/htdocs/societe/index.php b/htdocs/societe/index.php index 2404c11861e..e5b49ee3bea 100644 --- a/htdocs/societe/index.php +++ b/htdocs/societe/index.php @@ -267,7 +267,10 @@ $max=15; $sql = "SELECT s.rowid, s.nom as name, s.email, s.client, s.fournisseur"; $sql.= ", s.code_client"; $sql.= ", s.code_fournisseur"; +$sql.= ", s.code_compta_fournisseur"; +$sql.= ", s.code_compta"; $sql.= ", s.logo"; +$sql.= ", s.entity"; $sql.= ", s.canvas, s.tms as datem, s.status as status"; $sql.= " FROM ".MAIN_DB_PREFIX."societe as s"; if (! $user->rights->societe->client->voir && ! $socid) $sql.= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc"; @@ -314,6 +317,9 @@ if ($result) $thirdparty_static->code_fournisseur = $objp->code_fournisseur; $thirdparty_static->canvas=$objp->canvas; $thirdparty_static->email = $objp->email; + $thirdparty_static->entity = $objp->entity; + $thirdparty_static->code_compta_fournisseur = $objp->code_compta_fournisseur; + $thirdparty_static->code_compta = $objp->code_compta; print ''; // Name diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php index be4b0125698..c1fedf7cfe6 100644 --- a/htdocs/societe/list.php +++ b/htdocs/societe/list.php @@ -10,6 +10,7 @@ * Copyright (C) 2017 Rui Strecht * Copyright (C) 2017 Juanjo Menent * Copyright (C) 2018 Nicolas ZABOURI + * * 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 @@ -371,6 +372,7 @@ if ($resql) else dol_print_error($db); $sql = "SELECT s.rowid, s.nom as name, s.name_alias, s.barcode, s.town, s.zip, s.datec, s.code_client, s.code_fournisseur, s.logo,"; +$sql.= " s.entity,"; $sql.= " st.libelle as stcomm, s.fk_stcomm as stcomm_id, s.fk_prospectlevel, s.prefix_comm, s.client, s.fournisseur, s.canvas, s.status as status,"; $sql.= " s.email, s.phone, s.fax, s.url, s.siren as idprof1, s.siret as idprof2, s.ape as idprof3, s.idprof4 as idprof4, s.idprof5 as idprof5, s.idprof6 as idprof6, s.tva_intra, s.fk_pays,"; $sql.= " s.tms as date_update, s.datec as date_creation,"; @@ -1003,6 +1005,7 @@ while ($i < min($num, $limit)) $companystatic->fk_prospectlevel=$obj->fk_prospectlevel; $companystatic->fk_parent = $obj->fk_parent; + $companystatic->entity = $obj->entity; print '