diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php index bb6391dcb8c..c913d6a1b49 100644 --- a/htdocs/adherents/card.php +++ b/htdocs/adherents/card.php @@ -1773,8 +1773,10 @@ else if ($action != 'editlogin' && $action != 'editthirdparty') { // Send - if ($object->statut == 1) { - print '
'.$langs->trans('SendMail').'
'; + if (empty($user->socid)) { + if ($object->statut == 1) { + print '
'.$langs->trans('SendMail').'
'; + } } // Send card by email diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php index b0ab945f543..ddb2eaed9c4 100644 --- a/htdocs/asset/card.php +++ b/htdocs/asset/card.php @@ -281,7 +281,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - print ''.$langs->trans('SendMail').''."\n"; + if (empty($user->socid)) { + print ''.$langs->trans('SendMail').''."\n"; + } if ($user->rights->asset->write) { diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php index 887a319aefe..1f4498cf9cc 100644 --- a/htdocs/bom/bom_card.php +++ b/htdocs/bom/bom_card.php @@ -601,7 +601,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - //print '' . $langs->trans('SendMail') . ''."\n"; + //if (empty($user->socid)) { + // print '' . $langs->trans('SendMail') . ''."\n"; + //} // Back to draft if ($object->status == $object::STATUS_VALIDATED) diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php index 262493c9383..ac1b353cd9e 100644 --- a/htdocs/comm/propal/card.php +++ b/htdocs/comm/propal/card.php @@ -2498,11 +2498,13 @@ if ($action == 'create') } // Send - if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) { - if ($usercansend) { - print ''.$langs->trans('SendMail').''; - } else - print ''.$langs->trans('SendMail').''; + if (empty($user->socid)) { + if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) { + if ($usercansend) { + print ''.$langs->trans('SendMail').''; + } else + print ''.$langs->trans('SendMail').''; + } } // Create a sale order diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php index 372e64e4e43..b8a3960debb 100644 --- a/htdocs/commande/card.php +++ b/htdocs/commande/card.php @@ -2555,11 +2555,13 @@ if ($action == 'create' && $usercancreate) } // Send - if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) { - if ($usercansend) { - print ''.$langs->trans('SendMail').''; - } else - print ''.$langs->trans('SendMail').''; + if (empty($user->socid)) { + if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) { + if ($usercansend) { + print ''.$langs->trans('SendMail').''; + } else + print ''.$langs->trans('SendMail').''; + } } // Valid diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php index bc8b59671f8..4f0035ff62d 100644 --- a/htdocs/compta/facture/card.php +++ b/htdocs/compta/facture/card.php @@ -5125,14 +5125,16 @@ elseif ($id > 0 || !empty($ref)) } // Send by mail - if (($object->statut == Facture::STATUS_VALIDATED || $object->statut == Facture::STATUS_CLOSED) || !empty($conf->global->FACTURE_SENDBYEMAIL_FOR_ALL_STATUS)) { - if ($objectidnext) { - print ''.$langs->trans('SendMail').''; - } else { - if ($usercansend) { - print ''.$langs->trans('SendMail').''; - } else - print ''.$langs->trans('SendMail').''; + if (empty($user->socid)) { + if (($object->statut == Facture::STATUS_VALIDATED || $object->statut == Facture::STATUS_CLOSED) || !empty($conf->global->FACTURE_SENDBYEMAIL_FOR_ALL_STATUS)) { + if ($objectidnext) { + print ''.$langs->trans('SendMail').''; + } else { + if ($usercansend) { + print ''.$langs->trans('SendMail').''; + } else + print ''.$langs->trans('SendMail').''; + } } } diff --git a/htdocs/contact/card.php b/htdocs/contact/card.php index 73862b65b2e..3ca8a12b782 100644 --- a/htdocs/contact/card.php +++ b/htdocs/contact/card.php @@ -1451,15 +1451,17 @@ else $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook) && $action != 'presend') { - if (!empty($object->email)) - { - $langs->load("mails"); - print '
'.$langs->trans('SendMail').'
'; - } - else - { - $langs->load("mails"); - print '
'.$langs->trans('SendMail').'
'; + if (empty($user->socid)) { + if (!empty($object->email)) + { + $langs->load("mails"); + print '
'.$langs->trans('SendMail').'
'; + } + else + { + $langs->load("mails"); + print '
'.$langs->trans('SendMail').'
'; + } } if ($user->rights->societe->contact->creer) diff --git a/htdocs/contrat/card.php b/htdocs/contrat/card.php index 9bcae25badd..9d240a31a79 100644 --- a/htdocs/contrat/card.php +++ b/htdocs/contrat/card.php @@ -2108,11 +2108,13 @@ else if (empty($reshook)) { // Send - if ($object->statut == 1) { - if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) { - print '
'.$langs->trans('SendMail').'
'; - } else - print '
'.$langs->trans('SendMail').'
'; + if (empty($user->socid)) { + if ($object->statut == 1) { + if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->commande->order_advance->send)) { + print '
'.$langs->trans('SendMail').'
'; + } else + print '
'.$langs->trans('SendMail').'
'; + } } if ($object->statut == 0 && $nbofservices) diff --git a/htdocs/expedition/card.php b/htdocs/expedition/card.php index 3632cbfd52e..5ab5aeb4697 100644 --- a/htdocs/expedition/card.php +++ b/htdocs/expedition/card.php @@ -2529,13 +2529,15 @@ elseif ($id || $ref) } // Send - if ($object->statut > 0) - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send) + if (empty($user->socid)) { + if ($object->statut > 0) { - print ''.$langs->trans('SendMail').''; + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expedition->shipping_advance->send) + { + print ''.$langs->trans('SendMail').''; + } + else print ''.$langs->trans('SendMail').''; } - else print ''.$langs->trans('SendMail').''; } // Create bill diff --git a/htdocs/expensereport/card.php b/htdocs/expensereport/card.php index 6c587025209..fd582ac0a1e 100644 --- a/htdocs/expensereport/card.php +++ b/htdocs/expensereport/card.php @@ -2644,14 +2644,15 @@ if ($action != 'create' && $action != 'edit') $object->fetch($id, $ref); // Send - if ($object->fk_statut > ExpenseReport::STATUS_DRAFT) { - //if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expensereport->expensereport_advance->send)) { - print '
'.$langs->trans('SendMail').'
'; - //} else - // print '
' . $langs->trans('SendMail') . '
'; + if (empty($user->socid)) { + if ($object->fk_statut > ExpenseReport::STATUS_DRAFT) { + //if ((empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->expensereport->expensereport_advance->send)) { + print '
'.$langs->trans('SendMail').'
'; + //} else + // print '
' . $langs->trans('SendMail') . '
'; + } } - /* Si l'état est "Brouillon" * ET user à droit "creer/supprimer" * ET fk_user_author == user courant diff --git a/htdocs/fichinter/card.php b/htdocs/fichinter/card.php index ad96829d7b9..30f5731cfbf 100644 --- a/htdocs/fichinter/card.php +++ b/htdocs/fichinter/card.php @@ -1632,13 +1632,15 @@ elseif ($id > 0 || !empty($ref)) } // Send - if ($object->statut > Fichinter::STATUS_DRAFT) - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->ficheinter->ficheinter_advance->send) + if (empty($user->socid)) { + if ($object->statut > Fichinter::STATUS_DRAFT) { - print '
'.$langs->trans('SendMail').'
'; + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->ficheinter->ficheinter_advance->send) + { + print '
'.$langs->trans('SendMail').'
'; + } + else print '
'.$langs->trans('SendMail').'
'; } - else print '
'.$langs->trans('SendMail').'
'; } // create intervention model diff --git a/htdocs/fourn/commande/card.php b/htdocs/fourn/commande/card.php index d70f26f3920..515a86a9331 100644 --- a/htdocs/fourn/commande/card.php +++ b/htdocs/fourn/commande/card.php @@ -2441,11 +2441,13 @@ elseif (!empty($object->id)) } // Send - if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED, 3, 4, 5)) || !empty($conf->global->SUPPLIER_ORDER_SENDBYEMAIL_FOR_ALL_STATUS)) - { - if ($user->rights->fournisseur->commande->commander) + if (empty($user->socid)) { + if (in_array($object->statut, array(CommandeFournisseur::STATUS_ACCEPTED, 3, 4, 5)) || !empty($conf->global->SUPPLIER_ORDER_SENDBYEMAIL_FOR_ALL_STATUS)) { - print ''.$langs->trans('SendMail').''; + if ($user->rights->fournisseur->commande->commander) + { + print ''.$langs->trans('SendMail').''; + } } } diff --git a/htdocs/fourn/facture/card.php b/htdocs/fourn/facture/card.php index e4c502069e0..e350e9b2bbf 100644 --- a/htdocs/fourn/facture/card.php +++ b/htdocs/fourn/facture/card.php @@ -3148,13 +3148,15 @@ else } // Send by mail - if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED)) - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send) + if (empty($user->socid)) { + if (($object->statut == FactureFournisseur::STATUS_VALIDATED || $object->statut == FactureFournisseur::STATUS_CLOSED)) { - print '
'.$langs->trans('SendMail').'
'; + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->fournisseur->supplier_invoice_advance->send) + { + print '
'.$langs->trans('SendMail').'
'; + } + else print '
'.$langs->trans('SendMail').'
'; } - else print '
'.$langs->trans('SendMail').'
'; } // Make payments diff --git a/htdocs/langs/fr_FR/exports.lang b/htdocs/langs/fr_FR/exports.lang index e7c248d631d..d117a47c1bf 100644 --- a/htdocs/langs/fr_FR/exports.lang +++ b/htdocs/langs/fr_FR/exports.lang @@ -109,7 +109,7 @@ Separator=Séparateur de champs Enclosure=Encadrement des chaînes de textes SpecialCode=Code spécial ExportStringFilter=%% permet de remplacer 1 ou plusieurs caractères dans le texte -ExportDateFilter=AAAA, AAAAMM, AAAAMMJJ: filtre pour une année/mois/jour
AAAA+AAAA, AAAAMM+AAAAMM, AAAAMMJJ+AAAAMMJJ: filtre pour une plage année/mois/jour
> AAAA, > AAAAMM, > AAAAMMJJ': filtre pour une date supérieure à une année/mois/jour donné
< AAAA, < AAAAMM, < AAAAMMJJ: filtre pour une date inférieure à une année/mois/jour donné +ExportDateFilter=AAAA, AAAAMM, AAAAMMJJ: filtre pour une année/mois/jour
AAAA+AAAA, AAAAMM+AAAAMM, AAAAMMJJ+AAAAMMJJ: filtre pour une plage année/mois/jour
> AAAA, > AAAAMM, > AAAAMMJJ: filtre pour une date supérieure à une année/mois/jour donné
< AAAA, < AAAAMM, < AAAAMMJJ: filtre pour une date inférieure à une année/mois/jour donné ExportNumericFilter=NNNNN filtre une seule valeur
NNNNN+NNNNN filtre une plage de valeurs
< NNNNN filtre les valeurs inférieures
> NNNNN filtre les valeurs supérieures ImportFromLine=Début d'import à la ligne numéro EndAtLineNb=Fin à la ligne numéro diff --git a/htdocs/modulebuilder/template/myobject_card.php b/htdocs/modulebuilder/template/myobject_card.php index 97adff0558f..f44caa119a9 100644 --- a/htdocs/modulebuilder/template/myobject_card.php +++ b/htdocs/modulebuilder/template/myobject_card.php @@ -456,7 +456,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - print ''.$langs->trans('SendMail').''."\n"; + if (empty($user->socid)) { + print ''.$langs->trans('SendMail').''."\n"; + } // Back to draft if ($object->status == $object::STATUS_VALIDATED) diff --git a/htdocs/mrp/mo_card.php b/htdocs/mrp/mo_card.php index ca17ce7677e..5f23daa036d 100644 --- a/htdocs/mrp/mo_card.php +++ b/htdocs/mrp/mo_card.php @@ -574,7 +574,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - //print '' . $langs->trans('SendMail') . ''."\n"; + //if (empty($user->socid)) { + // print '' . $langs->trans('SendMail') . ''."\n"; + //} // Back to draft if ($object->status == $object::STATUS_VALIDATED) diff --git a/htdocs/product/inventory/card.php b/htdocs/product/inventory/card.php index 3d389cf7eb2..df872491ae1 100644 --- a/htdocs/product/inventory/card.php +++ b/htdocs/product/inventory/card.php @@ -329,7 +329,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - print ''.$langs->trans('SendMail').''."\n"; + if (empty($user->socid)) { + print ''.$langs->trans('SendMail').''."\n"; + } if ($permissiontoadd) { diff --git a/htdocs/product/stock/list.php b/htdocs/product/stock/list.php index 315d85e619a..361052bb27c 100644 --- a/htdocs/product/stock/list.php +++ b/htdocs/product/stock/list.php @@ -257,12 +257,12 @@ if (! empty($extrafields->attributes[$object->table_element]['label'])) { $parameters=array(); $reshook=$hookmanager->executeHooks('printFieldListGroupBy',$parameters); // Note that $action and $object may have been modified by hook $sql.=$hookmanager->resPrint; -$sql=preg_replace('/,\s*$/','', $sql); +$sql=preg_replace('/,\s*$/', '', $sql); $totalnboflines = 0; $result = $db->query($sql); if ($result) { - $totalnboflines = $db->num_rows($result); + $totalnboflines = $db->num_rows($result); // fetch totals $line = $total = $totalsell = $totalStock = 0; while ($line < $totalnboflines) diff --git a/htdocs/projet/card.php b/htdocs/projet/card.php index a16b77b6667..e41c3da3e88 100644 --- a/htdocs/projet/card.php +++ b/htdocs/projet/card.php @@ -1199,9 +1199,11 @@ elseif ($object->id > 0) }*/ // Send - if ($object->statut != 2) - { - print ''.$langs->trans('SendMail').''; + if (empty($user->socid)) { + if ($object->statut != 2) + { + print ''.$langs->trans('SendMail').''; + } } // Modify diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 0bc3839a23d..85ff3715b73 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -2058,13 +2058,15 @@ elseif ($id || $ref) } // Send - if ($object->statut > 0) - { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->reception->reception_advance->send) + if (empty($user->socid)) { + if ($object->statut > 0) { - print ''.$langs->trans('SendByMail').''; + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->reception->reception_advance->send) + { + print ''.$langs->trans('SendByMail').''; + } + else print ''.$langs->trans('SendByMail').''; } - else print ''.$langs->trans('SendByMail').''; } // Create bill diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php index c930be36035..54068f26265 100644 --- a/htdocs/societe/card.php +++ b/htdocs/societe/card.php @@ -2741,16 +2741,18 @@ else } } - if (!empty($object->email) || $at_least_one_email_contact) - { - $langs->load("mails"); - print ''.$langs->trans('SendMail').''; - } - else - { - $langs->load("mails"); - print ''.$langs->trans('SendMail').''; - } + if (empty($user->socid)) { + if (!empty($object->email) || $at_least_one_email_contact) + { + $langs->load("mails"); + print ''.$langs->trans('SendMail').''; + } + else + { + $langs->load("mails"); + print ''.$langs->trans('SendMail').''; + } + } if ($user->rights->societe->creer) { diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php index b6193d12b6e..6426d9ab98b 100644 --- a/htdocs/societe/class/societe.class.php +++ b/htdocs/societe/class/societe.class.php @@ -3625,6 +3625,7 @@ class Societe extends CommonObject $this->phone = $member->phone; // Prof phone $this->email = $member->email; $this->socialnetworks = $member->socialnetworks; + $this->entity=$member->entity; $this->client = 1; // A member is a customer by default $this->code_client = ($customercode ? $customercode : -1); diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php index 4b9284b06a2..df044e66f68 100644 --- a/htdocs/supplier_proposal/card.php +++ b/htdocs/supplier_proposal/card.php @@ -1891,11 +1891,13 @@ if ($action == 'create') } // Send - if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) { - if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance) { - print '
'.$langs->trans('SendMail').'
'; - } else - print '
'.$langs->trans('SendMail').'
'; + if (empty($user->socid)) { + if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) { + if (empty($conf->global->MAIN_USE_ADVANCED_PERMS) || $user->rights->supplier_proposal->send_advance) { + print '
'.$langs->trans('SendMail').'
'; + } else + print '
'.$langs->trans('SendMail').'
'; + } } // Create an order diff --git a/htdocs/supplier_proposal/list.php b/htdocs/supplier_proposal/list.php index e73a29be1dc..5d408be75ef 100644 --- a/htdocs/supplier_proposal/list.php +++ b/htdocs/supplier_proposal/list.php @@ -59,7 +59,7 @@ $search_user = GETPOST('search_user', 'int'); $search_sale = GETPOST('search_sale', 'int'); $search_ref = GETPOST('sf_ref') ?GETPOST('sf_ref', 'alpha') : GETPOST('search_ref', 'alpha'); $search_societe = GETPOST('search_societe', 'alpha'); -$search_author = GETPOST('search_author', 'alpha'); +$search_login = GETPOST('search_login', 'alpha'); $search_town = GETPOST('search_town', 'alpha'); $search_zip = GETPOST('search_zip', 'alpha'); $search_state = trim(GETPOST("search_state")); @@ -214,7 +214,6 @@ if (GETPOST('button_removefilter_x', 'alpha') || GETPOST('button_removefilter.x' $search_type = ''; $search_country = ''; $search_type_thirdparty = ''; - $search_author = ''; $yearvalid = ''; $monthvalid = ''; $dayvalid = ''; @@ -303,7 +302,7 @@ if ($search_country) $sql .= " AND s.fk_pays IN (".$search_country.')'; if ($search_type_thirdparty) $sql .= " AND s.fk_typent IN (".$search_type_thirdparty.')'; if ($search_ref) $sql .= natural_search('sp.ref', $search_ref); if ($search_societe) $sql .= natural_search('s.nom', $search_societe); -if ($search_author) $sql .= natural_search('u.login', $search_author); +if ($search_login) $sql .= natural_search('u.login', $search_login); if ($search_montant_ht) $sql .= natural_search('sp.total_ht=', $search_montant_ht, 1); if ($search_montant_vat != '') $sql .= natural_search("sp.tva", $search_montant_vat, 1); if ($search_montant_ttc != '') $sql .= natural_search("sp.total", $search_montant_ttc, 1); @@ -382,27 +381,27 @@ if ($resql) llxHeader('', $langs->trans('CommRequest'), $help_url); $param = ''; - if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.$contextpage; - if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.$limit; - if ($sall) $param .= '&sall='.$sall; - if ($month) $param .= '&month='.$month; - if ($year) $param .= '&year='.$year; - if ($search_ref) $param .= '&search_ref='.$search_ref; - if ($search_societe) $param .= '&search_societe='.$search_societe; - if ($search_user > 0) $param .= '&search_user='.$search_user; - if ($search_sale > 0) $param .= '&search_sale='.$search_sale; - if ($search_montant_ht) $param .= '&search_montant_ht='.$search_montant_ht; + if (!empty($contextpage) && $contextpage != $_SERVER["PHP_SELF"]) $param .= '&contextpage='.urlencode($contextpage); + if ($limit > 0 && $limit != $conf->liste_limit) $param .= '&limit='.urlencode($limit); + if ($sall) $param .= '&sall='.urlencode($sall); + if ($month) $param .= '&month='.urlencode($month); + if ($year) $param .= '&year='.urlencode($year); + if ($search_ref) $param .= '&search_ref='.urlencode($search_ref); + if ($search_societe) $param .= '&search_societe='.urlencode($search_societe); + if ($search_user > 0) $param .= '&search_user='.urlencode($search_user); + if ($search_sale > 0) $param .= '&search_sale='.urlencode($search_sale); + if ($search_montant_ht) $param .= '&search_montant_ht='.urlencode($search_montant_ht); if ($search_multicurrency_code != '') $param .= '&search_multicurrency_code='.urlencode($search_multicurrency_code); if ($search_multicurrency_tx != '') $param .= '&search_multicurrency_tx='.urlencode($search_multicurrency_tx); if ($search_multicurrency_montant_ht != '') $param .= '&search_multicurrency_montant_ht='.urlencode($search_multicurrency_montant_ht); if ($search_multicurrency_montant_vat != '') $param .= '&search_multicurrency_montant_vat='.urlencode($search_multicurrency_montant_vat); if ($search_multicurrency_montant_ttc != '') $param .= '&search_multicurrency_montant_ttc='.urlencode($search_multicurrency_montant_ttc); - if ($search_author) $param .= '&search_author='.$search_author; - if ($search_town) $param .= '&search_town='.$search_town; - if ($search_zip) $param .= '&search_zip='.$search_zip; - if ($socid > 0) $param .= '&socid='.$socid; - if ($search_status != '') $param .= '&search_status='.$search_status; - if ($optioncss != '') $param .= '&optioncss='.$optioncss; + if ($search_login) $param .= '&search_login='.urlencode($search_login); + if ($search_town) $param .= '&search_town='.urlencode($search_town); + if ($search_zip) $param .= '&search_zip='.urlencode($search_zip); + if ($socid > 0) $param .= '&socid='.urlencode($socid); + if ($search_status != '') $param .= '&search_status='.urlencode($search_status); + if ($optioncss != '') $param .= '&optioncss='.urlencode($optioncss); // Add $param from extra fields include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_param.tpl.php'; @@ -615,7 +614,7 @@ if ($resql) { // Author print ''; - print ''; + print ''; print ''; } // Extra fields diff --git a/htdocs/user/card.php b/htdocs/user/card.php index 4ea187c198c..772c04c5b51 100644 --- a/htdocs/user/card.php +++ b/htdocs/user/card.php @@ -1881,15 +1881,17 @@ else $reshook = $hookmanager->executeHooks('addMoreActionsButtons', $parameters, $object, $action); // Note that $action and $object may have been modified by hook if (empty($reshook)) { - if (!empty($object->email)) - { - $langs->load("mails"); - print '
'.$langs->trans('SendMail').'
'; - } - else - { - $langs->load("mails"); - print '
'.$langs->trans('SendMail').'
'; + if (empty($user->socid)) { + if (!empty($object->email)) + { + $langs->load("mails"); + print '
'.$langs->trans('SendMail').'
'; + } + else + { + $langs->load("mails"); + print '
'.$langs->trans('SendMail').'
'; + } } if ($caneditfield && (empty($conf->multicompany->enabled) || !$user->entity || ($object->entity == $conf->entity) || ($conf->global->MULTICOMPANY_TRANSVERSE_MODE && $conf->entity == 1))) diff --git a/htdocs/website/websiteaccount_card.php b/htdocs/website/websiteaccount_card.php index 36eb72dd916..046a5005e51 100644 --- a/htdocs/website/websiteaccount_card.php +++ b/htdocs/website/websiteaccount_card.php @@ -306,7 +306,9 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { // Send - print '
'.$langs->trans('SendMail').'
'."\n"; + if (empty($user->socid)) { + print '
'.$langs->trans('SendMail').'
'."\n"; + } if ($user->rights->website->write) { diff --git a/htdocs/zapier/hook_card.php b/htdocs/zapier/hook_card.php index d4dec007d86..c2755892716 100644 --- a/htdocs/zapier/hook_card.php +++ b/htdocs/zapier/hook_card.php @@ -334,9 +334,6 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea if (empty($reshook)) { - // Send - print ''.$langs->trans('SendMail').''."\n"; - // Modify if ($user->rights->mymodule->write) {