';
if ($row[0] == 'tobind') {
- print $langs->trans("Unknown");
+ print ''.$langs->trans("Unknown").' ';
} else {
print length_accountg($row[0]);
}
@@ -349,8 +349,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
print '';
print '
';
-print ''.$langs->trans("Account").' ';
-print ''.$langs->trans("Label").' ';
+print ''.$langs->trans("Account").' ';
+print ''.$langs->trans("Label").' ';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -436,7 +436,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '';
print '
';
- print ''.$langs->trans("TotalVente").' ';
+ print ''.$langs->trans("TotalVente").' ';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -497,7 +497,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print " \n";
print '';
print '
';
- print ''.$langs->trans("TotalMarge").' ';
+ print ''.$langs->trans("TotalMarge").' ';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
diff --git a/htdocs/accountancy/expensereport/index.php b/htdocs/accountancy/expensereport/index.php
index f06dd5f8d6f..0e3bda39521 100644
--- a/htdocs/accountancy/expensereport/index.php
+++ b/htdocs/accountancy/expensereport/index.php
@@ -154,8 +154,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
print '';
print '
';
-print ''.$langs->trans("Account").' ';
-print ''.$langs->trans("Label").' ';
+print ''.$langs->trans("Account").' ';
+print ''.$langs->trans("Label").' ';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -197,7 +197,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '';
if ($row[0] == 'tobind') {
- print $langs->trans("Unknown");
+ print ''.$langs->trans("Unknown").' ';
} else {
print length_accountg($row[0]);
}
@@ -233,8 +233,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
print '';
print '
';
-print ''.$langs->trans("Account").' ';
-print ''.$langs->trans("Label").' ';
+print ''.$langs->trans("Account").' ';
+print ''.$langs->trans("Label").' ';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -276,7 +276,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '';
if ($row[0] == 'tobind') {
- print $langs->trans("Unknown");
+ print ''.$langs->trans("Unknown").' ';
} else {
print length_accountg($row[0]);
}
@@ -314,7 +314,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '';
print '
';
- print ''.$langs->trans("Total").' ';
+ print ''.$langs->trans("Total").' ';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
diff --git a/htdocs/accountancy/journal/expensereportsjournal.php b/htdocs/accountancy/journal/expensereportsjournal.php
index 9633157b5b7..96ab150dd24 100644
--- a/htdocs/accountancy/journal/expensereportsjournal.php
+++ b/htdocs/accountancy/journal/expensereportsjournal.php
@@ -610,7 +610,7 @@ if (empty($action) || $action == 'view') {
$userstatic->id = $tabuser[$key]['id'];
$userstatic->name = $tabuser[$key]['name'];
print "".$userstatic->getNomUrl(0, 'user', 16).' - '.$accountingaccount->label." ";
- print ''.($mt >= 0 ? price($mt) : '')." ";
+ print ''.($mt >= 0 ? price($mt) : '')." ";
print ''.($mt < 0 ? price(-$mt) : '')." ";
print " ";
}
diff --git a/htdocs/accountancy/supplier/index.php b/htdocs/accountancy/supplier/index.php
index f047ddf70de..585121f7c36 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -265,8 +265,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '',
print '';
print '
';
-print ''.$langs->trans("Account").' ';
-print ''.$langs->trans("Label").' ';
+print ''.$langs->trans("Account").' ';
+print ''.$langs->trans("Label").' ';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -309,7 +309,7 @@ if ($resql) {
while ($row = $db->fetch_row($resql)) {
print '';
if ($row[0] == 'tobind') {
- print $langs->trans("Unknown");
+ print ''.$langs->trans("Unknown").' ';
} else {
print length_accountg($row[0]);
}
@@ -344,8 +344,8 @@ print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '',
print '';
print '
';
-print ''.$langs->trans("Account").' ';
-print ''.$langs->trans("Label").' ';
+print ''.$langs->trans("Account").' ';
+print ''.$langs->trans("Label").' ';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
@@ -425,7 +425,7 @@ if ($conf->global->MAIN_FEATURES_LEVEL > 0) { // This part of code looks strange
print '';
print '
';
- print ''.$langs->trans("Total").' ';
+ print ''.$langs->trans("Total").' ';
for ($i = 1; $i <= 12; $i++) {
$j = $i + ($conf->global->SOCIETE_FISCAL_MONTH_START ? $conf->global->SOCIETE_FISCAL_MONTH_START : 1) - 1;
if ($j > 12) {
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index 4fd16df2afe..90e44617b05 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -620,10 +620,12 @@ if ($result) {
}
// Level 3: Search suggested account for this thirdparty (similar code exists in page index.php to make automatic binding)
- if (!empty($objp->company_code_buy)) {
- $objp->code_buy_t = $objp->company_code_buy;
- $objp->aarowid_suggest = $objp->aarowid_thirdparty;
- $suggestedaccountingaccountfor = '';
+ if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
+ if (!empty($objp->company_code_buy)) {
+ $objp->code_buy_t = $objp->company_code_buy;
+ $objp->aarowid_suggest = $objp->aarowid_thirdparty;
+ $suggestedaccountingaccountfor = '';
+ }
}
if (!empty($objp->code_buy_p)) {
@@ -724,11 +726,13 @@ if ($result) {
$s .= $langs->trans("NotDefined");
print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
}
- print ' ';
- $s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
- $shelp = '';
- $s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : ''.$langs->trans("NotDefined").' ');
- print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
+ if (!empty($conf->global->ACCOUNTANCY_USE_PRODUCT_ACCOUNT_ON_THIRDPARTY)) {
+ print ' ';
+ $s = '3. '.(($objp->type_l == 1) ? $langs->trans("ServiceForThisThirdparty") : $langs->trans("ProductForThisThirdparty")).': ';
+ $shelp = '';
+ $s .= ($objp->code_buy_t > 0 ? length_accountg($objp->code_buy_t) : ''.$langs->trans("NotDefined").' ');
+ print $form->textwithpicto($s, $shelp, 1, 'help', '', 0, 2, '', 1);
+ }
print '';
// Suggested accounting account
diff --git a/htdocs/adherents/admin/member.php b/htdocs/adherents/admin/member.php
index f9b10c3ce3b..018498c2457 100644
--- a/htdocs/adherents/admin/member.php
+++ b/htdocs/adherents/admin/member.php
@@ -25,7 +25,7 @@
*/
/**
- * \file htdocs/adherents/admin/adherent.php
+ * \file htdocs/adherents/admin/member.php
* \ingroup member
* \brief Page to setup the module Foundation
*/
@@ -205,16 +205,16 @@ print ''.$langs->trans("Description").' ';
print ''.$langs->trans("Value").' ';
print " \n";
-// Login/Pass required for members
-print ''.$langs->trans("AdherentLoginRequired").' ';
-print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
-print " \n";
-
// Mail required for members
print ''.$langs->trans("AdherentMailRequired").' ';
print $form->selectyesno('ADHERENT_MAIL_REQUIRED', (!empty($conf->global->ADHERENT_MAIL_REQUIRED) ? $conf->global->ADHERENT_MAIL_REQUIRED : 0), 1);
print " \n";
+// Login/Pass required for members
+print ''.$langs->trans("AdherentLoginRequired").' ';
+print $form->selectyesno('ADHERENT_LOGIN_NOT_REQUIRED', (!empty($conf->global->ADHERENT_LOGIN_NOT_REQUIRED) ? 0 : 1), 1);
+print " \n";
+
// Send mail information is on by default
print ''.$langs->trans("MemberSendInformationByMailByDefault").' ';
print $form->selectyesno('ADHERENT_DEFAULT_SENDINFOBYMAIL', (!empty($conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL) ? $conf->global->ADHERENT_DEFAULT_SENDINFOBYMAIL : 0), 1);
diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php
index bb320e9f48a..e99e20452cc 100644
--- a/htdocs/adherents/admin/website.php
+++ b/htdocs/adherents/admin/website.php
@@ -56,7 +56,7 @@ if ($action == 'setMEMBER_ENABLE_PUBLIC') {
if ($action == 'update') {
$public = GETPOST('MEMBER_ENABLE_PUBLIC');
- $amount = GETPOST('MEMBER_NEWFORM_AMOUNT');
+ $amount = price2num(GETPOST('MEMBER_NEWFORM_AMOUNT'), 'MT', 2);
$editamount = GETPOST('MEMBER_NEWFORM_EDITAMOUNT');
$payonline = GETPOST('MEMBER_NEWFORM_PAYONLINE');
$forcetype = GETPOST('MEMBER_NEWFORM_FORCETYPE', 'int');
@@ -205,7 +205,7 @@ if (!empty($conf->global->MEMBER_ENABLE_PUBLIC)) {
print ' ';
print $langs->trans("DefaultAmount");
print ' ';
- print ' ';
+ print ' ';
print " \n";
// Can edit
diff --git a/htdocs/adherents/card.php b/htdocs/adherents/card.php
index 3ac82b893a7..56643d80632 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -645,7 +645,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
- $outputlangs->loadLangs(array("main", "members"));
+ $outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
@@ -716,7 +716,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
- $outputlangs->loadLangs(array("main", "members"));
+ $outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_CANCELATION;
@@ -787,7 +787,7 @@ if (empty($reshook)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
- $outputlangs->loadLangs(array("main", "members"));
+ $outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_EXCLUSION;
@@ -1506,7 +1506,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
$outputlangs = new Translate('', $conf);
$outputlangs->setDefaultLang(empty($object->thirdparty->default_lang) ? $mysoc->default_lang : $object->thirdparty->default_lang);
// Load traductions files required by page
- $outputlangs->loadLangs(array("main", "members"));
+ $outputlangs->loadLangs(array("main", "members", "companies", "install", "other"));
// Get email content from template
$arraydefaultmessage = null;
$labeltouse = $conf->global->ADHERENT_EMAIL_TEMPLATE_MEMBER_VALIDATION;
@@ -1949,7 +1949,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!empty($conf->societe->enabled) && !$object->socid) {
if ($user->rights->societe->creer) {
if (Adherent::STATUS_DRAFT != $object->statut) {
- print 'id.'&action=create_thirdparty">'.$langs->trans("CreateDolibarrThirdParty").' '."\n";;
+ print 'id.'&action=create_thirdparty" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrThirdPartyDesc")).'">'.$langs->trans("CreateDolibarrThirdParty").' '."\n";;
} else {
print ''.$langs->trans("CreateDolibarrThirdParty").' '."\n";
}
@@ -1962,7 +1962,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if (!$user->socid && !$object->user_id) {
if ($user->rights->user->user->creer) {
if (Adherent::STATUS_DRAFT != $object->statut) {
- print 'id.'&action=create_user">'.$langs->trans("CreateDolibarrLogin").' '."\n";
+ print 'id.'&action=create_user" title="'.dol_escape_htmltag($langs->trans("CreateDolibarrLoginDesc")).'">'.$langs->trans("CreateDolibarrLogin").' '."\n";
} else {
print ''.$langs->trans("CreateDolibarrLogin").' '."\n";
}
diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php
index df9e35651c2..b7f2810912b 100644
--- a/htdocs/adherents/class/adherent.class.php
+++ b/htdocs/adherents/class/adherent.class.php
@@ -1900,8 +1900,8 @@ class Adherent extends CommonObject
$sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET";
$sql .= " statut = ".self::STATUS_VALIDATED;
$sql .= ", datevalid = '".$this->db->idate($now)."'";
- $sql .= ", fk_user_valid=".$user->id;
- $sql .= " WHERE rowid = ".$this->id;
+ $sql .= ", fk_user_valid=".((int) $user->id);
+ $sql .= " WHERE rowid = ".((int) $this->id);
dol_syslog(get_class($this)."::validate", LOG_DEBUG);
$result = $this->db->query($sql);
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index 61226097d5c..ad78c2cb389 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -961,7 +961,8 @@ while ($i < min($num, $limit)) {
// Firstname
if (!empty($arrayfields['d.firstname']['checked'])) {
print '';
- print $obj->firstname;
+ print $memberstatic->getNomUrl(0, 0, 'card', 'fistname');
+ //print $obj->firstname;
print " \n";
if (!$i) {
$totalarray['nbfield']++;
@@ -970,7 +971,8 @@ while ($i < min($num, $limit)) {
// Lastname
if (!empty($arrayfields['d.lastname']['checked'])) {
print '';
- print $obj->lastname;
+ print $memberstatic->getNomUrl(0, 0, 'card', 'lastname');
+ //print $obj->lastname;
print " \n";
if (!$i) {
$totalarray['nbfield']++;
@@ -1100,7 +1102,9 @@ while ($i < min($num, $limit)) {
}
// EMail
if (!empty($arrayfields['d.email']['checked'])) {
- print ''.dol_print_email($obj->email, 0, 0, 1)." \n";
+ print '';
+ print dol_print_email($obj->email, 0, 0, 1, 64, 1, 1);
+ print " \n";
}
// End of subscription date
$datefin = $db->jdate($obj->datefin);
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 0ca1ae7d98e..85d168ac8b3 100644
--- a/htdocs/admin/company.php
+++ b/htdocs/admin/company.php
@@ -696,7 +696,7 @@ $tooltiphelp = '';
if ($mysoc->country_code == 'FR') {
$tooltiphelp = ''.$langs->trans("Example").': '.$langs->trans("VATIsUsedExampleFR")." ";
}
-print "".$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)." ";
+print ''.$form->textwithpicto($langs->trans("VATIsUsedDesc"), $tooltiphelp)." ";
print "\n";
@@ -706,7 +706,7 @@ $tooltiphelp = '';
if ($mysoc->country_code == 'FR') {
$tooltiphelp = "".$langs->trans("Example").': '.$langs->trans("VATIsNotUsedExampleFR")." \n";
}
-print "".$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)." ";
+print ''.$form->textwithpicto($langs->trans("VATIsNotUsedDesc"), $tooltiphelp)." ";
print "\n";
print "
";
@@ -721,12 +721,12 @@ print "
\n";
if ($mysoc->useLocalTax(1)) {
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
- print ' global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)." ";
+ print ' global->FACTURE_LOCAL_TAX1_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1on") ? " checked" : "").'> '.$langs->transcountry("LocalTax1IsUsed", $mysoc->country_code)." ";
print '';
print '';
$tooltiphelp = $langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code);
$tooltiphelp = ($tooltiphelp != "LocalTax1IsUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsUsedExample", $mysoc->country_code)." \n" : "");
- print ''.$form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp)." ";
+ print $form->textwithpicto($langs->transcountry("LocalTax1IsUsedDesc", $mysoc->country_code), $tooltiphelp);
if (!isOnlyOneLocalTax(1)) {
print ''.$langs->trans("LTRate").' : ';
$formcompany->select_localtax(1, $conf->global->MAIN_INFO_VALUE_LOCALTAX1, "lt1");
@@ -739,11 +739,11 @@ if ($mysoc->useLocalTax(1)) {
print "
";
print " \n";
- print ' global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "")."> ".$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)." ";
+ print ' global->FACTURE_LOCAL_TAX1_OPTION) || $conf->global->FACTURE_LOCAL_TAX1_OPTION == "localtax1off") ? " checked" : "").'> '.$langs->transcountry("LocalTax1IsNotUsed", $mysoc->country_code)." ";
print '';
$tooltiphelp = $langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code);
$tooltiphelp = ($tooltiphelp != "LocalTax1IsNotUsedExample" ? "".$langs->trans("Example").': '.$langs->transcountry("LocalTax1IsNotUsedExample", $mysoc->country_code)." \n" : "");
- print "".$form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp)." ";
+ print $form->textwithpicto($langs->transcountry("LocalTax1IsNotUsedDesc", $mysoc->country_code), $tooltiphelp);
print " \n";
} else {
if (empty($mysoc->country_code)) {
@@ -765,7 +765,7 @@ print "\n";
if ($mysoc->useLocalTax(2)) {
// Note: When option is not set, it must not appears as set on on, because there is no default value for this option
- print ' global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)." ";
+ print ' global->FACTURE_LOCAL_TAX2_OPTION == '1' || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2on") ? " checked" : "").'> '.$langs->transcountry("LocalTax2IsUsed", $mysoc->country_code)." ";
print '';
print '';
print ''.$langs->transcountry("LocalTax2IsUsedDesc", $mysoc->country_code)." ";
@@ -780,7 +780,7 @@ if ($mysoc->useLocalTax(2)) {
print "
";
print " \n";
- print ' global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "")."> ".$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)." ";
+ print ' global->FACTURE_LOCAL_TAX2_OPTION) || $conf->global->FACTURE_LOCAL_TAX2_OPTION == "localtax2off") ? " checked" : "").'> '.$langs->transcountry("LocalTax2IsNotUsed", $mysoc->country_code)." ";
print '';
print "";
$tooltiphelp = $langs->transcountry("LocalTax2IsNotUsedExample", $mysoc->country_code);
@@ -803,7 +803,7 @@ print "
";
print '
';
print '
';
print '';
-print ''.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).' '.$langs->trans("Description").' ';
+print ''.$form->textwithpicto($langs->trans("RevenueStamp"), $langs->trans("RevenueStampDesc")).' '.$langs->trans("Description").' ';
print ' ';
print " \n";
if ($mysoc->useRevenueStamp()) {
diff --git a/htdocs/admin/dolistore/class/dolistore.class.php b/htdocs/admin/dolistore/class/dolistore.class.php
index bfcb751f9a9..5e7a229fee3 100644
--- a/htdocs/admin/dolistore/class/dolistore.class.php
+++ b/htdocs/admin/dolistore/class/dolistore.class.php
@@ -217,15 +217,15 @@ class Dolistore
for ($i = 0; $i < $nbofcateg; $i++) {
$cat = $this->categories[$i];
if ($cat->is_root_category == 1 && $parent == 0) {
- $html .= '';
+ $html .= ' ';
$html .= self::get_categories($cat->id);
$html .= " \n";
} elseif (trim($cat->id_parent) == $parent && $cat->active == 1 && trim($cat->id_parent) != 0) { // si cat est de ce niveau
$select = ($cat->id == $this->categorie) ? ' selected' : '';
- $html .= 'description->language[$this->lang - 1])).'" ';
- $html .= '>'.$cat->name->language[$this->lang - 1].' '.$cat->nb_products_recursive.' ';
+ $html .= '>'.dol_escape_htmltag($cat->name->language[$this->lang - 1]).' '.dol_escape_htmltag($cat->nb_products_recursive).' ';
$html .= self::get_categories($cat->id);
$html .= " \n";
}
@@ -267,9 +267,9 @@ class Dolistore
// add image or default ?
if ($product->id_default_image != '') {
- $image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.$product->id.'&id_image='.$product->id_default_image;
- $images = '';
- $images .= ' ';
+ $image_url = DOL_URL_ROOT.'/admin/dolistore/ajax/image.php?id_product='.((int) $product->id).'&id_image='.((int) $product->id_default_image);
+ $images = '';
+ $images .= ' ';
} else {
$images = ' ';
}
@@ -277,11 +277,11 @@ class Dolistore
// free or pay ?
if ($product->price > 0) {
$price = ''.price(price2num($product->price, 'MT'), 0, $langs, 1, -1, -1, 'EUR').' '.$langs->trans("HT").' ';
- $download_link = ' ';
+ $download_link = ' ';
} else {
$price = ''.$langs->trans('Free').' ';
- $download_link = ' ';
- $download_link .= ' ';
+ $download_link = ' ';
+ $download_link .= ' ';
}
//checking versions
@@ -319,14 +319,14 @@ class Dolistore
//.''.$langs->trans("SeeInMarkerPlace").'
//output template
- $html .= '
- '.$newapp.$images.'
- '.$product->name->language[$this->lang - 1]
- .''.$version.'
- '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.$product->reference.' - '.$langs->trans('Id').': '.$product->id.' '.$product->description_short->language[$this->lang - 1].' ';
+ $html .= '
+ '.dol_escape_htmltag($newapp.$images).'
+ '.dol_escape_htmltag($product->name->language[$this->lang - 1])
+ .''.dol_escape_htmltag($version).'
+ '.dol_print_date(dol_stringtotime($product->date_upd), 'dayhour').' - '.$langs->trans('Ref').': '.dol_escape_htmltag($product->reference).' - '.dol_escape_htmltag($langs->trans('Id')).': '.((int) $product->id).' '.dol_escape_htmltag($product->description_short->language[$this->lang - 1]).' ';
// do not load if display none
//$html .= ''.$product->description->language[$this->lang - 1].' ';
- $html .= ''.$price.' ';
+ $html .= ''.dol_escape_htmltag($price).' ';
$html .= ''.$download_link.' ';
$html .= ' ';
}
@@ -343,7 +343,7 @@ class Dolistore
public function get_previous_link($text = '<<')
{
// phpcs:enable
- return ''.$text.' ';
+ return ''.dol_escape_htmltag($text).' ';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
@@ -356,7 +356,7 @@ class Dolistore
public function get_next_link($text = '>>')
{
// phpcs:enable
- return ''.$text.' ';
+ return ''.dol_escape_htmltag($text).' ';
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
diff --git a/htdocs/admin/eventorganization.php b/htdocs/admin/eventorganization.php
index d01aece1ca0..de8b6627cf8 100644
--- a/htdocs/admin/eventorganization.php
+++ b/htdocs/admin/eventorganization.php
@@ -48,8 +48,8 @@ $arrayofparameters = array(
'EVENTORGANIZATION_TASK_LABEL'=>array('type'=>'textarea','enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_CONF'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
'EVENTORGANIZATION_CATEG_THIRDPARTY_BOOTH'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
- //'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
- //'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
+ 'EVENTORGANIZATION_FILTERATTENDEES_CAT'=>array('type'=>'category:'.Categorie::TYPE_CUSTOMER, 'enabled'=>1),
+ 'EVENTORGANIZATION_FILTERATTENDEES_TYPE'=>array('type'=>'thirdparty_type:', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_CONF'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_ASK_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
'EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_BOOTH'=>array('type'=>'emailtemplate:conferenceorbooth', 'enabled'=>1),
@@ -213,7 +213,7 @@ if ($action == 'edit') {
print ' ';
print '';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
@@ -264,7 +264,7 @@ if ($action == 'edit') {
} elseif (preg_match('/thirdparty_type/', $val['type'])) {
require_once DOL_DOCUMENT_ROOT.'/core/class/html.formcompany.class.php';
$formcompany = new FormCompany($db);
- print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname);
+ print $formcompany->selectProspectCustomerType($conf->global->{$constname}, $constname, 'customerorprospect', 'form', '', 1);
} elseif ($val['type'] == 'securekey') {
print ' ';
if (!empty($conf->use_javascript_ajax)) {
@@ -309,7 +309,7 @@ if ($action == 'edit') {
} else {
if (!empty($arrayofparameters)) {
print '';
- print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
+ print ''.$langs->trans("Parameter").' '.$langs->trans("Value").' ';
foreach ($arrayofparameters as $constname => $val) {
if ($val['enabled']==1) {
@@ -366,7 +366,7 @@ if ($action == 'edit') {
$product = new Product($db);
$resprod = $product->fetch($conf->global->{$constname});
if ($resprod > 0) {
- print $product->ref;
+ print $product->getNomUrl(1);
} elseif ($resprod < 0) {
setEventMessages(null, $object->errors, "errors");
}
diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php
index 3388b649a67..d3c142b8e99 100644
--- a/htdocs/admin/fckeditor.php
+++ b/htdocs/admin/fckeditor.php
@@ -47,6 +47,8 @@ if (!$user->admin) {
// Constant and translation of the module description
$modules = array(
+ 'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
+ 'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
'SOCIETE' => 'FCKeditorForCompany',
'PRODUCTDESC' => 'FCKeditorForProduct',
'DETAILS' => 'FCKeditorForProductDetails',
@@ -54,11 +56,11 @@ $modules = array(
'MAILING' => 'FCKeditorForMailing',
'MAIL' => 'FCKeditorForMail',
'TICKET' => 'FCKeditorForTicket',
- 'NOTE_PUBLIC' => 'FCKeditorForNotePublic',
- 'NOTE_PRIVATE' => 'FCKeditorForNotePrivate',
);
// Conditions for the option to be offered
$conditions = array(
+ 'NOTE_PUBLIC' => 1,
+ 'NOTE_PRIVATE' => 1,
'SOCIETE' => 1,
'PRODUCTDESC' => (!empty($conf->product->enabled) || !empty($conf->service->enabled)),
'DETAILS' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled) || !empty($conf->supplier_proposal->enabled) || (!empty($conf->fournisseur->enabled) && empty($conf->global->MAIN_USE_NEW_SUPPLIERMOD)) || !empty($conf->supplier_order->enabled) || !empty($conf->supplier_invoice->enabled)),
@@ -66,11 +68,11 @@ $conditions = array(
'MAILING' => !empty($conf->mailing->enabled),
'MAIL' => (!empty($conf->facture->enabled) || !empty($conf->propal->enabled) || !empty($conf->commande->enabled)),
'TICKET' => !empty($conf->ticket->enabled),
- 'NOTE_PUBLIC' => 1,
- 'NOTE_PRIVATE' => 1,
);
// Picto
$picto = array(
+ 'NOTE_PUBLIC' => 'generic',
+ 'NOTE_PRIVATE' => 'generic',
'SOCIETE' => 'generic',
'PRODUCTDESC' => 'product',
'DETAILS' => 'product',
@@ -78,8 +80,6 @@ $picto = array(
'MAILING' => 'email',
'MAIL' => 'email',
'TICKET' => 'ticket',
- 'NOTE_PUBLIC' => 'generic',
- 'NOTE_PRIVATE' => 'generic',
);
diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php
index 26f0c28172f..b606a986ba2 100644
--- a/htdocs/admin/ldap.php
+++ b/htdocs/admin/ldap.php
@@ -43,6 +43,7 @@ $action = GETPOST('action', 'aZ09');
// Initialize technical object to manage hooks of page. Note that conf->hooks_modules contains array of hook context
$hookmanager->initHooks(array('adminldap', 'globaladmin'));
+
/*
* Actions
*/
@@ -150,7 +151,7 @@ $arraylist['0'] = $langs->trans("No");
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr");
$arraylist['dolibarr2ldap'] = $langs->trans("DolibarrToLDAP");
print $form->selectarray('activesynchro', $arraylist, $conf->global->LDAP_SYNCHRO_ACTIVE);
-print ''.$langs->trans("LDAPDnSynchroActiveExample");
+print ' '.$langs->trans("LDAPDnSynchroActiveExample").' ';
if ($conf->global->LDAP_SYNCHRO_ACTIVE && !$conf->global->LDAP_USER_DN) {
print ''.$langs->trans("LDAPSetupNotComplete").' ';
}
@@ -163,7 +164,7 @@ if (!empty($conf->societe->enabled)) {
$arraylist['0'] = $langs->trans("No");
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
print $form->selectarray('activecontact', $arraylist, $conf->global->LDAP_CONTACT_ACTIVE);
- print ''.$langs->trans("LDAPDnContactActiveExample").' ';
+ print ''.$langs->trans("LDAPDnContactActiveExample").' ';
}
// Synchro member active
@@ -174,7 +175,7 @@ if (!empty($conf->adherent->enabled)) {
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
print $form->selectarray('activemembers', $arraylist, $conf->global->LDAP_MEMBER_ACTIVE);
- print ''.$langs->trans("LDAPDnMemberActiveExample").' ';
+ print ''.$langs->trans("LDAPDnMemberActiveExample").' ';
}
// Synchro member type active
@@ -185,7 +186,7 @@ if (!empty($conf->adherent->enabled)) {
$arraylist['1'] = $langs->trans("DolibarrToLDAP");
$arraylist['ldap2dolibarr'] = $langs->trans("LDAPToDolibarr").' ('.$langs->trans("SupportedForLDAPImportScriptOnly").')';
print $form->selectarray('activememberstypes', $arraylist, $conf->global->LDAP_MEMBER_TYPE_ACTIVE);
- print ''.$langs->trans("LDAPDnMemberTypeActiveExample").' ';
+ print ''.$langs->trans("LDAPDnMemberTypeActiveExample").' ';
}
// Fields from hook
@@ -214,33 +215,33 @@ $arraylist = array();
$arraylist['3'] = 'Version 3';
$arraylist['2'] = 'Version 2';
print $form->selectarray('LDAP_SERVER_PROTOCOLVERSION', $arraylist, $conf->global->LDAP_SERVER_PROTOCOLVERSION);
-print ''.$langs->trans("LDAPServerProtocolVersion").' ';
+print ''.$langs->trans("LDAPServerProtocolVersion").' ';
// Serveur primaire
print '';
print $langs->trans("LDAPPrimaryServer").' ';
-print ' ';
-print ' '.$langs->trans("LDAPServerExample").' ';
+print ' ';
+print ''.$langs->trans("LDAPServerExample").' ';
// Serveur secondaire
print '';
print $langs->trans("LDAPSecondaryServer").' ';
-print ' ';
-print ' '.$langs->trans("LDAPServerExample").' ';
+print ' ';
+print ''.$langs->trans("LDAPServerExample").' ';
// Port
print ''.$langs->trans("LDAPServerPort").' ';
if (!empty($conf->global->LDAP_SERVER_PORT)) {
- print ' ';
+ print ' ';
} else {
- print ' ';
+ print ' ';
}
-print ' '.$langs->trans("LDAPServerPortExample").' ';
+print ''.$langs->trans("LDAPServerPortExample").' ';
// DNserver
print ''.$langs->trans("LDAPServerDn").' ';
-print ' ';
-print ' '.$langs->trans("LDAPServerDnExample").' ';
+print ' ';
+print ''.$langs->trans("LDAPServerDnExample").' ';
// Utiliser TLS
print ''.$langs->trans("LDAPServerUseTLS").' ';
@@ -248,7 +249,7 @@ $arraylist = array();
$arraylist['0'] = $langs->trans("No");
$arraylist['1'] = $langs->trans("Yes");
print $form->selectarray('usetls', $arraylist, $conf->global->LDAP_SERVER_USE_TLS);
-print ' '.$langs->trans("LDAPServerUseTLSExample").' ';
+print ''.$langs->trans("LDAPServerUseTLSExample").' ';
print '';
print ''.$langs->trans("ForANonAnonymousAccess").' ';
@@ -257,18 +258,18 @@ print " \n";
// DNAdmin
print '';
print ''.$langs->trans("LDAPAdminDn").' ';
-print ' ';
-print ' '.$langs->trans("LDAPAdminDnExample").' ';
+print ' ';
+print ''.$langs->trans("LDAPAdminDnExample").' ';
// Pass
print '';
print ''.$langs->trans("LDAPPassword").' ';
if (!empty($conf->global->LDAP_ADMIN_PASS)) {
- print ' '; // je le met en visible pour test
+ print ' '; // je le met en visible pour test
} else {
- print ' ';
+ print ' ';
}
-print ' '.$langs->trans('Password').' (ex: secret) ';
+print ''.$langs->trans('Password').' (ex: secret) ';
print '
';
diff --git a/htdocs/admin/mailing.php b/htdocs/admin/mailing.php
index 1b0df5843f3..7988c0dab7f 100644
--- a/htdocs/admin/mailing.php
+++ b/htdocs/admin/mailing.php
@@ -132,6 +132,7 @@ print '';
print '';
print ''.$langs->trans("Parameter").' ';
print ''.$langs->trans("Value").' ';
+print ''.$langs->trans("Example").' ';
print " \n";
print '';
@@ -140,7 +141,8 @@ print ' ';
+print ''.dol_escape_htmltag(($mysoc->name ? $mysoc->name : 'MyName').' ').' ';
+print '';
print '';
print $langs->trans("MailingEMailError").' ';
@@ -148,12 +150,14 @@ print ' ';
+print 'webmaster@example.com> ';
+print '';
print '';
print $langs->trans("MailingDelay").' ';
print ' ';
-print ' ';
+print ' ';
+print '';
// Constant to add salt into the unsubscribe and check read tag.
@@ -165,15 +169,17 @@ print ' ';
+print ' ';
+print '';
// default blacklist from mailing
print '';
-print '' . $langs->trans("DefaultBlacklistMailingStatus") . ' ';
+print '' . $langs->trans("DefaultBlacklistMailingStatus", $langs->transnoentitiesnoconv("No_Email")) . ' ';
print '';
-$blacklist_setting=array(0=>$langs->trans('No'),1=>$langs->trans('Yes'),-1=>$langs->trans('DefaultStatusEmptyMandatory'));
+$blacklist_setting=array(0=>$langs->trans('No'), 1=>$langs->trans('Yes'), 2=>$langs->trans('DefaultStatusEmptyMandatory'));
print $form->selectarray("MAILING_CONTACT_DEFAULT_BULK_STATUS", $blacklist_setting, $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS);
print ' ';
+print ' ';
print ' ';
@@ -181,7 +187,8 @@ if (!empty($conf->use_javascript_ajax) && $conf->global->MAIN_FEATURES_LEVEL >=
print '';
print $langs->trans("MailAdvTargetRecipients").' ';
print ajax_constantonoff('EMAILING_USE_ADVANCED_SELECTOR');
- print ' ';
+ print ' ';
+ print '';
}
print '
';
diff --git a/htdocs/admin/mails_templates.php b/htdocs/admin/mails_templates.php
index 1ea8564808e..3545892d486 100644
--- a/htdocs/admin/mails_templates.php
+++ b/htdocs/admin/mails_templates.php
@@ -228,7 +228,7 @@ if (!empty($conf->agenda->enabled)) {
$elementList['actioncomm_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventPush'));
}
if (!empty($conf->eventorganization->enabled) && !empty($user->rights->eventorganization->read)) {
- $elementList['eventorganization_send'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
+ $elementList['conferenceorbooth'] = img_picto('', 'action', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToSendEventOrganization'));
}
if (!empty($conf->partnership->enabled) && !empty($user->rights->partnership->read)) {
$elementList['partnership_send'] = img_picto('', 'partnership', 'class="paddingright"').dol_escape_htmltag($langs->trans('MailToPartnership'));
@@ -1071,8 +1071,8 @@ if ($resql) {
if ($showfield) {
print '';
print '';
print $valuetoshow;
diff --git a/htdocs/admin/modules.php b/htdocs/admin/modules.php
index dd6b22f7634..53cbc1aad69 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -1025,16 +1025,16 @@ if ($mode == 'marketplace') {
print ' '."\n";
+ if (! is_object($attendee->project)) {
+ $text = 'ErrorProjectotFound';
+ } else {
+ $text = $langs->trans("PaymentEvent").' - '.$attendee->project->title;
+ }
+
// Object
- $text = ''.$langs->trans("PaymentConferenceAttendee").' ';
print ''.$langs->trans("Designation");
- print ' '.$text;
+ print ' '.$text.' ';
print ' ';
print ' ';
print ' '."\n";
diff --git a/htdocs/public/payment/paymentok.php b/htdocs/public/payment/paymentok.php
index 3952e5f0565..845dc3ff450 100644
--- a/htdocs/public/payment/paymentok.php
+++ b/htdocs/public/payment/paymentok.php
@@ -23,9 +23,10 @@
/**
* \file htdocs/public/payment/paymentok.php
* \ingroup core
- * \brief File to show page after a successful payment
+ * \brief File to show page after a successful payment on a payment line system.
+ * The payment was already really recorded. So an error here must send warning to admin but must still infor user that payment is ok.
* This page is called by payment system with url provided to it completed with parameter TOKEN=xxx
- * This token can be used to get more informations.
+ * This token and session can be used to get more informations.
*/
if (!defined('NOLOGIN')) {
@@ -804,7 +805,7 @@ if ($ispaymentok) {
$ispostactionok = 1;
}
} else {
- $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
+ $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.';
$ispostactionok = -1;
$error++;
}
@@ -910,7 +911,7 @@ if ($ispaymentok) {
$ispostactionok = 1;
}
} else {
- $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
+ $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.';
$ispostactionok = -1;
$error++;
}
@@ -933,7 +934,7 @@ if ($ispaymentok) {
// TODO send email with acknowledgment for the donation
// (need that the donation module can gen a pdf document for the cerfa with pre filled content)
} elseif (array_key_exists('ATT', $tmptag) && $tmptag['ATT'] > 0) {
- // Record payment for attendee
+ // Record payment for registration to an event for an attendee
include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
$object = new Facture($db);
$result = $object->fetch($ref);
@@ -985,7 +986,7 @@ if ($ispaymentok) {
}
$paiement->paiementid = $paymentTypeId;
$paiement->num_payment = '';
- $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress;
+ $paiement->note_public = 'Online payment '.dol_print_date($now, 'standard').' from '.$ipaddress.' for event registration';
$paiement->ext_payment_id = $TRANSACTIONID;
$paiement->ext_payment_site = $service;
@@ -1026,77 +1027,86 @@ if ($ispaymentok) {
$ispostactionok = 1;
}
} else {
- $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
+ $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.';
$ispostactionok = -1;
$error++;
}
}
if (!$error) {
- $db->commit();
-
// Validating the attendee
$attendeetovalidate = new ConferenceOrBoothAttendee($db);
$resultattendee = $attendeetovalidate->fetch($tmptag['ATT']);
if ($resultattendee < 0) {
+ $error++;
setEventMessages(null, $attendeetovalidate->errors, "errors");
} else {
- $attendeetovalidate->amount=$FinalPaymentAmt;
- $attendeetovalidate->update($user);
$attendeetovalidate->validate($user);
- // Sending mail
- $thirdparty = new Societe($db);
- $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc);
- if ($resultthirdparty < 0) {
- setEventMessages(null, $attendeetovalidate->errors, "errors");
+ $attendeetovalidate->amount = $FinalPaymentAmt;
+ $attendeetovalidate->date_subscription = dol_now();
+ $attendeetovalidate->update($user);
+ }
+ }
+
+ if (!$error) {
+ $db->commit();
+ } else {
+ setEventMessages(null, $postactionmessages, 'warnings');
+
+ $db->rollback();
+ }
+
+ if (! $error) {
+ // Sending mail
+ $thirdparty = new Societe($db);
+ $resultthirdparty = $thirdparty->fetch($attendeetovalidate->fk_soc);
+ if ($resultthirdparty < 0) {
+ setEventMessages(null, $attendeetovalidate->errors, "errors");
+ } else {
+ require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
+ $formmail = new FormMail($db);
+ // Set output language
+ $outputlangs = new Translate('', $conf);
+ $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
+ // Load traductions files required by page
+ $outputlangs->loadLangs(array("main", "members"));
+ // Get email content from template
+ $arraydefaultmessage = null;
+
+ $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT;
+
+ if (!empty($labeltouse)) {
+ $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
+ }
+
+ if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
+ $subject = $arraydefaultmessage->topic;
+ $msg = $arraydefaultmessage->content;
+ }
+
+ $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
+ complete_substitutions_array($substitutionarray, $outputlangs, $object);
+
+ $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
+ $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
+
+ $sendto = $attendeetovalidate->email;
+ $from = $conf->global->MAILING_EMAIL_FROM;
+ $urlback = $_SERVER["REQUEST_URI"];
+
+ $ishtml = dol_textishtml($texttosend); // May contain urls
+
+ $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml);
+
+ $result = $mailfile->sendfile();
+ if ($result) {
+ dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
} else {
- require_once DOL_DOCUMENT_ROOT.'/core/class/CMailFile.class.php';
- include_once DOL_DOCUMENT_ROOT.'/core/class/html.formmail.class.php';
- $formmail = new FormMail($db);
- // Set output language
- $outputlangs = new Translate('', $conf);
- $outputlangs->setDefaultLang(empty($thirdparty->default_lang) ? $mysoc->default_lang : $thirdparty->default_lang);
- // Load traductions files required by page
- $outputlangs->loadLangs(array("main", "members"));
- // Get email content from template
- $arraydefaultmessage = null;
-
- $labeltouse = $conf->global->EVENTORGANIZATION_TEMPLATE_EMAIL_AFT_SUBS_EVENT;
-
- if (!empty($labeltouse)) {
- $arraydefaultmessage = $formmail->getEMailTemplate($db, 'conferenceorbooth', $user, $outputlangs, $labeltouse, 1, '');
- }
-
- if (!empty($labeltouse) && is_object($arraydefaultmessage) && $arraydefaultmessage->id > 0) {
- $subject = $arraydefaultmessage->topic;
- $msg = $arraydefaultmessage->content;
- }
-
- $substitutionarray = getCommonSubstitutionArray($outputlangs, 0, null, $thirdparty);
- complete_substitutions_array($substitutionarray, $outputlangs, $object);
-
- $subjecttosend = make_substitutions($subject, $substitutionarray, $outputlangs);
- $texttosend = make_substitutions($msg, $substitutionarray, $outputlangs);
-
- $sendto = $attendeetovalidate->email;
- $from = $conf->global->MAILING_EMAIL_FROM;
- $urlback = $_SERVER["REQUEST_URI"];
-
- $ishtml = dol_textishtml($texttosend); // May contain urls
-
- $mailfile = new CMailFile($subjecttosend, $sendto, $from, $texttosend, array(), array(), array(), '', '', 0, $ishtml);
-
- $result = $mailfile->sendfile();
- if ($result) {
- dol_syslog("EMail sent to ".$sendto, LOG_DEBUG, 0, '_payment');
- } else {
- dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
- }
+ dol_syslog("Failed to send EMail to ".$sendto, LOG_ERR, 0, '_payment');
}
}
- } else {
- $db->rollback();
}
}
} else {
@@ -1201,7 +1211,7 @@ if ($ispaymentok) {
$ispostactionok = 1;
}
} else {
- $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. No way to record the payment.';
+ $postactionmessages[] = 'Setup of bank account to use in module '.$paymentmethod.' was not set. Your payment was really executed but we failed to record it. Please contact us.';
$ispostactionok = -1;
$error++;
}
@@ -1330,6 +1340,7 @@ if ($ispaymentok) {
$key = 'ONLINE_PAYMENT_MESSAGE_OK';
if (!empty($conf->global->$key)) {
+ print ' ';
print $conf->global->$key;
}
diff --git a/htdocs/reception/list.php b/htdocs/reception/list.php
index e4b519517ea..5b4bdf6bb6f 100644
--- a/htdocs/reception/list.php
+++ b/htdocs/reception/list.php
@@ -85,7 +85,7 @@ $extrafields = new ExtraFields($db);
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
-$search_array_options = (array) $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
+$search_array_options = $extrafields->getOptionalsFromPost($object->table_element, '', 'search_');
// List of fields to search into when doing a "search in all"
$fieldstosearchall = array(
@@ -537,21 +537,7 @@ if ($sall) {
}
// Add where from extra fields
-foreach ($search_array_options as $key => $val) {
- $crit = $val;
- $tmpkey = preg_replace('/search_options_/', '', $key);
- $typ = $extrafields->attributes[$object->table_element]['type'][$tmpkey];
- $mode = 0;
- if (in_array($typ, array('int', 'double', 'real'))) {
- $mode = 1; // Search on a numeric
- }
- if (in_array($typ, array('sellist')) && $crit != '0' && $crit != '-1') {
- $mode = 2; // Search on a foreign key int
- }
- if ($crit != '' && (!in_array($typ, array('select', 'sellist')) || $crit != '0')) {
- $sql .= natural_search('ef.'.$tmpkey, $crit, $mode);
- }
-}
+include DOL_DOCUMENT_ROOT.'/core/tpl/extrafields_list_search_sql.tpl.php';
// Add where from hooks
$parameters = array();
$reshook = $hookmanager->executeHooks('printFieldListWhere', $parameters); // Note that $action and $object may have been modified by hook
diff --git a/htdocs/recruitment/class/recruitmentcandidature.class.php b/htdocs/recruitment/class/recruitmentcandidature.class.php
index 0069ce2d30f..985b207dd60 100644
--- a/htdocs/recruitment/class/recruitmentcandidature.class.php
+++ b/htdocs/recruitment/class/recruitmentcandidature.class.php
@@ -893,7 +893,7 @@ class RecruitmentCandidature extends CommonObject
$this->lines = array();
$objectline = new RecruitmentCandidatureLine($this->db);
- $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_recruitmentcandidature = '.$this->id));
+ $result = $objectline->fetchAll('ASC', 'position', 0, 0, array('customsql'=>'fk_recruitmentcandidature = '.((int) $this->id)));
if (is_numeric($result)) {
$this->error = $this->error;
diff --git a/htdocs/salaries/admin/salaries_extrafields.php b/htdocs/salaries/admin/salaries_extrafields.php
index 38303518ac4..2354da8048a 100644
--- a/htdocs/salaries/admin/salaries_extrafields.php
+++ b/htdocs/salaries/admin/salaries_extrafields.php
@@ -42,7 +42,7 @@ foreach ($tmptype2label as $key => $val) {
$action = GETPOST('action', 'aZ09');
$attrname = GETPOST('attrname', 'alpha');
-$elementtype = 'payment_salary'; //Must be the $table_element of the class that manage extrafield
+$elementtype = 'salary'; //Must be the $table_element of the class that manage extrafield
if (!$user->admin) {
accessforbidden();
diff --git a/htdocs/salaries/card.php b/htdocs/salaries/card.php
index d3c7ba504cb..b6f8dd91f14 100755
--- a/htdocs/salaries/card.php
+++ b/htdocs/salaries/card.php
@@ -67,6 +67,8 @@ $fk_user = GETPOSTINT('userid');
$object = new Salary($db);
$extrafields = new ExtraFields($db);
+$childids = $user->getAllChildIds(1);
+
// fetch optionals attributes and labels
$extrafields->fetch_name_optionals_label($object->table_element);
@@ -76,6 +78,18 @@ $hookmanager->initHooks(array('salarycard', 'globalcard'));
$object = new Salary($db);
if ($id > 0 || !empty($ref)) {
$object->fetch($id, $ref);
+
+ // Check current user can read this salary
+ $canread = 0;
+ if (!empty($user->rights->salaries->readall)) {
+ $canread = 1;
+ }
+ if (!empty($user->rights->salaries->read) && $object->fk_user > 0 && in_array($object->fk_user, $childids)) {
+ $canread = 1;
+ }
+ if (!$canread) {
+ accessforbidden();
+ }
}
// Security check
@@ -354,6 +368,30 @@ if ($action == 'confirm_clone' && $confirm == 'yes' && ($user->rights->salaries-
}
}
+// Action to update one extrafield
+if ($action == "update_extras" && !empty($user->rights->salaries->read)) {
+ $object->fetch(GETPOST('id', 'int'));
+
+ $attributekey = GETPOST('attribute', 'alpha');
+ $attributekeylong = 'options_'.$attributekey;
+
+ if (GETPOSTISSET($attributekeylong.'day') && GETPOSTISSET($attributekeylong.'month') && GETPOSTISSET($attributekeylong.'year')) {
+ // This is properties of a date
+ $object->array_options['options_'.$attributekey] = dol_mktime(GETPOST($attributekeylong.'hour', 'int'), GETPOST($attributekeylong.'min', 'int'), GETPOST($attributekeylong.'sec', 'int'), GETPOST($attributekeylong.'month', 'int'), GETPOST($attributekeylong.'day', 'int'), GETPOST($attributekeylong.'year', 'int'));
+ //var_dump(dol_print_date($object->array_options['options_'.$attributekey]));exit;
+ } else {
+ $object->array_options['options_'.$attributekey] = GETPOST($attributekeylong, 'alpha');
+ }
+
+ $result = $object->insertExtraFields(empty($triggermodname) ? '' : $triggermodname, $user);
+ if ($result > 0) {
+ setEventMessages($langs->trans('RecordSaved'), null, 'mesgs');
+ $action = 'view';
+ } else {
+ setEventMessages($object->error, $object->errors, 'errors');
+ $action = 'edit_extras';
+ }
+}
/*
* View
diff --git a/htdocs/salaries/paiement_salary.php b/htdocs/salaries/paiement_salary.php
index a266a2ed88b..86a0e787e84 100644
--- a/htdocs/salaries/paiement_salary.php
+++ b/htdocs/salaries/paiement_salary.php
@@ -315,8 +315,10 @@ if ($action == 'create') {
print "
";
// Bouton Save payment
- print ' '.$langs->trans("ClosePaidSalaryAutomatically");
- print '
';
+ print '
';
+ print '
';
diff --git a/htdocs/societe/ajax/company.php b/htdocs/societe/ajax/company.php
index 76151bccb97..b2578ea6562 100644
--- a/htdocs/societe/ajax/company.php
+++ b/htdocs/societe/ajax/company.php
@@ -119,10 +119,12 @@ if (!empty($action) && $action == 'fetch' && !empty($id)) {
}
if (!empty($excludeids)) {
- $filter .= 'rowid NOT IN ('.$db->sanitize($excludeids).')';
+ $excludeids = explode(',', $excludeids);
+ } else {
+ $excludeids = array();
}
- $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson);
+ $arrayresult = $form->select_thirdparty_list(0, $htmlname, $filter, 1, $showtype, 0, null, $searchkey, $outjson, 0, 'minwidth100', '', false, $excludeids);
$db->close();
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index b62c277cdf2..bfee51e5f8d 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -403,12 +403,12 @@ if (empty($reshook)) {
$error++;
}
- if (!empty($conf->mailing->enabled) && !empty($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) {
+ if (!empty($conf->mailing->enabled) && !empty($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors');
}
- if (!empty($conf->mailing->enabled) && GETPOST("private", 'int') == 1 && !empty($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) {
+ if (!empty($conf->mailing->enabled) && GETPOST("private", 'int') == 1 && !empty($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS) && $conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2 && GETPOST('contact_no_email', 'int')==-1 && !empty(GETPOST('email', 'custom', 0, FILTER_SANITIZE_EMAIL))) {
$error++;
setEventMessages($langs->trans("ErrorFieldRequired", $langs->transnoentities("No_Email")), null, 'errors');
}
@@ -1191,7 +1191,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
document.formsoc.action.value="create";
document.formsoc.submit();
});';
- if ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS==-1) {
+ if ($conf->global->MAILING_CONTACT_DEFAULT_BULK_STATUS == 2) {
print '
function init_check_no_email(input) {
if (input.val()!="") {
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index fa19b23e6cd..ff6e9474d34 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -1759,7 +1759,7 @@ class Societe extends CommonObject
$this->country_id = $obj->country_id;
$this->country_code = $obj->country_id ? $obj->country_code : '';
- $this->country = $obj->country_id ? ($langs->transnoentities('Country'.$obj->country_code) != 'Country'.$obj->country_code ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : '';
+ $this->country = $obj->country_id ? (($langs->transnoentities('Country'.$obj->country_code) != 'Country'.$obj->country_code) ? $langs->transnoentities('Country'.$obj->country_code) : $obj->country) : '';
$this->state_id = $obj->state_id;
$this->state_code = $obj->state_code;
@@ -4345,10 +4345,10 @@ class Societe extends CommonObject
}
/**
- * Return amount of order not paid and total
+ * Return amount of proposal not yet paid and total an dlist of all proposals
*
* @param string $mode 'customer' or 'supplier'
- * @return array array('opened'=>Amount, 'total'=>Total amount)
+ * @return array array('opened'=>Amount including tax that remains to pay, 'total_ht'=>Total amount without tax of all objects paid or not, 'total_ttc'=>Total amunt including tax of all object paid or not)
*/
public function getOutstandingProposals($mode = 'customer')
{
@@ -4389,10 +4389,10 @@ class Societe extends CommonObject
}
/**
- * Return amount of order not paid and total
+ * Return amount of order not yet paid and total and list of all orders
*
* @param string $mode 'customer' or 'supplier'
- * @return array array('opened'=>Amount, 'total'=>Total amount)
+ * @return array array('opened'=>Amount including tax that remains to pay, 'total_ht'=>Total amount without tax of all objects paid or not, 'total_ttc'=>Total amunt including tax of all object paid or not)
*/
public function getOutstandingOrders($mode = 'customer')
{
@@ -4432,11 +4432,11 @@ class Societe extends CommonObject
}
/**
- * Return amount of bill not paid and total
+ * Return amount of bill not yet paid and total of all invoices
*
- * @param string $mode 'customer' or 'supplier'
+ * @param string $mode 'customer' or 'supplier'
* @param int $late 0 => all invoice, 1=> only late
- * @return array array('opened'=>Amount, 'total'=>Total amount)
+ * @return array array('opened'=>Amount including tax that remains to pay, 'total_ht'=>Total amount without tax of all objects paid or not, 'total_ttc'=>Total amunt including tax of all object paid or not)
*/
public function getOutstandingBills($mode = 'customer', $late = 0)
{
@@ -4470,6 +4470,7 @@ class Societe extends CommonObject
$outstandingTotal = 0;
$outstandingTotalIncTax = 0;
$arrayofref = array();
+ $arrayofrefopened = array();
if ($mode == 'supplier') {
require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.facture.class.php';
$tmpobject = new FactureFournisseur($this->db);
@@ -4487,6 +4488,9 @@ class Societe extends CommonObject
$outstandingTotal += $obj->total_ht;
$outstandingTotalIncTax += $obj->total_ttc;
}
+
+ $remaintopay = 0;
+
if ($obj->paye == 0
&& $obj->status != $tmpobject::STATUS_DRAFT // Not a draft
&& $obj->status != $tmpobject::STATUS_ABANDONED // Not abandonned
@@ -4496,16 +4500,23 @@ class Societe extends CommonObject
$creditnotes = $tmpobject->getSumCreditNotesUsed();
$deposits = $tmpobject->getSumDepositsUsed();
- $outstandingOpened += $obj->total_ttc - $paiement - $creditnotes - $deposits;
+ $remaintopay = ($obj->total_ttc - $paiement - $creditnotes - $deposits);
+ $outstandingOpened += $remaintopay;
}
//if credit note is converted but not used
// TODO Do this also for customer ?
if ($mode == 'supplier' && $obj->type == FactureFournisseur::TYPE_CREDIT_NOTE && $tmpobject->isCreditNoteUsed()) {
- $outstandingOpened -= $tmpobject->getSumFromThisCreditNotesNotUsed();
+ $remainingcreditnote = $tmpobject->getSumFromThisCreditNotesNotUsed();
+ $remaintopay -= $remainingcreditnote;
+ $outstandingOpened -= $remainingcreditnote;
+ }
+
+ if ($remaintopay) {
+ $arrayofrefopened[$obj->rowid] = $obj->ref;
}
}
- return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref); // 'opened' is 'incl taxes'
+ return array('opened'=>$outstandingOpened, 'total_ht'=>$outstandingTotal, 'total_ttc'=>$outstandingTotalIncTax, 'refs'=>$arrayofref, 'refsopened'=>$arrayofrefopened); // 'opened' is 'incl taxes'
} else {
dol_syslog("Sql error ".$this->db->lasterror, LOG_ERR);
return array();
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index 5d22ea05684..6f1d0824b0b 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -258,8 +258,8 @@ if (empty($reshook)) {
$object->cond_reglement_id = GETPOST('cond_reglement_id');
$object->mode_reglement_id = GETPOST('mode_reglement_id');
$object->fk_account = GETPOST('fk_account', 'int');
- $object->remise_percent = price2num(GETPOST('remise_percent'), 2);
- $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
+ $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
+ $object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU', 2);
$object->socid = GETPOST('socid');
$object->fk_project = GETPOST('projectid', 'int');
$object->model_pdf = GETPOST('model');
@@ -915,8 +915,8 @@ if (empty($reshook)) {
$result = $object->updateline(
GETPOST('lineid', 'int'),
$ht,
- price2num(GETPOST('qty'), 'MS'),
- price2num(GETPOST('remise_percent'), 2),
+ price2num(GETPOST('qty'), 'MS', 2),
+ price2num(GETPOST('remise_percent'), '', 2),
$vat_rate,
$localtax1_rate,
$localtax2_rate,
@@ -996,9 +996,9 @@ if (empty($reshook)) {
// Terms of payments
$result = $object->setPaymentTerms(GETPOST('cond_reglement_id', 'int'));
} elseif ($action == 'setremisepercent' && $usercancreate) {
- $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), 2));
+ $result = $object->set_remise_percent($user, price2num(GETPOST('remise_percent'), '', 2));
} elseif ($action == 'setremiseabsolue' && $usercancreate) {
- $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU'));
+ $result = $object->set_remise_absolue($user, price2num(GETPOST('remise_absolue'), 'MU', 2));
} elseif ($action == 'setmode' && $usercancreate) {
// Payment mode
$result = $object->setPaymentMethods(GETPOST('mode_reglement_id', 'int'));
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index cb7aa69949c..8622e293906 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -3,7 +3,7 @@
* Copyright (C) 2002-2003 Jean-Louis Bergamo
* Copyright (C) 2004-2020 Laurent Destailleur
* Copyright (C) 2004 Eric Seigne
- * Copyright (C) 2005-2018 Regis Houssin
+ * Copyright (C) 2005-2021 Regis Houssin
* Copyright (C) 2005 Lionel Cousteix
* Copyright (C) 2011 Herve Prot
* Copyright (C) 2012-2018 Juanjo Menent
@@ -2290,7 +2290,7 @@ if ($action == 'create' || $action == 'adduserldap') {
}
if (preg_match('/dolibarr/', $dolibarr_main_authentication)) {
if ($caneditpassword) {
- $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').' ';
+ $valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').' ';
} else {
$valuetoshow .= ($valuetoshow ? (' '.$langs->trans("or").' ') : '').preg_replace('/./i', '*', $object->pass);
}
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 6df01a907f4..55be42de5e0 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -455,8 +455,9 @@ class User extends CommonObject
}
}
- if ($sid) { // permet une recherche du user par son SID ActiveDirectory ou Samba
- $sql .= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."') LIMIT 1";
+ if ($sid) {
+ // permet une recherche du user par son SID ActiveDirectory ou Samba
+ $sql .= " AND (u.ldap_sid = '".$this->db->escape($sid)."' OR u.login = '".$this->db->escape($login)."')";
} elseif ($login) {
$sql .= " AND u.login = '".$this->db->escape($login)."'";
} elseif ($email) {
@@ -466,6 +467,11 @@ class User extends CommonObject
}
$sql .= " ORDER BY u.entity ASC"; // Avoid random result when there is 2 login in 2 different entities
+ if ($sid) {
+ // permet une recherche du user par son SID ActiveDirectory ou Samba
+ $sql .= ' '.$this->db->plimit(1);
+ }
+
$result = $this->db->query($sql);
if ($result) {
$obj = $this->db->fetch_object($result);
@@ -3350,14 +3356,21 @@ class User extends CommonObject
public function load_state_board()
{
// phpcs:enable
+ global $conf;
$this->nb = array();
- $sql = "SELECT count(u.rowid) as nb";
+ $sql = "SELECT COUNT(DISTINCT u.rowid) as nb";
$sql .= " FROM ".MAIN_DB_PREFIX."user as u";
- $sql .= " WHERE u.statut > 0";
+ if (!empty($conf->multicompany->enabled) && !empty($conf->global->MULTICOMPANY_TRANSVERSE_MODE)) {
+ $sql .= ", ".MAIN_DB_PREFIX."usergroup_user as ug";
+ $sql .= " WHERE ug.entity IN (".getEntity('usergroup').")";
+ $sql .= " AND ug.fk_user = u.rowid";
+ } else {
+ $sql .= " WHERE u.entity IN (".getEntity('user').")";
+ }
+ $sql .= " AND u.statut > 0";
//$sql.= " AND employee != 0";
- $sql .= " AND u.entity IN (".getEntity('user').")";
$resql = $this->db->query($sql);
if ($resql) {
diff --git a/htdocs/website/index.php b/htdocs/website/index.php
index 23be98a3b8c..d069df8c4d5 100644
--- a/htdocs/website/index.php
+++ b/htdocs/website/index.php
@@ -2602,7 +2602,7 @@ if (!GETPOST('hide_websitemenu')) {
print $langs->trans("Website").' : ';
print '';
- $urltocreatenewwebsite = $_SERVER["PHP_SEFL"].'?action=createsite';
+ $urltocreatenewwebsite = $_SERVER["PHP_SELF"].'?action=createsite';
if (empty($conf->use_javascript_ajax)) {
print '';
print ' ';
@@ -2652,7 +2652,7 @@ if (!GETPOST('hide_websitemenu')) {
$out .= ' if (jQuery("#website option:selected").val() == \'-2\') {';
$out .= ' window.location.href = "'.dol_escape_js($urltocreatenewwebsite).'";';
$out .= ' } else {';
- $out .= ' window.location.href = "'.$_SERVER["PHP_SEFL"].'?website="+jQuery("#website option:selected").val();';
+ $out .= ' window.location.href = "'.$_SERVER["PHP_SELF"].'?website="+jQuery("#website option:selected").val();';
$out .= ' }';
$out .= ' });';
$out .= '});';
@@ -2691,16 +2691,16 @@ if (!GETPOST('hide_websitemenu')) {
print ' ';
// Regenerate all pages
- print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"> ';
+ print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("RegenerateWebsiteContent")).'"> ';
print ' ';
// Generate site map
- print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'"> ';
+ print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("GenerateSitemaps")).'"> ';
print ' ';
- print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"> ';
+ print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("ReplaceWebsiteContent")).'"> ';
}
print ' ';
@@ -2811,7 +2811,7 @@ if (!GETPOST('hide_websitemenu')) {
print '';
print '';
- print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'"> ';
+ print 'ref.'" class="button bordertransp"'.$disabled.' title="'.dol_escape_htmltag($langs->trans("AddPage")).'"> ';
print ' ';
//print '';
@@ -2826,7 +2826,7 @@ if (!GETPOST('hide_websitemenu')) {
$out .= $s;
$out .= ' ';
- $urltocreatenewpage = $_SERVER["PHP_SEFL"].'?action=createcontainer&website='.$website->ref;
+ $urltocreatenewpage = $_SERVER["PHP_SELF"].'?action=createcontainer&website='.$website->ref;
if (!empty($conf->use_javascript_ajax)) {
$out .= '