diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php index be93a257d05..9d7b2cb73d4 100644 --- a/htdocs/accountancy/class/accountancyexport.class.php +++ b/htdocs/accountancy/class/accountancyexport.class.php @@ -1016,7 +1016,7 @@ class AccountancyExport $tab['affaire'] = str_repeat(' ', 10); $tab['quantity1'] = str_repeat(' ', 10); $tab['num_piece2'] = str_pad(self::trunc((string) $line->piece_num, 8), 8); - $tab['devis'] = str_pad($conf->currency, 3); + $tab['devis'] = str_pad(getDolCurrency(), 3); $tab['code_journal2'] = str_pad(self::trunc($line->code_journal, 3), 3); $tab['filler3'] = str_repeat(' ', 3); diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index 41c99b8da2d..621813be385 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -194,7 +194,7 @@ if ($resql) { $outputlangs->loadLangs(array("main", "contracts", "bills", "products")); if (dol_strlen($newemail)) { - $message .= $outputlangs->trans("Contract")." ".$obj->ref.": ".$outputlangs->trans("Service")." ".dol_concatdesc($obj->plabel, $obj->description)." (".price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency)."), ".$outputlangs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite), 'day')."\n\n"; + $message .= $outputlangs->trans("Contract")." ".$obj->ref.": ".$outputlangs->trans("Service")." ".dol_concatdesc($obj->plabel, $obj->description)." (".price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, getDolCurrency())."), ".$outputlangs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite), 'day')."\n\n"; dol_syslog("email_expire_services_to_customers.php: ".$newemail." ".$message); $foundtoprocess++; } @@ -300,7 +300,6 @@ function sendEmailToCustomer($mode, $oldemail, $message, $total, $userlang, $old $allmessage .= "Please, find a summary of the services contracted by you that are about to expire.".($usehtml ? "
\n" : "\n").($usehtml ? "
\n" : "\n"); } $allmessage .= $message.($usehtml ? "
\n" : "\n"); - // $allmessage.= $langs->trans("Total")." = ".price($total,0,$userlang,0,0,-1,$conf->currency).($usehtml?"
\n":"\n"); if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER')) { $allmessage .= getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER'); if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_CUSTOMERS_FOOTER'))) { diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 77fb386e6f9..00f93ce687a 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -150,7 +150,7 @@ if ($resql) { $outputlangs->loadLangs(array("main", "contracts", "bills", "products")); if (dol_strlen($obj->email)) { - $message .= $outputlangs->trans("Contract")." ".$obj->ref.": ".$langs->trans("Service")." ".dol_concatdesc($obj->plabel, $obj->description)." (".price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency).") ".$obj->name.", ".$outputlangs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite), 'day')."\n\n"; + $message .= $outputlangs->trans("Contract")." ".$obj->ref.": ".$langs->trans("Service")." ".dol_concatdesc($obj->plabel, $obj->description)." (".price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, getDolCurrency()).") ".$obj->name.", ".$outputlangs->trans("DateEndPlannedShort")." ".dol_print_date($db->jdate($obj->date_fin_validite), 'day')."\n\n"; dol_syslog("email_expire_services_to_representatives.php: ".$obj->email); $foundtoprocess++; } @@ -250,7 +250,7 @@ function sendEmailToRepresentative($mode, $oldemail, $message, $total, $userlang $allmessage .= $newlangs->transnoentities("NoteListOfYourExpiredServices").($usehtml ? "
\n" : "\n").($usehtml ? "
\n" : "\n"); } $allmessage .= $message.($usehtml ? "
\n" : "\n"); - $allmessage .= $langs->trans("Total")." = ".price($total, 0, $userlang, 0, 0, -1, $conf->currency).($usehtml ? "
\n" : "\n"); + $allmessage .= $langs->trans("Total")." = ".price($total, 0, $userlang, 0, 0, -1, getDolCurrency()).($usehtml ? "
\n" : "\n"); if (getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER')) { $allmessage .= getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER'); if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_EXPIRE_SERVICES_SALESREPRESENTATIVES_FOOTER'))) { diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index 97cc77e4a89..3a5fe288f7b 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -197,7 +197,7 @@ if ($resql) { $outputlangs->loadLangs(array("main", "bills")); if (dol_strlen($newemail)) { - $message .= $outputlangs->trans("Invoice")." ".$obj->ref." : ".price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency)."\n"; + $message .= $outputlangs->trans("Invoice")." ".$obj->ref." : ".price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, getDolCurrency())."\n"; dol_syslog("email_unpaid_invoices_to_customers.php: ".$newemail." ".$message); $foundtoprocess++; } @@ -286,14 +286,14 @@ function sendMailCustomerUnpaid($mode, $oldemail, $message, $total, $userlang, $ $allmessage = ''; if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER')) { - $allmessage .= $conf->global->SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER; + $allmessage .= getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_HEADER'); } else { $allmessage .= "Dear customer".($usehtml ? "
\n" : "\n").($usehtml ? "
\n" : "\n"); $allmessage .= "Please, find a summary of the bills with pending payments from you.".($usehtml ? "
\n" : "\n").($usehtml ? "
\n" : "\n"); $allmessage .= "Note: This list contains only unpaid invoices.".($usehtml ? "
\n" : "\n"); } $allmessage .= $message.($usehtml ? "
\n" : "\n"); - $allmessage .= $langs->trans("Total")." = ".price($total, 0, $userlang, 0, 0, -1, $conf->currency).($usehtml ? "
\n" : "\n"); + $allmessage .= $langs->trans("Total")." = ".price($total, 0, $userlang, 0, 0, -1, getDolCurrency()).($usehtml ? "
\n" : "\n"); if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER')) { $allmessage .= getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER'); if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_CUSTOMERS_FOOTER'))) { diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index f717f11db55..bcb7b3c932d 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -157,7 +157,7 @@ if ($resql) { $outputlangs->loadLangs(array("main", "bills")); if (dol_strlen($obj->email)) { - $message .= $outputlangs->trans("Invoice")." ".$obj->ref." : ".price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, $conf->currency)." : ".$obj->name."\n"; + $message .= $outputlangs->trans("Invoice")." ".$obj->ref." : ".price($obj->total_ttc, 0, $outputlangs, 0, 0, -1, getDolCurrency())." : ".$obj->name."\n"; dol_syslog("email_unpaid_invoices_to_representatives.php: ".$obj->email); $foundtoprocess++; } @@ -246,7 +246,7 @@ function sendMailRepresentativeUnpaid($mode, $oldemail, $message, $total, $userl $allmessage .= $newlangs->transnoentities("NoteListOfYourUnpaidInvoices").($usehtml ? "
\n" : "\n"); } $allmessage .= $message.($usehtml ? "
\n" : "\n"); - $allmessage .= $langs->trans("Total")." = ".price($total, 0, $newlangs, 0, 0, -1, $conf->currency).($usehtml ? "
\n" : "\n"); + $allmessage .= $langs->trans("Total")." = ".price($total, 0, $newlangs, 0, 0, -1, getDolCurrency()).($usehtml ? "
\n" : "\n"); if (getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER')) { $allmessage .= getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER'); if (dol_textishtml(getDolGlobalString('SCRIPT_EMAIL_UNPAID_INVOICES_SALESREPRESENTATIVES_FOOTER'))) { diff --git a/scripts/members/sync_members_dolibarr2ldap.php b/scripts/members/sync_members_dolibarr2ldap.php index d8cb6ffb722..c915b700b98 100755 --- a/scripts/members/sync_members_dolibarr2ldap.php +++ b/scripts/members/sync_members_dolibarr2ldap.php @@ -91,7 +91,7 @@ if (!empty($dolibarr_main_db_readonly)) { $now = $argv[1]; print "Mails sending disabled (useless in batch mode)\n"; -$conf->global->MAIN_DISABLE_ALL_MAILS = 1; // On bloque les mails +$conf->global->MAIN_DISABLE_ALL_MAILS = 1; // We block email sending print "\n"; print "----- Synchronize all records from Dolibarr database:\n"; print "type=".$conf->db->type."\n"; diff --git a/scripts/members/sync_members_ldap2dolibarr.php b/scripts/members/sync_members_ldap2dolibarr.php index 92a4f8cadb9..854f5f965c8 100755 --- a/scripts/members/sync_members_ldap2dolibarr.php +++ b/scripts/members/sync_members_ldap2dolibarr.php @@ -84,32 +84,32 @@ dol_syslog($script_file." launched with arg ".implode(',', $argv)); // List of fields to get from LDAP $required_fields = array( - $conf->global->LDAP_KEY_MEMBERS, - $conf->global->LDAP_FIELD_FULLNAME, - $conf->global->LDAP_FIELD_LOGIN, - $conf->global->LDAP_FIELD_LOGIN_SAMBA, - $conf->global->LDAP_FIELD_PASSWORD, - $conf->global->LDAP_FIELD_PASSWORD_CRYPTED, - $conf->global->LDAP_FIELD_NAME, - $conf->global->LDAP_FIELD_FIRSTNAME, - $conf->global->LDAP_FIELD_MAIL, - $conf->global->LDAP_FIELD_PHONE, - $conf->global->LDAP_FIELD_PHONE_PERSO, - $conf->global->LDAP_FIELD_MOBILE, - $conf->global->LDAP_FIELD_FAX, - $conf->global->LDAP_FIELD_ADDRESS, - $conf->global->LDAP_FIELD_ZIP, - $conf->global->LDAP_FIELD_TOWN, - $conf->global->LDAP_FIELD_COUNTRY, - $conf->global->LDAP_FIELD_DESCRIPTION, - $conf->global->LDAP_FIELD_BIRTHDATE, - $conf->global->LDAP_FIELD_MEMBER_STATUS, - $conf->global->LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION, + getDolGlobalString('LDAP_KEY_MEMBERS'), + getDolGlobalString('LDAP_FIELD_FULLNAME'), + getDolGlobalString('LDAP_FIELD_LOGIN'), + getDolGlobalString('LDAP_FIELD_LOGIN_SAMBA'), + getDolGlobalString('LDAP_FIELD_PASSWORD'), + getDolGlobalString('LDAP_FIELD_PASSWORD_CRYPTED'), + getDolGlobalString('LDAP_FIELD_NAME'), + getDolGlobalString('LDAP_FIELD_FIRSTNAME'), + getDolGlobalString('LDAP_FIELD_MAIL'), + getDolGlobalString('LDAP_FIELD_PHONE'), + getDolGlobalString('LDAP_FIELD_PHONE_PERSO'), + getDolGlobalString('LDAP_FIELD_MOBILE'), + getDolGlobalString('LDAP_FIELD_FAX'), + getDolGlobalString('LDAP_FIELD_ADDRESS'), + getDolGlobalString('LDAP_FIELD_ZIP'), + getDolGlobalString('LDAP_FIELD_TOWN'), + getDolGlobalString('LDAP_FIELD_COUNTRY'), + getDolGlobalString('LDAP_FIELD_DESCRIPTION'), + getDolGlobalString('LDAP_FIELD_BIRTHDATE'), + getDolGlobalString('LDAP_FIELD_MEMBER_STATUS'), + getDolGlobalString('LDAP_FIELD_MEMBER_END_LASTSUBSCRIPTION'), // Subscriptions - $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE, - $conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT, - $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE, - $conf->global->LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT + getDolGlobalString('LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE'), + getDolGlobalString('LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_AMOUNT'), + getDolGlobalString('LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_DATE'), + getDolGlobalString('LDAP_FIELD_MEMBER_LASTSUBSCRIPTION_AMOUNT') ); // Remove from required_fields all entries not configured in LDAP (empty) and duplicated @@ -125,6 +125,7 @@ foreach ($argv as $key => $val) { if ($val == 'commitiferror') { $forcecommit = 1; } + $reg = array(); if (preg_match('/--server=([^\s]+)$/', $val, $reg)) { $conf->global->LDAP_SERVER_HOST = $reg[1]; } diff --git a/scripts/members/sync_members_types_ldap2dolibarr.php b/scripts/members/sync_members_types_ldap2dolibarr.php index 8c82e3d503c..d8cef5b5fc2 100755 --- a/scripts/members/sync_members_types_ldap2dolibarr.php +++ b/scripts/members/sync_members_types_ldap2dolibarr.php @@ -110,7 +110,7 @@ if (!empty($dolibarr_main_db_readonly)) { } print "Mails sending disabled (useless in batch mode)\n"; -$conf->global->MAIN_DISABLE_ALL_MAILS = 1; // On bloque les mails +$conf->global->MAIN_DISABLE_ALL_MAILS = 1; // We block email sending print "\n"; print "----- Synchronize all records from LDAP database:\n"; print "host=" . getDolGlobalString('LDAP_SERVER_HOST')."\n"; diff --git a/scripts/user/sync_groups_ldap2dolibarr.php b/scripts/user/sync_groups_ldap2dolibarr.php index 0de3bff13fe..d81f27179af 100755 --- a/scripts/user/sync_groups_ldap2dolibarr.php +++ b/scripts/user/sync_groups_ldap2dolibarr.php @@ -103,7 +103,7 @@ foreach ($argv as $key => $val) { } print "Mails sending disabled (useless in batch mode)\n"; -$conf->global->MAIN_DISABLE_ALL_MAILS = 1; // On bloque les mails +$conf->global->MAIN_DISABLE_ALL_MAILS = 1; // We block email sending print "\n"; print "----- Synchronize all records from LDAP database:\n"; print "host=" . getDolGlobalString('LDAP_SERVER_HOST')."\n"; diff --git a/scripts/user/sync_users_ldap2dolibarr.php b/scripts/user/sync_users_ldap2dolibarr.php index 6197d995a27..451c7b1d86c 100755 --- a/scripts/user/sync_users_ldap2dolibarr.php +++ b/scripts/user/sync_users_ldap2dolibarr.php @@ -76,25 +76,25 @@ dol_syslog($script_file." launched with arg ".implode(',', $argv)); // List of fields to get from LDAP $required_fields = array( - $conf->global->LDAP_KEY_USERS, - $conf->global->LDAP_FIELD_FULLNAME, - $conf->global->LDAP_FIELD_NAME, - $conf->global->LDAP_FIELD_FIRSTNAME, - $conf->global->LDAP_FIELD_LOGIN, - $conf->global->LDAP_FIELD_LOGIN_SAMBA, - $conf->global->LDAP_FIELD_PASSWORD, - $conf->global->LDAP_FIELD_PASSWORD_CRYPTED, - $conf->global->LDAP_FIELD_PHONE, - $conf->global->LDAP_FIELD_FAX, - $conf->global->LDAP_FIELD_MOBILE, - // $conf->global->LDAP_FIELD_ADDRESS, - // $conf->global->LDAP_FIELD_ZIP, - // $conf->global->LDAP_FIELD_TOWN, - // $conf->global->LDAP_FIELD_COUNTRY, - $conf->global->LDAP_FIELD_MAIL, - $conf->global->LDAP_FIELD_TITLE, - $conf->global->LDAP_FIELD_DESCRIPTION, - $conf->global->LDAP_FIELD_SID + getDolGlobalString('LDAP_KEY_USERS'), + getDolGlobalString('LDAP_FIELD_FULLNAME'), + getDolGlobalString('LDAP_FIELD_NAME'), + getDolGlobalString('LDAP_FIELD_FIRSTNAME'), + getDolGlobalString('LDAP_FIELD_LOGIN'), + getDolGlobalString('LDAP_FIELD_LOGIN_SAMBA'), + getDolGlobalString('LDAP_FIELD_PASSWORD'), + getDolGlobalString('LDAP_FIELD_PASSWORD_CRYPTED'), + getDolGlobalString('LDAP_FIELD_PHONE'), + getDolGlobalString('LDAP_FIELD_FAX'), + getDolGlobalString('LDAP_FIELD_MOBILE'), + // getDolGlobalString('LDAP_FIELD_ADDRESS'), + // getDolGlobalString('LDAP_FIELD_ZIP'), + // getDolGlobalString('LDAP_FIELD_TOWN'), + // getDolGlobalString('LDAP_FIELD_COUNTRY'), + getDolGlobalString('LDAP_FIELD_MAIL'), + getDolGlobalString('LDAP_FIELD_TITLE'), + getDolGlobalString('LDAP_FIELD_DESCRIPTION'), + getDolGlobalString('LDAP_FIELD_SID') ); // Remove from required_fields all entries not configured in LDAP (empty) and duplicated @@ -186,8 +186,6 @@ if ($resql) { $ldap = new Ldap(); $result = $ldap->connectBind(); if ($result >= 0) { - $justthese = array(); - // We disable synchro Dolibarr-LDAP $conf->global->LDAP_SYNCHRO_ACTIVE = 0; @@ -245,8 +243,8 @@ if ($result >= 0) { // TODO : revoir la gestion du status /* * if (isset($ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_STATUS')])) { - * $fuser->datec=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]); - * $fuser->datevalid=dol_stringtotime($ldapuser[$conf->global->LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE]); + * $fuser->datec=dol_stringtotime($ldapuser[getdolGlobalString('LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE')]); + * $fuser->datevalid=dol_stringtotime($ldapuser[getdolGlobalString('LDAP_FIELD_MEMBER_FIRSTSUBSCRIPTION_DATE')]); * $fuser->statut=$ldapuser[getDolGlobalString('LDAP_FIELD_MEMBER_STATUS')] ?? null; * } */