diff --git a/htdocs/accountancy/class/accountingaccount.class.php b/htdocs/accountancy/class/accountingaccount.class.php index b129cfd98b3..7bef70f9873 100644 --- a/htdocs/accountancy/class/accountingaccount.class.php +++ b/htdocs/accountancy/class/accountingaccount.class.php @@ -880,7 +880,8 @@ class AccountingAccount extends CommonObject } // Manage Deposit - if (getDolGlobalString('ACCOUNTING_ACCOUNT_' . strtoupper($type) . '_DEPOSIT')) { + $account_deposit = getDolGlobalString('ACCOUNTING_ACCOUNT_' . strtoupper($type) . '_DEPOSIT'); + if (!empty($account_deposit) && $account_deposit != '-1') { if ($factureDet->desc == "(DEPOSIT)" || $facture->type == $facture::TYPE_DEPOSIT) { $accountdeposittoventilated = new self($this->db); if ($type == 'customer') { diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php index a98a7e79962..366c7253f8f 100644 --- a/htdocs/accountancy/supplier/index.php +++ b/htdocs/accountancy/supplier/index.php @@ -208,9 +208,9 @@ if ($action == 'validatehistory' && $user->hasRight('accounting', 'bind', 'write $product_static->label = $objp->product_label; $product_static->status = !empty($objp->status) ? $objp->status : 0; $product_static->status_buy = !empty($objp->status_buy) ? $objp->status_buy : 0; - $product_static->accountancy_code_sell = $objp->code_sell; - $product_static->accountancy_code_sell_intra = $objp->code_sell_intra; - $product_static->accountancy_code_sell_export = $objp->code_sell_export; + $product_static->accountancy_code_sell = !empty($objp->code_sell)? $objp->code_sell : ""; + $product_static->accountancy_code_sell_intra = !empty($objp->code_sell_intra)? $objp->code_sell_intra : ""; + $product_static->accountancy_code_sell_export = !empty($objp->code_sell_export)? $objp->code_sell_export : ""; $product_static->accountancy_code_buy = !empty($objp->code_buy) ? $objp->code_buy : ""; $product_static->accountancy_code_buy_intra = !empty($objp->code_buy_intra) ? $objp->code_buy_intra : ""; $product_static->accountancy_code_buy_export = !empty($objp->code_buy_export) ? $objp->code_buy_export : ""; diff --git a/htdocs/admin/const.php b/htdocs/admin/const.php index b921e787195..e5d0ac61528 100644 --- a/htdocs/admin/const.php +++ b/htdocs/admin/const.php @@ -226,10 +226,10 @@ print "\n"; print "\n"; print ''; -print ''; +print ''; print ''."\n"; print ''; -print ''; +print ''; print ''; print ''; print ''; diff --git a/htdocs/admin/security_captcha.php b/htdocs/admin/security_captcha.php index 7f620f9bfbf..55f96b22bea 100644 --- a/htdocs/admin/security_captcha.php +++ b/htdocs/admin/security_captcha.php @@ -244,6 +244,7 @@ if (isModEnabled('recruitment')) { print ''; } + if (isModEnabled('webportal')) { print '' . $langs->trans("UseCaptchaCode").' - WebPortal public form'; if (!empty($conf->use_javascript_ajax)) { @@ -264,6 +265,7 @@ if (isModEnabled('webportal')) { print ''; print ''; + $selectedcaptcha = getDolGlobalString('MAIN_SECURITY_ENABLECAPTCHA_HANDLER', 'standard'); if ($showavailablecaptcha) { diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php index 7f6b39fef35..59cae88ed92 100644 --- a/htdocs/admin/system/security.php +++ b/htdocs/admin/system/security.php @@ -860,7 +860,7 @@ $exampletodecrypt = GETPOST('exampletodecrypt', 'password'); print ''.$langs->trans("AlgorithmFor", $langs->transnoentitiesnoconv("SensitiveData")); print $form->textwithpicto('', 'reversible encryption done with dolEncrypt/dolDecrypt'); -print ' = '.constant('MAIN_SECURITY_REVERSIBLE_ALGO').' with a random seed + a crypt key defined into the conf.php file (in $dolibarr_main_dolcrypt_key or $dolibarr_main_instance_unique_id)
'; +print ' = '.constant('MAIN_SECURITY_REVERSIBLE_ALGO').' with a random seed + a crypt key defined into the conf.php file (in $dolibarr_main_instance_unique_id or $dolibarr_main_dolcrypt_key)
'; print '
'; print ''; print ''; diff --git a/htdocs/admin/tools/dolibarr_import.php b/htdocs/admin/tools/dolibarr_import.php index a1fb9a13883..1d134ca4c66 100644 --- a/htdocs/admin/tools/dolibarr_import.php +++ b/htdocs/admin/tools/dolibarr_import.php @@ -247,7 +247,7 @@ print '
3< print '
'; print ''; -print $langs->trans("RestoreDesc4", 'dolibarr_main_dolcrypt_key or dolibarr_main_instance_unique_id').'
'; +print $langs->trans("RestoreDesc4", 'dolibarr_main_instance_unique_id '.$langs->transnoentitiesnoconv("or").' dolibarr_main_dolcrypt_key').'
'; print '
'; print '
'; diff --git a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php index 977c902eeb0..5044088c06d 100644 --- a/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php +++ b/htdocs/core/triggers/interface_95_modWebhook_WebhookTriggers.class.php @@ -132,7 +132,7 @@ class InterfaceWebhookTriggers extends DolibarrTriggers if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) { $nbPosts++; } else { - $errormsg = "The WebHook for ".$action." failed to get URL ".$tmpobject->url." with httpcode=".(!empty($response['http_code']) ? $response['http_code'] : "")." curl_error_no=".(!empty($response['curl_error_no']) ? $response['curl_error_no'] : ""); + $errormsg = "The WebHook for triggercode ".$action." failed to do the GET URL ".$tmpobject->url." with httpcode=".(!empty($response['http_code']) ? $response['http_code'] : "")." curl_error_no=".(!empty($response['curl_error_no']) ? $response['curl_error_no'] : ""); $errorforhistory ++; if ($tmpobject->type == Target::TYPE_BLOCKING) { diff --git a/htdocs/fourn/facture/paiement.php b/htdocs/fourn/facture/paiement.php index 0b2b6e45b35..d5583859ee0 100644 --- a/htdocs/fourn/facture/paiement.php +++ b/htdocs/fourn/facture/paiement.php @@ -562,9 +562,18 @@ if ($action == 'create' || $action == 'confirm_paiement' || $action == 'add_paie $sql .= ' SUM(pf.amount) as am, SUM(pf.multicurrency_amount) as multicurrency_am'; $sql .= ' FROM '.MAIN_DB_PREFIX.'facture_fourn as f'; $sql .= ' LEFT JOIN '.MAIN_DB_PREFIX.'paiementfourn_facturefourn as pf ON pf.fk_facturefourn = f.rowid'; - $sql .= " WHERE f.entity = ".((int) $conf->entity); - $sql .= ' AND f.fk_soc = '.((int) $object->socid); - $sql .= ' AND f.paye = 0'; + $sql .= ' WHERE f.entity = '.((int) $conf->entity); + $sql .= ' AND (f.fk_soc = '.((int) $object->socid); + $aux = $object->fetch_thirdparty(); + // Can pay invoices of all child of parent company + if (getDolGlobalString('FACTURE_PAYMENTS_ON_DIFFERENT_THIRDPARTIES_BILLS') && !empty($object->thirdparty->parent)) { + $sql .= ' OR f.fk_soc IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'societe WHERE parent = '.((int) $object->thirdparty->parent).')'; + } + // Can pay invoices of all child of myself + if (getDolGlobalString('FACTURE_PAYMENTS_ON_SUBSIDIARY_COMPANIES')) { + $sql .= ' OR f.fk_soc IN (SELECT rowid FROM '.MAIN_DB_PREFIX.'societe WHERE parent = '.((int) $object->thirdparty->id).')'; + } + $sql .= ') AND f.paye = 0'; $sql .= ' AND f.fk_statut = 1'; // Status=0 => unvalidated, Status=2 => canceled if (!$displayAllInvoices) { diff --git a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql index 9c82f0f5a6b..8feb364fbfc 100644 --- a/htdocs/install/mysql/migration/22.0.0-23.0.0.sql +++ b/htdocs/install/mysql/migration/22.0.0-23.0.0.sql @@ -150,6 +150,10 @@ ALTER TABLE llx_oauth_token ADD COLUMN apicount_total BIGINT UNSIGNED DEFAULT 0; ALTER TABLE llx_webhook_target ADD COLUMN entity integer DEFAULT 1 NOT NULL; +-- In case of table exists +ALTER TABLE llx_webhook_history MODIFY COLUMN url varchar(255); + +-- In cas table does not exist CREATE TABLE llx_webhook_history( -- BEGIN MODULEBUILDER FIELDS rowid integer AUTO_INCREMENT PRIMARY KEY NOT NULL, diff --git a/htdocs/install/upgrade.php b/htdocs/install/upgrade.php index 0113c876da8..50d9028f72b 100644 --- a/htdocs/install/upgrade.php +++ b/htdocs/install/upgrade.php @@ -165,6 +165,7 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ $db = getDoliDBInstance($conf->db->type, $conf->db->host, $conf->db->user, $conf->db->pass, $conf->db->name, (int) $conf->db->port); + // Create the global $hookmanager object include_once DOL_DOCUMENT_ROOT.'/core/class/hookmanager.class.php'; $hookmanager = new HookManager($db); @@ -400,18 +401,26 @@ if (!GETPOST('action', 'aZ09') || preg_match('/upgrade/i', GETPOST('action', 'aZ } if (count($modulesfile)) { + $conf->setValues($db); // Load conf so we knowmodules that are enabled + print '
'; foreach ($modulesfile as $modulefilelong => $modulefileshort) { if (in_array($modulefilelong, $listoffileprocessed)) { continue; } + $dirofmodule = preg_replace('/\//', '', preg_replace('/\/sql\/[a-z0-8_]+\.sql$/', '', $modulefileshort)); - print ''.$langs->trans("ChoosedMigrateScript").' (external modules)'.$modulefileshort.''."\n"; + if (isModEnabled($dirofmodule)) { + print ''.$langs->trans("ChoosedMigrateScript").' (external modules '.$dirofmodule.')'.$modulefileshort.''."\n"; - // Run sql script - $okmodule = run_sql($modulefilelong, 0, 0, 1); // Note: Result of migration of external module should not decide if we continue migration of Dolibarr or not. - $listoffileprocessed[$modulefilelong] = $modulefilelong; + // Run sql script + $okmodule = run_sql($modulefilelong, 0, 0, 1); // Note: Result of migration of external module should not decide if we continue migration of Dolibarr or not. + $listoffileprocessed[$modulefilelong] = $modulefilelong; + } else { + print ''.$langs->trans("ChoosedMigrateScript").' (external modules '.$dirofmodule.')'.$modulefileshort.''."\n"; + print ''.$langs->trans("ProcessMigrateScript").'Ignored (module not enabled)'."\n"; + } } } } diff --git a/htdocs/product/price.php b/htdocs/product/price.php index d58e0dcd8b2..565b9406ae6 100644 --- a/htdocs/product/price.php +++ b/htdocs/product/price.php @@ -289,6 +289,7 @@ if (empty($reshook)) { if (($action == 'update_price' || $action == 'update_level_price') && !$cancel && $permissiontoadd) { $error = 0; $pricestoupdate = array(); + $object->oldcopy = dol_clone($object, 2); $psq = GETPOSTINT('psqflag'); diff --git a/htdocs/public/recruitment/view.php b/htdocs/public/recruitment/view.php index 5f893c854b4..13885d4ee3b 100644 --- a/htdocs/public/recruitment/view.php +++ b/htdocs/public/recruitment/view.php @@ -471,11 +471,11 @@ if ($action != 'dosubmit') { print ''."\n"; print ''.$langs->trans("Email").''; - print img_picto("", "email").''; + print img_picto("", "email", 'class="pictofixedwidth"').''; print ''."\n"; print ''.$langs->trans("Phone").''; - print img_picto("", "phone").''; + print img_picto("", "phone", 'class="pictofixedwidth"').''; print ''."\n"; print ''.$langs->trans("DateOfBirth").''; diff --git a/htdocs/webhook/target_card.php b/htdocs/webhook/target_card.php index abb3e7602c1..71a2ab4d754 100644 --- a/htdocs/webhook/target_card.php +++ b/htdocs/webhook/target_card.php @@ -185,7 +185,7 @@ if (empty($reshook)) { if (empty($response['curl_error_no']) && $response['http_code'] >= 200 && $response['http_code'] < 300) { setEventMessages($langs->trans("Success"), null); } else { - $errormsg = "The WebHook for triggercode: ".$triggercode." failed to get URL ".$url." with httpcode=".(!empty($response['http_code']) ? $response['http_code'] : "")." curl_error_no=".(!empty($response['curl_error_no']) ? $response['curl_error_no'] : ""); + $errormsg = "The WebHook for triggercode: ".$triggercode." failed to do the GET of URL ".$url." with httpcode=".(!empty($response['http_code']) ? $response['http_code'] : "")." curl_error_no=".(!empty($response['curl_error_no']) ? $response['curl_error_no'] : ""); setEventMessages($langs->trans($errormsg), null, 'errors'); } }