diff --git a/dev/build/phpstan/phpstan-baseline.neon b/dev/build/phpstan/phpstan-baseline.neon index 13c5539c16e..c092f13c4fd 100644 --- a/dev/build/phpstan/phpstan-baseline.neon +++ b/dev/build/phpstan/phpstan-baseline.neon @@ -10749,7 +10749,7 @@ parameters: - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue - count: 1 + count: 2 path: ../../../htdocs/core/lib/company.lib.php - diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php index afda0e31733..b32c64b8b35 100644 --- a/htdocs/admin/mails.php +++ b/htdocs/admin/mails.php @@ -382,6 +382,7 @@ if ($action == 'edit') { clearstatcache(); + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -613,11 +614,11 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameters").'
'; - + print '
'; print '
'; - + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -664,6 +665,7 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("OtherOptions").'
'; + print '
'; print dol_get_fiche_end(); @@ -868,7 +870,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) { if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); } @@ -892,7 +894,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_FORCE_SENDTO").''.getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'); if (getDolGlobalString('MAIN_MAIL_FORCE_SENDTO')) { if (!isValidEmail(getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_FORCE_SENDTO'))); } else { print img_warning($langs->trans("RecipientEmailsWillBeReplacedWithThisValue")); } @@ -910,7 +912,7 @@ if ($action == 'edit') { if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM')) { print img_warning($langs->trans("Mandatory")); } elseif (!isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM'))); } print ''; @@ -958,7 +960,7 @@ if ($action == 'edit') { print ''.$langs->trans("MAIN_MAIL_ERRORS_TO").''; print ''.(getDolGlobalString('MAIN_MAIL_ERRORS_TO')); if (getDolGlobalString('MAIN_MAIL_ERRORS_TO') && !isValidEmail(getDolGlobalString('MAIN_MAIL_ERRORS_TO'))) { - print img_warning($langs->trans("ErrorBadEMail")); + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_ERRORS_TO'))); } print ''; diff --git a/htdocs/admin/mails_passwordreset.php b/htdocs/admin/mails_passwordreset.php index 5f3b07ce7ee..6433b63486c 100644 --- a/htdocs/admin/mails_passwordreset.php +++ b/htdocs/admin/mails_passwordreset.php @@ -104,6 +104,10 @@ if ($action == 'update' && !$cancel) { dolibarr_set_const($db, "MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_STARTTLS_PASSWORDRESET"), 'chaine', 0, '', $conf->entity); dolibarr_set_const($db, "MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_SMTP_ALLOW_SELF_SIGNED_PASSWORDRESET"), 'chaine', 0, '', $conf->entity); + if (GETPOSTISSET("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET")) { + dolibarr_set_const($db, "MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", GETPOST("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", 'alphanohtml'), 'chaine', 0, '', $conf->entity); + } + header("Location: ".$_SERVER["PHP_SELF"]."?mainmenu=home&leftmenu=setup"); exit; } @@ -349,6 +353,7 @@ if ($action == 'edit') { clearstatcache(); + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table print ''; print ''; @@ -553,6 +558,26 @@ if ($action == 'edit') { print ''; print '
'.$langs->trans("Parameters").'
'; + print '
'; + + print '
'; + + + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + print ''; + print ''; + + // From + $help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; + print ''; + + print '
'.$langs->trans("OtherOptions").'
'; + print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); + print ' '.$help; + print '
'; + print '
'; print dol_get_fiche_end(); @@ -685,6 +710,36 @@ if ($action == 'edit') { print ''; print ''; + + print '
'; + + + print '
'; // You can use div-table-responsive-no-min if you don't need reserved height for your table + print ''; + print ''; + + // From + $help = $form->textwithpicto('', $langs->trans("EMailHelpMsgSPFDKIM")); + print ''; + print ''; + + print '
'.$langs->trans("OtherOptions").'
'; + print $langs->trans("MAIN_MAIL_EMAIL_FROM", ini_get('sendmail_from') ? ini_get('sendmail_from') : $langs->transnoentities("Undefined")); + print ' '.$help; + print ''; + if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) { + print ''.getDolGlobalString('MAIN_MAIL_EMAIL_FROM').''; + } else { + print getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'); + } + if (!getDolGlobalString('MAIN_MAIL_EMAIL_FROM') && !getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET')) { + print img_warning($langs->trans("Mandatory")); + } elseif (getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET') && !isValidEmail(getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))) { + print img_warning($langs->trans("ErrorBadEMail", getDolGlobalString('MAIN_MAIL_EMAIL_FROM_PASSWORDRESET'))); + } + print '
'; + print '
'; + print dol_get_fiche_end(); diff --git a/htdocs/admin/pdf_other.php b/htdocs/admin/pdf_other.php index 73b4d52596c..8e5bbe44ae5 100644 --- a/htdocs/admin/pdf_other.php +++ b/htdocs/admin/pdf_other.php @@ -224,11 +224,33 @@ if (isModEnabled('propal')) { print ajax_constantonoff('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, $conf->global->MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING); + print $form->selectarray("MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING", $arrval, getDolGlobalString('MAIN_PDF_PROPAL_USE_ELECTRONIC_SIGNING')); } print ''; */ + print ''; + print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_PROPAL_SHOW_PRICE_INCL_TAX'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_PROPAL_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_PROPAL_SHOW_PRICE_INCL_TAX')); + } + print ''; + + print ''; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_PROPOSALS_WITH_PICTURE')); + } + print ''; + print ''; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_PROPAL"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -236,18 +258,7 @@ if (isModEnabled('propal')) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_PROPAL'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_PROPAL); - } - print ''; - - print ''; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_PROPOSALS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_PROPOSALS_WITH_PICTURE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_PROPOSALS_WITH_PICTURE", $arrval, $conf->global->MAIN_GENERATE_PROPOSALS_WITH_PICTURE); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_PROPAL", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_PROPAL')); } print ''; @@ -261,7 +272,31 @@ if (isModEnabled('order')) { print '
'; print ''; + print ''; + + print ''; + + print ''; + print ''; - print ''; @@ -289,74 +324,6 @@ if (isModEnabled('order')) { } -if (isModEnabled('supplier_proposal')) { - $langs->load("supplier_proposal"); - print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal'); - - print '
'; - print '
'.$langs->trans("Parameters").'
'; + print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_ORDER_SHOW_PRICE_INCL_TAX'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_ORDER_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_ORDER_SHOW_PRICE_INCL_TAX')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_ORDERS_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_ORDERS_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_ORDERS_WITH_PICTURE')); + } + print '
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_ORDER"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -269,18 +304,18 @@ if (isModEnabled('order')) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_ORDER'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_ORDER); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_ORDER", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_ORDER')); } print '
'; + print '
'; print $form->textwithpicto($langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESS"), $langs->trans("SALES_ORDER_SHOW_SHIPPING_ADDRESSMore")); print ''; if ($conf->use_javascript_ajax) { print ajax_constantonoff('SALES_ORDER_SHOW_SHIPPING_ADDRESS'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->SALES_ORDER_SHOW_SHIPPING_ADDRESS); + print $form->selectarray("SALES_ORDER_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('SALES_ORDER_SHOW_SHIPPING_ADDRESS')); } print '
'; - print ''; - - print ''; - - print ''; - - print '
'.$langs->trans("Parameter").'
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE); - } - print '
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN); - } - print '
'; - print '
'; -} - - -if (isModEnabled('supplier_order')) { - $langs->load("supplier_order"); - print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal'); - - print '
'; - print ''; - print ''; - - print ''; - - print ''; - - print '
'.$langs->trans("Parameter").'
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE); - } - print '
'; - print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), ''); - print ''; - if ($conf->use_javascript_ajax) { - print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN'); - } else { - $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, $conf->global->MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN); - } - print '
'; - print '
'; -} if (isModEnabled('invoice')) { print load_fiche_titre($langs->trans("Invoices"), '', 'bill'); @@ -365,6 +332,28 @@ if (isModEnabled('invoice')) { print ''; print ''; + print ''; + + print ''; + print ''; + print ''; @@ -466,7 +456,77 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('INVOICE_HIDE_LINKED_OBJECT'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, $conf->global->INVOICE_HIDE_LINKED_OBJECT); + print $form->selectarray("INVOICE_HIDE_LINKED_OBJECT", $arrval, getDolGlobalString('INVOICE_HIDE_LINKED_OBJECT')); + } + print ''; + + print '
'.$langs->trans("Parameters").'
'; + print $form->textwithpicto($langs->trans("PDF_XXX_SHOW_PRICE_INCL_TAX"), $langs->trans("AvailableWithSomePDFTemplatesOnly")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('PDF_INVOICE_SHOW_PRICE_INCL_TAX'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("PDF_INVOICE_SHOW_PRICE_INCL_TAX", $arrval, getDolGlobalString('PDF_INVOICE_SHOW_PRICE_INCL_TAX')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_WITH_PICTURE"), $langs->trans("RandomlySelectedIfSeveral")); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_INVOICES_WITH_PICTURE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_INVOICES_WITH_PICTURE", $arrval, getDolGlobalString('MAIN_GENERATE_INVOICES_WITH_PICTURE')); + } + print '
'; print $form->textwithpicto($langs->trans("MAIN_PDF_ADD_TERMSOFSALE_INVOICE"), $langs->trans("PdfAddTermOfSaleHelp")); print ''; @@ -372,9 +361,10 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('MAIN_PDF_ADD_TERMSOFSALE_INVOICE'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, $conf->global->MAIN_PDF_ADD_TERMSOFSALE_INVOICE); + print $form->selectarray("MAIN_PDF_ADD_TERMSOFSALE_INVOICE", $arrval, getDolGlobalString('MAIN_PDF_ADD_TERMSOFSALE_INVOICE')); } print '
'; print $form->textwithpicto($langs->trans("INVOICE_ADD_ZATCA_QR_CODE"), $langs->trans("INVOICE_ADD_ZATCA_QR_CODEMore")); print ''; @@ -430,7 +420,7 @@ if (isModEnabled('invoice')) { print ajax_constantonoff('INVOICE_SHOW_SHIPPING_ADDRESS'); } else { $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); - print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, $conf->global->INVOICE_SHOW_SHIPPING_ADDRESS); + print $form->selectarray("INVOICE_SHOW_SHIPPING_ADDRESS", $arrval, getDolGlobalString('INVOICE_SHOW_SHIPPING_ADDRESS')); } print '
'; + print ''; +} + + +if (isModEnabled('supplier_proposal')) { + $langs->load("supplier_proposal"); + print load_fiche_titre($langs->trans("SupplierProposal"), '', 'supplier_proposal'); + + print '
'; + print ''; + print ''; + + print ''; + + print ''; + + print '
'.$langs->trans("Parameter").'
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN')); + } + print '
'; + print '
'; +} + + +if (isModEnabled('supplier_order')) { + $langs->load("supplier_order"); + print load_fiche_titre($langs->trans("SupplierOrder"), '', 'supplier_proposal'); + + print '
'; + print ''; + print ''; + + print ''; + + print ''; @@ -495,7 +555,6 @@ if (isModEnabled('shipping')) { print ''; } - if (isModEnabled('reception')) { print load_fiche_titre($langs->trans("Receptions"), '', 'reception'); @@ -572,7 +631,7 @@ $maxfilesizearray = getMaxFileSizeArray(); $tooltiptermsofsale .= ($maxfilesizearray['maxmin'] > 0) ? '
'.$langs->trans('MaxSize').' : '.$maxfilesizearray['maxmin'].' '.$langs->trans('Kb') : ''; $documenturl = DOL_URL_ROOT.'/document.php'; if (isset($conf->global->DOL_URL_ROOT_DOCUMENT_PHP)) { - $documenturl = $conf->global->DOL_URL_ROOT_DOCUMENT_PHP; + $documenturl = getDolGlobalString('DOL_URL_ROOT_DOCUMENT_PHP'); } $modulepart = 'mycompany'; diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php index b15f1f714ef..47debff0fd2 100644 --- a/htdocs/comm/action/list.php +++ b/htdocs/comm/action/list.php @@ -469,6 +469,12 @@ if ($filtert > 0 || $usergroup > 0) { if ($usergroup > 0) { $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."usergroup_user as ugu ON ugu.fk_user = ar.fk_element"; } + +// Add table from hooks +$parameters = array(); +$reshook = $hookmanager->executeHooks('printFieldListFrom', $parameters, $object, $action); // Note that $action and $object may have been modified by hook +$sql .= $hookmanager->resPrint; + $sql .= " WHERE a.entity IN (".getEntity('agenda').")"; // Condition on actioncode if (!empty($actioncode)) { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 681b708b5e3..081725e89e3 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -104,7 +104,7 @@ class Facture extends CommonInvoice protected $table_ref_field = 'ref'; /** - * @var int ID + * @var int|null ID * @deprecated Use $user_creation_id */ public $fk_user_author; @@ -2554,9 +2554,12 @@ class Facture extends CommonInvoice if (isset($this->retained_warranty)) { $this->retained_warranty = (float) $this->retained_warranty; } - - // Check parameters - // Put here code to add control on parameters values + if (!isset($this->user_creation_id) && isset($this->fk_user_author) ) { + $this->user_creation_id = $this->fk_user_author; + } + if (!isset($this->user_validation_id) && isset($this->fk_user_valid) ) { + $this->user_validation_id = $this->fk_user_valid; + } // Update request $sql = "UPDATE ".MAIN_DB_PREFIX."facture SET"; @@ -2581,7 +2584,8 @@ class Facture extends CommonInvoice $sql .= " total_ttc=".(isset($this->total_ttc) ? (float) $this->total_ttc : "null").","; $sql .= " revenuestamp=".((isset($this->revenuestamp) && $this->revenuestamp != '') ? (float) $this->revenuestamp : "null").","; $sql .= " fk_statut=".(isset($this->status) ? (int) $this->status : "null").","; - $sql .= " fk_user_valid=".(isset($this->fk_user_valid) ? (int) $this->fk_user_valid : "null").","; + $sql .= " fk_user_author=".(isset($this->user_creation_id) ? ((int) $this->user_creation_id) : "null").","; + $sql .= " fk_user_valid=".(isset($this->user_validation_id) ? (int) $this->user_validation_id : "null").","; $sql .= " fk_facture_source=".(isset($this->fk_facture_source) ? (int) $this->fk_facture_source : "null").","; $sql .= " fk_projet=".(isset($this->fk_project) ? (int) $this->fk_project : "null").","; $sql .= " fk_cond_reglement=".(isset($this->cond_reglement_id) ? (int) $this->cond_reglement_id : "null").","; @@ -3324,10 +3328,17 @@ class Facture extends CommonInvoice } } if ($key == 'TVA_INTRA') { - // Check for mandatory - if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') && ($this->thirdparty->tva_assuj) && empty($this->thirdparty->tva_intra)) { + // Check for mandatory vat number + if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') == 'eeconly') { + if (($this->thirdparty->tva_assuj) && empty($this->thirdparty->tva_intra) && $this->thirdparty->isInEEC()) { + $langs->load("errors"); + $this->error = $langs->trans('ErrorProdIdIsMandatoryForEuThirdparties', $langs->transnoentitiesnoconv('VATIntra')).' ('.$langs->transnoentitiesnoconv("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; + dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); + return -1; + } + } elseif (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') && ($this->thirdparty->tva_assuj) && empty($this->thirdparty->tva_intra)) { $langs->load("errors"); - $this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->trans('VATIntra')).' ('.$langs->trans("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; + $this->error = $langs->trans('ErrorProdIdIsMandatory', $langs->transnoentitiesnoconv('VATIntra')).' ('.$langs->transnoentitiesnoconv("ForbiddenBySetupRules").') ['.$langs->trans('Company').' : '.$this->thirdparty->name.']'; dol_syslog(__METHOD__.' '.$this->error, LOG_ERR); return -1; } diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 8aab950b74e..b1e97a53395 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -704,7 +704,7 @@ abstract class CommonObject public $user_creation; /** - * @var int User id author/creation + * @var int|null User id author/creation */ public $user_creation_id; diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php index 0ffc40ac8f8..3cf1933fed9 100644 --- a/htdocs/core/lib/company.lib.php +++ b/htdocs/core/lib/company.lib.php @@ -2683,9 +2683,54 @@ function addMailingEventTypeSQL($actioncode, $objcon, $filterobj) } +/** + * Show header of company in HTML public pages + * + * @param Societe $mysoc Third party + * @param Translate $langs Output language + * @return void + */ +function htmlPrintOnlineHeader($mysoc, $langs) +{ + global $conf; + + // Define urllogo + $urllogo = DOL_URL_ROOT.'/theme/common/login_logo.png'; + + if (!empty($mysoc->logo_small) && is_readable($conf->mycompany->dir_output.'/logos/thumbs/'.$mysoc->logo_small)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/thumbs/'.$mysoc->logo_small); + } elseif (!empty($mysoc->logo) && is_readable($conf->mycompany->dir_output.'/logos/'.$mysoc->logo)) { + $urllogo = DOL_URL_ROOT.'/viewimage.php?cache=1&modulepart=mycompany&file='.urlencode('logos/'.$mysoc->logo); + } elseif (is_readable(DOL_DOCUMENT_ROOT.'/theme/dolibarr_logo.svg')) { + $urllogo = DOL_URL_ROOT.'/theme/dolibarr_logo.svg'; + } + + print '
'; + + // Output html code for logo + if ($urllogo) { + print '
'; + print '
'; + print ''; + print '
'; + if (!getDolGlobalString('MAIN_HIDE_POWERED_BY')) { + print ''; + } + print '
'; + } + + if (getDolGlobalString('MEMBER_IMAGE_PUBLIC_REGISTRATION')) { + print '
'; + print ''; + print '
'; + } + + print '
'; +} + /** - * Show footer of company in HTML pages + * Show footer of company in HTML public pages * * @param Societe $fromcompany Third party * @param Translate $langs Output language diff --git a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php index e4199a5bf8e..0b068fbfa22 100644 --- a/htdocs/core/modules/commande/doc/pdf_proforma.modules.php +++ b/htdocs/core/modules/commande/doc/pdf_proforma.modules.php @@ -47,7 +47,7 @@ class pdf_proforma extends pdf_eratosthene */ public function __construct($db) { - global $conf, $langs, $mysoc; + global $langs; parent::__construct($db); diff --git a/htdocs/ecm/class/ecmfiles.class.php b/htdocs/ecm/class/ecmfiles.class.php index 142aaf70270..28db17eceb0 100644 --- a/htdocs/ecm/class/ecmfiles.class.php +++ b/htdocs/ecm/class/ecmfiles.class.php @@ -1013,9 +1013,17 @@ class EcmFiles extends CommonObject } elseif ($option == 'commande_fournisseur') { $tmppath = preg_replace('/^fournisseur\/commande\//', '', $this->filepath); } else { - $tmppath = preg_replace('/^[^\/]+\//', '', $this->filepath); + if ((int) $this->entity > 1) { + // Remove the part "entityid/commande/" into "entityid/commande/REFXXX" to get only the ref + $tmppath = preg_replace('/^\d+\/[^\/]+\//', '', $this->filepath); + } else { + // Remove the part "commande/" into "commande/REFXXX" to get only the ref + $tmppath = preg_replace('/^[^\/]+\//', '', $this->filepath); + } } - $url = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($option).'&file='.urlencode($tmppath.'/'.$this->filename).'&entity='.$this->entity; + //var_dump($this->filepath); + + $url = DOL_URL_ROOT.'/document.php?modulepart='.urlencode($option).'&file='.urlencode($tmppath.'/'.$this->filename).'&entity='.((int) $this->entity); } else { $url = DOL_URL_ROOT.'/ecm/file_card.php?id='.$this->id; } diff --git a/htdocs/expedition/dispatch.php b/htdocs/expedition/dispatch.php index 0711f4597fb..b2baa27b425 100644 --- a/htdocs/expedition/dispatch.php +++ b/htdocs/expedition/dispatch.php @@ -785,13 +785,16 @@ if ($object->id > 0 || !empty($object->ref)) { print ''; // Dispatch column print ''; // Warehouse column - $sql = "SELECT ed.rowid, ed.qty, ed.fk_entrepot,"; - $sql .= " eb.batch, eb.eatby, eb.sellby, cd.fk_product"; - $sql .= " FROM ".MAIN_DB_PREFIX."expeditiondet as ed"; - $sql .= " LEFT JOIN ".MAIN_DB_PREFIX."expeditiondet_batch as eb on ed.rowid = eb.fk_expeditiondet"; - $sql .= " JOIN ".MAIN_DB_PREFIX."commandedet as cd on ed.fk_elementdet = cd.rowid"; - $sql .= " WHERE ed.fk_elementdet =".(int) $objp->rowid; - $sql .= " AND ed.fk_expedition =".(int) $object->id; + $sql = "SELECT ed.rowid"; + $sql .= ", cd.fk_product"; + $sql .= ", ".$db->ifsql('eb.rowid IS NULL', 'ed.qty', 'eb.qty')." as qty"; + $sql .= ", ed.fk_entrepot"; + $sql .= ", eb.batch, eb.eatby, eb.sellby"; + $sql .= " FROM ".$db->prefix()."expeditiondet as ed"; + $sql .= " LEFT JOIN ".$db->prefix()."expeditiondet_batch as eb on ed.rowid = eb.fk_expeditiondet"; + $sql .= " INNER JOIN ".$db->prefix()."commandedet as cd on ed.fk_origin_line = cd.rowid"; + $sql .= " WHERE ed.fk_origin_line = ".(int) $objp->rowid; + $sql .= " AND ed.fk_expedition = ".(int) $object->id; $sql .= " ORDER BY ed.rowid, ed.fk_elementdet"; $resultsql = $db->query($sql); diff --git a/htdocs/expedition/shipment.php b/htdocs/expedition/shipment.php index c0d84059027..a964ea621b4 100644 --- a/htdocs/expedition/shipment.php +++ b/htdocs/expedition/shipment.php @@ -94,7 +94,7 @@ $result = restrictedArea($user, 'expedition', 0, ''); // We use 0 for id, becaus $permissiontoread = $user->hasRight('expedition', 'lire'); $permissiontoadd = $user->hasRight('expedition', 'creer'); // Used by the include of actions_addupdatedelete.inc.php and actions_lineupdown.inc.php -$permissiontodelete = $user->hasRight('expedition', 'supprimer') || ($permissiontoadd && isset($object->status) && $object->status == $object::STATUS_DRAFT); +$permissiontodelete = $user->hasRight('expedition', 'supprimer') || ($permissiontoadd && ((int) $object->status == $object::STATUS_DRAFT)); $permissionnote = $user->hasRight('expedition', 'creer'); // Used by the include of actions_setnotes.inc.php $permissiondellink = $user->hasRight('expedition', 'creer'); // Used by the include of actions_dellink.inc.php diff --git a/htdocs/fourn/facture/card-rec.php b/htdocs/fourn/facture/card-rec.php index 86150a73118..c3529974a76 100644 --- a/htdocs/fourn/facture/card-rec.php +++ b/htdocs/fourn/facture/card-rec.php @@ -737,6 +737,7 @@ if (empty($reshook)) { unset($_POST['date_end_fill']); unset($_POST['situations']); unset($_POST['progress']); + unset($_POST['fourn_ref']); } else { setEventMessages($object->error, $object->errors, 'errors'); } @@ -879,6 +880,7 @@ if (empty($reshook)) { unset($_POST['date_endyear']); unset($_POST['situations']); unset($_POST['progress']); + unset($_POST['fourn_ref']); } else { setEventMessages($object->error, $object->errors, 'errors'); } diff --git a/htdocs/langs/en_US/accountancy.lang b/htdocs/langs/en_US/accountancy.lang index c89a5f9a3f9..1af4cfa6c57 100644 --- a/htdocs/langs/en_US/accountancy.lang +++ b/htdocs/langs/en_US/accountancy.lang @@ -412,6 +412,7 @@ SaleExport=Export sale SaleEEC=Sale in EEC SaleEECWithVAT=Sale in EEC with a VAT not null, so we suppose this is NOT an intracommunautary sale and the suggested account is the standard product account. SaleEECWithoutVATNumber=Sale in EEC with no VAT but the VAT ID of third party is not defined. We fall back on the account for standard sales. You can fix the VAT ID of the third party, or change the product account suggested for binding if needed. +AnySale=Any sale ForbiddenTransactionAlreadyExported=Forbidden: The transaction has been validated and/or exported. ForbiddenTransactionAlreadyValidated=Forbidden: The transaction has been validated. DataMustHaveBeenTransferredInAccounting=The transfer of data in accounting must have been done diff --git a/htdocs/langs/en_US/admin.lang b/htdocs/langs/en_US/admin.lang index df17e0ee429..a8c61ef799f 100644 --- a/htdocs/langs/en_US/admin.lang +++ b/htdocs/langs/en_US/admin.lang @@ -2137,6 +2137,7 @@ MAIN_PDF_MARGIN_BOTTOM=Bottom margin on PDF MAIN_DOCUMENTS_LOGO_HEIGHT=Height for logo on PDF DOC_SHOW_FIRST_SALES_REP=Show first sales representative MAIN_GENERATE_PROPOSALS_WITH_PICTURE=Add column for picture on proposal lines +MAIN_GENERATE_DOCUMENTS_WITH_PICTURE=Add column for picture on document lines MAIN_DOCUMENTS_WITH_PICTURE_WIDTH=Width of the column if a picture is added on lines MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_UNIT_PRICE=Hide the unit price column on quotation requests MAIN_GENERATE_DOCUMENTS_SUPPLIER_PROPOSAL_WITHOUT_TOTAL_COLUMN=Hide the total price column on quotation requests @@ -2611,3 +2612,5 @@ UploadExtensionRestriction=List of forbidden file extensions to upload UploadExtensionRestrictionExemple=htm, html, shtml, js, php Privileges=Privileges FieldsLinked=Fields Linked +PDF_XXX_SHOW_PRICE_INCL_TAX=Show column Price including tax +AvailableWithSomePDFTemplatesOnly=Feature not supported on old PDF templates diff --git a/htdocs/langs/en_US/errors.lang b/htdocs/langs/en_US/errors.lang index 1f9126c5962..038534f56fa 100644 --- a/htdocs/langs/en_US/errors.lang +++ b/htdocs/langs/en_US/errors.lang @@ -31,6 +31,7 @@ ErrorFromToAccountsMustDiffers=Source and targets bank accounts must be differen ErrorBadThirdPartyName=Bad value for third-party name ForbiddenBySetupRules=Forbidden by setup rules ErrorProdIdIsMandatory=The %s is mandatory +ErrorProdIdIsMandatoryForEuThirdparties=The %s is mandatory for customers in EEC ErrorAccountancyCodeCustomerIsMandatory=The accountancy code of customer %s is mandatory ErrorAccountancyCodeSupplierIsMandatory=The accountancy code of supplier %s is mandatory ErrorBadCustomerCodeSyntax=Bad syntax for customer code diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index b406d67b761..37c0f19ee04 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5561,8 +5561,6 @@ class Product extends CommonObject */ public function getChildsArbo($id, $firstlevelonly = 0, $level = 1, $parents = array()) { - global $alreadyfound; - if (empty($id)) { return array(); } @@ -5579,9 +5577,6 @@ class Product extends CommonObject dol_syslog(get_class($this).'::getChildsArbo id='.$id.' level='.$level. ' parents='.(is_array($parents) ? implode(',', $parents) : $parents), LOG_DEBUG); - if ($level == 1) { - $alreadyfound = array($id => 1); // We init array of found object to start of tree, so if we found it later (should not happened), we stop immediately - } // Protection against infinite loop if ($level > 30) { return array(); @@ -5590,14 +5585,16 @@ class Product extends CommonObject $res = $this->db->query($sql); if ($res) { $prods = array(); + if ($this->db->num_rows($res) > 0) { + $parents[] = $id; + } + while ($rec = $this->db->fetch_array($res)) { - if (!empty($alreadyfound[$rec['rowid']])) { + if (in_array($rec['id'], $parents)) { dol_syslog(get_class($this).'::getChildsArbo the product id='.$rec['rowid'].' was already found at a higher level in tree. We discard to avoid infinite loop', LOG_WARNING); - if (in_array($rec['id'], $parents)) { - continue; // We discard this child if it is already found at a higher level in tree in the same branch. - } + continue; // We discard this child if it is already found at a higher level in tree in the same branch. } - $alreadyfound[$rec['rowid']] = 1; + $prods[$rec['rowid']] = array( 0 => $rec['rowid'], 1 => $rec['qty'], @@ -5611,7 +5608,6 @@ class Product extends CommonObject //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty'],2=>$rec['fk_product_type']); //$prods[$this->db->escape($rec['label'])]= array(0=>$rec['id'],1=>$rec['qty']); if (empty($firstlevelonly)) { - $parents[] = $rec['rowid']; $listofchilds = $this->getChildsArbo($rec['rowid'], 0, $level + 1, $parents); foreach ($listofchilds as $keyChild => $valueChild) { $prods[$rec['rowid']]['childs'][$keyChild] = $valueChild; diff --git a/htdocs/public/members/new.php b/htdocs/public/members/new.php index df26dbf783a..40c79fc427e 100644 --- a/htdocs/public/members/new.php +++ b/htdocs/public/members/new.php @@ -978,7 +978,7 @@ if (getDolGlobalString('MEMBER_SKIP_TABLE') || getDolGlobalString('MEMBER_NEWFOR } } - +//htmlPrintOnlineFooter($mysoc, $langs); llxFooterVierge(); $db->close(); diff --git a/htdocs/public/onlinesign/newonlinesign.php b/htdocs/public/onlinesign/newonlinesign.php index 17506fc264a..566b45618cc 100644 --- a/htdocs/public/onlinesign/newonlinesign.php +++ b/htdocs/public/onlinesign/newonlinesign.php @@ -233,6 +233,7 @@ if ($action == 'confirm_refusepropal' && $confirm == 'yes') { // Test on pemriss */ $form = new Form($db); + $head = ''; if (getDolGlobalString('MAIN_SIGN_CSS_URL')) { $head = ''."\n"; @@ -241,8 +242,12 @@ if (getDolGlobalString('MAIN_SIGN_CSS_URL')) { $conf->dol_hide_topmenu = 1; $conf->dol_hide_leftmenu = 1; +$title = $langs->trans("OnlineSignature"); + $replacemainarea = (empty($conf->dol_hide_leftmenu) ? '
' : '').'
'; -llxHeader($head, $langs->trans("OnlineSignature"), '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); +llxHeader($head, $title, '', '', 0, 0, '', '', '', 'onlinepaymentbody', $replacemainarea, 1); + +htmlPrintOnlineHeader($mysoc, $langs); if ($action == 'refusepropal') { print $form->formconfirm($_SERVER["PHP_SELF"].'?ref='.urlencode($ref).'&securekey='.urlencode($SECUREKEY).(isModEnabled('multicompany') ? '&entity='.$entity : ''), $langs->trans('RefusePropal'), $langs->trans('ConfirmRefusePropal', $object->ref), 'confirm_refusepropal', '', '', 1); @@ -862,6 +867,7 @@ if ($action == "dosign" && empty($cancel)) { } print '
'."\n"; print '
'.$langs->trans("Parameter").'
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_UNIT_PRICE')); + } + print '
'; + print $form->textwithpicto($langs->trans("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN"), ''); + print ''; + if ($conf->use_javascript_ajax) { + print ajax_constantonoff('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN'); + } else { + $arrval = array('0' => $langs->trans("No"), '1' => $langs->trans("Yes")); + print $form->selectarray("MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN", $arrval, getDolGlobalString('MAIN_GENERATE_DOCUMENTS_PURCHASE_ORDER_WITHOUT_TOTAL_COLUMN')); } print '
'."\n"; + print ''."\n"; print '
'."\n"; print '
'; diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php index e36905642e7..e4e0925f5b1 100644 --- a/htdocs/societe/admin/societe.php +++ b/htdocs/societe/admin/societe.php @@ -43,7 +43,7 @@ require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php'; * @var User $user */ -$langs->loadLangs(array("admin", "companies", "other")); +$langs->loadLangs(array("admin", "accountancy", "companies", "other")); $action = GETPOST('action', 'aZ09'); $value = GETPOST('value', 'alpha'); @@ -329,9 +329,11 @@ if ($action == 'setprofidmandatory') { } //Activate ProfId invoice mandatory -if ($action == 'setprofidinvoicemandatory') { +if ($action == 'setprofidinvoicemandatory' || $action == 'setprofidinvoicemandatoryeeconly') { $status = GETPOST('status', 'alpha'); - + if ($status == '1' && $action == 'setprofidinvoicemandatoryeeconly') { + $status = 'eeconly'; + } $idprof = "SOCIETE_".$value."_INVOICE_MANDATORY"; $result = dolibarr_set_const($db, $idprof, $status, 'chaine', 0, '', $conf->entity); if ($result <= 0) { @@ -777,31 +779,52 @@ print ''.$langs->trans('VATIntra')."\n"; $key = 'VAT_INTRA'; if (getDolGlobalString('SOCIETE_VAT_INTRA_UNIQUE')) { print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle"'); print ''; } else { print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle"'); print ''; } if (getDolGlobalString('SOCIETE_VAT_INTRA_MANDATORY')) { print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); + print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle"'); print ''; } else { print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); + print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle"'); print ''; } -if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY')) { - print ''; - print img_picto($langs->trans("Activated"), 'switch_on'); - print ''; +print ''; +if (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY') == 'eeconly') { + print ''; + print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("SaleEEC").'
'; + print ''; + print img_picto($langs->trans("Activated"), 'switch_off', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("AnySale"); +} elseif (getDolGlobalString('SOCIETE_VAT_INTRA_INVOICE_MANDATORY')) { + print ''; + print img_picto($langs->trans("Activated"), 'switch_off', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("SaleEEC").'
'; + print ''; + print img_picto($langs->trans("Activated"), 'switch_on', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("AnySale"); } else { - print ''; - print img_picto($langs->trans("Disabled"), 'switch_off'); - print ''; + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("SaleEEC").'
'; + print ''; + print img_picto($langs->trans("Disabled"), 'switch_off', 'class="valignmiddle paddingrightonly"'); + print ''; + print $langs->trans("AnySale"); } +print ''; print "\n"; print "\n"; diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php index 3c46fd80675..5e7686e6d52 100644 --- a/htdocs/user/class/user.class.php +++ b/htdocs/user/class/user.class.php @@ -2650,7 +2650,7 @@ class User extends CommonObject public function send_password($user, $password = '', $changelater = 0) { // phpcs:enable - global $conf, $langs, $mysoc; + global $conf, $langs; global $dolibarr_main_url_root; require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php'; @@ -2663,12 +2663,12 @@ class User extends CommonObject $outputlangs = new Translate("", $conf); if (isset($this->conf->MAIN_LANG_DEFAULT) - && $this->conf->MAIN_LANG_DEFAULT != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) - $outputlangs->getDefaultLang($this->conf->MAIN_LANG_DEFAULT); + && getDolGlobalString('MAIN_LANG_DEFAULT') != 'auto') { // If user has defined its own language (rare because in most cases, auto is used) + $outputlangs->getDefaultLang(getDolGlobalString('MAIN_LANG_DEFAULT')); } - if ($this->conf->MAIN_LANG_DEFAULT) { - $outputlangs->setDefaultLang($this->conf->MAIN_LANG_DEFAULT); + if (getDolGlobalString('MAIN_LANG_DEFAULT')) { + $outputlangs->setDefaultLang(getDolGlobalString('MAIN_LANG_DEFAULT')); } else { // If user has not defined its own language, we used current language $outputlangs = $langs; } @@ -2729,7 +2729,7 @@ class User extends CommonObject $mailfile = new CMailFile( $subject, $this->email, - $conf->global->MAIN_MAIL_EMAIL_FROM, + getDolGlobalString("MAIN_MAIL_EMAIL_FROM_PASSWORDRESET", getDolGlobalString("MAIN_MAIL_EMAIL_FROM")), $mesg, array(), array(), diff --git a/htdocs/webportal/class/webportalorder.class.php b/htdocs/webportal/class/webportalorder.class.php index 1cbf082dccb..8c11ba5d92f 100644 --- a/htdocs/webportal/class/webportalorder.class.php +++ b/htdocs/webportal/class/webportalorder.class.php @@ -166,7 +166,7 @@ class WebPortalOrder extends Commande */ public function getTooltipContentArray($params) { - global $conf, $langs; + global $langs; $datas = []; @@ -174,9 +174,8 @@ class WebPortalOrder extends Commande return ['optimize' => $langs->trans("WebPortalOrder")]; } $datas['picto'] = img_picto('', $this->picto) . ' ' . $langs->trans("WebPortalOrder") . ''; - if (isset($this->status)) { - $datas['picto'] .= ' ' . $this->getLibStatut(5); - } + $datas['picto'] .= ' ' . $this->getLibStatut(5); + $datas['ref'] .= '
' . $langs->trans('Ref') . ': ' . $this->ref; return $datas;