diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php index 20c88c3479a..c71afe928ae 100644 --- a/htdocs/admin/mails_templates.php +++ b/htdocs/admin/mails_templates.php @@ -215,10 +215,10 @@ if (isModEnabled('ficheinter')) { if (isModEnabled('supplier_proposal')) { $elementList['supplier_proposal_send'] = img_picto('', 'propal', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierRequestForQuotation')); } -if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->commande->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_order") && !empty($user->rights->supplier_order->lire))) { +if (isModEnabled("supplier_order") && ($user->hasRight('fournisseur', 'commande', 'lire') || $user->hasRight('supplier_order', 'read'))) { $elementList['order_supplier_send'] = img_picto('', 'order', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierOrder')); } -if ((isModEnabled("fournisseur") && !empty($user->rights->fournisseur->facture->lire) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || (isModEnabled("supplier_invoice") && !empty($user->rights->supplier_invoice->lire))) { +if (isModEnabled("supplier_invoice") && ($user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('supplier_invoice', 'read'))) { $elementList['invoice_supplier_send'] = img_picto('', 'bill', 'class="pictofixedwidth"').dol_escape_htmltag($langs->trans('MailToSendSupplierInvoice')); } if (isModEnabled('contrat') && !empty($user->rights->contrat->lire)) { diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 60537abd797..7f051a1672e 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -1339,7 +1339,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl // Photo - Name if (!empty($arrayfields['t.name']['checked'])) { - print ''; + print ''; print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 1); print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage)); print ''; @@ -1347,17 +1347,18 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl // Job position if (!empty($arrayfields['t.poste']['checked'])) { - print ''; + print ''; if ($obj->poste) { - print $obj->poste; + print dol_escape_htmltag($obj->poste); } print ''; } // Address - Phone - Email if (!empty($arrayfields['t.address']['checked'])) { - print ''; - print $contactstatic->getBannerAddress('contact', $object); + $addresstoshow = $contactstatic->getBannerAddress('contact', $object); + print ''; + print $addresstoshow; print ''; } @@ -1379,7 +1380,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl // Birthday if (!empty($arrayfields['t.birthday']['checked'])) { - print ''; + print ''; print dol_print_date($db->jdate($obj->birthday)); print ''; } @@ -1390,7 +1391,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl } if ($showuserlogin) { - print ''; + print ''; $tmpuser= new User($db); $resfetch = $tmpuser->fetch(0, '', '', 0, -1, '', $contactstatic->id); if ($resfetch > 0) { @@ -1433,7 +1434,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $colspan++; } } - print ''.$langs->trans("NoRecordFound").''; + print ''.$langs->trans("NoRecordFound").''; } } else { $colspan = 1 + ($showuserlogin ? 1 : 0); @@ -1442,7 +1443,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl $colspan++; } } - print ''.$langs->trans("None").''; + print ''.$langs->trans("None").''; } print "\n\n"; print ''; diff --git a/htdocs/core/lib/invoice.lib.php b/htdocs/core/lib/invoice.lib.php index 8933ac848cf..17752f9081b 100644 --- a/htdocs/core/lib/invoice.lib.php +++ b/htdocs/core/lib/invoice.lib.php @@ -1142,7 +1142,7 @@ function getPurchaseInvoiceUnpaidOpenTable($maxCount = 500, $socid = 0) $result = ''; - if ((isModEnabled("fournisseur") && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD) && $user->rights->fournisseur->facture->lire) || (isModEnabled("supplier_invoice") && $user->hasRight('supplier_invoice', 'lire')) { + if (isModEnabled("supplier_invoice") && ($user->hasRight('fournisseur', 'facture', 'lire') || $user->hasRight('supplier_invoice', 'read'))) { $facstatic = new FactureFournisseur($db); $sql = "SELECT ff.rowid, ff.ref, ff.fk_statut as status, ff.type, ff.libelle as label, ff.total_ht, ff.total_tva, ff.total_ttc, ff.paye"; diff --git a/htdocs/reception/card.php b/htdocs/reception/card.php index 757f52b9d49..4280dabfc9d 100644 --- a/htdocs/reception/card.php +++ b/htdocs/reception/card.php @@ -2140,7 +2140,7 @@ if ($action == 'create') { // Create bill if (isModEnabled("supplier_invoice") && ($object->statut == Reception::STATUS_VALIDATED || $object->statut == Reception::STATUS_CLOSED)) { - if ($user->rights->fournisseur->facture->creer || $user->rights->supplier_invoice->creer) { + if ($user->hasRight('fournisseur', 'facture', 'creer') || $user->hasRight('supplier_invoice', 'creer')) { // TODO show button only if (!empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) // If we do that, we must also make this option official. print ''.$langs->trans("CreateBill").''; @@ -2153,7 +2153,7 @@ if ($action == 'create') { if ($user->rights->reception->creer && $object->statut > 0 && !$object->billed) { $label = "Close"; $paramaction = 'classifyclosed'; // = Transferred/Received // Label here should be "Close" or "ClassifyBilled" if we decided to make bill on receptions instead of orders - if (isModEnabled("supplier_order")) && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? + if (isModEnabled("supplier_order") && !empty($conf->global->WORKFLOW_BILL_ON_RECEPTION)) { // Quand l'option est on, il faut avoir le bouton en plus et non en remplacement du Close ? $label = "ClassifyBilled"; $paramaction = 'classifybilled'; }