';
if ($row[0] == 'tobind') {
- print $langs->trans("Unknown");
+ print ''.$langs->trans("Unknown").' ';
} else {
print length_accountg($row[0]);
}
print ' ';
- print '';
+ print ' ';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else {
@@ -344,13 +344,13 @@ print '';
print ' ';
-print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
+print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print load_fiche_titre($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) {
@@ -404,7 +404,7 @@ if ($resql) {
}
print '';
- print '';
+ print ' ';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/customer/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else {
@@ -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 1544976bb07..a7c926f9dab 100644
--- a/htdocs/accountancy/expensereport/index.php
+++ b/htdocs/accountancy/expensereport/index.php
@@ -149,13 +149,13 @@ $y = $year_current;
$buttonbind = ''.$langs->trans("ValidateHistory").' ';
-print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
+print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
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,12 +197,12 @@ 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]);
}
print ' ';
- print '';
+ print ' ';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else {
@@ -227,14 +227,14 @@ print '';
print ' ';
-print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
+print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print load_fiche_titre($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,13 +276,13 @@ 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]);
}
print ' ';
- print '';
+ print ' ';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/expensereport/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else {
@@ -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 1836687d042..5e409f303ea 100644
--- a/htdocs/accountancy/supplier/index.php
+++ b/htdocs/accountancy/supplier/index.php
@@ -260,13 +260,13 @@ $y = $year_current;
$buttonbind = ''.$langs->trans("ValidateHistory").' ';
-print_barre_liste($langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
+print_barre_liste(img_picto('', 'unlink', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesNotBound"), '', '', '', '', '', '', -1, '', '', 0, $buttonbind, '', 0, 1, 1);
//print load_fiche_titre($langs->trans("OverviewOfAmountOfLinesNotBound"), $buttonbind, '');
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,12 +309,12 @@ 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]);
}
print ' ';
- print '';
+ print ' ';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else {
@@ -339,13 +339,13 @@ print '';
print ' ';
-print_barre_liste($langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
+print_barre_liste(img_picto('', 'link', 'class="paddingright fa-color-unset"').$langs->trans("OverviewOfAmountOfLinesBound"), '', '', '', '', '', '', -1, '', '', 0, '', '', 0, 1, 1);
//print load_fiche_titre($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) {
@@ -393,7 +393,7 @@ if ($resql) {
print length_accountg($row[0]);
}
print '';
- print '';
+ print ' ';
if ($row[0] == 'tobind') {
print $langs->trans("UseMenuToSetBindindManualy", DOL_URL_ROOT.'/accountancy/supplier/list.php?search_year='.$y, $langs->transnoentitiesnoconv("ToBind"));
} else {
@@ -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 c6cfd3f7c92..ffdd5b6de57 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 5a589756feb..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
*/
diff --git a/htdocs/adherents/admin/website.php b/htdocs/adherents/admin/website.php
index 87e4538248c..f00fbb6b0de 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 f6a512eaa11..d46442edc94 100644
--- a/htdocs/adherents/card.php
+++ b/htdocs/adherents/card.php
@@ -660,7 +660,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;
@@ -731,7 +731,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;
@@ -802,7 +802,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;
@@ -1509,7 +1509,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;
diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php
index 021233ef449..0aae15eef3e 100644
--- a/htdocs/admin/bom.php
+++ b/htdocs/admin/bom.php
@@ -225,7 +225,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php
index 837d8d997b2..3ba8c3b854a 100644
--- a/htdocs/admin/chequereceipts.php
+++ b/htdocs/admin/chequereceipts.php
@@ -174,7 +174,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/commande.php b/htdocs/admin/commande.php
index c10fdd5bbdf..d57292e3562 100644
--- a/htdocs/admin/commande.php
+++ b/htdocs/admin/commande.php
@@ -289,7 +289,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/company.php b/htdocs/admin/company.php
index 7420aa17ce9..5e0ab61c3ee 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/contract.php b/htdocs/admin/contract.php
index ea8a80b17d6..b5e0c3ae28b 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -220,7 +220,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/delivery.php b/htdocs/admin/delivery.php
index 04d52c491b2..4fa7b2b79c7 100644
--- a/htdocs/admin/delivery.php
+++ b/htdocs/admin/delivery.php
@@ -225,7 +225,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
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 c37c5ccd41f..9c088aec61c 100644
--- a/htdocs/admin/eventorganization.php
+++ b/htdocs/admin/eventorganization.php
@@ -16,7 +16,7 @@
*/
/**
- * \file htdocs/admin/setup.php
+ * \file htdocs/admin/eventorganization.php
* \ingroup eventorganization
* \brief EventOrganization setup page.
*/
@@ -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)) {
@@ -305,7 +305,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) {
@@ -362,7 +362,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");
}
@@ -445,7 +445,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index ee3d4f18562..32f82f5dad5 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -219,7 +219,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index 0b6beb2abc6..1553f6887f8 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -228,7 +228,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php
index 26ba4d40f58..85cd419d9ee 100644
--- a/htdocs/admin/external_rss.php
+++ b/htdocs/admin/external_rss.php
@@ -252,9 +252,8 @@ if ($resql) {
print '';
print "".$langs->trans("RSS")." ".($i + 1)." ";
print '';
- print ' ';
- print " ";
- print ' ';
+ print ' ';
+ print ' ';
print ' ';
print ' ';
print ' '."\n";
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 8b88b9a9ac8..bf4e2ea9eb6 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/fckeditor.php b/htdocs/admin/fckeditor.php
index 9d3fd768647..09113ef882b 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/fichinter.php b/htdocs/admin/fichinter.php
index b878c40138e..4d9304472d5 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -284,7 +284,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php
index 9dfb15477cc..81db1cbe58d 100644
--- a/htdocs/admin/holiday.php
+++ b/htdocs/admin/holiday.php
@@ -220,7 +220,7 @@ foreach ($dirmodels as $reldir) {
$langs->load("errors");
print ''.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print ''.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/ihm.php b/htdocs/admin/ihm.php
index 9d8f655a608..3dcfb66031d 100644
--- a/htdocs/admin/ihm.php
+++ b/htdocs/admin/ihm.php
@@ -4,6 +4,7 @@
* Copyright (C) 2005-2017 Regis Houssin
* Copyright (C) 2016 Juanjo Menent
* Copyright (C) 2018 Ferran Marcet
+ * Copyright (C) 2021 Alexandre Spangaro
*
* 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
@@ -43,7 +44,7 @@ if (!$user->admin) {
$action = GETPOST('action', 'aZ09');
$contextpage = GETPOST('contextpage', 'aZ') ?GETPOST('contextpage', 'aZ') : 'adminihm'; // To manage different context of search
-$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'language'; // 'language', 'template', 'login', 'other'
+$mode = GETPOST('mode', 'aZ09') ? GETPOST('mode', 'aZ09') : 'other'; // 'template', 'dashboard', 'login', 'other'
if (!defined("MAIN_MOTD")) {
define("MAIN_MOTD", "");
@@ -96,12 +97,6 @@ if ($action == 'removebackgroundlogin' && !empty($conf->global->MAIN_LOGIN_BACKG
if ($action == 'update') {
$error = 0;
- if ($mode == 'language') {
- dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity);
- dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
- //dolibarr_set_const($db, "MAIN_MULTILANGS", GETPOST("MAIN_MULTILANGS"), 'chaine', 0, '', $conf->entity);
- }
-
if ($mode == 'template') {
dolibarr_set_const($db, "MAIN_THEME", GETPOST("main_theme", 'aZ09'), 'chaine', 0, '', $conf->entity);
@@ -206,7 +201,14 @@ if ($action == 'update') {
}
}
+ if ($mode == 'dashboard') {
+ dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
+ }
+
if ($mode == 'other') {
+ dolibarr_set_const($db, "MAIN_LANG_DEFAULT", GETPOST("MAIN_LANG_DEFAULT", 'aZ09'), 'chaine', 0, '', $conf->entity);
+ dolibarr_set_const($db, "MAIN_IHM_PARAMS_REV", (int) $conf->global->MAIN_IHM_PARAMS_REV + 1, 'chaine', 0, '', $conf->entity);
+
dolibarr_set_const($db, "MAIN_SIZE_LISTE_LIMIT", GETPOST("main_size_liste_limit", 'int'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_SIZE_SHORTLIST_LIMIT", GETPOST("main_size_shortliste_limit", 'int'), 'chaine', 0, '', $conf->entity);
@@ -221,8 +223,6 @@ if ($action == 'update') {
dolibarr_set_const($db, "MAIN_BUGTRACK_ENABLELINK", GETPOST("MAIN_BUGTRACK_ENABLELINK", 'alpha'), 'chaine', 0, '', $conf->entity);
dolibarr_set_const($db, "MAIN_FIRSTNAME_NAME_POSITION", GETPOST("MAIN_FIRSTNAME_NAME_POSITION", 'aZ09'), 'chaine', 0, '', $conf->entity);
-
- dolibarr_set_const($db, "MAIN_MOTD", dol_htmlcleanlastbr(GETPOST("main_motd", 'restricthtml')), 'chaine', 0, '', $conf->entity);
}
if ($mode == 'login') {
@@ -301,10 +301,139 @@ print dol_get_fiche_head($head, $mode, '', -1, '');
clearstatcache();
-if ($mode == 'language') {
+if ($mode == 'template') {
+ // Themes and themes options
+ showSkins(null, 1);
+}
+
+if ($mode == 'dashboard') {
+ print '';
+ print '
';
+
+ // Message of the day on home page
+ $substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
+ complete_substitutions_array($substitutionarray, $langs);
+
+ print '';
+ $texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . ' ';
+ foreach ($substitutionarray as $key => $val) {
+ $texthelp .= $key . ' ';
+ }
+ print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
+
+ print ' ';
+
+ $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
+ $doleditor->Create();
+
+ print ' ' . "\n";
+
+ /* no more need for this option. It is now a widget already controlled by end user
+ print '' . $langs->trans('BoxstatsDisableGlobal') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_GLOBAL_BOXSTATS", array(), $conf->entity, 0, 0, 1, 0);
+ print ' ';
+ print ' ';
+ */
+
+ print '
';
+ print '
';
+
+ print ' ';
+
+ print '';
+ print '
';
+
+ print '';
+ print $langs->trans("DashboardDisableBlocks");
+ print ' ';
+ print ' ';
+
+ print '' . $langs->trans('DashboardDisableGlobal') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_GLOBAL_WORKBOARD", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ if (empty($conf->global->MAIN_DISABLE_GLOBAL_WORKBOARD)) {
+ // Block meteo
+ print '' . $langs->trans('MAIN_DISABLE_METEO') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_METEO", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block agenda
+ print '' . $langs->trans('DashboardDisableBlockAgenda') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_AGENDA", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block agenda
+ print '' . $langs->trans('DashboardDisableBlockProject') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_PROJECT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block customer
+ print '' . $langs->trans('DashboardDisableBlockCustomer') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_CUSTOMER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block supplier
+ print '' . $langs->trans('DashboardDisableBlockSupplier') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_SUPPLIER", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block contract
+ print '' . $langs->trans('DashboardDisableBlockContract') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_CONTRACT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block ticket
+ print '' . $langs->trans('DashboardDisableBlockTicket') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_TICKET", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block bank
+ print '' . $langs->trans('DashboardDisableBlockBank') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_BANK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block adherent
+ print '' . $langs->trans('DashboardDisableBlockAdherent') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_ADHERENT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block expense report
+ print '' . $langs->trans('DashboardDisableBlockExpenseReport') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_EXPENSEREPORT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+
+ // Block holiday
+ print '' . $langs->trans('DashboardDisableBlockHoliday') . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_BLOCK_HOLIDAY", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '_red', 'dashboard');
+ print ' ';
+ print ' ';
+ }
+
+ print '
' . "\n";
+ print '
';
+}
+
+if ($mode == 'other') {
print '';
print '
';
+ print '';
+ print $langs->trans("Language");
+ print ' ';
+ print ' ';
+
// Default language
print ''.$langs->trans("DefaultLanguage").' ';
print img_picto('', 'language', 'class="pictofixedwidth"');
@@ -315,32 +444,28 @@ if ($mode == 'language') {
// Multilingual GUI
print ' ' . $langs->trans("EnableMultilangInterface") . ' ';
- print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0);
+ print ajax_constantonoff("MAIN_MULTILANGS", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'language');
print ' ';
print ' ';
print '
' . "\n";
print '
';
-}
-if ($mode == 'template') {
- // Themes and themes options
- showSkins(null, 1);
-}
+ print ' ';
+ print '';
+ print ' ';
+ print '
';
+
+ print ' ';
-if ($mode == 'other') {
// Other
print '';
print '
';
- // Disable javascript and ajax
- print '' . $langs->trans("DisableJavascript") . ' ';
- print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0);
- print ' ' . $langs->trans("DisableJavascriptNote") . ' ';
- print ' ';
- print '';
- print ' ';
- print ' ';
+ print '';
+ print $langs->trans("Miscelaneous");
+ print ' ';
+ print ' ';
// Max size of lists
print '' . $langs->trans("DefaultMaxSizeList") . ' ';
@@ -393,7 +518,7 @@ if ($mode == 'other') {
// Hide unauthorized menus
print '' . $langs->trans("HideUnauthorizedMenu") . ' ';
//print $form->selectyesno('MAIN_MENU_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_MENU_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_MENU_HIDE_UNAUTHORIZED : 0, 1);
- print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
+ print ajax_constantonoff("MAIN_MENU_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print ' ';
print ' ';
print ' ';
@@ -401,7 +526,7 @@ if ($mode == 'other') {
// Hide unauthorized button
print '' . $langs->trans("ButtonHideUnauthorized") . ' ';
//print $form->selectyesno('MAIN_BUTTON_HIDE_UNAUTHORIZED', isset($conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED) ? $conf->global->MAIN_BUTTON_HIDE_UNAUTHORIZED : 0, 1);
- print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0);
+ print ajax_constantonoff("MAIN_BUTTON_HIDE_UNAUTHORIZED", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
print ' ';
print ' ';
print ' ';
@@ -417,7 +542,9 @@ if ($mode == 'other') {
*/
// Show bugtrack link
- print '' . $langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")) . ' ';
+ print ' ';
+ print $form->textwithpicto($langs->trans("ShowBugTrackLink", $langs->transnoentitiesnoconv("FindBug")), $langs->trans("ShowBugTrackLinkDesc"));
+ print ' ';
print ' ';
print ' ';
print ' ';
@@ -426,29 +553,20 @@ if ($mode == 'other') {
// Hide wiki link on login page
$pictohelp = ' ';
print '' . str_replace('{picto}', $pictohelp, $langs->trans("DisableLinkToHelp", '{picto}')) . ' ';
- print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0);
+ print ajax_constantonoff("MAIN_HELP_DISABLELINK", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
//print $form->selectyesno('MAIN_HELP_DISABLELINK', isset($conf->global->MAIN_HELP_DISABLELINK) ? $conf->global->MAIN_HELP_DISABLELINK : 0, 1);
print ' ';
print ' ';
print ' ';
- // Message of the day on home page
- $substitutionarray = getCommonSubstitutionArray($langs, 0, array('object', 'objectamount'));
- complete_substitutions_array($substitutionarray, $langs);
-
- print '';
- $texthelp = $langs->trans("FollowingConstantsWillBeSubstituted") . ' ';
- foreach ($substitutionarray as $key => $val) {
- $texthelp .= $key . ' ';
- }
- print $form->textwithpicto($langs->trans("MessageOfDay"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessageofday');
-
- print ' ';
-
- $doleditor = new DolEditor('main_motd', (isset($conf->global->MAIN_MOTD) ? $conf->global->MAIN_MOTD : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
- $doleditor->Create();
-
- print ' ' . "\n";
+ // Disable javascript and ajax
+ print '' . $langs->trans("DisableJavascript") . ' ';
+ print ajax_constantonoff("MAIN_DISABLE_JAVASCRIPT", array(), $conf->entity, 0, 0, 1, 0, 0, 0, '', 'other');
+ print ' ' . $langs->trans("DisableJavascriptNote") . ' ';
+ print ' ';
+ print '';
+ print ' ';
+ print ' ';
print '
' . "\n";
print '
';
@@ -459,11 +577,16 @@ if ($mode == 'login') {
print '';
print '
';
+ print '';
+ print $langs->trans("Parameter");
+ print ' ';
+ print $langs->trans("Value");
+ print ' ';
+
// Hide helpcenter link on login page
print '' . $langs->trans("DisableLinkToHelpCenter") . ' ';
- print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0);
+ print ajax_constantonoff("MAIN_HELPCENTER_DISABLELINK", array(), $conf->entity, 0, 0, 0, 0, 0, 0, '', 'login');
print ' ';
- print ' ';
print ' ';
// Message on login page
@@ -475,13 +598,13 @@ if ($mode == 'login') {
$texthelp .= $key . ' ';
}
print $form->textwithpicto($langs->trans("MessageLogin"), $texthelp, 1, 'help', '', 0, 2, 'tooltipmessagelogin');
- print '';
+ print ' ';
$doleditor = new DolEditor('main_home', (isset($conf->global->MAIN_HOME) ? $conf->global->MAIN_HOME : ''), '', 142, 'dolibarr_notes', 'In', false, true, true, ROWS_4, '90%');
$doleditor->Create();
print ' ' . "\n";
// Background
- print '' . $langs->trans("BackgroundImageLogin") . ' (png,jpg) ';
+ print ' ' . $langs->trans("BackgroundImageLogin") . ' (png,jpg) ';
print '';
$disabled = '';
if (!empty($conf->global->ADD_UNSPLASH_LOGIN_BACKGROUND)) {
diff --git a/htdocs/admin/knowledgemanagement.php b/htdocs/admin/knowledgemanagement.php
index 457303c9798..477f38fa663 100644
--- a/htdocs/admin/knowledgemanagement.php
+++ b/htdocs/admin/knowledgemanagement.php
@@ -396,7 +396,7 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
$langs->load("errors");
print '
'.$langs->trans($tmp).'
';
} elseif ($tmp == 'NotConfigured') {
- print $langs->trans($tmp);
+ print '
'.$langs->trans($tmp).' ';
} else {
print $tmp;
}
diff --git a/htdocs/admin/ldap.php b/htdocs/admin/ldap.php
index 80897320e90..1a274f8cec1 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/mails_templates.php b/htdocs/admin/mails_templates.php
index 25a33717c46..bacc8ef3166 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'));
@@ -935,7 +935,7 @@ if ($resql) {
print '
';
print ' ';
print ' ';
- print ' ';
+ print ' ';
print '
';
print ' ';
print ' ';
@@ -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 658be446765..ccf12d5a104 100644
--- a/htdocs/admin/modules.php
+++ b/htdocs/admin/modules.php
@@ -1025,16 +1025,16 @@ if ($mode == 'marketplace') {
print ' ';
}
// Action column
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index e5e264a12f5..dda6eec132c 100644
--- a/htdocs/compta/bank/bankentries_list.php
+++ b/htdocs/compta/bank/bankentries_list.php
@@ -889,7 +889,7 @@ if ($resql) {
print '';
}*/
print '
';
- print ' ';
+ print ' ';
print ' ';
print ' ';
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 94a884bf1bf..99e09130011 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -433,8 +433,8 @@ if (empty($reshook)) {
$tva_tx = '';
}
- $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS');
- $remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
+ $qty = price2num(GETPOST('qty'.$predef, 'alpha'), 'MS', 2);
+ $remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
// Extrafields
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
@@ -781,6 +781,8 @@ if (empty($reshook)) {
$result = -1;
}*/
+ $remise_percent = price2num(GETPOST('remise_percent'), '', 2);
+
// Check minimum price
$productid = GETPOST('productid', 'int');
if (!empty($productid)) {
@@ -797,7 +799,7 @@ if (empty($reshook)) {
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
- if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent', 2)) / 100) < price2num($price_min)))) {
+ if (((!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && empty($user->rights->produit->ignore_price_min_advance)) || empty($conf->global->MAIN_USE_ADVANCED_PERMS)) && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
}
@@ -830,8 +832,8 @@ if (empty($reshook)) {
$vat_rate,
$localtax1_rate,
$localtax1_rate,
- GETPOST('productid'),
- price2num(GETPOST('remise_percent'), 2),
+ GETPOST('productid', 'int'),
+ $remise_percent,
'HT',
$info_bits,
0,
@@ -1226,6 +1228,8 @@ if ($action == 'create') {
}
$morehtmlref .= '
';
+ $morehtmlright = '';
+
dol_banner_tab($object, 'ref', $linkback, 1, 'title', 'none', $morehtmlref, '', 0, '', $morehtmlright);
print '';
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 2a834fea79e..cbf2d8952b6 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -521,7 +521,7 @@ if (empty($reshook)) {
$result = $object->setBankAccount(GETPOST('fk_account', 'int'));
} elseif ($action == 'setremisepercent' && $usercancreate) {
$object->fetch($id);
- $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), 2));
+ $result = $object->setDiscount($user, price2num(GETPOST('remise_percent'), '', 2));
} elseif ($action == "setabsolutediscount" && $usercancreate) {
// POST[remise_id] or POST[remise_id_for_payment]
@@ -1037,8 +1037,8 @@ if (empty($reshook)) {
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
- $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->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@@ -1094,7 +1094,7 @@ if (empty($reshook)) {
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
$object->fk_account = GETPOST('fk_account', 'int');
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
- $object->remise_percent = price2num(GETPOST('remise_percent'), 2);
+ $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@@ -1309,7 +1309,7 @@ if (empty($reshook)) {
$object->fk_account = GETPOST('fk_account', 'int');
$object->amount = price2num(GETPOST('amount'));
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
- $object->remise_percent = price2num(GETPOST('remise_percent'), 2);
+ $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@@ -1390,7 +1390,7 @@ if (empty($reshook)) {
$object->fk_account = GETPOST('fk_account', 'int');
$object->amount = price2num(GETPOST('amount'));
$object->remise_absolue = price2num(GETPOST('remise_absolue'), 'MU');
- $object->remise_percent = price2num(GETPOST('remise_percent'), 2);
+ $object->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
$object->fk_incoterms = GETPOST('incoterm_id', 'int');
$object->location_incoterms = GETPOST('location_incoterms', 'alpha');
$object->multicurrency_code = GETPOST('multicurrency_code', 'alpha');
@@ -1813,7 +1813,7 @@ if (empty($reshook)) {
$product->fetch(GETPOST('idprod'.$i, 'int'));
$startday = dol_mktime(12, 0, 0, GETPOST('date_start'.$i.'month'), GETPOST('date_start'.$i.'day'), GETPOST('date_start'.$i.'year'));
$endday = dol_mktime(12, 0, 0, GETPOST('date_end'.$i.'month'), GETPOST('date_end'.$i.'day'), GETPOST('date_end'.$i.'year'));
- $result = $object->addline($product->description, $product->price, price2num(GETPOST('qty'.$i), 'MS'), $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, GETPOST('idprod'.$i, 'int'), price2num(GETPOST('remise_percent'.$i)), $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit);
+ $result = $object->addline($product->description, $product->price, price2num(GETPOST('qty'.$i), 'MS'), $product->tva_tx, $product->localtax1_tx, $product->localtax2_tx, GETPOST('idprod'.$i, 'int'), price2num(GETPOST('remise_percent'.$i), '', 2), $startday, $endday, 0, 0, '', $product->price_base_type, $product->price_ttc, $product->type, -1, 0, '', 0, 0, null, 0, '', 0, 100, '', $product->fk_unit);
}
}
}
@@ -1914,8 +1914,8 @@ if (empty($reshook)) {
$object->fk_project = GETPOST('projectid', 'int');
$object->cond_reglement_id = GETPOST('cond_reglement_id', 'int');
$object->mode_reglement_id = GETPOST('mode_reglement_id', 'int');
- $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->remise_percent = price2num(GETPOST('remise_percent'), '', 2);
// Proprietes particulieres a facture de remplacement
@@ -2001,8 +2001,8 @@ if (empty($reshook)) {
$tva_tx = '';
}
- $qty = price2num(GETPOST('qty'.$predef), 'MS');
- $remise_percent = price2num(GETPOST('remise_percent'.$predef), 2);
+ $qty = price2num(GETPOST('qty'.$predef), 'MS', 2);
+ $remise_percent = price2num(GETPOST('remise_percent'.$predef), '', 2);
// Extrafields
$extralabelsline = $extrafields->fetch_name_optionals_label($object->table_element_line);
@@ -2404,6 +2404,8 @@ if (empty($reshook)) {
}
}
+ $remise_percent = price2num(GETPOST('remise_percent'), '', 2);
+
// Check minimum price
$productid = GETPOST('productid', 'int');
if (!empty($productid)) {
@@ -2420,7 +2422,7 @@ if (empty($reshook)) {
$label = ((GETPOST('update_label') && GETPOST('product_label')) ? GETPOST('product_label') : '');
// Check price is not lower than minimum (check is done only for standard or replacement invoices)
- if ($usercanproductignorepricemin && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - price2num(GETPOST('remise_percent'), 2) / 100) < price2num($price_min)))) {
+ if ($usercanproductignorepricemin && (($object->type == Facture::TYPE_STANDARD || $object->type == Facture::TYPE_REPLACEMENT) && $price_min && (price2num($pu_ht) * (1 - $remise_percent / 100) < price2num($price_min)))) {
setEventMessages($langs->trans("CantBeLessThanMinPrice", price(price2num($price_min, 'MU'), 0, $langs, 0, 0, - 1, $conf->currency)), null, 'errors');
$error++;
}
@@ -2473,7 +2475,7 @@ if (empty($reshook)) {
$description,
$pu_ht,
$qty,
- price2num(GETPOST('remise_percent'), 2),
+ $remise_percent,
$date_start,
$date_end,
$vat_rate,
@@ -4671,7 +4673,7 @@ if ($action == 'create') {
print ' ';
print $formother->select_revenue_stamp('', 'revenuestamp_type', $mysoc->country_code);
print ' → ';
- print ' ';
+ print ' ';
print '';
print " ';
+ $response[] = array('title'=>$obj->question,'ref'=>$obj->url,'answer'=>$obj->answer,'url'=>$urltoprint);
+ }
+ $i++;
+ }
+ } else {
+ dol_print_error($db);
+ }
+ $response =json_encode($response);
+ echo $response;
+}
diff --git a/htdocs/core/ajax/row.php b/htdocs/core/ajax/row.php
index 95518cbbf66..7b271fafdf2 100644
--- a/htdocs/core/ajax/row.php
+++ b/htdocs/core/ajax/row.php
@@ -1,5 +1,5 @@
+/* Copyright (C) 2010-2021 Regis Houssin
* Copyright (C) 2017 Laurent Destailleur
*
* This program is free software; you can redistribute it and/or modify
@@ -79,7 +79,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
$perm = 1;
} elseif ($table_element_line == 'facturedet' && $user->rights->facture->creer) {
$perm = 1;
- } elseif ($table_element_line == 'facturerecdet' && $user->rights->facture->creer) {
+ } elseif ($table_element_line == 'facturedet_rec' && $user->rights->facture->creer) {
$perm = 1;
} elseif ($table_element_line == 'ecm_files' && $user->rights->ecm->creer) {
$perm = 1;
@@ -89,7 +89,7 @@ if (GETPOST('roworder', 'alpha', 3) && GETPOST('table_element_line', 'aZ09', 3)
$perm = 1;
} elseif ($table_element_line == 'mrp_production' && $user->rights->mrp->write) {
$perm = 1;
- } elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->write) {
+ } elseif ($table_element_line == 'supplier_proposaldet' && $user->rights->supplier_proposal->creer) {
$perm = 1;
} elseif ($table_element_line == 'commande_fournisseurdet' && $user->rights->fournisseur->commande->creer) {
$perm = 1;
diff --git a/htdocs/core/ajax/security.php b/htdocs/core/ajax/security.php
index 066e5b7812d..0056120c6bd 100644
--- a/htdocs/core/ajax/security.php
+++ b/htdocs/core/ajax/security.php
@@ -53,7 +53,7 @@ top_httphead();
// Registering the location of boxes
if (isset($_GET['action']) && !empty($_GET['action'])) {
- if ($_GET['action'] == 'getrandompassword' && $user->admin) {
+ if ($_GET['action'] == 'getrandompassword' && ($user->admin || $user->rights->api->apikey->generate)) {
require_once DOL_DOCUMENT_ROOT.'/core/lib/security2.lib.php';
$generic = $_GET['generic'] ? true : false;
echo getRandomPassword($generic);
diff --git a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php
index b61fe66f064..87be4a10c2d 100644
--- a/htdocs/core/boxes/box_customers_outstanding_bill_reached.php
+++ b/htdocs/core/boxes/box_customers_outstanding_bill_reached.php
@@ -133,7 +133,8 @@ class box_customers_outstanding_bill_reached extends ModeleBoxes
$thirdpartystatic->entity = $objp->entity;
$thirdpartystatic->outstanding_limit = $objp->outstanding_limit;
- $outstandingtotal = $thirdpartystatic->getOutstandingBills()['opened'];
+ $tmp = $thirdpartystatic->getOutstandingBills();
+ $outstandingtotal = $tmp['opened'];
$outstandinglimit = $thirdpartystatic->outstanding_limit;
if ($outstandingtotal >= $outstandinglimit) {
diff --git a/htdocs/core/boxes/box_task.php b/htdocs/core/boxes/box_task.php
index 9b7cbfc2fe6..0c349ad3e4c 100644
--- a/htdocs/core/boxes/box_task.php
+++ b/htdocs/core/boxes/box_task.php
@@ -122,7 +122,7 @@ class box_task extends ModeleBoxes
$boxcontent .= ' '."\n";
$selectArray = array('all' => $langs->trans("NoFilter"), 'im_task_contact' => $langs->trans("WhichIamLinkedTo"), 'im_project_contact' => $langs->trans("WhichIamLinkedToProject"));
$boxcontent .= $form->selectArray($cookie_name, $selectArray, $filterValue);
- $boxcontent .= ''.$langs->trans("Refresh").' ';
+ $boxcontent .= ''.$langs->trans("Refresh").' ';
$boxcontent .= ''."\n";
$boxcontent .= '
'."\n";
if (!empty($conf->use_javascript_ajax)) {
diff --git a/htdocs/core/class/commondocgenerator.class.php b/htdocs/core/class/commondocgenerator.class.php
index 18920da3bc2..3f75ee30d02 100644
--- a/htdocs/core/class/commondocgenerator.class.php
+++ b/htdocs/core/class/commondocgenerator.class.php
@@ -447,6 +447,9 @@ abstract class CommonDocGenerator
$array_key.'_bank_iban'=>$bank_account->iban,
$array_key.'_bank_bic'=>$bank_account->bic,
+ $array_key.'_bank_label'=>$bank_account->label,
+ $array_key.'_bank_number'=>$bank_account->number,
+ $array_key.'_bank_proprio'=>$bank_account->proprio,
$array_key.'_total_ht_locale'=>price($object->total_ht, 0, $outputlangs),
$array_key.'_total_vat_locale'=>(!empty($object->total_vat) ?price($object->total_vat, 0, $outputlangs) : price($object->total_tva, 0, $outputlangs)),
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 119ea398ead..45076e522a3 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -2010,6 +2010,11 @@ abstract class CommonObject
return 1;
}
+ // For backward compatibility
+ if ($this->table_element == 'facture_rec' && $fieldid == 'title') {
+ $fieldid = 'titre';
+ }
+
// Security on socid
$socid = 0;
if ($user->socid > 0) {
@@ -3840,8 +3845,14 @@ abstract class CommonObject
$classfile = 'conferenceorbooth';
$classname = 'ConferenceOrBooth';
$module = 'eventorganization';
+ } elseif ($objecttype == 'mo') {
+ $classpath = 'mrp/class';
+ $classfile = 'mo';
+ $classname = 'Mo';
+ $module = 'mrp';
}
+
// Here $module, $classfile and $classname are set
if ($conf->$module->enabled && (($element != $this->element) || $alsosametype)) {
if ($loadalsoobjects) {
@@ -4292,10 +4303,10 @@ abstract class CommonObject
//print 'Found into table '.$table.', type '.$langs->transnoentitiesnoconv($elementname).', haschild='.$haschild;
$haschild += $obj->nb;
if (is_numeric($elementname)) { // old usage
- $this->errors[] = $langs->trans("ErrorRecordHasAtLeastOneChildOfType", $table);
+ $this->errors[] = $langs->transnoentities("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $table);
} else // new usage: $elementname=Translation key
{
- $this->errors[] = $langs->trans("ErrorRecordHasAtLeastOneChildOfType", $langs->transnoentitiesnoconv($elementname));
+ $this->errors[] = $langs->transnoentities("ErrorRecordHasAtLeastOneChildOfType", method_exists($this, 'getNomUrl') ? $this->getNomUrl() : $this->ref, $langs->transnoentitiesnoconv($elementname));
}
break; // We found at least one, we stop here
}
@@ -6721,9 +6732,9 @@ abstract class CommonObject
foreach ($fields_label as $field_toshow) {
$translabel = $langs->trans($obj->$field_toshow);
if ($translabel != $obj->$field_toshow) {
- $labeltoshow = dol_trunc($translabel, 18).' ';
+ $labeltoshow = dol_trunc($translabel).' ';
} else {
- $labeltoshow = dol_trunc($obj->$field_toshow, 18).' ';
+ $labeltoshow = dol_trunc($obj->$field_toshow).' ';
}
}
$out .= ''.$labeltoshow.' ';
@@ -6733,7 +6744,7 @@ abstract class CommonObject
if ($translabel != $obj->{$InfoFieldList[1]}) {
$labeltoshow = dol_trunc($translabel, 18);
} else {
- $labeltoshow = dol_trunc($obj->{$InfoFieldList[1]}, 18);
+ $labeltoshow = dol_trunc($obj->{$InfoFieldList[1]});
}
}
if (empty($labeltoshow)) {
@@ -6916,7 +6927,7 @@ abstract class CommonObject
}
}
} elseif ($type == 'link') {
- $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter]]'
+ $param_list = array_keys($param['options']); // $param_list='ObjectName:classPath[:AddCreateButtonOrNot[:Filter[:Sortfield]]]'
$param_list_array = explode(':', $param_list[0]);
$showempty = (($required && $default != '') ? 0 : 1);
@@ -8961,7 +8972,7 @@ abstract class CommonObject
* @param User $user User that deletes
* @param bool $notrigger false=launch triggers after, true=disable triggers
* @param int $forcechilddeletion 0=no, 1=Force deletion of children
- * @return int <=0 if KO, >0 if OK
+ * @return int <=0 if KO, 0=Nothing done because object has child, >0 if OK
*/
public function deleteCommon(User $user, $notrigger = false, $forcechilddeletion = 0)
{
diff --git a/htdocs/core/class/dolreceiptprinter.class.php b/htdocs/core/class/dolreceiptprinter.class.php
index 9813876c031..2062f1b351c 100644
--- a/htdocs/core/class/dolreceiptprinter.class.php
+++ b/htdocs/core/class/dolreceiptprinter.class.php
@@ -388,9 +388,9 @@ class dolReceiptPrinter extends Printer
{
global $conf;
$error = 0;
- $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt';
- $sql .= ' (name, fk_type, fk_profile, parameter, entity)';
- $sql .= ' VALUES ("'.$this->db->escape($name).'", '.((int) $type).', '.((int) $profile).', "'.$this->db->escape($parameter).'", '.$conf->entity.')';
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt";
+ $sql .= " (name, fk_type, fk_profile, parameter, entity)";
+ $sql .= " VALUES ('".$this->db->escape($name)."', ".((int) $type).", ".((int) $profile).", '".$this->db->escape($parameter)."', ".((int) $conf->entity).")";
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
@@ -413,12 +413,14 @@ class dolReceiptPrinter extends Printer
{
global $conf;
$error = 0;
- $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt';
- $sql .= ' SET name="'.$this->db->escape($name).'"';
- $sql .= ', fk_type='.((int) $type);
- $sql .= ', fk_profile='.((int) $profile);
- $sql .= ', parameter="'.$this->db->escape($parameter).'"';
- $sql .= ' WHERE rowid='.((int) $printerid);
+
+ $sql = "UPDATE ".MAIN_DB_PREFIX."printer_receipt";
+ $sql .= " SET name='".$this->db->escape($name)."'";
+ $sql .= ", fk_type=".((int) $type);
+ $sql .= ", fk_profile=".((int) $profile);
+ $sql .= ", parameter='".$this->db->escape($parameter)."'";
+ $sql .= " WHERE rowid=".((int) $printerid);
+
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
@@ -458,9 +460,9 @@ class dolReceiptPrinter extends Printer
{
global $conf;
$error = 0;
- $sql = 'INSERT INTO '.MAIN_DB_PREFIX.'printer_receipt_template';
- $sql .= ' (name, template, entity) VALUES ("'.$this->db->escape($name).'"';
- $sql .= ', "'.$this->db->escape($template).'", '.$conf->entity.')';
+ $sql = "INSERT INTO ".MAIN_DB_PREFIX."printer_receipt_template";
+ $sql .= " (name, template, entity) VALUES ('".$this->db->escape($name)."'";
+ $sql .= ", '".$this->db->escape($template)."', ".$conf->entity.")";
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
@@ -502,10 +504,11 @@ class dolReceiptPrinter extends Printer
{
global $conf;
$error = 0;
- $sql = 'UPDATE '.MAIN_DB_PREFIX.'printer_receipt_template';
- $sql .= ' SET name="'.$this->db->escape($name).'"';
- $sql .= ', template="'.$this->db->escape($template).'"';
- $sql .= ' WHERE rowid='.((int) $templateid);
+
+ $sql = "UPDATE ".MAIN_DB_PREFIX."printer_receipt_template";
+ $sql .= " SET name='".$this->db->escape($name)."'";
+ $sql .= ", template='".$this->db->escape($template)."'";
+ $sql .= " WHERE rowid=".((int) $templateid);
$resql = $this->db->query($sql);
if (!$resql) {
$error++;
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index 1ab990f59a9..9eb84c39c89 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1976,7 +1976,7 @@ class ExtraFields
*/
public function showSeparator($key, $object, $colspan = 2, $display_type = 'card')
{
- global $langs;
+ global $conf, $langs;
if ($display_type=='card') {
$tagtype='tr';
@@ -1989,6 +1989,7 @@ class ExtraFields
$out = '<'.$tagtype.' id="trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'" class="trextrafieldseparator trextrafieldseparator'.$key.(!empty($object->id)?'_'.$object->id:'').'">';
$out .= '<'.$tagtype_dyn.' '.(!empty($colspan)?'colspan="' . $colspan . '"':'').'>';
+ // Some js code will be injected here to manage the collapsing of extrafields
$out .='';
$out .= $langs->trans($this->attributes[$object->table_element]['label'][$key]);
$out .= ' ';
@@ -2011,15 +2012,17 @@ class ExtraFields
$out .= ''."\n";
+ }
+
// MESSAGE
$msg = GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : '';
print ''.$langs->trans("Message").' ';
@@ -589,23 +648,29 @@ class FormTicket
/**
* Return html list of ticket anaytic codes
*
- * @param string $selected Id categorie pre-selectionnée
- * @param string $htmlname Name of select component
- * @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users.
- * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
- * @param int $empty 1=peut etre vide, 0 sinon
- * @param int $noadmininfo 0=Add admin info, 1=Disable admin info
- * @param int $maxlength Max length of label
- * @param string $morecss More CSS
- * @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes.
+ * @param string $selected Id categorie pre-selectionnée
+ * @param string $htmlname Name of select component
+ * @param string $filtertype To filter on some properties in llx_c_ticket_category ('public = 1'). This parameter must not come from input of users.
+ * @param int $format 0=id+libelle, 1=code+code, 2=code+libelle, 3=id+code
+ * @param int $empty 1=peut etre vide, 0 sinon
+ * @param int $noadmininfo 0=Add admin info, 1=Disable admin info
+ * @param int $maxlength Max length of label
+ * @param string $morecss More CSS
+ * @param int $use_multilevel If > 0 create a multilevel select which use $htmlname example: $use_multilevel = 1 permit to have 2 select boxes.
+ * @param Translate $outputlangs Output lnaguage
* @return void
*/
- public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0)
+ public function selectGroupTickets($selected = '', $htmlname = 'ticketcategory', $filtertype = '', $format = 0, $empty = 0, $noadmininfo = 0, $maxlength = 0, $morecss = '', $use_multilevel = 0, $outputlangs = null)
{
- global $langs, $user;
+ global $conf, $langs, $user;
dol_syslog(get_class($this)."::selectCategoryTickets ".$selected.", ".$htmlname.", ".$filtertype.", ".$format, LOG_DEBUG);
+ if (empty($outputlangs)) {
+ $outputlangs = $langs;
+ }
+ $outputlangs->load("ticket");
+
$ticketstat = new Ticket($this->db);
$ticketstat->loadCacheCategoriesTickets();
@@ -629,6 +694,13 @@ class FormTicket
continue;
}
+ $label = ($arraycategories['label'] != '-' ? $arraycategories['label'] : '');
+ if ($outputlangs->trans("TicketCategoryShort".$arraycategories['code']) != ("TicketCategoryShort".$arraycategories['code'])) {
+ $label = $outputlangs->trans("TicketCategoryShort".$arraycategories['code']);
+ } elseif ($outputlangs->trans($arraycategories['code']) != $arraycategories['code']) {
+ $label = $outputlangs->trans($arraycategories['code']);
+ }
+
if ($format == 0) {
print '';
if ($format == 0) {
- $value = ($maxlength ? dol_trunc($arraycategories['label'], $maxlength) : $arraycategories['label']);
+ $value = ($maxlength ? dol_trunc($label, $maxlength) : $label);
}
if ($format == 1) {
@@ -665,7 +737,7 @@ class FormTicket
}
if ($format == 2) {
- $value = ($maxlength ? dol_trunc($arraycategories['label'], $maxlength) : $arraycategories['label']);
+ $value = ($maxlength ? dol_trunc($label, $maxlength) : $label);
}
if ($format == 3) {
@@ -685,21 +757,26 @@ class FormTicket
} elseif ($htmlname!='') {
$groupticket=GETPOST($htmlname, 'aZ09');
$child_id=GETPOST($htmlname.'_child_id', 'aZ09')?GETPOST($htmlname.'_child_id', 'aZ09'):0;
- $arraycodenotparent[] = "";
+
$arrayidused = array();
+ $arrayidusedconcat = array();
+ $arraycodenotparent = array();
+ $arraycodenotparent[] = "";
+
$stringtoprint = ''.$langs->trans("GroupOfTicket").' ';
$stringtoprint .= '';
$stringtoprint .= ' ';
- $sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, ";
+ $sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, ctc.public, ";
$sql .= $this->db->ifsql("ctc.rowid NOT IN (SELECT ctcfather.rowid FROM llx_c_ticket_category as ctcfather JOIN llx_c_ticket_category as ctcjoin ON ctcfather.rowid = ctcjoin.fk_parent)", "'NOTPARENT'", "'PARENT'")." as isparent";
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc";
- $sql .= " WHERE ctc.active > 0";
+ $sql .= " WHERE ctc.active > 0 AND ctc.entity = ".((int) $conf->entity);
if ($filtertype == 'public=1') {
$sql .= " AND ctc.public = 1";
}
$sql .= " AND ctc.fk_parent = 0";
$sql .= $this->db->order('ctc.pos', 'ASC');
+
$resql = $this->db->query($sql);
if ($resql) {
$num_rows_level0 = $this->db->num_rows($resql);
@@ -707,23 +784,32 @@ class FormTicket
while ($i < $num_rows_level0) {
$obj = $this->db->fetch_object($resql);
if ($obj) {
+ $label = ($obj->label != '-' ? $obj->label : '');
+ if ($outputlangs->trans("TicketCategoryShort".$obj->code) != ("TicketCategoryShort".$obj->code)) {
+ $label = $outputlangs->trans("TicketCategoryShort".$obj->code);
+ } elseif ($outputlangs->trans($obj->code) != $obj->code) {
+ $label = $outputlangs->trans($obj->code);
+ }
+
$grouprowid = $obj->rowid;
$groupvalue = $obj->code;
- $grouplabel = $obj->label;
+ $grouplabel = $label;
+
$isparent = $obj->isparent;
$iselected = $groupticket == $obj->code ?'selected':'';
$stringtoprint .= ''.dol_escape_htmltag($grouplabel).' ';
if ($isparent == 'NOTPARENT') {
$arraycodenotparent[] = $groupvalue;
}
- $arrayidused[]=$grouprowid;
+ $arrayidused[] = $grouprowid;
+ $arrayidusedconcat[] = $grouprowid;
}
$i++;
}
} else {
dol_print_error($this->db);
}
- if ($num_rows_level0 == 1) {
+ if (count($arrayidused) == 1) {
return ' ';
} else {
$stringtoprint .= ' ';
@@ -731,20 +817,22 @@ class FormTicket
}
$stringtoprint .= ' ';
- $levelid = 1;
- while ($levelid <= $use_multilevel) {
+ $levelid = 1; // The first combobox
+ while ($levelid <= $use_multilevel) { // Loop to take the child of the combo
$tabscript = array();
$stringtoprint .= '';
$stringtoprint .= ' ';
- $sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, ctcjoin.code as codefather, ";
- $sql .= $this->db->ifsql("ctc.rowid NOT IN (SELECT ctcfather.rowid FROM llx_c_ticket_category as ctcfather JOIN llx_c_ticket_category as ctcjoin ON ctcfather.rowid = ctcjoin.fk_parent)", "'NOTPARENT'", "'PARENT'")." as isparent";
+ $sql = "SELECT ctc.rowid, ctc.code, ctc.label, ctc.fk_parent, ctc.public, ctcjoin.code as codefather";
$sql .= " FROM ".MAIN_DB_PREFIX."c_ticket_category as ctc";
$sql .= " JOIN ".MAIN_DB_PREFIX."c_ticket_category as ctcjoin ON ctc.fk_parent = ctcjoin.rowid";
- $sql .= " WHERE ctc.active = 1";
+ $sql .= " WHERE ctc.active > 0 AND ctc.entity = ".((int) $conf->entity);
+ $sql .= " AND ctc.rowid NOT IN (".$this->db->sanitize(join(',', $arrayidusedconcat)).")";
+
if ($filtertype == 'public=1') {
$sql .= " AND ctc.public = 1";
}
+ // Add a test to take only record that are direct child
if (!empty($arrayidused)) {
$sql .= " AND ctc.fk_parent IN ( ";
foreach ($arrayidused as $idused) {
@@ -755,6 +843,7 @@ class FormTicket
} else {
}
$sql .= $this->db->order('ctc.pos', 'ASC');
+
$resql = $this->db->query($sql);
if ($resql) {
$num_rows = $this->db->num_rows($resql);
@@ -763,12 +852,20 @@ class FormTicket
while ($i < $num_rows) {
$obj = $this->db->fetch_object($resql);
if ($obj) {
+ $label = ($obj->label != '-' ? $obj->label : '');
+ if ($outputlangs->trans("TicketCategoryShort".$obj->code) != ("TicketCategoryShort".$obj->code)) {
+ $label = $outputlangs->trans("TicketCategoryShort".$obj->code);
+ } elseif ($outputlangs->trans($obj->code) != $obj->code) {
+ $label = $outputlangs->trans($obj->code);
+ }
+
$grouprowid = $obj->rowid;
$groupvalue = $obj->code;
- $grouplabel = $obj->label;
+ $grouplabel = $label;
$isparent = $obj->isparent;
$fatherid = $obj->fk_parent;
$arrayidused[] = $grouprowid;
+ $arrayidusedconcat[] = $grouprowid;
$groupcodefather = $obj->codefather;
if ($isparent == 'NOTPARENT') {
$arraycodenotparent[] = $groupvalue;
@@ -793,7 +890,7 @@ class FormTicket
$stringtoprint .=' ';
$stringtoprint .='';
- $out .= ''.img_picto($langs->trans($text_off), 'switch_off').' ';
- $out .= ''.img_picto($langs->trans($text_on), 'switch_on').' ';
+ $out .= ''.img_picto($langs->trans($text_off), 'switch_off').' ';
+ $out .= ''.img_picto($langs->trans($text_on), 'switch_on').' ';
return $out;
}
diff --git a/htdocs/core/lib/company.lib.php b/htdocs/core/lib/company.lib.php
index 7a10d2d4ff8..1d8024cf40e 100644
--- a/htdocs/core/lib/company.lib.php
+++ b/htdocs/core/lib/company.lib.php
@@ -1548,7 +1548,7 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
$sql .= "OR (";
}
if (!empty($code)) {
- addEventTypeSQL($sql, $code, $donetodo, $now, $filters, "");
+ addEventTypeSQL($sql, $code);
}
if ($key != 0) {
$sql .= ")";
@@ -1556,9 +1556,11 @@ function show_actions_done($conf, $langs, $db, $filterobj, $objcon = '', $noprin
}
$sql .= ')';
} elseif (!empty($actioncode)) {
- addEventTypeSQL($sql, $actioncode, $donetodo, $now, $filters);
+ addEventTypeSQL($sql, $actioncode);
}
+ addOtherFilterSQL($sql, $donetodo, $now, $filters);
+
if (is_array($actioncode)) {
foreach ($actioncode as $code) {
$sql2 = addMailingEventTypeSQL($code, $objcon, $filterobj);
@@ -2021,13 +2023,10 @@ function show_subsidiaries($conf, $langs, $db, $object)
*
* @param string $sql $sql modified
* @param string $actioncode Action code
- * @param string $donetodo donetodo
- * @param string $now now
- * @param string $filters array
* @param string $sqlANDOR "AND", "OR" or "" sql condition
* @return string sql request
*/
-function addEventTypeSQL(&$sql, $actioncode, $donetodo, $now, $filters, $sqlANDOR = "AND")
+function addEventTypeSQL(&$sql, $actioncode, $sqlANDOR = "AND")
{
global $conf, $db;
// Condition on actioncode
@@ -2054,6 +2053,23 @@ function addEventTypeSQL(&$sql, $actioncode, $donetodo, $now, $filters, $sqlANDO
}
}
+ return $sql;
+}
+
+/**
+ * Add Event Type SQL
+ *
+ * @param string $sql $sql modified
+ * @param string $donetodo donetodo
+ * @param string $now now
+ * @param string $filters array
+ * @return string sql request
+ */
+function addOtherFilterSQL(&$sql, $donetodo, $now, $filters)
+{
+ global $conf, $db;
+ // Condition on actioncode
+
if ($donetodo == 'todo') {
$sql .= " AND ((a.percent >= 0 AND a.percent < 100) OR (a.percent = -1 AND a.datep > '".$db->idate($now)."'))";
} elseif ($donetodo == 'done') {
diff --git a/htdocs/core/lib/files.lib.php b/htdocs/core/lib/files.lib.php
index 350c2334915..1a2823fb933 100644
--- a/htdocs/core/lib/files.lib.php
+++ b/htdocs/core/lib/files.lib.php
@@ -2303,9 +2303,13 @@ function dol_check_secure_access_document($modulepart, $original_file, $entity,
$sqlprotectagainstexternals = '';
$ret = array();
- // Find the subdirectory name as the reference. For exemple original_file='10/myfile.pdf' -> refname='10'
+ // Find the subdirectory name as the reference. For example original_file='10/myfile.pdf' -> refname='10'
if (empty($refname)) {
$refname = basename(dirname($original_file)."/");
+ if ($refname == 'thumbs') {
+ // If we get the thumbns directory, we must go one step higher. For example original_file='10/thumbs/myfile_small.jpg' -> refname='10'
+ $refname = basename(dirname(dirname($original_file))."/");
+ }
}
// Define possible keys to use for permission check
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index dd22c804f23..9c93b69ee16 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -3615,7 +3615,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'margin', 'map-marker-alt', 'member', 'meeting', 'money-bill-alt', 'movement', 'mrp', 'note', 'next',
'off', 'on', 'order',
'paiment', 'paragraph', 'play', 'pdf', 'phone', 'phoning', 'phoning_mobile', 'phoning_fax', 'playdisabled', 'previous', 'poll', 'pos', 'printer', 'product', 'propal', 'stock', 'resize', 'service', 'stats', 'trip',
- 'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
+ 'security', 'setup', 'share-alt', 'sign-out', 'split', 'stripe', 'stripe-s', 'switch_off', 'switch_on', 'switch_on_red', 'tools', 'unlink', 'uparrow', 'user', 'vcard', 'wrench',
'github', 'jabber', 'skype', 'twitter', 'facebook', 'linkedin', 'instagram', 'snapchat', 'youtube', 'google-plus-g', 'whatsapp',
'chevron-left', 'chevron-right', 'chevron-down', 'chevron-top', 'commercial', 'companies',
'generic', 'home', 'hrm', 'members', 'products', 'invoicing',
@@ -3659,7 +3659,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'member'=>'user-alt', 'meeting'=>'chalkboard-teacher', 'mrp'=>'cubes', 'next'=>'arrow-alt-circle-right',
'trip'=>'wallet', 'expensereport'=>'wallet', 'group'=>'users', 'movement'=>'people-carry',
'sign-out'=>'sign-out-alt',
- 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
+ 'switch_off'=>'toggle-off', 'switch_on'=>'toggle-on', 'switch_on_red'=>'toggle-on', 'check'=>'check', 'bookmark'=>'star', 'bookmark'=>'star',
'bank'=>'university', 'close_title'=>'times', 'delete'=>'trash', 'edit'=>'pencil-alt', 'filter'=>'filter',
'list-alt'=>'list-alt', 'calendar'=>'calendar-alt', 'calendarmonth'=>'calendar-alt', 'calendarweek'=>'calendar-week', 'calendarmonth'=>'calendar-alt', 'calendarday'=>'calendar-day', 'calendarperuser'=>'table',
'intervention'=>'ambulance', 'invoice'=>'file-invoice-dollar', 'multicurrency'=>'dollar-sign', 'order'=>'file-invoice',
@@ -3720,7 +3720,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
// Define $marginleftonlyshort
$arrayconvpictotomarginleftonly = array(
'bank', 'check', 'delete', 'generic', 'grip', 'grip_title', 'jabber',
- 'grip_title', 'grip', 'listlight', 'note', 'on', 'off', 'playdisabled', 'printer', 'resize', 'sign-out', 'stats', 'switch_on', 'switch_off',
+ 'grip_title', 'grip', 'listlight', 'note', 'on', 'off', 'playdisabled', 'printer', 'resize', 'sign-out', 'stats', 'switch_on', 'switch_on_red', 'switch_off',
'uparrow', '1uparrow', '1downarrow', '1leftarrow', '1rightarrow', '1uparrow_selected', '1downarrow_selected', '1leftarrow_selected', '1rightarrow_selected'
);
if (!isset($arrayconvpictotomarginleftonly[$pictowithouttext])) {
@@ -3742,7 +3742,7 @@ function img_picto($titlealt, $picto, $moreatt = '', $pictoisfullpath = false, $
'members'=>'infobox-adherent', 'member'=>'infobox-adherent', 'money-bill-alt'=>'infobox-bank_account',
'order'=>'infobox-commande',
'user'=>'infobox-adherent', 'users'=>'infobox-adherent',
- 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4',
+ 'error'=>'pictoerror', 'warning'=>'pictowarning', 'switch_on'=>'font-status4', 'switch_on_red'=>'font-status8',
'holiday'=>'infobox-holiday', 'info'=>'opacityhigh', 'invoice'=>'infobox-commande',
'knowledgemanagement'=>'infobox-contrat rotate90', 'loan'=>'infobox-bank_account',
'payment'=>'infobox-bank_account', 'poll'=>'infobox-adherent', 'pos'=>'infobox-bank_account', 'project'=>'infobox-project', 'projecttask'=>'infobox-project', 'propal'=>'infobox-propal',
diff --git a/htdocs/core/lib/project.lib.php b/htdocs/core/lib/project.lib.php
index 73fc5295a99..1400dc40458 100644
--- a/htdocs/core/lib/project.lib.php
+++ b/htdocs/core/lib/project.lib.php
@@ -31,16 +31,17 @@ require_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
* Prepare array with list of tabs
*
* @param Project $project Object related to tabs
+ * @param string $moreparam More param on url
* @return array Array of tabs to show
*/
-function project_prepare_head(Project $project)
+function project_prepare_head(Project $project, $moreparam = '')
{
global $db, $langs, $conf, $user;
$h = 0;
$head = array();
- $head[$h][0] = DOL_URL_ROOT.'/projet/card.php?id='.$project->id;
+ $head[$h][0] = DOL_URL_ROOT.'/projet/card.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
$head[$h][1] = $langs->trans("Project");
$head[$h][2] = 'project';
$h++;
@@ -56,7 +57,7 @@ function project_prepare_head(Project $project)
$nbContacts = count($project->liste_contact(-1, 'internal')) + count($project->liste_contact(-1, 'external'));
dol_setcache($cachekey, $nbContacts, 120); // If setting cache fails, this is not a problem, so we do not test result.
}
- $head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.$project->id;
+ $head[$h][0] = DOL_URL_ROOT.'/projet/contact.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
$head[$h][1] = $langs->trans("ProjectContact");
if ($nbContacts > 0) {
$head[$h][1] .= ''.$nbContacts.' ';
@@ -80,7 +81,7 @@ function project_prepare_head(Project $project)
$nbTasks = count($taskstatic->getTasksArray(0, 0, $project->id, 0, 0));
dol_setcache($cachekey, $nbTasks, 120); // If setting cache fails, this is not a problem, so we do not test result.
}
- $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.$project->id;
+ $head[$h][0] = DOL_URL_ROOT.'/projet/tasks.php?id='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
$head[$h][1] = $langs->trans("Tasks");
if ($nbTasks > 0) {
$head[$h][1] .= ''.($nbTasks).' ';
@@ -113,7 +114,7 @@ function project_prepare_head(Project $project)
}
}
- $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.urlencode($project->id);
+ $head[$h][0] = DOL_URL_ROOT.'/projet/tasks/time.php?withproject=1&projectid='.((int) $project->id).($moreparam ? '&'.$moreparam : '');
$head[$h][1] = $langs->trans("TimeSpent");
if ($nbTimeSpent > 0) {
$head[$h][1] .= '... ';
@@ -207,7 +208,7 @@ function project_prepare_head(Project $project)
if ($conf->eventorganization->enabled && !empty($project->usage_organize_event)) {
$langs->load('eventorganization');
$head[$h][0] = DOL_URL_ROOT . '/eventorganization/conferenceorbooth_list.php?projectid=' . $project->id;
- $head[$h][1] = $langs->trans("ConferenceOrBoothTab");
+ $head[$h][1] = $langs->trans("EventOrganization");
// Enable caching of conf or booth count
$nbConfOrBooth = 0;
diff --git a/htdocs/core/lib/security.lib.php b/htdocs/core/lib/security.lib.php
index b297c81035e..4c36244a5bf 100644
--- a/htdocs/core/lib/security.lib.php
+++ b/htdocs/core/lib/security.lib.php
@@ -611,7 +611,7 @@ function checkUserAccessToObject($user, array $featuresarray, $objectid = 0, $ta
$feature = 'projet_task';
}
- $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salary', 'website'); // Test on entity only (Objects with no link to company)
+ $check = array('adherent', 'banque', 'bom', 'don', 'mrp', 'user', 'usergroup', 'payment', 'payment_supplier', 'product', 'produit', 'service', 'produit|service', 'categorie', 'resource', 'expensereport', 'holiday', 'salaries', 'website'); // Test on entity only (Objects with no link to company)
$checksoc = array('societe'); // Test for societe object
$checkother = array('contact', 'agenda'); // Test on entity + link to third party on field $dbt_keyfield. Allowed if link is empty (Ex: contacts...).
$checkproject = array('projet', 'project'); // Test for project object
diff --git a/htdocs/core/menus/standard/eldy.lib.php b/htdocs/core/menus/standard/eldy.lib.php
index d960d4d52c7..0f4aedcd2f9 100644
--- a/htdocs/core/menus/standard/eldy.lib.php
+++ b/htdocs/core/menus/standard/eldy.lib.php
@@ -382,12 +382,18 @@ function print_eldy_menu($db, $atarget, $type_user, &$tabMenu, &$menu, $noout =
'submenus' => array(),
);
- // Tickets and knwoledge base
+ // Tickets and knowledge base
$tmpentry = array(
- 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knwoledgemanagement->enabled)),
- 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knwoledgemanagement->read)),
- 'module'=>'ticket|knwoledgemanagement'
+ 'enabled'=>(!empty($conf->ticket->enabled) || !empty($conf->knowledgemanagement->enabled)),
+ 'perms'=>(!empty($user->rights->ticket->read) || !empty($user->rights->knowledgemanagement->knowledgerecord->read)),
+ 'module'=>'ticket|knowledgemanagement'
);
+ $link = '';
+ if (!empty($conf->ticket->enabled)) {
+ $link = '/ticket/index.php?mainmenu=ticket&leftmenu=';
+ } else {
+ $link = '/knowledgemanagement/knowledgerecord_list.php?mainmenu=ticket&leftmenu=';
+ }
$menu_arr[] = array(
'name' => 'Ticket',
'link' => '/ticket/index.php?mainmenu=ticket&leftmenu=',
@@ -2092,8 +2098,10 @@ function print_left_eldy_menu($db, $menu_array_before, $menu_array_after, &$tabM
$cssmenu = ' menu_contenu'.dol_string_nospecial(preg_replace('/\.php.*$/', '', $menu_array[$i]['url']));
}
- if ($menu_array[$i]['enabled'] && $lastlevel0 == 'enabled') { // Enabled so visible, except if parent was not enabled.
- print '