diff --git a/README.md b/README.md
index 2cfe4138d62..54fdf1e958b 100644
--- a/README.md
+++ b/README.md
@@ -154,18 +154,18 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
### Other application/modules
-- Electronic Document Management (EDM)
+- Electronic Document Management (EDM)
- Bookmarks management
- Reporting
- Data export/import
-- Barcodes
+- Barcodes
- Margin calculations
- LDAP connectivity
- ClickToDial integration
- Mass emailing
- RSS integration
- Skype integration
-- Social platforms linking
+- Social platforms linking
- Payment platforms integration (PayPal, Stripe, Paybox...)
- Email-Collector
@@ -179,14 +179,11 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Multi-Users and groups with finely grained rights
- Multi-Currency
- Multi-Company (by adding of an external module)
-
- Very user friendly and easy to use
- customizable Dashboard
- Highly customizable: enable only the modules you need, add user personalized fields, choose your skin, several menu managers (can be used by internal users as a back-office with a particular menu, or by external users as a front-office with another one)
-
- APIs (REST, SOAP)
- Code that is easy to understand, maintain and develop (PHP with no heavy framework; trigger and hook architecture)
-
- Support a lot of country specific features:
- Spanish Tax RE and ISPF
- French NPR VAT rate (VAT called "Non Perçue Récupérable" for DOM-TOM)
@@ -197,7 +194,7 @@ See the [ChangeLog](https://github.com/Dolibarr/dolibarr/blob/develop/ChangeLog)
- Compatible with European GDPR rules
- ...
- Flexible PDF & ODT generation for invoices, proposals, orders...
-- …
+- ...
### System Environment / Requirements
diff --git a/dev/initdemo/mysqldump_dolibarr_14.0.0.sql b/dev/initdemo/mysqldump_dolibarr_14.0.0.sql
index 4061fb9f4cf..e619c2c8fda 100644
--- a/dev/initdemo/mysqldump_dolibarr_14.0.0.sql
+++ b/dev/initdemo/mysqldump_dolibarr_14.0.0.sql
@@ -2056,7 +2056,7 @@ CREATE TABLE `llx_c_holiday_types` (
`label` varchar(255) COLLATE utf8_unicode_ci NOT NULL,
`affect` int(11) NOT NULL,
`delay` int(11) NOT NULL,
- `newByMonth` double(8,5) NOT NULL DEFAULT 0.00000,
+ `newbymonth` double(8,5) NOT NULL DEFAULT 0.00000,
`fk_country` int(11) DEFAULT NULL,
`active` int(11) DEFAULT 1,
PRIMARY KEY (`rowid`),
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index 9596cd96af8..a842c294937 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -186,12 +186,28 @@ if ($action == 'update') {
$msg .= '
'.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.' '.$sql.' ';
$ko++;
} else {
- $db->begin();
-
+ $sql = '';
if (!empty($conf->global->MAIN_PRODUCT_PERENTITY_SHARED)) {
- $sql = "INSERT INTO ".MAIN_DB_PREFIX."product_perentity (fk_product, entity, '".$db->escape($accountancy_field_name)."')";
- $sql .= " VALUES (".((int) $productid).", ".((int) $conf->entity).", '".$db->escape($accounting->account_number)."')";
- $sql .= " ON DUPLICATE KEY UPDATE ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
+ $sql_exists = "SELECT rowid FROM " . MAIN_DB_PREFIX . "product_perentity";
+ $sql_exists .= " WHERE fk_product = " . ((int) $productid) . " AND entity = " . ((int) $conf->entity);
+ $resql_exists = $db->query($sql_exists);
+ if (!$resql_exists) {
+ $msg .= ''.$langs->trans("ErrorDB").' : '.$langs->trans("Product").' '.$productid.' '.$langs->trans("NotVentilatedinAccount").' : id='.$accounting_account_id.' '.$resql_exists.' ';
+ $ko++;
+ } else {
+ $nb_exists = $db->num_rows($resql_exists);
+ if ($nb_exists <= 0) {
+ // insert
+ $sql = "INSERT INTO " . MAIN_DB_PREFIX . "product_perentity (fk_product, entity, '" . $db->escape($accountancy_field_name) . "')";
+ $sql .= " VALUES (" . ((int) $productid) . ", " . ((int) $conf->entity) . ", '" . $db->escape($accounting->account_number) . "')";
+ } else {
+ $obj_exists = $db->fetch_object($resql_exists);
+ // update
+ $sql = "UPDATE " . MAIN_DB_PREFIX . "product_perentity";
+ $sql .= " SET " . $accountancy_field_name . " = '" . $db->escape($accounting->account_number) . "'";
+ $sql .= " WHERE rowid = " . ((int) $obj_exists->rowid);
+ }
+ }
} else {
$sql = " UPDATE ".MAIN_DB_PREFIX."product";
$sql .= " SET ".$accountancy_field_name." = '".$db->escape($accounting->account_number)."'";
@@ -199,6 +215,9 @@ if ($action == 'update') {
}
dol_syslog("/accountancy/admin/productaccount.php", LOG_DEBUG);
+
+ $db->begin();
+
if ($db->query($sql)) {
$ok++;
$db->commit();
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index dd96ff7dbbd..0cdecb3645f 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -1012,7 +1012,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (count($listetype)) {
print $form->selectarray("typeid", $listetype, (GETPOST('typeid', 'int') ? GETPOST('typeid', 'int') : $typeid), (count($listetype) > 1 ? 1 : 0), 0, 0, '', 0, 0, 0, '', '', 1);
} else {
- print ''.$langs->trans("NoTypeDefinedGoToSetup").' ';
+ print ''.$langs->trans("NoTypeDefinedGoToSetup").' ';
}
print "\n";
@@ -1997,7 +1997,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
print '';
if ($isinspip == -1) {
- print ''.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.' ';
+ print ''.$langs->trans('SPIPConnectionFailed').': '.$mailmanspip->error.' ';
}
diff --git a/htdocs/adherents/ldap.php b/htdocs/adherents/ldap.php
index d714e3d9a32..983e6d9aada 100644
--- a/htdocs/adherents/ldap.php
+++ b/htdocs/adherents/ldap.php
@@ -190,7 +190,7 @@ if ($result > 0) {
if (empty($dn)) {
$langs->load("errors");
- print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).' ';
+ print ''.$langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("Member")).' ';
} else {
$records = $ldap->getAttribute($dn, $search);
@@ -199,7 +199,7 @@ if ($result > 0) {
// Show tree
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
if (!is_array($records)) {
- print ''.$langs->trans("ErrorFailedToReadLDAP").' ';
+ print ''.$langs->trans("ErrorFailedToReadLDAP").' ';
} else {
$result = show_ldap_content($records, 0, $records['count'], true);
}
diff --git a/htdocs/adherents/type_ldap.php b/htdocs/adherents/type_ldap.php
index a695f84bb81..f932b65e98c 100644
--- a/htdocs/adherents/type_ldap.php
+++ b/htdocs/adherents/type_ldap.php
@@ -161,7 +161,7 @@ if ($result > 0) {
// Show tree
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
if (!is_array($records)) {
- print ''.$langs->trans("ErrorFailedToReadLDAP").' ';
+ print ''.$langs->trans("ErrorFailedToReadLDAP").' ';
} else {
$result = show_ldap_content($records, 0, $records['count'], true);
}
diff --git a/htdocs/admin/accountant.php b/htdocs/admin/accountant.php
index c7bd40efa37..5be2b3d6eea 100644
--- a/htdocs/admin/accountant.php
+++ b/htdocs/admin/accountant.php
@@ -91,7 +91,7 @@ $form = new Form($db);
$formother = new FormOther($db);
$formcompany = new FormCompany($db);
-$countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").') ';
+$countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").') ';
print ''.$langs->trans("AccountantDesc")." \n";
print " \n";
diff --git a/htdocs/admin/barcode.php b/htdocs/admin/barcode.php
index 5b48301c30d..c370c07b73b 100644
--- a/htdocs/admin/barcode.php
+++ b/htdocs/admin/barcode.php
@@ -302,7 +302,7 @@ if (!isset($_SERVER['WINDIR'])) {
print ' ';
if (!empty($conf->global->GENBARCODE_LOCATION) && !@file_exists($conf->global->GENBARCODE_LOCATION)) {
$langs->load("errors");
- print ''.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).' ';
+ print ''.$langs->trans("ErrorFileNotFound", $conf->global->GENBARCODE_LOCATION).' ';
}
print '';
}
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 5e0ab61c3ee..5cffc0257e1 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -369,7 +369,7 @@ $form = new Form($db);
$formother = new FormOther($db);
$formcompany = new FormCompany($db);
-$countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").') ';
+$countrynotdefined = ''.$langs->trans("ErrorSetACountryFirst").' ('.$langs->trans("SeeAbove").') ';
print load_fiche_titre($langs->trans("CompanyFoundation"), '', 'title_setup');
diff --git a/htdocs/admin/dict.php b/htdocs/admin/dict.php
index c51875b43a6..d0a699ef979 100644
--- a/htdocs/admin/dict.php
+++ b/htdocs/admin/dict.php
@@ -223,7 +223,7 @@ $tabsql[24] = "SELECT rowid as rowid, code, label, active FROM ".MAIN_DB_PREFI
$tabsql[25] = "SELECT rowid as rowid, code, label, active, module FROM ".MAIN_DB_PREFIX."c_type_container as t WHERE t.entity IN (".getEntity('c_type_container').")";
//$tabsql[26]= "SELECT rowid as rowid, code, label, short_label, active FROM ".MAIN_DB_PREFIX."c_units";
$tabsql[27] = "SELECT id as rowid, code, libelle, picto, active FROM ".MAIN_DB_PREFIX."c_stcomm";
-$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newByMonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
+$tabsql[28] = "SELECT h.rowid as rowid, h.code, h.label, h.affect, h.delay, h.newbymonth, h.fk_country as country_id, c.code as country_code, c.label as country, h.active FROM ".MAIN_DB_PREFIX."c_holiday_types as h LEFT JOIN ".MAIN_DB_PREFIX."c_country as c ON h.fk_country=c.rowid";
$tabsql[29] = "SELECT rowid as rowid, code, label, percent, position, active FROM ".MAIN_DB_PREFIX."c_lead_status";
$tabsql[30] = "SELECT rowid, code, name, paper_size, orientation, metric, leftmargin, topmargin, nx, ny, spacex, spacey, width, height, font_size, custom_x, custom_y, active FROM ".MAIN_DB_PREFIX."c_format_cards";
//$tabsql[31]= "SELECT s.rowid as rowid, pcg_version, s.label, s.active FROM ".MAIN_DB_PREFIX."accounting_system as s";
@@ -315,7 +315,7 @@ $tabfield[24] = "code,label";
$tabfield[25] = "code,label";
//$tabfield[26]= "code,label,short_label";
$tabfield[27] = "code,libelle,picto";
-$tabfield[28] = "code,label,affect,delay,newByMonth,country_id,country";
+$tabfield[28] = "code,label,affect,delay,newbymonth,country_id,country";
$tabfield[29] = "code,label,percent,position";
$tabfield[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
//$tabfield[31]= "pcg_version,label";
@@ -361,7 +361,7 @@ $tabfieldvalue[24] = "code,label";
$tabfieldvalue[25] = "code,label";
//$tabfieldvalue[26]= "code,label,short_label";
$tabfieldvalue[27] = "code,libelle,picto";
-$tabfieldvalue[28] = "code,label,affect,delay,newByMonth,country";
+$tabfieldvalue[28] = "code,label,affect,delay,newbymonth,country";
$tabfieldvalue[29] = "code,label,percent,position";
$tabfieldvalue[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
//$tabfieldvalue[31]= "pcg_version,label";
@@ -407,7 +407,7 @@ $tabfieldinsert[24] = "code,label";
$tabfieldinsert[25] = "code,label";
//$tabfieldinsert[26]= "code,label,short_label";
$tabfieldinsert[27] = "code,libelle,picto";
-$tabfieldinsert[28] = "code,label,affect,delay,newByMonth,fk_country";
+$tabfieldinsert[28] = "code,label,affect,delay,newbymonth,fk_country";
$tabfieldinsert[29] = "code,label,percent,position";
$tabfieldinsert[30] = "code,name,paper_size,orientation,metric,leftmargin,topmargin,nx,ny,spacex,spacey,width,height,font_size,custom_x,custom_y";
//$tabfieldinsert[31]= "pcg_version,label";
@@ -548,7 +548,7 @@ $tabhelp[24] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[25] = array('code'=>$langs->trans('EnterAnyCode'));
//$tabhelp[26] = array('code'=>$langs->trans("EnterAnyCode"));
$tabhelp[27] = array('code'=>$langs->trans("EnterAnyCode"), 'picto'=>$langs->trans("PictoHelp"));
-$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newByMonth'=>$langs->trans("NbAddedAutomatically"));
+$tabhelp[28] = array('affect'=>$langs->trans("FollowedByACounter"), 'delay'=>$langs->trans("MinimumNoticePeriod"), 'newbymonth'=>$langs->trans("NbAddedAutomatically"));
$tabhelp[29] = array('code'=>$langs->trans("EnterAnyCode"), 'percent'=>$langs->trans("OpportunityPercent"), 'position'=>$langs->trans("PositionIntoComboList"));
$tabhelp[30] = array('code'=>$langs->trans("EnterAnyCode"), 'name'=>$langs->trans("LabelName"), 'paper_size'=>$langs->trans("LabelPaperSize"));
//$tabhelp[31] = array('pcg_version'=>$langs->trans("EnterAnyCode"));
@@ -1394,7 +1394,7 @@ if ($id) {
if ($value == 'delay') {
$valuetoshow = $langs->trans("NoticePeriod");
}
- if ($value == 'newByMonth') {
+ if ($value == 'newbymonth') {
$valuetoshow = $langs->trans("NewByMonth");
}
if ($value == 'fk_tva') {
@@ -1739,7 +1739,7 @@ if ($id) {
if ($value == 'delay') {
$valuetoshow = $langs->trans("NoticePeriod");
}
- if ($value == 'newByMonth') {
+ if ($value == 'newbymonth') {
$valuetoshow = $langs->trans("NewByMonth");
}
if ($value == 'fk_tva') {
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index f063c113af5..5b73d995b5c 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -145,13 +145,18 @@ if ($action == 'updateMask') {
$draft = GETPOST('EXPENSEREPORT_DRAFT_WATERMARK', 'alpha');
$res2 = dolibarr_set_const($db, "EXPENSEREPORT_DRAFT_WATERMARK", trim($draft), 'chaine', 0, '', $conf->entity);
+ $res3 = 0;
+ if (!empty($conf->projet->enabled) && GETPOSTISSET('EXPENSEREPORT_PROJECT_IS_REQUIRED')) { // Option may not be provided
+ $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PROJECT_IS_REQUIRED', GETPOST('EXPENSEREPORT_PROJECT_IS_REQUIRED', 'int'), 'chaine', 0, '', $conf->entity);
+ }
+
$dates = GETPOST('EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', 'int');
- $res3 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
+ $res4 = dolibarr_set_const($db, 'EXPENSEREPORT_PREFILL_DATES_WITH_CURRENT_MONTH', intval($dates), 'chaine', 0, '', $conf->entity);
$amounts = GETPOST('EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', 'int');
- $res4 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
+ $res5 = dolibarr_set_const($db, 'EXPENSEREPORT_FORCE_LINE_AMOUNTS_INCLUDING_TAXES_ONLY', intval($amounts), 'chaine', 0, '', $conf->entity);
- if (!($res1 > 0) || !($res2 > 0) || !($res3 > 0) || !($res4 >0)) {
+ if (!($res1 > 0) || !($res2 > 0) || !($res3 >= 0) || !($res4 >0) || !($res5 >0)) {
$error++;
}
@@ -464,6 +469,14 @@ print $form->textwithpicto($langs->trans("WatermarkOnDraftExpenseReports"), $htm
print ' ';
print ''."\n";
+if (!empty($conf->projet->enabled)) {
+ print '';
+ print $langs->trans('ProjectIsRequiredOnExpenseReports');
+ print ' ';
+ print $form->selectyesno('EXPENSEREPORT_PROJECT_IS_REQUIRED', empty($conf->global->EXPENSEREPORT_PROJECT_IS_REQUIRED) ? 0 : 1, 1);
+ print ' ';
+}
+
print '';
print $langs->trans('PrefillExpenseReportDatesWithCurrentMonth');
print ' ';
diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php
index 85cd419d9ee..d0f08783e22 100644
--- a/htdocs/admin/external_rss.php
+++ b/htdocs/admin/external_rss.php
@@ -275,9 +275,9 @@ if ($resql) {
print " ".$langs->trans("Status")." ";
print "";
if ($result > 0 && empty($rss->error)) {
- print ''.$langs->trans("Online").'';
+ print ''.$langs->trans("Online").'';
} else {
- print ''.$langs->trans("Offline");
+ print ''.$langs->trans("Offline");
$langs->load("errors");
if ($rssparser->error) {
print ' - '.$langs->trans($rssparser->error);
diff --git a/htdocs/admin/index.php b/htdocs/admin/index.php
index 7dcc5a356b5..affedf1f43c 100644
--- a/htdocs/admin/index.php
+++ b/htdocs/admin/index.php
@@ -112,8 +112,8 @@ $reshook = $hookmanager->executeHooks('addHomeSetup', $parameters, $object, $act
print $hookmanager->resPrint;
if (empty($reshook)) {
// Show into other
- print ''.$langs->trans("SetupDescription5")." ";
- print " ";
+ print ''.$langs->trans("SetupDescription5")." ";
+ print ' ';
// Show logo
print '';
diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php
index 2317d63ab7f..4010d724c1a 100644
--- a/htdocs/admin/ldap.php
+++ b/htdocs/admin/ldap.php
@@ -1,10 +1,10 @@
- * Copyright (C) 2004 Sebastien Di Cintio
- * Copyright (C) 2004 Benoit Mortier
- * Copyright (C) 2005-2017 Regis Houssin
- * Copyright (C) 2006-2020 Laurent Destailleur
- * Copyright (C) 2011-2013 Juanjo Menent
+/* Copyright (C) 2004 Rodolphe Quiedeville
+ * Copyright (C) 2004 Sebastien Di Cintio
+ * Copyright (C) 2004 Benoit Mortier
+ * Copyright (C) 2005-2017 Regis Houssin
+ * Copyright (C) 2006-2020 Laurent Destailleur
+ * Copyright (C) 2011-2013 Juanjo Menent
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -153,7 +153,7 @@ $arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP");
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
print ' '.$langs->trans("LDAPDnSynchroActiveExample").' ';
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
- print ''.$langs->trans("LDAPSetupNotComplete").' ';
+ print ''.$langs->trans("LDAPSetupNotComplete").' ';
}
print ' ';
@@ -297,24 +297,24 @@ if (function_exists("ldap_connect")) {
if ($result > 0) {
// Test ldap connect and bind
print img_picto('', 'info').' ';
- print ''.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).' ';
+ print ''.$langs->trans("LDAPTCPConnectOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).' ';
print ' ';
if ($conf->global->LDAP_ADMIN_DN && !empty($conf->global->LDAP_ADMIN_PASS)) {
if ($result == 2) {
print img_picto('', 'info').' ';
- print ''.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).' ';
+ print ''.$langs->trans("LDAPBindOK", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).' ';
print ' ';
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).' ';
+ print ''.$langs->trans("LDAPBindKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT, $conf->global->LDAP_ADMIN_DN, preg_replace('/./i', '*', $conf->global->LDAP_ADMIN_PASS)).' ';
print ' ';
print $langs->trans("Error").' '.$ldap->error;
print ' ';
}
} else {
print img_picto('', 'warning').' ';
- print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").' ';
+ print ''.$langs->trans("LDAPNoUserOrPasswordProvidedAccessIsReadOnly").' ';
print ' ';
}
@@ -322,18 +322,18 @@ if (function_exists("ldap_connect")) {
// Test ldap_getversion
if (($ldap->getVersion() == 3)) {
print img_picto('', 'info').' ';
- print ''.$langs->trans("LDAPSetupForVersion3").' ';
+ print ''.$langs->trans("LDAPSetupForVersion3").' ';
print ' ';
} else {
print img_picto('', 'info').' ';
- print ''.$langs->trans("LDAPSetupForVersion2").' ';
+ print ''.$langs->trans("LDAPSetupForVersion2").' ';
print ' ';
}
$unbind = $ldap->unbind();
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).' ';
+ print ''.$langs->trans("LDAPTCPConnectKO", $conf->global->LDAP_SERVER_HOST, $conf->global->LDAP_SERVER_PORT).' ';
print ' ';
print $langs->trans("Error").' '.$ldap->error;
print ' ';
diff --git a/htdocs/admin/ldap_contacts.php b/htdocs/admin/ldap_contacts.php
index 3be7d63759b..fef3882d2ff 100644
--- a/htdocs/admin/ldap_contacts.php
+++ b/htdocs/admin/ldap_contacts.php
@@ -321,12 +321,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
- print ''.$langs->trans("LDAPSynchroOK").' ';
+ print ''.$langs->trans("LDAPSynchroOK").' ';
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
+ print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
@@ -336,9 +336,9 @@ if (function_exists("ldap_connect")) {
print "\n ";
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKO");
+ print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
}
diff --git a/htdocs/admin/ldap_groups.php b/htdocs/admin/ldap_groups.php
index 7ba47fb8e3d..82ee85b9a20 100644
--- a/htdocs/admin/ldap_groups.php
+++ b/htdocs/admin/ldap_groups.php
@@ -260,12 +260,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
- print ''.$langs->trans("LDAPSynchroOK").' ';
+ print ''.$langs->trans("LDAPSynchroOK").' ';
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
+ print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
@@ -275,9 +275,9 @@ if (function_exists("ldap_connect")) {
print "\n ";
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKO");
+ print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
}
@@ -331,9 +331,9 @@ if (function_exists("ldap_connect")) {
print "\n ";
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKO");
+ print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
}
diff --git a/htdocs/admin/ldap_members.php b/htdocs/admin/ldap_members.php
index cda1700299c..876c31d79b1 100644
--- a/htdocs/admin/ldap_members.php
+++ b/htdocs/admin/ldap_members.php
@@ -472,12 +472,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
- print ''.$langs->trans("LDAPSynchroOK").' ';
+ print ''.$langs->trans("LDAPSynchroOK").' ';
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
+ print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
@@ -487,9 +487,9 @@ if (function_exists("ldap_connect")) {
print "\n ";
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKO");
+ print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
}
diff --git a/htdocs/admin/ldap_members_types.php b/htdocs/admin/ldap_members_types.php
index 1fde587f21e..05572dc8bbf 100644
--- a/htdocs/admin/ldap_members_types.php
+++ b/htdocs/admin/ldap_members_types.php
@@ -223,12 +223,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
- print ''.$langs->trans("LDAPSynchroOK").' ';
+ print ''.$langs->trans("LDAPSynchroOK").' ';
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
+ print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
@@ -238,9 +238,9 @@ if (function_exists("ldap_connect")) {
print "\n ";
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKO");
+ print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
}
diff --git a/htdocs/admin/ldap_users.php b/htdocs/admin/ldap_users.php
index ffb1e2ca90b..e6041650d63 100644
--- a/htdocs/admin/ldap_users.php
+++ b/htdocs/admin/ldap_users.php
@@ -444,12 +444,12 @@ if (function_exists("ldap_connect")) {
if ($result2 > 0) {
print img_picto('', 'info').' ';
- print ''.$langs->trans("LDAPSynchroOK").' ';
+ print ''.$langs->trans("LDAPSynchroOK").' ';
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
+ print ''.$langs->trans("LDAPSynchroKOMayBePermissions");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
@@ -459,9 +459,9 @@ if (function_exists("ldap_connect")) {
print "\n ";
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKO");
+ print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
}
@@ -530,9 +530,9 @@ if (function_exists("ldap_connect")) {
print "\n ";
} else {
print img_picto('', 'error').' ';
- print ''.$langs->trans("LDAPSynchroKO");
+ print ''.$langs->trans("LDAPSynchroKO");
print ': '.$ldap->error;
- print ' ';
+ print ' ';
print $langs->trans("ErrorLDAPMakeManualTest", $conf->ldap->dir_temp).' ';
}
}
diff --git a/htdocs/admin/pdf.php b/htdocs/admin/pdf.php
index c11d5023e27..be45a2101f5 100644
--- a/htdocs/admin/pdf.php
+++ b/htdocs/admin/pdf.php
@@ -307,7 +307,7 @@ for ($i = 1; $i <= 6; $i++) {
$pid = false;
}
} else {
- $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).' ';
+ $pid = img_warning().' '.$langs->trans("ErrorFieldRequired", $langs->transnoentitiesnoconv("CompanyCountry")).' ';
}
if ($pid) {
print ''.$langs->trans("ShowProfIdInAddress").' - '.$pid.' ';
diff --git a/htdocs/admin/sms.php b/htdocs/admin/sms.php
index d6b6d6e428a..05abf8c3995 100644
--- a/htdocs/admin/sms.php
+++ b/htdocs/admin/sms.php
@@ -183,7 +183,7 @@ if ($action == 'edit') {
if (count($listofmethods)) {
print $form->selectarray('MAIN_SMS_SENDMODE', $listofmethods, $conf->global->MAIN_SMS_SENDMODE, 1);
} else {
- print ''.$langs->trans("None").' ';
+ print ''.$langs->trans("None").' ';
}
print ' ';
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index 00b5fbfdb8e..808528cdc0a 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -132,6 +132,8 @@ if ($action == 'updateMask') {
if ($ret > 0) {
$ret = addDocumentModel($value, $type, $label, $scandir);
}
+} elseif ($action == 'unsetdoc') {
+ dolibarr_del_const($db, "COMMANDE_SUPPLIER_ADDON_PDF", $conf->entity);
} elseif ($action == 'setmod') {
// TODO Verifier si module numerotation choisi peut etre active
// par appel methode canBeActivated
@@ -397,7 +399,8 @@ foreach ($dirmodels as $reldir) {
// Default
print '';
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
- print img_picto($langs->trans("Default"), 'on');
+ // print img_picto($langs->trans("Default"), 'on');
+ print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
} else {
print 'scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php
index ce2c9f0f872..b31e4c9a433 100644
--- a/htdocs/admin/supplier_payment.php
+++ b/htdocs/admin/supplier_payment.php
@@ -89,6 +89,8 @@ if ($action == 'updateMask') {
if ($ret > 0) {
$ret = addDocumentModel($value, $type, $label, $scandir);
}
+} elseif ($action == 'unsetdoc') {
+ dolibarr_del_const($db, "SUPPLIER_PAYMENT_ADDON_PDF", $conf->entity);
} elseif ($action == 'specimen') {
$modele = GETPOST('module', 'alpha');
diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php
index 0bf568082b2..b0614c7501d 100644
--- a/htdocs/admin/system/security.php
+++ b/htdocs/admin/system/security.php
@@ -258,6 +258,8 @@ print ' ';
print '$dolibarr_nocsrfcheck : '.(empty($dolibarr_nocsrfcheck) ? '0' : $dolibarr_nocsrfcheck);
if (!empty($dolibarr_nocsrfcheck)) {
print ' '.img_picto('', 'warning').' '.$langs->trans("IfYouAreOnAProductionSetThis", 0);
+} else {
+ print ' ('.$langs->trans("Recommended").': 0) ';
}
print ' ';
diff --git a/htdocs/admin/tools/dolibarr_export.php b/htdocs/admin/tools/dolibarr_export.php
index 4f6977ffb41..ec363ad112d 100644
--- a/htdocs/admin/tools/dolibarr_export.php
+++ b/htdocs/admin/tools/dolibarr_export.php
@@ -513,7 +513,7 @@ if (!empty($_SESSION["commandbackuplastdone"])) {
$_SESSION["commandbackupresult"] = '';
}
if (!empty($_SESSION["commandbackuptorun"])) {
- print ''.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).': '."\n";
+ print ''.$langs->trans("YouMustRunCommandFromCommandLineAfterLoginToUser", $dolibarr_main_db_user, $dolibarr_main_db_user).': '."\n";
print ' '."\n";
print ajax_autoselect("commandbackuptoruntext", 0);
print ' ';
diff --git a/htdocs/api/class/api_documents.class.php b/htdocs/api/class/api_documents.class.php
index 00fd1a91a8a..f10c7b10b48 100644
--- a/htdocs/api/class/api_documents.class.php
+++ b/htdocs/api/class/api_documents.class.php
@@ -120,7 +120,7 @@ class Documents extends DolibarrApi
*
* Test sample 1: { "modulepart": "invoice", "original_file": "FA1701-001/FA1701-001.pdf", "doctemplate": "crabe", "langcode": "fr_FR" }.
*
- * @param string $modulepart Name of module or area concerned by file download ('invoice', 'order', ...).
+ * @param string $modulepart Name of module or area concerned by file download ('thirdparty', 'member', 'proposal', 'supplier_proposal', 'order', 'supplier_order', 'invoice', 'supplier_invoice', 'shipment', 'project', ...)
* @param string $original_file Relative path with filename, relative to modulepart (for example: IN201701-999/IN201701-999.pdf).
* @param string $doctemplate Set here the doc template to use for document generation (If not set, use the default template).
* @param string $langcode Language code like 'en_US', 'fr_FR', 'es_ES', ... (If not set, use the default language).
@@ -325,6 +325,20 @@ class Documents extends DolibarrApi
throw new RestException(404, 'Proposal not found');
}
+ $upload_dir = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal');
+ } elseif ($modulepart == 'supplier_proposal') {
+ require_once DOL_DOCUMENT_ROOT.'/supplier_proposal/class/supplier_proposal.class.php';
+
+ if (!DolibarrApiAccess::$user->rights->supplier_proposal->read) {
+ throw new RestException(401);
+ }
+
+ $object = new Propal($this->db);
+ $result = $object->fetch($id, $ref);
+ if (!$result) {
+ throw new RestException(404, 'Supplier proposal not found');
+ }
+
$upload_dir = $conf->propal->multidir_output[$object->entity]."/".get_exdir(0, 0, 0, 1, $object, 'propal');
} elseif ($modulepart == 'commande' || $modulepart == 'order') {
require_once DOL_DOCUMENT_ROOT.'/commande/class/commande.class.php';
@@ -340,6 +354,22 @@ class Documents extends DolibarrApi
}
$upload_dir = $conf->commande->dir_output."/".get_exdir(0, 0, 0, 1, $object, 'commande');
+ } elseif ($modulepart == 'commande_fournisseur' || $modulepart == 'supplier_order') {
+ $modulepart = 'supplier_order';
+
+ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.commande.class.php';
+
+ if (empty(DolibarrApiAccess::$user->rights->fournisseur->commande->lire) && empty(DolibarrApiAccess::$user->rights->supplier_order->lire)) {
+ throw new RestException(401);
+ }
+
+ $object = new CommandeFournisseur($this->db);
+ $result = $object->fetch($id, $ref);
+ if (!$result) {
+ throw new RestException(404, 'Purchase order not found');
+ }
+
+ $upload_dir = $conf->fournisseur->dir_output."/facture/".get_exdir($object->id, 2, 0, 0, $object, 'invoice_supplier').dol_sanitizeFileName($object->ref);
} elseif ($modulepart == 'shipment' || $modulepart == 'expedition') {
require_once DOL_DOCUMENT_ROOT.'/expedition/class/expedition.class.php';
@@ -373,7 +403,7 @@ class Documents extends DolibarrApi
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
- if (!DolibarrApiAccess::$user->rights->fournisseur->facture->lire) {
+ if (empty(DolibarrApiAccess::$user->rights->fournisseur->facture->lire) && empty(DolibarrApiAccess::$user->rights->supplier_invoice->lire)) {
throw new RestException(401);
}
@@ -504,7 +534,7 @@ class Documents extends DolibarrApi
* Test sample for medias file: { "filename": "mynewfile.txt", "modulepart": "medias", "ref": "", "subdir": "image/mywebsite", "filecontent": "Y29udGVudCB0ZXh0Cg==", "fileencoding": "base64", "overwriteifexists": "0" }.
*
* @param string $filename Name of file to create ('FA1705-0123.txt')
- * @param string $modulepart Name of module or area concerned by file upload ('facture', 'project', 'project_task', ...)
+ * @param string $modulepart Name of module or area concerned by file upload ('product', 'service', 'invoice', 'proposal', 'project', 'project_task', 'supplier_invoice', 'expensereport', 'member', ...)
* @param string $ref Reference of object (This will define subdir automatically and store submited file into it)
* @param string $subdir Subdirectory (Only if ref not provided)
* @param string $filecontent File content (string with file content. An empty file will be created if this parameter is not provided)
diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php
index 4ebbe832dc5..be76a00099c 100644
--- a/htdocs/barcode/codeinit.php
+++ b/htdocs/barcode/codeinit.php
@@ -274,7 +274,7 @@ if ($conf->product->enabled || $conf->product->service) {
} else {
$disabled = 1;
$titleno = $langs->trans("NoBarcodeNumberingTemplateDefined");
- print ''.$langs->trans("NoBarcodeNumberingTemplateDefined").' ('.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").' ) ';
+ print ''.$langs->trans("NoBarcodeNumberingTemplateDefined").' ('.$langs->trans("ToGenerateCodeDefineAutomaticRuleFirst").' ) ';
}
if (empty($nbno)) {
$disabled1 = 1;
diff --git a/htdocs/bom/lib/bom.lib.php b/htdocs/bom/lib/bom.lib.php
index 8f3cadeedc2..edd9bd69ef4 100644
--- a/htdocs/bom/lib/bom.lib.php
+++ b/htdocs/bom/lib/bom.lib.php
@@ -54,7 +54,9 @@ function bomAdminPrepareHead()
//$this->tabs = array(
// 'entity:-tabname:Title:@bom:/bom/mypage.php?id=__ID__'
//); // to remove a tab
- complete_head_from_modules($conf, $langs, null, $head, $h, 'bom');
+ complete_head_from_modules($conf, $langs, null, $head, $h, 'bom@mrp');
+
+ complete_head_from_modules($conf, $langs, $object, $head, $h, 'bom@mrp', 'remove');
return $head;
}
diff --git a/htdocs/comm/card.php b/htdocs/comm/card.php
index c9f422d78c8..c8ec0621394 100644
--- a/htdocs/comm/card.php
+++ b/htdocs/comm/card.php
@@ -351,7 +351,7 @@ if ($object->id > 0) {
print showValueWithClipboardCPButton(dol_escape_htmltag($object->code_client));
$tmpcheck = $object->check_codeclient();
if ($tmpcheck != 0 && $tmpcheck != -5) {
- print ' ('.$langs->trans("WrongCustomerCode").') ';
+ print ' ('.$langs->trans("WrongCustomerCode").') ';
}
print ' ';
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 2ed56683c02..614bedb8268 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -912,7 +912,7 @@ if ($action == 'create') {
}
}
if (empty($nbemail)) {
- $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").' ';
+ $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").' ';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');
@@ -1161,7 +1161,7 @@ if ($action == 'create') {
}
}
if (empty($nbemail)) {
- $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").' ';
+ $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").' ';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index e3d151c6bbb..340ac1dfc8c 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -284,7 +284,7 @@ if ($object->fetch($id) >= 0) {
}
}
if (empty($nbemail)) {
- $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").' ';
+ $nbemail .= ' '.img_warning('').' '.$langs->trans("NoTargetYet").' ';
}
if ($text) {
print $form->textwithpicto($nbemail, $text, 1, 'warning');
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 9cb9bca667b..7f3865906c8 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -363,7 +363,8 @@ if ((!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SU
}
print ''.price($obj->total_ttc).' ';
print ''.dol_print_date($db->jdate($obj->tms), 'day').' ';
- print ''.$facstatic->getLibStatut(3).' ';
+ $alreadypaid = $facstatic->getSommePaiement();
+ print ''.$facstatic->getLibStatut(3, $alreadypaid).' ';
print '';
$total_ht += $obj->total_ht;
$total_ttc += $obj->total_ttc;
@@ -711,7 +712,7 @@ if (!empty($conf->facture->enabled) && !empty($conf->commande->enabled) && $user
print "\n";
}
- print ''.$langs->trans("Total").' ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') ';
+ print ''.$langs->trans("Total").' ('.$langs->trans("RemainderToBill").': '.price($tot_tobill).') ';
if (!empty($conf->global->MAIN_SHOW_HT_ON_SUMMARY)) {
print ''.price($tot_ht).' ';
}
diff --git a/htdocs/contact/class/contact.class.php b/htdocs/contact/class/contact.class.php
index e03010cb5a5..1aecac97f19 100644
--- a/htdocs/contact/class/contact.class.php
+++ b/htdocs/contact/class/contact.class.php
@@ -165,7 +165,8 @@ class Contact extends CommonObject
/**
* @var int Thirdparty ID
*/
- public $socid;
+ public $socid; // both socid and fk_soc are used
+ public $fk_soc; // both socid and fk_soc are used
/**
* @var int 0=inactive, 1=active
@@ -1027,7 +1028,8 @@ class Contact extends CommonObject
$this->country_code = $obj->country_id ? $obj->country_code : '';
$this->country = $obj->country_id ? ($langs->trans('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : '';
- $this->socid = $obj->fk_soc;
+ $this->fk_soc = $obj->fk_soc; // Both fk_soc and socid are used
+ $this->socid = $obj->fk_soc; // Both fk_soc and socid are used
$this->socname = $obj->socname;
$this->poste = $obj->poste;
$this->statut = $obj->statut;
diff --git a/htdocs/contact/ldap.php b/htdocs/contact/ldap.php
index 79696d12997..8babb849e7e 100644
--- a/htdocs/contact/ldap.php
+++ b/htdocs/contact/ldap.php
@@ -173,7 +173,7 @@ if ($result > 0) {
// Show tree
if (((!is_numeric($records)) || $records != 0) && (!isset($records['count']) || $records['count'] > 0)) {
if (!is_array($records)) {
- print ''.$langs->trans("ErrorFailedToReadLDAP").' ';
+ print ''.$langs->trans("ErrorFailedToReadLDAP").' ';
} else {
$result = show_ldap_content($records, 0, $records['count'], true);
}
diff --git a/htdocs/core/actions_addupdatedelete.inc.php b/htdocs/core/actions_addupdatedelete.inc.php
index a6157d2a26b..e4483258b92 100644
--- a/htdocs/core/actions_addupdatedelete.inc.php
+++ b/htdocs/core/actions_addupdatedelete.inc.php
@@ -129,7 +129,6 @@ if ($action == 'add' && !empty($permissiontoadd)) {
if (!$error) {
$result = $object->create($user);
- var_dump($object);exit;
if ($result > 0) {
// Creation OK
if ($conf->categorie->enabled && method_exists($object, 'setCategories')) {
@@ -298,6 +297,7 @@ if ($action == 'confirm_delete' && !empty($permissiontodelete)) {
}
$result = $object->delete($user);
+
if ($result > 0) {
// Delete OK
setEventMessages("RecordDeleted", null, 'mesgs');
diff --git a/htdocs/core/actions_builddoc.inc.php b/htdocs/core/actions_builddoc.inc.php
index 4e2165d6f38..c813e8af4a0 100644
--- a/htdocs/core/actions_builddoc.inc.php
+++ b/htdocs/core/actions_builddoc.inc.php
@@ -102,12 +102,12 @@ if ($action == 'builddoc' && $permissiontoadd) {
if (empty($donotredirect)) { // This is set when include is done by bulk action "Bill Orders"
setEventMessages($langs->trans("FileGenerated"), null);
- $urltoredirect = $_SERVER['REQUEST_URI'];
+ /*$urltoredirect = $_SERVER['REQUEST_URI'];
$urltoredirect = preg_replace('/#builddoc$/', '', $urltoredirect);
$urltoredirect = preg_replace('/action=builddoc&?/', '', $urltoredirect); // To avoid infinite loop
header('Location: '.$urltoredirect.'#builddoc');
- exit;
+ exit;*/
}
}
}
diff --git a/htdocs/core/ajax/ajaxdirpreview.php b/htdocs/core/ajax/ajaxdirpreview.php
index 810a23957fd..a3da2812067 100644
--- a/htdocs/core/ajax/ajaxdirpreview.php
+++ b/htdocs/core/ajax/ajaxdirpreview.php
@@ -334,7 +334,7 @@ if ($type == 'directory') {
$textifempty = $langs->trans('NoFileFound');
} elseif ($section === '0') {
if ($module == 'ecm') {
- $textifempty = ''.$langs->trans("DirNotSynchronizedSyncFirst").'
';
+ $textifempty = ''.$langs->trans("DirNotSynchronizedSyncFirst").'
';
} else {
$textifempty = $langs->trans('NoFileFound');
}
diff --git a/htdocs/core/ajax/ajaxdirtree.php b/htdocs/core/ajax/ajaxdirtree.php
index 9a0a11f04d4..d63726dcea6 100644
--- a/htdocs/core/ajax/ajaxdirtree.php
+++ b/htdocs/core/ajax/ajaxdirtree.php
@@ -283,7 +283,7 @@ if (empty($conf->use_javascript_ajax) || !empty($conf->global->MAIN_ECM_DISABLE_
print '';
print '';
if ($nbofsubdir && $nboffilesinsubdir) {
- print '+'.$nboffilesinsubdir.' ';
+ print '+'.$nboffilesinsubdir.' ';
}
print ' ';
@@ -439,7 +439,7 @@ function treeOutputForAbsoluteDir($sqltree, $selecteddir, $fullpathselecteddir,
print '';
print '';
if ($nbofsubdir > 0 && $nboffilesinsubdir > 0) {
- print '+'.$nboffilesinsubdir.' ';
+ print '+'.$nboffilesinsubdir.' ';
}
print ' ';
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 3f75ee30d02..7183605ae10 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -220,6 +220,7 @@ abstract class CommonDocGenerator
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Define array with couple substitution key => substitution value
+ * For example {company_name}, {company_name_alias}
*
* @param Societe $object Object
* @param Translate $outputlangs Language object for output
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 6020e0b2723..004dc184fa9 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -5324,7 +5324,7 @@ abstract class CommonObject
$ecmfile->gen_or_uploaded = 'generated';
$ecmfile->description = ''; // indexed content
$ecmfile->keywords = ''; // keyword content
- $ecmfile->src_object_type = $this->table_element.(empty($this->module) ? '' : '@'.$this->module);
+ $ecmfile->src_object_type = $this->table_element; // $this->table_name is 'myobject' or 'mymodule_myobject'.
$ecmfile->src_object_id = $this->id;
$result = $ecmfile->create($user);
@@ -7808,7 +7808,7 @@ abstract class CommonObject
$out .= $labeltoshow;
}
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) {
- $out .= ' * ';
+ $out .= ' * ';
}
} else {
if ($mode != 'view' && !empty($extrafields->attributes[$this->table_element]['required'][$key])) {
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 5ec3a4cfbc0..ee91d67b9ce 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -624,14 +624,15 @@ class Conf
if (!empty($this->global->MAILING_EMAIL_FROM)) {
$this->mailing->email_from = $this->global->MAILING_EMAIL_FROM;
}
- if (!isset($this->global->MAIN_EMAIL_ADD_TRACK_ID)) {
- $this->global->MAIN_EMAIL_ADD_TRACK_ID = 1;
- }
if (!isset($this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP)) {
$this->global->MAIN_HIDE_WARNING_TO_ENCOURAGE_SMTP_SETUP = 1;
}
+ if (!isset($this->global->MAIN_FIX_FOR_BUGGED_MTA)) {
+ $this->global->MAIN_FIX_FOR_BUGGED_MTA = 1;
+ }
+
// Format for date (used by default when not found or not searched in lang)
$this->format_date_short = "%d/%m/%Y"; // Format of day with PHP/C tags (strftime functions)
$this->format_date_short_java = "dd/MM/yyyy"; // Format of day with Java tags
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index a98957969cb..37155a4566e 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -1268,6 +1268,7 @@ class Form
$selected_input_value = $societetmp->name;
unset($societetmp);
}
+
// mode 1
$urloption = 'htmlname='.urlencode($htmlname).'&outjson=1&filter='.urlencode($filter).(empty($excludeids) ? '' : '&excludeids='.join(',', $excludeids)).($showtype ? '&showtype='.urlencode($showtype) : '');
$out .= ajax_autocompleter($selected, $htmlname, DOL_URL_ROOT.'/societe/ajax/company.php', $urloption, $conf->global->COMPANY_USE_SEARCH_TO_SELECT, 0, $ajaxoptions);
@@ -1443,6 +1444,10 @@ class Form
$label .= ' ('.$obj->name_alias.')';
}
+ if ($conf->global->SOCIETE_SHOW_VAT_IN_LIST && !empty($obj->tva_intra)) {
+ $label .= ' - '.$obj->tva_intra.'';
+ }
+
if ($showtype) {
if ($obj->client || $obj->fournisseur) {
$label .= ' (';
@@ -1680,11 +1685,6 @@ class Form
if ($resql) {
$num = $this->db->num_rows($resql);
- if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
- include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
- $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
- }
-
if ($htmlname != 'none' && !$options_only) {
$out .= '';
}
@@ -1815,6 +1815,11 @@ class Form
$out .= ' ';
}
+ if ($conf->use_javascript_ajax && !$forcecombo && !$options_only) {
+ include_once DOL_DOCUMENT_ROOT.'/core/lib/ajax.lib.php';
+ $out .= ajax_combobox($htmlid, $events, getDolGlobalString("CONTACT_USE_SEARCH_TO_SELECT"));
+ }
+
$this->num = $num;
return $out;
} else {
@@ -5783,11 +5788,11 @@ class Form
return $num;
} else {
- $this->error = ''.$langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code).' ';
+ $this->error = ''.$langs->trans("ErrorNoVATRateDefinedForSellerCountry", $country_code).' ';
return -1;
}
} else {
- $this->error = ''.$this->db->error().' ';
+ $this->error = ''.$this->db->error().' ';
return -2;
}
}
@@ -5838,9 +5843,9 @@ class Form
// Check parameters
if (is_object($societe_vendeuse) && !$societe_vendeuse->country_code) {
if ($societe_vendeuse->id == $mysoc->id) {
- $return .= ''.$langs->trans("ErrorYourCountryIsNotDefined").' ';
+ $return .= ''.$langs->trans("ErrorYourCountryIsNotDefined").' ';
} else {
- $return .= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").' ';
+ $return .= ''.$langs->trans("ErrorSupplierCountryIsNotDefined").' ';
}
return $return;
}
@@ -7923,7 +7928,7 @@ class Form
}
if (!$nboftypesoutput) {
- print ''.$langs->trans("None").' ';
+ print ''.$langs->trans("None").' ';
}
print '';
@@ -8789,8 +8794,8 @@ class Form
public function showFilterButtons()
{
$out = '';
- $out .= ' ';
- $out .= ' ';
+ $out .= ' ';
+ $out .= ' ';
$out .= '
';
return $out;
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index d558571d5b8..03faffb941b 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -393,6 +393,38 @@ class FormFile
global $langs, $conf, $user, $hookmanager;
global $form;
+ $reshook = 0;
+ if (is_object($hookmanager)) {
+ $parameters = array(
+ 'modulepart'=>&$modulepart,
+ 'modulesubdir'=>&$modulesubdir,
+ 'filedir'=>&$filedir,
+ 'urlsource'=>&$urlsource,
+ 'genallowed'=>&$genallowed,
+ 'delallowed'=>&$delallowed,
+ 'modelselected'=>&$modelselected,
+ 'allowgenifempty'=>&$allowgenifempty,
+ 'forcenomultilang'=>&$forcenomultilang,
+ 'noform'=>&$noform,
+ 'param'=>&$param,
+ 'title'=>&$title,
+ 'buttonlabel'=>&$buttonlabel,
+ 'codelang'=>&$codelang,
+ 'morepicto'=>&$morepicto,
+ 'hideifempty'=>&$hideifempty,
+ 'removeaction'=>&$removeaction
+ );
+ $reshook = $hookmanager->executeHooks('showDocuments', $parameters, $object); // Note that parameters may have been updated by hook
+ // May report error
+ if ($reshook < 0) {
+ setEventMessages($hookmanager->error, $hookmanager->errors, 'errors');
+ }
+ }
+ // Remode default action if $reskook > 0
+ if ($reshook > 0) {
+ return $hookmanager->resPrint;
+ }
+
if (!is_object($form)) {
$form = new Form($this->db);
}
@@ -702,9 +734,10 @@ class FormFile
$urlsource .= '#'.$forname.'_form'; // So we switch to form after a generation
}
if (empty($noform)) {
- $out .= '