Debug v18

This commit is contained in:
Laurent Destailleur 2023-04-18 16:40:38 +02:00
parent d907944a4d
commit 224c7b1847
4 changed files with 15 additions and 14 deletions

View File

@ -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)) {

View File

@ -1339,7 +1339,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
// Photo - Name
if (!empty($arrayfields['t.name']['checked'])) {
print '<td>';
print '<td class="tdoverflowmax150">';
print $form->showphoto('contact', $contactstatic, 0, 0, 0, 'photorefnoborder valignmiddle marginrightonly', 'small', 1, 0, 1);
print $contactstatic->getNomUrl(0, '', 0, '&backtopage='.urlencode($backtopage));
print '</td>';
@ -1347,17 +1347,18 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
// Job position
if (!empty($arrayfields['t.poste']['checked'])) {
print '<td>';
print '<td class="tdoverflowmax100" title="'.dol_escape_htmltag($obj->poste).'">';
if ($obj->poste) {
print $obj->poste;
print dol_escape_htmltag($obj->poste);
}
print '</td>';
}
// Address - Phone - Email
if (!empty($arrayfields['t.address']['checked'])) {
print '<td>';
print $contactstatic->getBannerAddress('contact', $object);
$addresstoshow = $contactstatic->getBannerAddress('contact', $object);
print '<td class="tdoverflowmax150" title="'.dol_escape_htmltag(dol_string_nohtmltag($addresstoshow)).'">';
print $addresstoshow;
print '</td>';
}
@ -1379,7 +1380,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
// Birthday
if (!empty($arrayfields['t.birthday']['checked'])) {
print '<td>';
print '<td class="nowraponall">';
print dol_print_date($db->jdate($obj->birthday));
print '</td>';
}
@ -1390,7 +1391,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
}
if ($showuserlogin) {
print '<td>';
print '<td class="tdoverflowmax125">';
$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 '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("NoRecordFound").'</td></tr>';
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("NoRecordFound").'</span></td></tr>';
}
} else {
$colspan = 1 + ($showuserlogin ? 1 : 0);
@ -1442,7 +1443,7 @@ function show_contacts($conf, $langs, $db, $object, $backtopage = '', $showuserl
$colspan++;
}
}
print '<tr><td colspan="'.$colspan.'" class="opacitymedium">'.$langs->trans("None").'</td></tr>';
print '<tr><td colspan="'.$colspan.'"><span class="opacitymedium">'.$langs->trans("None").'</span></td></tr>';
}
print "\n</table>\n";
print '</div>';

View File

@ -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";

View File

@ -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 '<a class="butAction" href="'.DOL_URL_ROOT.'/fourn/facture/card.php?action=create&amp;origin='.$object->element.'&amp;originid='.$object->id.'&amp;socid='.$object->socid.'">'.$langs->trans("CreateBill").'</a>';
@ -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';
}