';
@@ -298,7 +298,7 @@ foreach ($dirmodels as $reldir)
if (in_array($name, $def))
{
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"),'switch_on');
print ' ';
print ' ';
@@ -306,7 +306,7 @@ foreach ($dirmodels as $reldir)
else
{
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').' ';
print " ";
}
@@ -318,7 +318,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').' ';
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').' ';
}
print '';
diff --git a/htdocs/admin/prelevement.php b/htdocs/admin/prelevement.php
index f9c183b5c7d..90a75626e7c 100644
--- a/htdocs/admin/prelevement.php
+++ b/htdocs/admin/prelevement.php
@@ -312,7 +312,7 @@ foreach ($dirmodels as $reldir)
if (in_array($name, $def))
{
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"),'switch_on');
print ' ';
print ' ';
@@ -320,7 +320,7 @@ foreach ($dirmodels as $reldir)
else
{
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"),'switch_off').' ';
print " ";
}
@@ -332,7 +332,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').' ';
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"),'off').' ';
}
print '';
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index dcd91df0dbc..22ce045a7ab 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -278,7 +278,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->PROPALE_ADDON == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
@@ -402,13 +402,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -417,7 +417,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->PROPALE_ADDON_PDF == "$name") {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -658,11 +658,11 @@ if ($conf->banque->enabled)
{
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_PROPOSAL))
{
- print ''.img_picto($langs->trans("Disabled"),'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"),'switch_off').' ';
}
else
{
- print ''.img_picto($langs->trans("Enabled"),'switch_on').' ';
+ print ''.img_picto($langs->trans("Enabled"),'switch_on').' ';
}
}
print '';
diff --git a/htdocs/admin/receiptprinter.php b/htdocs/admin/receiptprinter.php
index 988023175db..a2758304527 100644
--- a/htdocs/admin/receiptprinter.php
+++ b/htdocs/admin/receiptprinter.php
@@ -350,15 +350,15 @@ if ($mode == 'config' && $user->admin) {
print ''.$langs->trans($printer->listprinters[$line]['fk_profile_name']).' ';
print ''.$printer->listprinters[$line]['parameter'].' ';
// edit icon
- print '';
+ print ' ';
print img_picto($langs->trans("Edit"), 'edit');
print ' ';
// delete icon
- print '';
+ print ' ';
print img_picto($langs->trans("Delete"), 'delete');
print ' ';
// test icon
- print '';
+ print ' ';
print img_picto($langs->trans("TestPrinter"), 'printer');
print ' ';
print '';
@@ -438,15 +438,15 @@ if ($mode == 'template' && $user->admin) {
print ''.$printer->listprinterstemplates[$line]['name'].' ';
print ''.dol_htmlentitiesbr($printer->listprinterstemplates[$line]['template']).' ';
// edit icon
- print '';
+ print ' ';
print img_picto($langs->trans("Edit"), 'edit');
print ' ';
// delete icon
- print '';
+ print ' ';
print img_picto($langs->trans("Delete"), 'delete');
print ' ';
// test icon
- print '';
+ print ' ';
print img_picto($langs->trans("TestPrinterTemplate"), 'printer');
print ' ';
}
diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php
index 6367b80c150..218cc1ef853 100644
--- a/htdocs/admin/reception_setup.php
+++ b/htdocs/admin/reception_setup.php
@@ -235,7 +235,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->RECEPTION_ADDON_NUMBER == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
@@ -363,13 +363,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -378,7 +378,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->RECEPTION_ADDON_PDF == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/admin/security.php b/htdocs/admin/security.php
index a86ca272b85..b3204d594e0 100644
--- a/htdocs/admin/security.php
+++ b/htdocs/admin/security.php
@@ -260,7 +260,7 @@ foreach ($arrayhandler as $key => $module) {
//print img_picto('', 'tick');
print img_picto($langs->trans("Enabled"), 'switch_on');
} else {
- print '';
+ print ' ';
//print $langs->trans("Activate");
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
diff --git a/htdocs/admin/security_other.php b/htdocs/admin/security_other.php
index 5f8cc66eb1e..477691cf6ef 100644
--- a/htdocs/admin/security_other.php
+++ b/htdocs/admin/security_other.php
@@ -111,9 +111,9 @@ if (function_exists("imagecreatefrompng")) {
print ajax_constantonoff('MAIN_SECURITY_ENABLECAPTCHA');
} else {
if (empty($conf->global->MAIN_SECURITY_ENABLECAPTCHA)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
} else {
@@ -130,9 +130,9 @@ if (!empty($conf->use_javascript_ajax)) {
print ajax_constantonoff('MAIN_USE_ADVANCED_PERMS');
} else {
if (empty($conf->global->MAIN_USE_ADVANCED_PERMS)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
print "";
diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php
index 8f267e9eb1c..92dba301854 100644
--- a/htdocs/admin/spip.php
+++ b/htdocs/admin/spip.php
@@ -149,7 +149,7 @@ if (!empty($conf->global->ADHERENT_USE_SPIP)) {
} else {
print dol_get_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
- $link = '';
+ $link = ' ';
//$link.=$langs->trans("Activate");
$link .= img_picto($langs->trans("Disabled"), 'switch_off');
$link .= ' ';
diff --git a/htdocs/admin/stock.php b/htdocs/admin/stock.php
index e45a01d9ed1..2f357b2d5fc 100644
--- a/htdocs/admin/stock.php
+++ b/htdocs/admin/stock.php
@@ -565,13 +565,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -580,7 +580,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->STOCK_ADDON_PDF == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index a888a248d11..40fe58f68d6 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -256,7 +256,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->INVOICE_SUPPLIER_ADDON_NUMBER == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -375,7 +375,7 @@ foreach ($dirmodels as $reldir) {
//if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF != "$name")
//{
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
- print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">';
+ print ' scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
/*}
@@ -386,7 +386,7 @@ foreach ($dirmodels as $reldir) {
print "";
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'&type=invoice_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -395,9 +395,9 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->INVOICE_SUPPLIER_ADDON_PDF == "$name") {
//print img_picto($langs->trans("Default"),'on');
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
- print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
+ print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
} else {
- print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir.'&label='.urlencode($module->name).'&type=invoice_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index cfa6c878a74..00b5fbfdb8e 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -269,7 +269,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->COMMANDE_SUPPLIER_ADDON_NUMBER == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
@@ -381,7 +381,7 @@ foreach ($dirmodels as $reldir) {
if (in_array($name, $def)) {
print ''."\n";
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF != "$name") {
- print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">';
+ print ' scandir).'&label='.urlencode($module->name).'&type=order_supplier">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
} else {
@@ -390,7 +390,7 @@ foreach ($dirmodels as $reldir) {
print " ";
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'&type=order_supplier">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -399,7 +399,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->COMMANDE_SUPPLIER_ADDON_PDF == "$name") {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'&type=order_supplier"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'&type=order_supplier" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
@@ -472,11 +472,11 @@ if ($conf->banque->enabled)
{
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_ORDER))
{
- print ''.img_picto($langs->trans("Disabled"),'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"),'switch_off').' ';
}
else
{
- print ''.img_picto($langs->trans("Enabled"),'switch_on').' ';
+ print ''.img_picto($langs->trans("Enabled"),'switch_on').' ';
}
}
print '';
diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php
index 15210f89360..ce2c9f0f872 100644
--- a/htdocs/admin/supplier_payment.php
+++ b/htdocs/admin/supplier_payment.php
@@ -372,7 +372,7 @@ foreach ($dirmodels as $reldir) {
print "";
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -381,9 +381,9 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->SUPPLIER_PAYMENT_ADDON_PDF == "$name") {
//print img_picto($langs->trans("Default"),'on');
// Even if choice is the default value, we allow to disable it: For supplier invoice, we accept to have no doc generation at all
- print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
+ print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Disable").'">'.img_picto($langs->trans("Enabled"), 'on').' ';
} else {
- print 'scandir.'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'&type=SUPPLIER_PAYMENT"" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php
index 980ebe10fff..6e3f190aeb6 100644
--- a/htdocs/admin/supplier_proposal.php
+++ b/htdocs/admin/supplier_proposal.php
@@ -257,7 +257,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->SUPPLIER_PROPOSAL_ADDON == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
@@ -380,22 +380,22 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
- print "\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ' '."\n";
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
// Defaut
- print "";
+ print ' ';
if ($conf->global->SUPPLIER_PROPOSAL_ADDON_PDF == "$name") {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print ' ';
@@ -503,9 +503,9 @@ if ($conf->banque->enabled) {
print ajax_constantonoff('BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL');
} else {
if (empty($conf->global->BANK_ASK_PAYMENT_BANK_DURING_SUPPLIER_PROPOSAL)) {
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'switch_on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'switch_on').' ';
}
}
print '';
diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php
index 3d31c516858..72e8db6bb4e 100644
--- a/htdocs/admin/system/database-tables.php
+++ b/htdocs/admin/system/database-tables.php
@@ -149,7 +149,7 @@ if (!$base) {
print ''.$obj->Check_time.' ';
print ''.$obj->Collation;
if (isset($obj->Collation) && (in_array($obj->Collation, array("utf8mb4_general_ci", "utf8mb4_unicode_ci", "latin1_swedish_ci")))) {
- print ''.$langs->trans("Convert").' UTF8 ';
+ print ''.$langs->trans("Convert").' UTF8 ';
}
print ' ';
print '';
diff --git a/htdocs/admin/system/security.php b/htdocs/admin/system/security.php
index 8a6d6bbb4ed..db2b8374b9b 100644
--- a/htdocs/admin/system/security.php
+++ b/htdocs/admin/system/security.php
@@ -340,69 +340,6 @@ if (empty($out)) {
}
print ' ';
-print ' ';
-print ' ';
-print ' ';
-
-
-print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder');
-
-
-//print ''.$langs->trans("PasswordEncryption").' : ';
-print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? ''.$langs->trans("Undefined").' ' : $conf->global->MAIN_SECURITY_HASH_ALGO)." ";
-if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) {
- print ' If unset: \'md5\' ';
-}
-if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
- print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? ''.$langs->trans("Undefined").' ' : $conf->global->MAIN_SECURITY_SALT).' ';
-} else {
- print '('.$langs->trans("Recommended").': password_hash) ';
- print ' ';
-}
-if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
- print 'The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible. ';
- print 'If you really want to switch, you must: ';
- print '- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\' ';
- print '- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password ';
- print '- You can now logout and login with this new password. You must now reset password of all other users. ';
- print '
';
-}
-print ' ';
-
-print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added) ' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)." ";
-print ' ';
-
-print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES).' ('.$langs->trans("Recommended").': 0) ';
-print ' ';
-
-print 'MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? ''.$langs->trans("Undefined").' ' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).' ('.$langs->trans("Recommended").': 1) ';
-print ' ';
-
-print 'MAIN_RESTRICTHTML_ONLY_VALID_HTML = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? ''.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1) ' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)." ";
-print ' ';
-
-print 'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? ''.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1) ' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)." ";
-print ' ';
-
-print 'MAIN_EXEC_USE_POPEN = ';
-if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
- print ''.$langs->trans("Undefined").' ';
-} else {
- print $conf->global->MAIN_EXEC_USE_POPEN;
-}
-if ($execmethod == 1) {
- print ', "exec" PHP method will be used for shell commands';
- print ' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
- print ' ';
-}
-if ($execmethod == 2) {
- print ', "popen" PHP method will be used for shell commands';
- print ' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
- print ' ';
-}
-print " ";
-print ' ';
-
// Modules/Applications
@@ -462,6 +399,73 @@ if (empty($conf->api->enabled) && empty($conf->webservices->enabled)) {
print ' ';
+
+print ' ';
+
+
+print load_fiche_titre($langs->trans("OtherSetup").' ('.$langs->trans("Experimental").')', '', 'folder');
+
+
+//print ''.$langs->trans("PasswordEncryption").' : ';
+print 'MAIN_SECURITY_HASH_ALGO = '.(empty($conf->global->MAIN_SECURITY_HASH_ALGO) ? ''.$langs->trans("Undefined").' ' : $conf->global->MAIN_SECURITY_HASH_ALGO)." ";
+if (empty($conf->global->MAIN_SECURITY_HASH_ALGO)) {
+ print ' If unset: \'md5\' ';
+}
+if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
+ print 'MAIN_SECURITY_SALT = '.(empty($conf->global->MAIN_SECURITY_SALT) ? ''.$langs->trans("Undefined").' ' : $conf->global->MAIN_SECURITY_SALT).' ';
+} else {
+ print '('.$langs->trans("Recommended").': password_hash) ';
+ print ' ';
+}
+if ($conf->global->MAIN_SECURITY_HASH_ALGO != 'password_hash') {
+ print 'The recommanded value for MAIN_SECURITY_HASH_ALGO is now \'password_hash\' but setting it now will make ALL existing passwords of all users not valid, so update is not possible. ';
+ print 'If you really want to switch, you must: ';
+ print '- Go on home - setup - other and add constant MAIN_SECURITY_HASH_ALGO to value \'password_hash\' ';
+ print '- In same session, WITHOUT LOGGING OUT, go into your admin user record and set a new password ';
+ print '- You can now logout and login with this new password. You must now reset password of all other users. ';
+ print '
';
+}
+print ' ';
+
+print 'MAIN_SECURITY_ANTI_SSRF_SERVER_IP = '.(empty($conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP) ? ''.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': List of static IPs of server separated with coma - '.$langs->trans("Note").': common loopback ip like 127.*.*.*, [::1] are already added) ' : $conf->global->MAIN_SECURITY_ANTI_SSRF_SERVER_IP)." ";
+print ' ';
+
+print 'MAIN_ALLOW_SVG_FILES_AS_IMAGES = '.(empty($conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES) ? '0' : $conf->global->MAIN_ALLOW_SVG_FILES_AS_IMAGES).' ('.$langs->trans("Recommended").': 0) ';
+print ' ';
+
+print 'MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE = '.(empty($conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE) ? ''.$langs->trans("Undefined").' ' : $conf->global->MAIN_ALWAYS_CREATE_LOCK_AFTER_LAST_UPGRADE).' ('.$langs->trans("Recommended").': 1) ';
+print ' ';
+
+print 'MAIN_RESTRICTHTML_ONLY_VALID_HTML = '.(empty($conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML) ? ''.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1) ' : $conf->global->MAIN_RESTRICTHTML_ONLY_VALID_HTML)." ";
+print ' ';
+
+print 'MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES = '.(empty($conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES) ? ''.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1) ' : $conf->global->MAIN_RESTRICTHTML_REMOVE_ALSO_BAD_ATTRIBUTES)." ";
+print ' ';
+
+print 'MAIN_SECURITY_CSRF_WITH_TOKEN = '.(empty($conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN) ? ''.$langs->trans("Undefined").' ('.$langs->trans("Recommended").': 1) ' : $conf->global->MAIN_SECURITY_CSRF_WITH_TOKEN)." ";
+print ' ';
+
+
+print 'MAIN_EXEC_USE_POPEN = ';
+if (empty($conf->global->MAIN_EXEC_USE_POPEN)) {
+ print ''.$langs->trans("Undefined").' ';
+} else {
+ print $conf->global->MAIN_EXEC_USE_POPEN;
+}
+if ($execmethod == 1) {
+ print ', "exec" PHP method will be used for shell commands';
+ print ' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
+ print ' ';
+}
+if ($execmethod == 2) {
+ print ', "popen" PHP method will be used for shell commands';
+ print ' ('.$langs->trans("Recommended").': '.$langs->trans("Undefined").' '.$langs->trans("or").' 1)';
+ print ' ';
+}
+print " ";
+print ' ';
+
+
// End of page
llxFooter();
$db->close();
diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php
index c3778861ddf..03fd647dd29 100644
--- a/htdocs/admin/ticket.php
+++ b/htdocs/admin/ticket.php
@@ -400,13 +400,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
diff --git a/htdocs/admin/ticket_public.php b/htdocs/admin/ticket_public.php
index 22e4a4a1b42..68dbfb429b8 100644
--- a/htdocs/admin/ticket_public.php
+++ b/htdocs/admin/ticket_public.php
@@ -180,10 +180,11 @@ $head = ticketAdminPrepareHead();
print dol_get_fiche_head($head, 'public', $langs->trans("Module56000Name"), -1, "ticket");
-print ''.$langs->trans("TicketPublicAccess").' : '.dol_buildpath('/public/ticket/index.php', 2).' ';
+print ''.$langs->trans("TicketPublicAccess").' : '.dol_buildpath('/public/ticket/index.php', 2).' ';
print dol_get_fiche_end();
+$param = '';
$enabledisablehtml = $langs->trans("TicketsActivatePublicInterface").' ';
if (empty($conf->global->TICKET_ENABLE_PUBLIC_INTERFACE)) {
diff --git a/htdocs/admin/translation.php b/htdocs/admin/translation.php
index 8b5c05b7bda..2327abd549e 100644
--- a/htdocs/admin/translation.php
+++ b/htdocs/admin/translation.php
@@ -463,6 +463,8 @@ if ($mode == 'searchkey') {
}
print_barre_liste($title, $page, $_SERVER["PHP_SELF"], $param, $sortfield, $sortorder, '', $num, -1 * $nbtotalofrecords, '', 0, '', '', $limit, 0, 0, 1);
+ $massactionbutton = '';
+
print ' ';
print ' ';
@@ -499,7 +501,7 @@ if ($mode == 'searchkey') {
//}
print '';
// Action column
- print '';
+ print ' ';
$searchpicto = $form->showFilterAndCheckAddButtons(!empty($massactionbutton) ? 1 : 0, 'checkforselect', 1);
print $searchpicto;
print ' ';
diff --git a/htdocs/admin/user.php b/htdocs/admin/user.php
index da3a1913d64..85ab0f0e9a8 100644
--- a/htdocs/admin/user.php
+++ b/htdocs/admin/user.php
@@ -147,9 +147,9 @@ if ($conf->use_javascript_ajax) {
print ajax_constantonoff('USER_MAIL_REQUIRED');
} else {
if (empty($conf->global->USER_MAIL_REQUIRED)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
print '';
@@ -165,9 +165,9 @@ if ($conf->use_javascript_ajax) {
print ajax_constantonoff('USER_HIDE_INACTIVE_IN_COMBOBOX');
} else {
if (empty($conf->global->USER_HIDE_INACTIVE_IN_COMBOBOX)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
print '';
@@ -256,13 +256,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -271,7 +271,7 @@ foreach ($dirmodels as $reldir) {
if (getDolGlobalString('USER_ADDON_PDF_ODT') == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/admin/usergroup.php b/htdocs/admin/usergroup.php
index b73d3ce4f22..3319ab994a6 100644
--- a/htdocs/admin/usergroup.php
+++ b/htdocs/admin/usergroup.php
@@ -188,13 +188,13 @@ foreach ($dirmodels as $reldir) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
@@ -203,7 +203,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->USERGROUP_ADDON_PDF == $name) {
print img_picto($langs->trans("Default"), 'on');
} else {
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'off').' ';
}
print '';
diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php
index 1b6fa5bebe7..ada5a6e0b3b 100644
--- a/htdocs/admin/workflow.php
+++ b/htdocs/admin/workflow.php
@@ -250,11 +250,11 @@ foreach ($workflowcodes as $key => $params) {
print ajax_constantonoff($key);
} else {
if (!empty($conf->global->$key)) {
- print '';
+ print ' ';
print img_picto($langs->trans("Activated"), 'switch_on');
print ' ';
} else {
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/admin/workstation.php b/htdocs/admin/workstation.php
index f14393e2588..76556fb4d68 100755
--- a/htdocs/admin/workstation.php
+++ b/htdocs/admin/workstation.php
@@ -423,13 +423,13 @@ foreach ($myTmpObjects as $myTmpObjectKey => $myTmpObjectArray) {
// Active
if (in_array($name, $def)) {
print ''."\n";
- print '';
+ print ' ';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
print ' ';
} else {
print ''."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
diff --git a/htdocs/asset/card.php b/htdocs/asset/card.php
index ceaf6aa2ecc..b2473409b5b 100644
--- a/htdocs/asset/card.php
+++ b/htdocs/asset/card.php
@@ -102,7 +102,7 @@ if (empty($reshook)) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = DOL_URL_ROOT.'/compta/bank/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/asset/card.php?id='.((!empty($id) && $id > 0) ? $id : '__ID__');
}
}
}
@@ -247,7 +247,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
$morehtmlref = '';
/*
@@ -294,13 +294,13 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
if (empty($reshook)) {
if ($user->rights->asset->write) {
- print '
id.'&action=edit">'.$langs->trans("Modify").' '."\n";
+ print '
id.'&action=edit&token='.newToken().'">'.$langs->trans("Modify").' '."\n";
} else {
print '
'.$langs->trans('Modify').' '."\n";
}
if ($user->rights->asset->delete) {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
} else {
print '
'.$langs->trans('Delete').' '."\n";
}
@@ -334,7 +334,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// List of actions on element
include_once DOL_DOCUMENT_ROOT.'/core/class/html.formactions.class.php';
$formactions = new FormActions($db);
- $somethingshown = $formactions->showactions($object, 'asset', $socid, 1, '', $MAXEVENT, '', $morehtmlright);
+ $somethingshown = $formactions->showactions($object, $object->element, $socid, 1, '', $MAXEVENT, '', $morehtmlright);
print '
';
}
diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php
index 66cd9bcb4cf..34e0a732f57 100644
--- a/htdocs/asset/class/asset.class.php
+++ b/htdocs/asset/class/asset.class.php
@@ -57,6 +57,7 @@ class Asset extends CommonObject
const STATUS_DRAFT = 0;
const STATUS_VALIDATED = 1;
+ const STATUS_CANCELED = 9;
/**
@@ -95,7 +96,7 @@ class Asset extends CommonObject
'fk_user_creat' => array('type'=>'integer', 'label'=>'UserAuthor', 'visible'=>-2, 'enabled'=>1, 'position'=>510, 'notnull'=>1,),
'fk_user_modif' => array('type'=>'integer', 'label'=>'UserModif', 'visible'=>-2, 'enabled'=>1, 'position'=>511, 'notnull'=>-1,),
'import_key' => array('type'=>'varchar(14)', 'label'=>'ImportId', 'visible'=>-2, 'enabled'=>1, 'position'=>1000, 'notnull'=>-1,),
- 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Active', '-1'=>'Cancel')),
+ 'status' => array('type'=>'integer', 'label'=>'Status', 'visible'=>1, 'enabled'=>1, 'position'=>1000, 'notnull'=>1, 'index'=>1, 'arrayofkeyval'=>array('0'=>'Draft', '1'=>'Active', '9'=>'Cancel')),
);
/**
diff --git a/htdocs/asset/note.php b/htdocs/asset/note.php
index 16af18d8277..ebd340e393d 100644
--- a/htdocs/asset/note.php
+++ b/htdocs/asset/note.php
@@ -97,7 +97,7 @@ if ($id > 0 || !empty($ref)) {
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
$morehtmlref = '';
/*
@@ -114,7 +114,7 @@ if ($id > 0 || !empty($ref)) {
if ($user->rights->asset->creer)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php
index bf65f40fe13..841086399c9 100644
--- a/htdocs/bom/bom_agenda.php
+++ b/htdocs/bom/bom_agenda.php
@@ -139,7 +139,7 @@ if ($object->id > 0) {
// Object card
// ------------------------------------------------------------
- $linkback = '
'.$langs->trans("BackToList").' ';
+ $linkback = '
'.$langs->trans("BackToList").' ';
$morehtmlref = '
';
/*
@@ -156,7 +156,7 @@ if ($object->id > 0) {
if ($user->rights->bom->creer)
{
if ($action != 'classify')
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref.=' : ';
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/bom/bom_card.php b/htdocs/bom/bom_card.php
index 235336d4f73..ed55f7cf29c 100644
--- a/htdocs/bom/bom_card.php
+++ b/htdocs/bom/bom_card.php
@@ -71,6 +71,9 @@ if (empty($action) && empty($id) && empty($ref)) {
// Load object
include DOL_DOCUMENT_ROOT.'/core/actions_fetchobject.inc.php'; // Must be include, not include_once.
+if ($object->id > 0) {
+ $object->calculateCosts();
+}
// Security check - Protection if external user
//if ($user->socid > 0) accessforbidden();
@@ -105,7 +108,7 @@ if (empty($reshook)) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = dol_buildpath('/bom/bom_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/bom/bom_card.php?id='.($id > 0 ? $id : '__ID__');
}
}
}
@@ -305,8 +308,6 @@ if (($id || $ref) && $action == 'edit') {
// Part to show record
if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'create'))) {
- $res = $object->fetch_optionals();
-
$head = bomPrepareHead($object);
print dol_get_fiche_head($head, 'card', $langs->trans("BillOfMaterials"), -1, 'bom');
@@ -450,7 +451,7 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
// Object card
// ------------------------------------------------------------
- $linkback = '
'.$langs->trans("BackToList").' ';
+ $linkback = '
'.$langs->trans("BackToList").' ';
$morehtmlref = '
';
}
diff --git a/htdocs/bom/bom_document.php b/htdocs/bom/bom_document.php
index dd0227e4305..c36ac32bb59 100644
--- a/htdocs/bom/bom_document.php
+++ b/htdocs/bom/bom_document.php
@@ -125,7 +125,7 @@ if ($object->id) {
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, 1, 'ref', 'ref', $morehtmlref);
diff --git a/htdocs/bom/bom_note.php b/htdocs/bom/bom_note.php
index f456e7ddf98..8ace40cc900 100644
--- a/htdocs/bom/bom_note.php
+++ b/htdocs/bom/bom_note.php
@@ -100,7 +100,7 @@ if ($id > 0 || !empty($ref)) {
// Object card
// ------------------------------------------------------------
- $linkback = ''.$langs->trans("BackToList").' ';
+ $linkback = ''.$langs->trans("BackToList").' ';
$morehtmlref = '';
diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php
index de8c87bcd43..a4ab56c2a66 100644
--- a/htdocs/bom/class/bom.class.php
+++ b/htdocs/bom/class/bom.class.php
@@ -98,7 +98,7 @@ class BOM extends CommonObject
'entity' => array('type'=>'integer', 'label'=>'Entity', 'enabled'=>1, 'visible'=>0, 'notnull'=> 1, 'default'=>1, 'index'=>1, 'position'=>5),
'ref' => array('type'=>'varchar(128)', 'label'=>'Ref', 'enabled'=>1, 'noteditable'=>1, 'visible'=>4, 'position'=>10, 'notnull'=>1, 'default'=>'(PROV)', 'index'=>1, 'searchall'=>1, 'comment'=>"Reference of BOM", 'showoncombobox'=>'1',),
'label' => array('type'=>'varchar(255)', 'label'=>'Label', 'enabled'=>1, 'visible'=>1, 'position'=>30, 'notnull'=>1, 'searchall'=>1, 'showoncombobox'=>'2', 'autofocusoncreate'=>1, 'css'=>'maxwidth300', 'csslist'=>'tdoverflowmax200'),
- 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth150', 'csslist'=>'minwidth150 center'),
+ 'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>1, 'position'=>33, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing', 1=>'Disassemble'), 'css'=>'minwidth175', 'csslist'=>'minwidth175 center'),
//'bomtype' => array('type'=>'integer', 'label'=>'Type', 'enabled'=>1, 'visible'=>-1, 'position'=>32, 'notnull'=>1, 'default'=>'0', 'arrayofkeyval'=>array(0=>'Manufacturing')),
'fk_product' => array('type'=>'integer:Product:product/class/product.class.php:1:(finished IS NULL or finished <> 0)', 'label'=>'Product', 'picto'=>'product', 'enabled'=>1, 'visible'=>1, 'position'=>35, 'notnull'=>1, 'index'=>1, 'help'=>'ProductBOMHelp', 'css'=>'maxwidth500', 'csslist'=>'tdoverflowmax100'),
'description' => array('type'=>'text', 'label'=>'Description', 'enabled'=>1, 'visible'=>-1, 'position'=>60, 'notnull'=>-1,),
@@ -381,7 +381,7 @@ class BOM extends CommonObject
if ($result > 0 && !empty($this->table_element_line)) {
$this->fetchLines();
}
- $this->calculateCosts();
+ //$this->calculateCosts(); // This consume a high number of subrequests. Do not call it into fetch but when you need it.
return $result;
}
@@ -1035,7 +1035,8 @@ class BOM extends CommonObject
}
/**
- * BOM costs calculation based on cost_price or pmp of each BOM line
+ * BOM costs calculation based on cost_price or pmp of each BOM line.
+ * Set the property ->total_cost and ->unit_cost of BOM.
*
* @return void
*/
@@ -1045,30 +1046,36 @@ class BOM extends CommonObject
$this->unit_cost = 0;
$this->total_cost = 0;
- require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
- $productFournisseur = new ProductFournisseur($this->db);
-
- foreach ($this->lines as &$line) {
+ if (is_array($this->lines) && count($this->lines)) {
+ require_once DOL_DOCUMENT_ROOT.'/fourn/class/fournisseur.product.class.php';
+ $productFournisseur = new ProductFournisseur($this->db);
$tmpproduct = new Product($this->db);
- $result = $tmpproduct->fetch($line->fk_product);
- if ($result < 0) {
- $this->error = $tmpproduct->error;
- return -1;
- }
- $line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
- if (empty($line->unit_cost)) {
- if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
- $line->unit_cost = $productFournisseur->fourn_unitprice;
+
+ foreach ($this->lines as &$line) {
+ $tmpproduct->cost_price = 0;
+ $tmpproduct->pmp = 0;
+
+ $result = $tmpproduct->fetch($line->fk_product, '', '', '', 0, 1, 1); // We discard selling price and language loading
+ if ($result < 0) {
+ $this->error = $tmpproduct->error;
+ return -1;
}
+ $line->unit_cost = price2num((!empty($tmpproduct->cost_price)) ? $tmpproduct->cost_price : $tmpproduct->pmp);
+ if (empty($line->unit_cost)) {
+ if ($productFournisseur->find_min_price_product_fournisseur($line->fk_product) > 0) {
+ $line->unit_cost = $productFournisseur->fourn_unitprice;
+ }
+ }
+
+ $line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
+
+ $this->total_cost += $line->total_cost;
}
- $line->total_cost = price2num($line->qty * $line->unit_cost, 'MT');
- $this->total_cost += $line->total_cost;
- }
-
- $this->total_cost = price2num($this->total_cost, 'MT');
- if ($this->qty) {
- $this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
+ $this->total_cost = price2num($this->total_cost, 'MT');
+ if ($this->qty) {
+ $this->unit_cost = price2num($this->total_cost / $this->qty, 'MU');
+ }
}
}
}
@@ -1383,7 +1390,7 @@ class BOMLine extends CommonObjectLine
$label .= '
';
$label .= '
'.$langs->trans('Ref').': '.$this->ref;
- $url = dol_buildpath('/bom/bomline_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/bom/bomline_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/bom/tpl/linkedobjectblock.tpl.php b/htdocs/bom/tpl/linkedobjectblock.tpl.php
index fcba37105d3..946563f7b81 100644
--- a/htdocs/bom/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/bom/tpl/linkedobjectblock.tpl.php
@@ -73,7 +73,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo '
';
// For now, shipments must stay linked to order, so link is not deletable
if ($object->element != 'shipping') {
- echo 'id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
+ echo 'id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
}
echo ' ';
echo "\n";
diff --git a/htdocs/bom/tpl/objectline_view.tpl.php b/htdocs/bom/tpl/objectline_view.tpl.php
index fff9d077a08..2c3896a6282 100644
--- a/htdocs/bom/tpl/objectline_view.tpl.php
+++ b/htdocs/bom/tpl/objectline_view.tpl.php
@@ -129,7 +129,7 @@ if ($this->status == 0 && ($object_rights->write) && $action != 'selectlines') {
$coldisplay++;
if (($line->fk_prev_id == null) && empty($disableremove)) {
//La suppression n'est autorisée que si il n'y a pas de ligne dans une précédente situation
- print '
id.'&action=deleteline&token='.newToken().'&lineid='.$line->id.'">';
+ print ' id.'&action=deleteline&token='.newToken().'&lineid='.$line->id.'">';
print img_delete();
print ' ';
}
diff --git a/htdocs/bookmarks/card.php b/htdocs/bookmarks/card.php
index 045e656de50..839ce4c3f86 100644
--- a/htdocs/bookmarks/card.php
+++ b/htdocs/bookmarks/card.php
@@ -313,12 +313,12 @@ if ($id > 0 && !preg_match('/^add/i', $action)) {
// Edit
if ($user->rights->bookmark->creer && $action != 'edit') {
- print '
id.'&action=edit&token='.newToken().'">'.$langs->trans("Edit").' '."\n";
+ print '
id.'&action=edit&token='.newToken().'">'.$langs->trans("Edit").' '."\n";
}
// Remove
if ($user->rights->bookmark->supprimer && $action != 'edit') {
- print '
'.$langs->trans("Delete").' '."\n";
+ print '
'.$langs->trans("Delete").' '."\n";
}
print '
';
diff --git a/htdocs/categories/admin/categorie.php b/htdocs/categories/admin/categorie.php
index bddeb9a771a..02e6892b571 100644
--- a/htdocs/categories/admin/categorie.php
+++ b/htdocs/categories/admin/categorie.php
@@ -101,9 +101,9 @@ if ($conf->use_javascript_ajax) {
print ajax_constantonoff('CATEGORIE_RECURSIV_ADD');
} else {
if (empty($conf->global->CATEGORIE_RECURSIV_ADD)) {
- print ''.img_picto($langs->trans("Disabled"), 'off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'off').' ';
} else {
- print ''.img_picto($langs->trans("Enabled"), 'on').' ';
+ print ''.img_picto($langs->trans("Enabled"), 'on').' ';
}
}
print '';
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index ba5515149d4..d5c135279bf 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -58,6 +58,7 @@ class Categorie extends CommonObject
const TYPE_ACTIONCOMM = 'actioncomm';
const TYPE_WEBSITE_PAGE = 'website_page';
const TYPE_TICKET = 'ticket';
+ const TYPE_KNOWLEDGEMANAGEMENT = 'knowledgemanagement';
/**
* @var string String with name of icon for myobject. Must be the part after the 'object_' into object_myobject.png
@@ -81,7 +82,8 @@ class Categorie extends CommonObject
'warehouse' => 9,
'actioncomm' => 10,
'website_page' => 11,
- 'ticket' => 12
+ 'ticket' => 12,
+ 'knowledgemanagement' => 13
);
/**
@@ -102,7 +104,8 @@ class Categorie extends CommonObject
9 => 'warehouse',
10 => 'actioncomm',
11 => 'website_page',
- 12 => 'ticket'
+ 12 => 'ticket',
+ 13 => 'knowledgemanagement'
);
/**
@@ -146,7 +149,8 @@ class Categorie extends CommonObject
'warehouse'=> 'Entrepot',
'actioncomm' => 'ActionComm',
'website_page' => 'WebsitePage',
- 'ticket' => 'Ticket'
+ 'ticket' => 'Ticket',
+ 'knowledgemanagement' => 'KnowledgeRecord'
);
/**
diff --git a/htdocs/categories/photos.php b/htdocs/categories/photos.php
index 5fb1c85dd40..06c3caae43c 100644
--- a/htdocs/categories/photos.php
+++ b/htdocs/categories/photos.php
@@ -234,7 +234,7 @@ if ($object->id) {
print 'id.'&action=addthumb&type='.$type.'&file='.urlencode($pdir.$viewfilename).'">'.img_picto($langs->trans('GenerateThumb'), 'refresh').' ';
}
if ($user->rights->categorie->creer) {
- print 'id.'&action=delete&token='.newToken().'&type='.$type.'&file='.urlencode($pdir.$viewfilename).'">';
+ print ' id.'&action=delete&token='.newToken().'&type='.$type.'&file='.urlencode($pdir.$viewfilename).'">';
print img_delete().' ';
}
if ($nbbyrow) {
diff --git a/htdocs/comm/action/card.php b/htdocs/comm/action/card.php
index e4ceccdb3fc..8a10b39826f 100644
--- a/htdocs/comm/action/card.php
+++ b/htdocs/comm/action/card.php
@@ -278,8 +278,20 @@ if (empty($reshook) && $action == 'add') {
$object->fulldayevent = (!empty($fulldayevent) ? 1 : 0);
$object->location = GETPOST("location", 'alphanohtml');
$object->label = GETPOST('label', 'alphanohtml');
- $object->fk_element = GETPOST("fk_element", 'int');
- $object->elementtype = GETPOST("elementtype", 'alpha');
+
+ if (GETPOST("elementtype", 'alpha')) {
+ $modulecodetouseforpermissioncheck = GETPOST("elementtype", 'alpha');
+
+ $hasPermissionOnLinkedObject = 0;
+ if ($user->hasRight($modulecodetouseforpermissioncheck, 'read')) {
+ $hasPermissionOnLinkedObject = 1;
+ }
+ if ($hasPermissionOnLinkedObject) {
+ $object->fk_element = GETPOST("fk_element", 'int');
+ $object->elementtype = GETPOST("elementtype", 'alpha');
+ }
+ }
+
if (!GETPOST('label')) {
if (GETPOST('actioncode', 'aZ09') == 'AC_RDV' && $contact->getFullName($langs)) {
$object->label = $langs->transnoentitiesnoconv("TaskRDVWith", $contact->getFullName($langs));
@@ -520,8 +532,20 @@ if (empty($reshook) && $action == 'update') {
}
$object->fk_project = GETPOST("projectid", 'int');
$object->note_private = trim(GETPOST("note", "restricthtml"));
- $object->fk_element = GETPOST("fk_element", "int");
- $object->elementtype = GETPOST("elementtype", "alphanohtml");
+
+ if (GETPOST("elementtype", 'alpha')) {
+ $modulecodetouseforpermissioncheck = GETPOST("elementtype", 'alpha');
+
+ $hasPermissionOnLinkedObject = 0;
+ if ($user->hasRight($modulecodetouseforpermissioncheck, 'read')) {
+ $hasPermissionOnLinkedObject = 1;
+ }
+ if ($hasPermissionOnLinkedObject) {
+ $object->fk_element = GETPOST("fk_element", 'int');
+ $object->elementtype = GETPOST("elementtype", 'alpha');
+ }
+ }
+
if (!$datef && $percentage == 100) {
$error++; $donotclearsession = 1;
setEventMessages($langs->transnoentitiesnoconv("ErrorFieldRequired", $langs->transnoentitiesnoconv("DateEnd")), $object->errors, 'errors');
@@ -1191,7 +1215,7 @@ if ($action == 'create') {
print img_picto('', 'project', 'class="pictofixedwidth"');
print $formproject->select_projects((empty($societe->id) ? '' : $societe->id), $projectid, 'projectid', 0, 0, 1, 1, 0, 0, 0, '', 1, 0, 'maxwidth500 widthcentpercentminusxx');
- print ' ';
+ print ' ';
print ' ';
$urloption = '?action=create&donotclearsession=1';
$url = dol_buildpath('comm/action/card.php', 2).$urloption;
@@ -1218,7 +1242,7 @@ if ($action == 'create') {
if (!empty($projectid)) {
$projectsListId = $projectid;
}
- $tid = GETPOST("projecttaskid") ? GETPOST("projecttaskid") : '';
+ $tid = GETPOSTISSET("projecttaskid") ? GETPOST("projecttaskid", 'int') : (GETPOSTISSET("taskid") ? GETPOST("taskid", 'int') : '');
$formproject->selectTasks((!empty($societe->id) ? $societe->id : -1), $tid, 'taskid', 24, 0, '1', 1, 0, 0, 'maxwidth500', $projectsListId);
print '';
}
@@ -1226,12 +1250,28 @@ if ($action == 'create') {
// Object linked
if (!empty($origin) && !empty($originid)) {
include_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
- print ''.$langs->trans("LinkedObject").' ';
- print ''.dolGetElementUrl($originid, $origin, 1).' ';
- print ' ';
- print ' ';
- print ' ';
- print ' ';
+
+ $hasPermissionOnLinkedObject = 0;
+ if ($user->hasRight($origin, 'read')) {
+ $hasPermissionOnLinkedObject = 1;
+ }
+ //var_dump('origin='.$origin.' originid='.$originid.' $hasPermissionOnLinkedObject='.$hasPermissionOnLinkedObject);
+
+ if (! in_array($origin, array('societe', 'project', 'task', 'user'))) {
+ // We do not use link for object that already contains a hard coded field to make links with agenda events
+ print ''.$langs->trans("LinkedObject").' ';
+ print '';
+ if ($hasPermissionOnLinkedObject) {
+ print dolGetElementUrl($originid, $origin, 1);
+ print ' ';
+ print ' ';
+ print ' ';
+ print ' ';
+ } else {
+ print '';
+ }
+ print ' ';
+ }
}
$reg = array();
@@ -1847,7 +1887,7 @@ if ($id > 0) {
if ($user->rights->agenda->allactions->create ||
(($object->authorid == $user->id || $object->userownerid == $user->id) && $user->rights->agenda->myactions->create)) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php
index df73c6a70f7..79fb13a8717 100644
--- a/htdocs/comm/action/class/actioncomm.class.php
+++ b/htdocs/comm/action/class/actioncomm.class.php
@@ -735,13 +735,14 @@ class ActionComm extends CommonObject
/**
* Load object from database
*
- * @param int $id Id of action to get
- * @param string $ref Ref of action to get
- * @param string $ref_ext Ref ext to get
- * @param string $email_msgid Email msgid
- * @return int <0 if KO, >0 if OK
+ * @param int $id Id of action to get
+ * @param string $ref Ref of action to get
+ * @param string $ref_ext Ref ext to get
+ * @param string $email_msgid Email msgid
+ * @param string $loadresources 1=Load also resources
+ * @return int <0 if KO, >0 if OK
*/
- public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '')
+ public function fetch($id, $ref = '', $ref_ext = '', $email_msgid = '', $loadresources = 1)
{
global $langs;
@@ -858,7 +859,11 @@ class ActionComm extends CommonObject
$this->event_paid = $obj->event_paid;
$this->status = $obj->status;
- $this->fetchResources();
+ $this->fetch_optionals();
+
+ if ($loadresources) {
+ $this->fetchResources();
+ }
}
$this->db->free($resql);
} else {
diff --git a/htdocs/comm/mailing/card.php b/htdocs/comm/mailing/card.php
index 8b97f23737e..dbfbc84b69f 100644
--- a/htdocs/comm/mailing/card.php
+++ b/htdocs/comm/mailing/card.php
@@ -952,18 +952,18 @@ if ($action == 'create') {
print "\n\n\n";
if (($object->statut == 1) && ($user->rights->mailing->valider || $object->fk_user_valid == $user->id)) {
- print '
'.$langs->trans("SetToDraft").' ';
+ print '
'.$langs->trans("SetToDraft").' ';
}
if (($object->statut == 0 || $object->statut == 1 || $object->statut == 2) && $user->rights->mailing->creer) {
if (!empty($conf->fckeditor->enabled) && !empty($conf->global->FCKEDITOR_ENABLE_MAILING)) {
- print '
'.$langs->trans("EditWithEditor").' ';
+ print '
'.$langs->trans("EditWithEditor").' ';
} else {
- print '
'.$langs->trans("EditWithTextEditor").' ';
+ print '
'.$langs->trans("EditWithTextEditor").' ';
}
if (!empty($conf->use_javascript_ajax)) {
- print '
'.$langs->trans("EditHTMLSource").' ';
+ print '
'.$langs->trans("EditHTMLSource").' ';
}
}
@@ -972,7 +972,7 @@ if ($action == 'create') {
if (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->send) {
print '
'.$langs->trans("TestMailing").' ';
} else {
- print '
'.$langs->trans("TestMailing").' ';
+ print '
'.$langs->trans("TestMailing").' ';
}
if ($object->statut == 0) {
@@ -1011,7 +1011,7 @@ if ($action == 'create') {
if ($object->statut > 0 && (!empty($conf->global->MAIN_USE_ADVANCED_PERMS) && !$user->rights->mailing->mailing_advance->delete)) {
print '
'.$langs->trans("DeleteMailing").' ';
} else {
- print '
'.$langs->trans("DeleteMailing").' ';
+ print '
'.$langs->trans("DeleteMailing").' ';
}
}
diff --git a/htdocs/comm/propal/card.php b/htdocs/comm/propal/card.php
index 656d370d6d5..72eee9c22df 100644
--- a/htdocs/comm/propal/card.php
+++ b/htdocs/comm/propal/card.php
@@ -2011,7 +2011,7 @@ if ($action == 'create') {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -2544,7 +2544,7 @@ if ($action == 'create') {
// ReOpen
if ( (( ! empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && $object->statut == Propal::STATUS_NOTSIGNED) || (empty($conf->global->PROPAL_REOPEN_UNSIGNED_ONLY) && ($object->statut == Propal::STATUS_SIGNED || $object->statut == Propal::STATUS_NOTSIGNED || $object->statut == Propal::STATUS_BILLED))) && $usercanclose) {
- print '
id.'&action=reopen'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#reopen').'"';
+ print ' id.'&action=reopen&token='.newToken().(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#reopen').'"';
print '>'.$langs->trans('ReOpen').' ';
}
@@ -2552,7 +2552,7 @@ if ($action == 'create') {
if (empty($user->socid)) {
if ($object->statut == Propal::STATUS_VALIDATED || $object->statut == Propal::STATUS_SIGNED || !empty($conf->global->PROPOSAL_SENDBYEMAIL_FOR_ALL_STATUS)) {
if ($usercansend) {
- print '
id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').' ';
+ print '
id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').' ';
} else {
print '
'.$langs->trans('SendMail').' ';
}
@@ -2595,13 +2595,13 @@ if ($action == 'create') {
// Create an invoice and classify billed
if ($object->statut == Propal::STATUS_SIGNED && empty($conf->global->PROPOSAL_ARE_NOT_BILLABLE)) {
if (!empty($conf->facture->enabled) && $usercancreateinvoice) {
- print '
'.$langs->trans("AddBill").' ';
+ print '
'.$langs->trans("CreateBill").' ';
}
$arrayofinvoiceforpropal = $object->getInvoiceArrayList();
if ((is_array($arrayofinvoiceforpropal) && count($arrayofinvoiceforpropal) > 0) || empty($conf->global->WORKFLOW_PROPAL_NEED_INVOICE_TO_BE_CLASSIFIED_BILLED)) {
if ($usercanclose) {
- print '
id.'&action=classifybilled&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").' ';
+ print '
id.'&action=classifybilled&token='.newToken().'&socid='.$object->socid.'">'.$langs->trans("ClassifyBilled").' ';
} else {
print '
'.$langs->trans("ClassifyBilled").' ';
}
@@ -2611,7 +2611,7 @@ if ($action == 'create') {
// Close as accepted/refused
if ($object->statut == Propal::STATUS_VALIDATED) {
if ($usercanclose) {
- print '
id.'&action=closeas'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
+ print ' id.'&action=closeas&token='.newToken().(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#close').'"';
print '>'.$langs->trans('SetAcceptedRefused').' ';
} else {
print '
'.$langs->trans("ToClone").' ';
+ print '
'.$langs->trans("ToClone").' ';
}
// Delete
if ($usercandelete) {
- print '
id.'&action=delete&token='.newToken().'"';
+ print ' id.'&action=delete&token='.newToken().'"';
print '>'.$langs->trans('Delete').' ';
}
}
diff --git a/htdocs/comm/propal/contact.php b/htdocs/comm/propal/contact.php
index 61a14ab62d8..69876476907 100644
--- a/htdocs/comm/propal/contact.php
+++ b/htdocs/comm/propal/contact.php
@@ -148,7 +148,7 @@ if ($object->id > 0) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/comm/propal/document.php b/htdocs/comm/propal/document.php
index a60f892274c..e1e9eec4ee4 100644
--- a/htdocs/comm/propal/document.php
+++ b/htdocs/comm/propal/document.php
@@ -141,7 +141,7 @@ if ($object->id > 0) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/comm/propal/info.php b/htdocs/comm/propal/info.php
index 798dc87bcfd..5a8d2b2294c 100644
--- a/htdocs/comm/propal/info.php
+++ b/htdocs/comm/propal/info.php
@@ -88,7 +88,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index ff8a583b0ef..bff848c78e2 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -316,13 +316,14 @@ if ($action == 'validate' && $permissiontovalidate) {
if ($tmpproposal->fetch($checked)) {
if ($tmpproposal->statut == 0) {
if ($tmpproposal->valid($user)) {
- setEventMessage($tmpproposal->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
+ setEventMessage($langs->trans('hasBeenValidated', $tmpproposal->ref), 'mesgs');
} else {
setEventMessage($langs->trans('CantBeValidated'), 'errors');
$error++;
}
} else {
- setEventMessage($tmpproposal->ref." ".$langs->trans('IsNotADraft'), 'errors');
+ $langs->load("errors");
+ setEventMessage($langs->trans('ErrorIsNotADraft', $tmpproposal->ref), 'errors');
$error++;
}
} else {
diff --git a/htdocs/comm/propal/note.php b/htdocs/comm/propal/note.php
index 53a3a37c84d..c46fb7a67b2 100644
--- a/htdocs/comm/propal/note.php
+++ b/htdocs/comm/propal/note.php
@@ -112,7 +112,7 @@ if ($object->id > 0) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->propal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
index 23c1a459c74..829effed6a2 100644
--- a/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/comm/propal/tpl/linkedobjectblock.tpl.php
@@ -68,7 +68,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
}
print '';
print '
'.$objectlink->getLibStatut(3).' ';
- print '
id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
+ print '
id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
print "\n";
}
if (count($linkedObjectBlock) > 1) {
diff --git a/htdocs/commande/card.php b/htdocs/commande/card.php
index 3aaa79cab55..2e37cdcd0a1 100644
--- a/htdocs/commande/card.php
+++ b/htdocs/commande/card.php
@@ -2041,7 +2041,7 @@ if ($action == 'create' && $usercancreate) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -2485,14 +2485,14 @@ if ($action == 'create' && $usercancreate) {
if (empty($reshook)) {
// Reopen a closed order
if (($object->statut == Commande::STATUS_CLOSED || $object->statut == Commande::STATUS_CANCELED) && $usercancreate) {
- print '
'.$langs->trans('ReOpen').' ';
+ print '
'.$langs->trans('ReOpen').' ';
}
// Send
if (empty($user->socid)) {
if ($object->statut > Commande::STATUS_DRAFT || !empty($conf->global->COMMANDE_SENDBYEMAIL_FOR_ALL_STATUS)) {
if ($usercansend) {
- print '
id.'&action=presend&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').' ';
+ print '
id.'&action=presend&token='.newToken().'&mode=init#formmailbeforetitle">'.$langs->trans('SendMail').' ';
} else {
print '
'.$langs->trans('SendMail').' ';
}
@@ -2574,31 +2574,31 @@ if ($action == 'create' && $usercancreate) {
// Note: Even if module invoice is not enabled, we should be able to use button "Classified billed"
if ($object->statut > Commande::STATUS_DRAFT && !$object->billed && $object->total_ttc >= 0) {
if (!empty($conf->facture->enabled) && $user->rights->facture->creer && empty($conf->global->WORKFLOW_DISABLE_CREATE_INVOICE_FROM_ORDER)) {
- print '
'.$langs->trans("CreateBill").' ';
+ print '
'.$langs->trans("CreateBill").' ';
}
if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) {
- print '
id.'&action=classifybilled">'.$langs->trans("ClassifyBilled").' ';
+ print '
id.'&action=classifybilled&token='.newToken().'">'.$langs->trans("ClassifyBilled").' ';
}
}
if ($object->statut > Commande::STATUS_DRAFT && $object->billed) {
if ($usercancreate && $object->statut >= Commande::STATUS_VALIDATED && empty($conf->global->WORKFLOW_DISABLE_CLASSIFY_BILLED_FROM_ORDER) && empty($conf->global->WORKFLOW_BILL_ON_SHIPMENT)) {
- print '
id.'&action=classifyunbilled">'.$langs->trans("ClassifyUnBilled").' ';
+ print '
id.'&action=classifyunbilled&token='.newToken().'">'.$langs->trans("ClassifyUnBilled").' ';
}
}
// Clone
if ($usercancreate) {
- print '
'.$langs->trans("ToClone").' ';
+ print '
'.$langs->trans("ToClone").' ';
}
// Cancel order
if ($object->statut == Commande::STATUS_VALIDATED && (!empty($usercanclose) || !empty($usercancancel))) {
- print '
id.'&action=cancel">'.$langs->trans("Cancel").' ';
+ print '
id.'&action=cancel&token='.newToken().'">'.$langs->trans("Cancel").' ';
}
// Delete order
if ($usercandelete) {
if ($numshipping == 0) {
- print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' ';
+ print '
id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' ';
} else {
print '
'.$langs->trans("Delete").' ';
}
diff --git a/htdocs/commande/contact.php b/htdocs/commande/contact.php
index 0a44d87f4ae..5b9705209c5 100644
--- a/htdocs/commande/contact.php
+++ b/htdocs/commande/contact.php
@@ -143,7 +143,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/commande/document.php b/htdocs/commande/document.php
index f8cc503e0ec..7eb835fe938 100644
--- a/htdocs/commande/document.php
+++ b/htdocs/commande/document.php
@@ -135,7 +135,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/commande/info.php b/htdocs/commande/info.php
index 2e5f0b696ff..d9221096392 100644
--- a/htdocs/commande/info.php
+++ b/htdocs/commande/info.php
@@ -88,7 +88,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index d91638fcf52..22b24c048a2 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -309,13 +309,14 @@ if ($action == 'validate' && $permissiontoadd) {
$idwarehouse = 0;
}
if ($objecttmp->valid($user, $idwarehouse)) {
- setEventMessage($objecttmp->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
+ setEventMessage($langs->trans('hasBeenValidated', $objecttmp->ref), 'mesgs');
} else {
setEventMessage($langs->trans('CantBeValidated'), 'errors');
$error++;
}
} else {
- setEventMessage($objecttmp->ref." ".$langs->trans('IsNotADraft'), 'errors');
+ $langs->load("errors");
+ setEventMessage($langs->trans('ErrorIsNotADraft', $objecttmp->ref), 'errors');
$error++;
}
} else {
@@ -339,13 +340,14 @@ if ($action == 'shipped' && $permissiontoadd) {
if ($objecttmp->fetch($checked)) {
if ($objecttmp->statut == 1) {
if ($objecttmp->cloture($user)) {
- setEventMessage($objecttmp->ref." ".$langs->trans('PassedInOpenStatus'), 'mesgs');
+ setEventMessage($langs->trans('PassedInClosedStatus', $objecttmp->ref), 'mesgs');
} else {
- setEventMessage($langs->trans('CantBeValidated'), 'errors');
+ setEventMessage($langs->trans('CantBeClosed'), 'errors');
$error++;
}
} else {
- setEventMessage($objecttmp->ref." ".$langs->trans('IsNotADraft'), 'errors');
+ $langs->load("errors");
+ setEventMessage($langs->trans('ErrorIsNotADraft', $objecttmp->ref), 'errors');
$error++;
}
} else {
diff --git a/htdocs/commande/note.php b/htdocs/commande/note.php
index e03d9c00edb..c3218c8cbe8 100644
--- a/htdocs/commande/note.php
+++ b/htdocs/commande/note.php
@@ -107,7 +107,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->commande->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/commande/tpl/linkedobjectblock.tpl.php b/htdocs/commande/tpl/linkedobjectblock.tpl.php
index a0641c4c493..211702059cb 100644
--- a/htdocs/commande/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/commande/tpl/linkedobjectblock.tpl.php
@@ -64,7 +64,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo '
';
// For now, shipments must stay linked to order, so link is not deletable
if ($object->element != 'shipping') {
- echo 'id.'&action=dellink&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
+ echo 'id.'&action=dellink&token='.newToken().'&dellinkid='.$key.'">'.img_picto($langs->transnoentitiesnoconv("RemoveLink"), 'unlink').' ';
}
echo ' ';
echo "\n";
diff --git a/htdocs/compta/bank/bankentries_list.php b/htdocs/compta/bank/bankentries_list.php
index e5e264a12f5..f6a03c1d11d 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 ' ';
@@ -1683,7 +1683,7 @@ if ($resql) {
}
}
if ($user->rights->banque->modifier) {
- print '
rowid.'&id='.$objp->bankid.'&page='.$page.'">';
+ print ' rowid.'&id='.$objp->bankid.'&page='.$page.'">';
print img_delete('', 'class="marginleftonly"');
print ' ';
}
diff --git a/htdocs/compta/bank/categ.php b/htdocs/compta/bank/categ.php
index 403caa6cdfd..2605bc39d30 100644
--- a/htdocs/compta/bank/categ.php
+++ b/htdocs/compta/bank/categ.php
@@ -146,8 +146,8 @@ if ($result) {
//print '
'.$langs->trans("List").' ';
print '';
print '
';
- print 'rowid.'&action=edit&token='.newToken().'">'.img_edit().' ';
- print 'rowid.'&action=delete&token='.newToken().'">'.img_delete().' ';
+ print 'rowid.'&action=edit&token='.newToken().'">'.img_edit().' ';
+ print 'rowid.'&action=delete&token='.newToken().'">'.img_delete().' ';
print ' ';
}
print "";
diff --git a/htdocs/compta/bank/various_payment/card.php b/htdocs/compta/bank/various_payment/card.php
index 68c6ed20458..3b078698728 100644
--- a/htdocs/compta/bank/various_payment/card.php
+++ b/htdocs/compta/bank/various_payment/card.php
@@ -555,7 +555,7 @@ if ($id) {
$morehtmlref .= $langs->trans('Project').' ';
if ($user->rights->banque->modifier) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/compta/bank/various_payment/document.php b/htdocs/compta/bank/various_payment/document.php
index 1b5fd5fd383..5f55f4c2559 100644
--- a/htdocs/compta/bank/various_payment/document.php
+++ b/htdocs/compta/bank/various_payment/document.php
@@ -99,7 +99,7 @@ if ($object->id) {
$morehtmlref .= $langs->trans('Project').' : ';
if ($user->rights->banque->modifier && 0) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/compta/bank/various_payment/info.php b/htdocs/compta/bank/various_payment/info.php
index b173426e179..e50dc10ff7f 100644
--- a/htdocs/compta/bank/various_payment/info.php
+++ b/htdocs/compta/bank/various_payment/info.php
@@ -62,7 +62,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= $langs->trans('Project').' : ';
if ($user->rights->banque->modifier && 0) {
if ($action != 'classify') {
- $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= '
'.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/compta/cashcontrol/cashcontrol_card.php b/htdocs/compta/cashcontrol/cashcontrol_card.php
index 26949590334..eebe3e4832f 100644
--- a/htdocs/compta/cashcontrol/cashcontrol_card.php
+++ b/htdocs/compta/cashcontrol/cashcontrol_card.php
@@ -107,9 +107,9 @@ if (!$user->rights->cashdesk->run && !$user->rights->takepos->run) {
$permissiontoadd = ($user->rights->cashdesk->run || $user->rights->takepos->run);
$permissiontodelete = ($user->rights->cashdesk->run || $user->rights->takepos->run) || ($permissiontoadd && $object->status == 0);
if (empty($backtopage)) {
- $backtopage = dol_buildpath('/compta/cashcontrol/cashcontrol_card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_card.php?id='.($id > 0 ? $id : '__ID__');
}
-$backurlforlist = dol_buildpath('/compta/cashcontrol/cashcontrol_list.php', 1);
+$backurlforlist = DOL_URL_ROOT.'/compta/cashcontrol/cashcontrol_list.php';
$triggermodname = 'CACHCONTROL_MODIFY'; // Name of trigger action code to execute when we modify record
if (empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH) && empty($conf->global->CASHDESK_ID_BANKACCOUNT_CASH1)) {
@@ -679,11 +679,11 @@ if (empty($action) || $action == "view" || $action == "close") {
print '
';
if ($object->status == CashControl::STATUS_DRAFT) {
- print '
';
+ print '
';
- print '
';
+ print '
';
} else {
- print '
';
+ print '
';
}
print '
';
diff --git a/htdocs/compta/deplacement/card.php b/htdocs/compta/deplacement/card.php
index 6f390e82552..77db777c077 100644
--- a/htdocs/compta/deplacement/card.php
+++ b/htdocs/compta/deplacement/card.php
@@ -431,7 +431,7 @@ if ($action == 'create') {
print $langs->trans('Project');
print '';
if ($action != 'classify' && $user->rights->deplacement->creer) {
- print 'id.'">';
+ print ' id.'">';
print img_edit($langs->trans('SetProject'), 1);
print ' ';
}
@@ -485,7 +485,7 @@ if ($action == 'create') {
if ($object->statut == Deplacement::STATUS_VALIDATED) { // if validated
if ($user->rights->deplacement->creer) {
- print ''.$langs->trans('ClassifyRefunded').' ';
+ print ''.$langs->trans('ClassifyRefunded').' ';
} else {
print ''.$langs->trans('ClassifyRefunded').' ';
}
diff --git a/htdocs/compta/facture/card-rec.php b/htdocs/compta/facture/card-rec.php
index 99e09130011..153bd58114d 100644
--- a/htdocs/compta/facture/card-rec.php
+++ b/htdocs/compta/facture/card-rec.php
@@ -1201,7 +1201,7 @@ if ($action == 'create') {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->facture->creer) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
diff --git a/htdocs/compta/facture/card.php b/htdocs/compta/facture/card.php
index 99bf843f50b..105c94d6a73 100644
--- a/htdocs/compta/facture/card.php
+++ b/htdocs/compta/facture/card.php
@@ -4202,7 +4202,7 @@ if ($action == 'create') {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -4673,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/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_graph_invoices_peryear.php b/htdocs/core/boxes/box_graph_invoices_peryear.php
new file mode 100644
index 00000000000..14a431bcb84
--- /dev/null
+++ b/htdocs/core/boxes/box_graph_invoices_peryear.php
@@ -0,0 +1,215 @@
+
+ *
+ * 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
+ * the Free Software Foundation; either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see .
+ */
+
+/**
+ * \file htdocs/core/boxes/box_graph_invoices_peryear.php
+ * \ingroup factures
+ * \brief Box to show graph of invoices per year
+ */
+include_once DOL_DOCUMENT_ROOT.'/core/boxes/modules_boxes.php';
+
+
+/**
+ * Class to manage the box to show last invoices
+ */
+class box_graph_invoices_peryear extends ModeleBoxes
+{
+ public $boxcode = "invoicesperyear";
+ public $boximg = "object_bill";
+ public $boxlabel = "BoxCustomersInvoicesPerYear";
+ public $depends = array("facture");
+
+ /**
+ * @var DoliDB Database handler.
+ */
+ public $db;
+
+ public $info_box_head = array();
+ public $info_box_contents = array();
+
+
+ /**
+ * Constructor
+ *
+ * @param DoliDB $db Database handler
+ * @param string $param More parameters
+ */
+ public function __construct($db, $param)
+ {
+ global $user;
+
+ $this->db = $db;
+
+ $this->hidden = !($user->rights->facture->lire);
+ }
+
+ /**
+ * Load data into info_box_contents array to show array later.
+ *
+ * @param int $max Maximum number of records to load
+ * @return void
+ */
+ public function loadBox($max = 5)
+ {
+ global $conf, $user, $langs;
+
+ $this->max = $max;
+
+ $refreshaction = 'refresh_'.$this->boxcode;
+
+ //include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facture.class.php';
+ //$facturestatic=new Facture($this->db);
+
+ $startmonth = $conf->global->SOCIETE_FISCAL_MONTH_START ? ($conf->global->SOCIETE_FISCAL_MONTH_START) : 1;
+ if (empty($conf->global->GRAPH_USE_FISCAL_YEAR)) $startmonth = 1;
+
+ $text = $langs->trans("Turnover", $max);
+ $this->info_box_head = array(
+ 'text' => $text,
+ 'limit'=> dol_strlen($text),
+ 'graph'=> 1,
+ 'sublink'=>'',
+ 'subtext'=>$langs->trans("Filter"),
+ 'subpicto'=>'filter.png',
+ 'subclass'=>'linkobject boxfilter',
+ 'target'=>'none' // Set '' to get target="_blank"
+ );
+
+ $dir = ''; // We don't need a path because image file will not be saved into disk
+ $prefix = '';
+ $socid = 0;
+ if ($user->socid) $socid = $user->socid;
+ if (!$user->rights->societe->client->voir || $socid) $prefix .= 'private-'.$user->id.'-'; // If user has no permission to see all, output dir is specific to user
+
+ if ($user->rights->facture->lire) {
+ $mesg = '';
+
+ $param_year = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_year';
+ $param_showtot = 'DOLUSERCOOKIE_box_'.$this->boxcode.'_showtot';
+
+ include_once DOL_DOCUMENT_ROOT.'/core/class/dolgraph.class.php';
+ include_once DOL_DOCUMENT_ROOT.'/compta/facture/class/facturestats.class.php';
+ $autosetarray = preg_split("/[,;:]+/", GETPOST('DOL_AUTOSET_COOKIE'));
+ if (in_array('DOLUSERCOOKIE_box_'.$this->boxcode, $autosetarray)) {
+ $endyear = GETPOST($param_year, 'int');
+ $showtot = GETPOST($param_showtot, 'alpha');
+ } else {
+ $tmparray = json_decode($_COOKIE['DOLUSERCOOKIE_box_'.$this->boxcode], true);
+ $endyear = $tmparray['year'];
+ $showtot = $tmparray['showtot'];
+ }
+ if (empty($showtot)) { $showtot = 1; }
+ $nowarray = dol_getdate(dol_now(), true);
+ if (empty($endyear)) $endyear = $nowarray['year'];
+ $numberyears = (empty($conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH) ? 5 : $conf->global->MAIN_NB_OF_YEAR_IN_WIDGET_GRAPH);
+ $startyear = $endyear - $numberyears;
+
+ $mode = 'customer';
+ $WIDTH = (($showtot) || !empty($conf->dol_optimize_smallscreen)) ? '256' : '320';
+ $HEIGHT = '192';
+
+ $stats = new FactureStats($this->db, $socid, $mode, 0);
+
+ // Build graphic amount of object. $data = array(array('Lib',val1,val2,val3),...)
+ $data2 = $stats->getAmountByYear($numberyears);
+
+ $filenamenb = $dir."/".$prefix."invoicesamountyears-".$endyear.".png";
+ // default value for customer mode
+ $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstats&file=invoicesamountyears-'.$endyear.'.png';
+ if ($mode == 'supplier') $fileurlnb = DOL_URL_ROOT.'/viewimage.php?modulepart=billstatssupplier&file=invoicessupplieramountyears-'.$endyear.'.png';
+
+ $px2 = new DolGraph();
+ $mesg = $px2->isGraphKo();
+ if (!$mesg) {
+ $langs->load("bills");
+
+ $px2->SetData($data2);
+ unset($data2);
+ $i = $startyear;
+ $legend = array();
+ while ($i <= $endyear) {
+ if ($startmonth != 1) {
+ $legend[] = sprintf("%d/%d", $i - 2001, $i - 2000);
+ } else {
+ $legend[] = $i;
+ }
+ $i++;
+ }
+ $px2->SetLegend([$langs->trans("AmountOfBillsHT")]);
+ $px2->SetMaxValue($px2->GetCeilMaxValue());
+ $px2->SetWidth($WIDTH);
+ $px2->SetHeight($HEIGHT);
+ $px2->SetYLabel($langs->trans("AmountOfBillsHT"));
+ $px2->SetShading(3);
+ $px2->SetHorizTickIncrement(1);
+ $px2->SetCssPrefix("cssboxes");
+ $px2->mode = 'depth';
+ $px2->SetTitle($langs->trans("Turnover"));
+
+ $px2->draw($filenamenb, $fileurlnb);
+ }
+
+ if (empty($conf->use_javascript_ajax)) {
+ $langs->load("errors");
+ $mesg = $langs->trans("WarningFeatureDisabledWithDisplayOptimizedForBlindNoJs");
+ }
+
+ if (!$mesg) {
+ $stringtoshow = '';
+ $stringtoshow .= '';
+ $stringtoshow .= ''; // hideobject is to start hidden
+ $stringtoshow .= '';
+ $stringtoshow .= '
';
+ $stringtoshow .= $px2->show();
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover center"', 'textnoformat'=>$stringtoshow);
+ } else {
+ $this->info_box_contents[0][0] = array('tr'=>'class="oddeven nohover"', 'td' => 'class="nohover left"', 'maxlength'=>500, 'text' => $mesg);
+ }
+ } else {
+ $this->info_box_contents[0][0] = array(
+ 'td' => 'class="nohover left"',
+ 'text' => ''.$langs->trans("ReadPermissionNotAllowed").' '
+ );
+ }
+ }
+
+ /**
+ * Method to show box
+ *
+ * @param array $head Array with properties of box title
+ * @param array $contents Array with properties of box lines
+ * @param int $nooutput No print, only return string
+ * @return string
+ */
+ public function showBox($head = null, $contents = null, $nooutput = 0)
+ {
+ return parent::showBox($this->info_box_head, $this->info_box_contents, $nooutput);
+ }
+}
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/boxes/box_validated_projects.php b/htdocs/core/boxes/box_validated_projects.php
index 0c4155da6c7..d756e1461ea 100644
--- a/htdocs/core/boxes/box_validated_projects.php
+++ b/htdocs/core/boxes/box_validated_projects.php
@@ -112,11 +112,11 @@ class box_validated_projects extends ModeleBoxes
$sql .= " COUNT(DISTINCT t.rowid) as tasknumber";
$sql .= " FROM ".MAIN_DB_PREFIX."projet AS p";
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."projet_task AS t ON p.rowid = t.fk_projet";
- // TODO Replace -1, -2, -3 with ID used for type of contat project_task into llx_c_type_contact. Once done, we can switch widget as stable.
+ // TODO Replace -1, -2, -3 with ID used for type of contact project_task into llx_c_type_contact. Once done, we can switch widget as stable.
$sql .= " INNER JOIN ".MAIN_DB_PREFIX."element_contact as ec ON ec.element_id = t.rowid AND fk_c_type_contact IN (-1, -2, -3)";
$sql .= " WHERE p.fk_statut = 1"; // Only open projects
if ($projectsListId) {
- $sql .= ' AND p.rowid IN ('.$this->db->sanitize($projectsListId).')'; // Only project we ara allowed
+ $sql .= ' AND p.rowid IN ('.$this->db->sanitize($projectsListId).')'; // Only project are allowed
}
$sql .= " AND t.rowid NOT IN (SELECT fk_task FROM ".MAIN_DB_PREFIX."projet_task_time WHERE fk_user = ".((int) $user->id).")";
$sql .= " GROUP BY p.rowid, p.ref, p.fk_soc, p.dateo";
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 462a3bd5c44..eb5edb921f3 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -1733,6 +1733,18 @@ abstract class CommonObject
return 0;
}
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ /**
+ * Load the project with id $this->fk_project into this->project
+ *
+ * @return int <0 if KO, >=0 if OK
+ */
+ public function fetch_project()
+ {
+ // phpcs:enable
+ return $this->fetch_projet();
+ }
+
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
/**
* Load the project with id $this->fk_project into this->project
@@ -3845,8 +3857,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) {
@@ -7323,7 +7341,11 @@ abstract class CommonObject
dol_include_once($InfoFieldList[1]);
if ($classname && class_exists($classname)) {
$object = new $classname($this->db);
- $object->fetch($value);
+ if ($object->element === 'product') { // Special cas for product because default valut of fetch are wrong
+ $object->fetch($value, '', '', '', 0, 1, 1);
+ } else {
+ $object->fetch($value);
+ }
$value = $object->getNomUrl($getnomurlparam, $getnomurlparam2);
}
} else {
@@ -8199,10 +8221,10 @@ abstract class CommonObject
// Special cas for product
if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer)) {
// Link to resize
- $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').' ';
+ $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').' ';
// Link to delete
- $return .= 'id.'&action=delete&token='.newToken().'&file='.urlencode($pdir.$viewfilename).'">';
+ $return .= ' id.'&action=delete&token='.newToken().'&file='.urlencode($pdir.$viewfilename).'">';
$return .= img_delete().' ';
}
}
@@ -8228,10 +8250,10 @@ abstract class CommonObject
// Special case for product
if ($modulepart == 'product' && ($user->rights->produit->creer || $user->rights->service->creer)) {
// Link to resize
- $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').' ';
+ $return .= ''.img_picto($langs->trans("Resize"), 'resize', '').' ';
// Link to delete
- $return .= 'id.'&action=delete&token='.newToken().'&file='.urlencode($pdir.$viewfilename).'">';
+ $return .= ' id.'&action=delete&token='.newToken().'&file='.urlencode($pdir.$viewfilename).'">';
$return .= img_delete().' ';
}
}
diff --git a/htdocs/core/class/html.form.class.php b/htdocs/core/class/html.form.class.php
index 5813c45047a..46159a52519 100644
--- a/htdocs/core/class/html.form.class.php
+++ b/htdocs/core/class/html.form.class.php
@@ -7009,7 +7009,7 @@ class Form
$tmparray = explode('@', $objecttmp->ismultientitymanaged);
$sql .= " INNER JOIN ".MAIN_DB_PREFIX.$tmparray[1]." as parenttable ON parenttable.rowid = t.".$tmparray[0];
}
- if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
+ if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= ", ".MAIN_DB_PREFIX."societe_commerciaux as sc";
}
@@ -7037,7 +7037,7 @@ class Form
$sql .= " AND t.fk_soc = ".((int) $user->socid);
}
}
- if ($objecttmp->ismultientitymanaged == 'fk_soc@societe') {
+ if ($objecttmp->ismultientitymanaged === 'fk_soc@societe') {
if (!$user->rights->societe->client->voir && !$user->socid) {
$sql .= " AND t.rowid = sc.fk_soc AND sc.fk_user = ".((int) $user->id);
}
@@ -7891,12 +7891,16 @@ class Form
$tplpath = 'eventorganization';
} elseif ($objecttype == 'conferenceorboothattendee') {
$tplpath = 'eventorganization';
+ } elseif ($objecttype == 'mo') {
+ $tplpath = 'mrp';
+ if (empty($conf->mrp->enabled)) {
+ continue; // Do not show if module disabled
+ }
}
global $linkedObjectBlock;
$linkedObjectBlock = $objects;
-
// Output template part (modules that overwrite templates must declare this into descriptor)
$dirtpls = array_merge($conf->modules_parts['tpl'], array('/'.$tplpath.'/tpl'));
foreach ($dirtpls as $reldir) {
@@ -7982,7 +7986,8 @@ class Form
'supplier_proposal'=>array('enabled'=>$conf->supplier_proposal->enabled, 'perms'=>1, 'label'=>'LinkToSupplierProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, '' as ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."supplier_proposal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('supplier_proposal').')'),
'order_supplier'=>array('enabled'=>$conf->supplier_order->enabled, 'perms'=>1, 'label'=>'LinkToSupplierOrder', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."commande_fournisseur as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('commande_fournisseur').')'),
'invoice_supplier'=>array('enabled'=>$conf->supplier_invoice->enabled, 'perms'=>1, 'label'=>'LinkToSupplierInvoice', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_supplier, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."facture_fourn as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('facture_fourn').')'),
- 'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')')
+ 'ticket'=>array('enabled'=>$conf->ticket->enabled, 'perms'=>1, 'label'=>'LinkToTicket', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.track_id, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."ticket as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('ticket').')'),
+ 'mo'=>array('enabled'=>$conf->mrp->enabled, 'perms'=>1, 'label'=>'LinkToMO', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.rowid, '0' as total_ht FROM ".MAIN_DB_PREFIX."societe as s INNER JOIN ".MAIN_DB_PREFIX."mrp_mo as t ON t.fk_soc = s.rowid WHERE t.fk_soc IN (".$this->db->sanitize($listofidcompanytoscan).') AND t.entity IN ('.getEntity('mo').')')
);
}
diff --git a/htdocs/core/class/html.formactions.class.php b/htdocs/core/class/html.formactions.class.php
index 09c94485d11..4b12b4513e5 100644
--- a/htdocs/core/class/html.formactions.class.php
+++ b/htdocs/core/class/html.formactions.class.php
@@ -221,10 +221,13 @@ class FormActions
if ($typeelement == 'project') {
$projectid = $object->id;
}
+ if ($typeelement == 'task') {
+ $taskid = $object->id;
+ }
$newcardbutton = '';
if (!empty($conf->agenda->enabled) && !empty($user->rights->agenda->myactions->create)) {
- $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').'&backtopage='.urlencode($urlbacktopage);
+ $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.urlencode(dol_print_date(dol_now(), 'dayhourlog', 'tzuser')).'&origin='.urlencode($typeelement).'&originid='.$object->id.((!empty($object->socid) && $object->socid > 0) ? '&socid='.$object->socid : ((!empty($socid) && $socid > 0) ? '&socid='.$socid : '')).($projectid > 0 ? '&projectid='.$projectid : '').($taskid > 0 ? '&taskid='.$taskid : '').'&backtopage='.urlencode($urlbacktopage);
$newcardbutton .= dolGetButtonTitle($langs->trans("AddEvent"), '', 'fa fa-plus-circle', $url);
}
diff --git a/htdocs/core/class/html.formadmin.class.php b/htdocs/core/class/html.formadmin.class.php
index 8e03f158a02..13619fe5aa3 100644
--- a/htdocs/core/class/html.formadmin.class.php
+++ b/htdocs/core/class/html.formadmin.class.php
@@ -73,6 +73,18 @@ class FormAdmin
$langs_available = $langs->get_available_languages(DOL_DOCUMENT_ROOT, 12, 0, $mainlangonly);
+ // If the language to select is not inside the list of available language and empty value is not available, we must find
+ // an alternative as the language code to pre-select (to avoid to have first element in list pre-selected).
+ if ($selected && !in_array($selected, $langs_available) && empty($showempty)) {
+ $tmparray = explode('_', $selected);
+ if (!empty($tmparray[1])) {
+ $selected = getLanguageCodeFromCountryCode($tmparray[1]);
+ }
+ if (empty($selected)) {
+ $selected = $langs->defaultlang;
+ }
+ }
+
$out = '';
$out .= '';
diff --git a/htdocs/core/class/html.formfile.class.php b/htdocs/core/class/html.formfile.class.php
index 60054ecf5ad..591fb5ed2d1 100644
--- a/htdocs/core/class/html.formfile.class.php
+++ b/htdocs/core/class/html.formfile.class.php
@@ -901,16 +901,16 @@ class FormFile
$out .= '';
if ($delallowed) {
$tmpurlsource = preg_replace('/#[a-zA-Z0-9_]*$/', '', $urlsource);
- $out .= 'trans("Delete"), 'delete').' ';
}
if ($printer) {
//$out.= ' ';
- $out .= ''.img_picto($langs->trans("PrintFile", $relativepath), 'printer.png').' ';
}
if ($morepicto) {
diff --git a/htdocs/core/class/html.formticket.class.php b/htdocs/core/class/html.formticket.class.php
index 4c4fd764e57..dd43ae0ffae 100644
--- a/htdocs/core/class/html.formticket.class.php
+++ b/htdocs/core/class/html.formticket.class.php
@@ -243,6 +243,65 @@ class FormTicket
}
}
+ if ($conf->knowledgemanagement->enabled) {
+ // KM Articles
+ print ' ';
+ print '
+ '."\n";
+ }
+
// MESSAGE
$msg = GETPOSTISSET('message') ? GETPOST('message', 'restricthtml') : '';
print ''.$langs->trans("Message").' ';
@@ -698,8 +757,12 @@ 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 .= ' ';
@@ -739,6 +802,7 @@ class FormTicket
$arraycodenotparent[] = $groupvalue;
}
$arrayidused[] = $grouprowid;
+ $arrayidusedconcat[] = $grouprowid;
}
$i++;
}
@@ -753,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, ctc.public, 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 > 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) {
@@ -799,6 +865,7 @@ class FormTicket
$isparent = $obj->isparent;
$fatherid = $obj->fk_parent;
$arrayidused[] = $grouprowid;
+ $arrayidusedconcat[] = $grouprowid;
$groupcodefather = $obj->codefather;
if ($isparent == 'NOTPARENT') {
$arraycodenotparent[] = $groupvalue;
@@ -823,7 +890,7 @@ class FormTicket
$stringtoprint .=' ';
$stringtoprint .='';
}
@@ -732,7 +732,7 @@ if ($id) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->salaries->write) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -977,17 +977,17 @@ if ($id) {
if ($action != 'edit') {
// Reopen
if ($object->paye && $user->rights->salaries->write) {
- print "";
+ print '";
}
// Edit
if ($object->paye == 0 && $user->rights->salaries->write) {
- print "";
+ print '";
}
// Emit payment
if ($object->paye == 0 && ((price2num($object->amount) < 0 && price2num($resteapayer, 'MT') < 0) || (price2num($object->amount) > 0 && price2num($resteapayer, 'MT') > 0)) && $user->rights->salaries->write) {
- print "";
+ print '";
}
// Classify 'paid'
diff --git a/htdocs/salaries/payment_salary/card.php b/htdocs/salaries/payment_salary/card.php
index e4364f6727f..d33d04c49ff 100644
--- a/htdocs/salaries/payment_salary/card.php
+++ b/htdocs/salaries/payment_salary/card.php
@@ -248,7 +248,7 @@ print '';
if ($action == '') {
if ($user->rights->salaries->delete) {
if (!$disable_delete) {
- print '
'.$langs->trans('Delete').' ';
+ print '
'.$langs->trans('Delete').' ';
} else {
print '
'.$langs->trans('Delete').' ';
}
diff --git a/htdocs/societe/admin/societe.php b/htdocs/societe/admin/societe.php
index b9b2046fd90..29f8d0b175d 100644
--- a/htdocs/societe/admin/societe.php
+++ b/htdocs/societe/admin/societe.php
@@ -391,7 +391,7 @@ foreach ($arrayofmodules as $file => $modCodeTiers) {
$disabled = (!empty($conf->multicompany->enabled) && (is_object($mc) && !empty($mc->sharings['referent']) && $mc->sharings['referent'] != $conf->entity) ? true : false);
print '
';
if (!$disabled) {
- print '';
+ print ' ';
}
print img_picto($langs->trans("Disabled"), 'switch_off');
if (!$disabled) {
@@ -468,7 +468,7 @@ foreach ($arrayofmodules as $file => $modCodeCompta) {
print img_picto($langs->trans("Activated"), 'switch_on');
print ' ';
} else {
- print '
';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
@@ -560,7 +560,7 @@ foreach ($dirsociete as $dirroot) {
print "
\n";
//if ($conf->global->COMPANY_ADDON_PDF != "$name")
//{
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Enabled"), 'switch_on');
print ' ';
//}
@@ -576,7 +576,7 @@ foreach ($dirsociete as $dirroot) {
print " ";
} else {
print '
'."\n";
- print 'scandir.'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir).'&label='.urlencode($module->name).'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
print " ";
}
}
diff --git a/htdocs/societe/canvas/company/tpl/card_view.tpl.php b/htdocs/societe/canvas/company/tpl/card_view.tpl.php
index 8169a6ca22f..7dfe7c212f2 100644
--- a/htdocs/societe/canvas/company/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/company/tpl/card_view.tpl.php
@@ -267,7 +267,7 @@ for ($i = 1; $i <= 4; $i++) {
use_javascript_ajax) { ?>
trans('Delete'); ?>
-
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
+
control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
diff --git a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
index f058d38cd7c..86c7d9c9f65 100644
--- a/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
+++ b/htdocs/societe/canvas/individual/tpl/card_view.tpl.php
@@ -194,7 +194,7 @@ if ($this->control->tpl['action_delete']) {
use_javascript_ajax) { ?>
trans('Delete'); ?>
- control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
+ control->tpl['id'].'&action=delete&token='.newToken().'&canvas='.$canvas; ?>">trans('Delete'); ?>
diff --git a/htdocs/societe/card.php b/htdocs/societe/card.php
index 96142f65cd6..a155f08e529 100644
--- a/htdocs/societe/card.php
+++ b/htdocs/societe/card.php
@@ -2942,7 +2942,7 @@ if (is_object($objcanvas) && $objcanvas->displayCanvasExists($action)) {
if ($conf->use_javascript_ajax && empty($conf->dol_use_jmobile)) { // We can't use preloaded confirm form with jmobile
print ''.$langs->trans('Delete').' '."\n";
} else {
- print 'id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
+ print 'id.'&action=delete&token='.newToken().'">'.$langs->trans('Delete').' '."\n";
}
}
}
diff --git a/htdocs/societe/class/companypaymentmode.class.php b/htdocs/societe/class/companypaymentmode.class.php
index 1f11e6a29c3..9574544a11a 100644
--- a/htdocs/societe/class/companypaymentmode.class.php
+++ b/htdocs/societe/class/companypaymentmode.class.php
@@ -394,7 +394,7 @@ class CompanyPaymentMode extends CommonObject
$label .= ' ';
$label .= ''.$langs->trans('Ref').': '.$this->ref;
- $url = dol_buildpath('/monmodule/companypaymentmode_card.php', 1).'?id='.$this->id;
+ $url = '';
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/societe/class/societe.class.php b/htdocs/societe/class/societe.class.php
index 4110e59d4de..8f0e2c84805 100644
--- a/htdocs/societe/class/societe.class.php
+++ b/htdocs/societe/class/societe.class.php
@@ -2581,7 +2581,7 @@ class Societe extends CommonObject
$label .= ' ('.dol_escape_htmltag($this->name_alias).')';
}
}
- $label .= ''.$langs->trans('Email').': '.$this->email;
+ $label .= ' '.img_picto('', 'email', 'class="pictofixedwidth"').$this->email;
if (!empty($this->phone) || !empty($this->fax)) {
$phonelist = array();
if ($this->phone) {
@@ -2590,7 +2590,7 @@ class Societe extends CommonObject
if ($this->fax) {
$phonelist[] = dol_print_phone($this->fax, $this->country_code, $this->id, 0, '', ' ', 'fax');
}
- $label .= ''.$langs->trans('Phone').': '.implode(' ', $phonelist);
+ $label .= ' '.implode(' ', $phonelist);
}
if (!empty($this->address)) {
$label .= ''.$langs->trans("Address").': '.dol_format_address($this, 1, ' ', $langs); // Address + country
diff --git a/htdocs/societe/class/societeaccount.class.php b/htdocs/societe/class/societeaccount.class.php
index 8fbbbbcee6e..f73c460b4a4 100644
--- a/htdocs/societe/class/societeaccount.class.php
+++ b/htdocs/societe/class/societeaccount.class.php
@@ -392,7 +392,7 @@ class SocieteAccount extends CommonObject
$label .= ''.$langs->trans('Login').': '.$this->ref;
//$label.= '' . $langs->trans('WebSite') . ': ' . $this->ref;
- $url = dol_buildpath('/website/websiteaccount_card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/website/websiteaccount_card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/societe/list.php b/htdocs/societe/list.php
index ca4793c2c60..bc786a540d6 100644
--- a/htdocs/societe/list.php
+++ b/htdocs/societe/list.php
@@ -1639,7 +1639,7 @@ while ($i < min($num, $limit)) {
$titlealt = $val['label'];
}
if ($obj->stcomm_id != $val['id']) {
- print 'rowid.'&stcomm='.$val['code'].'&action=setstcomm&token='.newToken().$param.($page ? '&page='.urlencode($page) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).' ';
+ print 'rowid.'&stcomm='.urlencode($val['code']).'&action=setstcomm&token='.newToken().$param.($page ? '&page='.urlencode($page) : '').'">'.img_action($titlealt, $val['code'], $val['picto']).' ';
}
}
print ' ';
diff --git a/htdocs/societe/partnership.php b/htdocs/societe/partnership.php
index 295fe8b2075..85223e856f3 100644
--- a/htdocs/societe/partnership.php
+++ b/htdocs/societe/partnership.php
@@ -132,7 +132,7 @@ $date_end = dol_mktime(0, 0, 0, GETPOST('date_partnership_endmonth', 'int'), GET
if (empty($reshook)) {
$error = 0;
- $backtopage = dol_buildpath('/partnership/partnership.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/partnership/partnership.php?id='.($id > 0 ? $id : '__ID__');
// Actions when linking object each other
include DOL_DOCUMENT_ROOT.'/core/actions_dellink.inc.php';
diff --git a/htdocs/societe/price.php b/htdocs/societe/price.php
index da4ca1c0cd7..dbb0e8f0553 100644
--- a/htdocs/societe/price.php
+++ b/htdocs/societe/price.php
@@ -620,11 +620,11 @@ if (!empty($conf->global->PRODUIT_CUSTOMER_PRICES)) {
print img_info();
print '';
print ' ';
- print 'id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_edit('default', 0, 'style="vertical-align: middle;"');
print ' ';
print ' ';
- print 'id.'&lineid='.$line->id.'">';
+ print ' id.'&lineid='.$line->id.'">';
print img_delete('default', 'style="vertical-align: middle;"');
print ' ';
print '';
diff --git a/htdocs/supplier_proposal/card.php b/htdocs/supplier_proposal/card.php
index b00e5954e6d..bc677f29f53 100644
--- a/htdocs/supplier_proposal/card.php
+++ b/htdocs/supplier_proposal/card.php
@@ -1463,7 +1463,7 @@ if ($action == 'create') {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($usercancreate) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' : ';
}
if ($action == 'classify') {
//$morehtmlref.=$form->form_project($_SERVER['PHP_SELF'] . '?id=' . $object->id, $object->socid, $object->fk_project, 'projectid', 0, 0, 1, 1);
@@ -1848,12 +1848,12 @@ if ($action == 'create') {
// Edit
if ($object->statut == SupplierProposal::STATUS_VALIDATED && $usercancreate) {
- print '';
+ print '';
}
// ReOpen
if (($object->statut == SupplierProposal::STATUS_SIGNED || $object->statut == SupplierProposal::STATUS_NOTSIGNED || $object->statut == SupplierProposal::STATUS_CLOSE) && $usercanclose) {
- print 'id.'&action=reopen'.(empty($conf->global->MAIN_JUMP_TAG) ? '' : '#reopen').'"';
+ print '';
}
@@ -1861,7 +1861,7 @@ if ($action == 'create') {
if (empty($user->socid)) {
if ($object->statut == SupplierProposal::STATUS_VALIDATED || $object->statut == SupplierProposal::STATUS_SIGNED) {
if ($usercansend) {
- print '';
+ print '';
} else {
print '';
}
@@ -1889,12 +1889,12 @@ if ($action == 'create') {
// Clone
if ($usercancreate) {
- print '';
+ print '';
}
// Delete
if (($object->statut == SupplierProposal::STATUS_DRAFT && $usercancreate) || $usercandelete) {
- print 'id.'&action=delete&token='.newToken().'"';
+ print '';
}
}
diff --git a/htdocs/supplier_proposal/contact.php b/htdocs/supplier_proposal/contact.php
index 02a4fc51966..faa9127779c 100644
--- a/htdocs/supplier_proposal/contact.php
+++ b/htdocs/supplier_proposal/contact.php
@@ -139,7 +139,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($permissiontoedit) {
if ($action != 'classify') {
- //$morehtmlref.=' ' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/document.php b/htdocs/supplier_proposal/document.php
index 580c0f0974e..2795c006723 100644
--- a/htdocs/supplier_proposal/document.php
+++ b/htdocs/supplier_proposal/document.php
@@ -116,7 +116,7 @@ if ($object->id > 0) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/info.php b/htdocs/supplier_proposal/info.php
index 80c67871e91..7d6d72276d8 100644
--- a/htdocs/supplier_proposal/info.php
+++ b/htdocs/supplier_proposal/info.php
@@ -81,7 +81,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/note.php b/htdocs/supplier_proposal/note.php
index c4ab85e8e20..6466c6f42cb 100644
--- a/htdocs/supplier_proposal/note.php
+++ b/htdocs/supplier_proposal/note.php
@@ -110,7 +110,7 @@ if ($id > 0 || !empty($ref)) {
$morehtmlref .= '
'.$langs->trans('Project').' ';
if ($user->rights->supplier_proposal->creer) {
if ($action != 'classify') {
- //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
+ //$morehtmlref.='
' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' : ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
index c33c3b2ebac..d0fce33ed22 100644
--- a/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/supplier_proposal/tpl/linkedobjectblock.tpl.php
@@ -53,7 +53,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
echo price($objectlink->total_ht);
} ?>
getLibStatut(3); ?>
-
id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+
id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
global->TAKEPOS_REF_ADDON == "$file") {
print img_picto($langs->trans("Activated"), 'switch_on');
} else {
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/takepos/index.php b/htdocs/takepos/index.php
index ed52280a8f4..858531e97a1 100644
--- a/htdocs/takepos/index.php
+++ b/htdocs/takepos/index.php
@@ -999,36 +999,39 @@ if (empty($conf->global->TAKEPOS_HIDE_HEAD_BAR)) {
query($sql);
-$paiementsModes = array();
-if ($resql) {
- while ($obj = $db->fetch_object($resql)) {
- $paycode = $obj->code;
- if ($paycode == 'LIQ') {
- $paycode = 'CASH';
- }
- if ($paycode == 'CHQ') {
- $paycode = 'CHEQUE';
- }
+ $resql = $db->query($sql);
+ $paiementsModes = array();
+ if ($resql) {
+ while ( $obj = $db->fetch_object($resql) ) {
+ $paycode = $obj->code;
+ if ($paycode == 'LIQ') {
+ $paycode = 'CASH';
+ }
+ if ($paycode == 'CHQ') {
+ $paycode = 'CHEQUE';
+ }
- $constantforkey = "CASHDESK_ID_BANKACCOUNT_".$paycode.$_SESSION["takeposterminal"];
- //var_dump($constantforkey.' '.$conf->global->$constantforkey);
- if (!empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
- array_push($paiementsModes, $obj);
+ $constantforkey = "CASHDESK_ID_BANKACCOUNT_" . $paycode . $_SESSION["takeposterminal"];
+ //var_dump($constantforkey.' '.$conf->global->$constantforkey);
+ if ( ! empty($conf->global->$constantforkey) && $conf->global->$constantforkey > 0) {
+ array_push($paiementsModes, $obj);
+ }
}
}
+
+ if (empty($paiementsModes)) {
+ $langs->load('errors');
+ setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
+ setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
+ }
}
-if (empty($paiementsModes)) {
- $langs->load('errors');
- setEventMessages($langs->trans("ErrorModuleSetupNotComplete", $langs->transnoentitiesnoconv("TakePOS")), null, 'errors');
- setEventMessages($langs->trans("ProblemIsInSetupOfTerminal", $_SESSION["takeposterminal"]), null, 'errors');
-}
if (count($maincategories) == 0) {
if ($conf->global->TAKEPOS_ROOT_CATEGORY_ID > 0) {
$tmpcategory = new Categorie($db);
diff --git a/htdocs/takepos/invoice.php b/htdocs/takepos/invoice.php
index 520fe8dccdb..ae12665e008 100644
--- a/htdocs/takepos/invoice.php
+++ b/htdocs/takepos/invoice.php
@@ -188,11 +188,9 @@ if ($action == 'valid' && $user->rights->facture->creer) {
if (!empty($conf->global->TAKEPOS_CAN_FORCE_BANK_ACCOUNT_DURING_PAYMENT)) {
$bankaccount = GETPOST('accountid', 'int');
} else {
- if ($pay == "cash") {
+ if ($pay == 'LIQ') {
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CASH'.$_SESSION["takeposterminal"]}; // For backward compatibility
- } elseif ($pay == "card") {
- $bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CB'.$_SESSION["takeposterminal"]}; // For backward compatibility
- } elseif ($pay == "cheque") {
+ } elseif ($pay == "CHQ") {
$bankaccount = $conf->global->{'CASHDESK_ID_BANKACCOUNT_CHEQUE'.$_SESSION["takeposterminal"]}; // For backward compatibility
} else {
$accountname = "CASHDESK_ID_BANKACCOUNT_".$pay.$_SESSION["takeposterminal"];
diff --git a/htdocs/takepos/pay.php b/htdocs/takepos/pay.php
index 773118e670f..51744ce0528 100644
--- a/htdocs/takepos/pay.php
+++ b/htdocs/takepos/pay.php
@@ -330,23 +330,20 @@ print ''.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).' ';
+ print ''.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[0]->code)).' ';
} else {
print ''.$langs->trans("NoPaimementModesDefined").' ';
}
@@ -359,23 +356,20 @@ print ''.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).' ';
+ print ''.(!empty($payIcon) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code) : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[1]->code)).' ';
} else {
$button = array_pop($action_buttons);
print ''.$button["text"].' ';
@@ -389,23 +383,20 @@ print ''.(!empty($payIcon) ? ' '.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).' ';
+ print ''.(!empty($payIcon) ? ' '.(!empty($conf->global->TAKEPOS_NUMPAD_FORCE_PAYMENT_ICONS_LABELS) ? ' '. $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code) : '') : $langs->trans("PaymentTypeShort".$arrayOfValidPaymentModes[2]->code)).' ';
} else {
$button = array_pop($action_buttons);
print ''.$button["text"].' ';
diff --git a/htdocs/ticket/agenda.php b/htdocs/ticket/agenda.php
index fee91e959aa..9acf76b30c2 100644
--- a/htdocs/ticket/agenda.php
+++ b/htdocs/ticket/agenda.php
@@ -190,7 +190,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= ' '.$langs->trans('Project');
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
@@ -217,7 +217,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '';
-$linkback = ''.$langs->trans("BackToList").' ';
+$linkback = ''.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
diff --git a/htdocs/ticket/card.php b/htdocs/ticket/card.php
index e7a00699733..f91fe4f01b3 100644
--- a/htdocs/ticket/card.php
+++ b/htdocs/ticket/card.php
@@ -532,7 +532,7 @@ if (empty($reshook)) {
}
}
- if ($action == 'setsubject') {
+ if ($action == 'setsubject' && $user->rights->ticket->write) {
if ($object->fetch(GETPOST('id', 'int'))) {
if ($action == 'setsubject') {
$object->subject = GETPOST('subject', 'alphanohtml');
@@ -946,7 +946,7 @@ if ($action == 'create' || $action == 'presend') {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
+ $morehtmlref .= ''.img_edit($langs->transnoentitiesnoconv('SetProject')).' ';
}
$morehtmlref .= ' : ';
if ($action == 'classify') {
@@ -1340,28 +1340,28 @@ if ($action == 'create' || $action == 'presend') {
print '';
}
if ($object->fk_soc > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ficheinter->creer) {
- print '';
+ print '';
}
/* This is useless. We can already modify each field individually
if ($user->rights->ticket->write && $object->fk_statut < Ticket::STATUS_CLOSED) {
- print '';
+ print '';
}
*/
// Close ticket if statut is read
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
- print '';
+ print '';
}
// Abadon ticket if statut is read
if ($object->fk_statut > 0 && $object->fk_statut < Ticket::STATUS_CLOSED && $user->rights->ticket->write) {
- print '';
+ print '';
}
// Re-open ticket
if (!$user->socid && ($object->fk_statut == Ticket::STATUS_CLOSED || $object->fk_statut == Ticket::STATUS_CANCELED) && !$user->socid) {
- print '';
+ print '';
}
// Delete ticket
diff --git a/htdocs/ticket/class/ticket.class.php b/htdocs/ticket/class/ticket.class.php
index ea273064840..874036a5c38 100644
--- a/htdocs/ticket/class/ticket.class.php
+++ b/htdocs/ticket/class/ticket.class.php
@@ -1344,7 +1344,7 @@ class Ticket extends CommonObject
$label .= ''.$langs->trans('TicketTrackId').': '.$this->track_id.' ';
$label .= ''.$langs->trans('Subject').': '.$this->subject;
- $url = dol_buildpath('/ticket/card.php', 1).'?id='.$this->id;
+ $url = DOL_URL_ROOT.'/ticket/card.php?id='.$this->id;
if ($option != 'nolink') {
// Add param to save lastsearch_values or not
diff --git a/htdocs/ticket/contact.php b/htdocs/ticket/contact.php
index 8d450ffb44b..dbd553f9c1f 100644
--- a/htdocs/ticket/contact.php
+++ b/htdocs/ticket/contact.php
@@ -52,7 +52,7 @@ $lineid = GETPOST('lineid', 'int');
// Store current page url
-$url_page_current = dol_buildpath('/ticket/contact.php', 1);
+$url_page_current = DOL_URL_ROOT.'/ticket/contact.php';
$object = new Ticket($db);
@@ -192,7 +192,7 @@ if ($id > 0 || !empty($track_id) || !empty($ref)) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/ticket/document.php b/htdocs/ticket/document.php
index d534e8a1123..8b45b8ebbf7 100644
--- a/htdocs/ticket/document.php
+++ b/htdocs/ticket/document.php
@@ -161,7 +161,7 @@ if ($object->id) {
$morehtmlref .= ' '.$langs->trans('Project').' ';
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
diff --git a/htdocs/ticket/list.php b/htdocs/ticket/list.php
index 4b048d54671..aeab9ac6e27 100644
--- a/htdocs/ticket/list.php
+++ b/htdocs/ticket/list.php
@@ -159,7 +159,7 @@ if (!$user->rights->ticket->read) {
}
// Store current page url
-$url_page_current = dol_buildpath('/ticket/list.php', 1);
+$url_page_current = DOL_URL_ROOT.'/ticket/list.php';
if ($project_ref) {
$tmpproject = new Project($db);
diff --git a/htdocs/ticket/messaging.php b/htdocs/ticket/messaging.php
index 68615424abf..365376f0add 100644
--- a/htdocs/ticket/messaging.php
+++ b/htdocs/ticket/messaging.php
@@ -188,7 +188,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= ' '.$langs->trans('Project');
if ($user->rights->ticket->write) {
if ($action != 'classify') {
- //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
+ //$morehtmlref.='' . img_edit($langs->transnoentitiesnoconv('SetProject')) . ' ';
$morehtmlref .= ' : ';
}
if ($action == 'classify') {
@@ -215,7 +215,7 @@ if (!empty($conf->projet->enabled)) {
$morehtmlref .= '';
-$linkback = ''.$langs->trans("BackToList").' ';
+$linkback = ''.$langs->trans("BackToList").' ';
dol_banner_tab($object, 'ref', $linkback, ($user->socid ? 0 : 1), 'ref', 'ref', $morehtmlref, '', 0, '', '', 1);
@@ -248,7 +248,7 @@ if (!empty($object->id)) {
// Show link to add event (if read and not closed)
$btnstatus = $object->fk_statut < Ticket::STATUS_CLOSED && $action != "presend" && $action != "presend_addmessage";
- $url = dol_buildpath('/comm/action/card.php', 1).'?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
+ $url = DOL_URL_ROOT.'/comm/action/card.php?action=create&datep='.date('YmdHi').'&origin=ticket&originid='.$object->id.'&projectid='.$object->fk_project.'&backtopage='.urlencode($_SERVER["PHP_SELF"].'?track_id='.$object->track_id);
$morehtmlright .= dolGetButtonTitle($langs->trans('AddAction'), '', 'fa fa-plus-circle', $url, 'add-new-ticket-even-button', $btnstatus);
diff --git a/htdocs/ticket/tpl/linkedobjectblock.tpl.php b/htdocs/ticket/tpl/linkedobjectblock.tpl.php
index 17da4cd2db5..51c2cbfb7fd 100644
--- a/htdocs/ticket/tpl/linkedobjectblock.tpl.php
+++ b/htdocs/ticket/tpl/linkedobjectblock.tpl.php
@@ -65,7 +65,7 @@ foreach ($linkedObjectBlock as $key => $objectlink) {
// For now, shipments must stay linked to order, so link is not deletable
if ($object->element != 'shipping') {
?>
- id.'&action=dellink&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
+ id.'&action=dellink&token='.newToken().'&dellinkid='.$key; ?>">transnoentitiesnoconv("RemoveLink"), 'unlink'); ?>
diff --git a/htdocs/user/card.php b/htdocs/user/card.php
index 8d03d1d1cfb..480ff3a8a74 100644
--- a/htdocs/user/card.php
+++ b/htdocs/user/card.php
@@ -1805,7 +1805,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print ''."\n";
// API key
- if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin)) {
+ if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->rights->api->apikey->generate)) {
print ''.$langs->trans("ApiKey").' ';
print '';
if (!empty($object->api_key)) {
@@ -1972,7 +1972,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print $form->select_dolgroups('', 'group', 1, $exclude, 0, '', '', $object->entity);
print ' ';
print ' ';
- print ' ';
+ print ' ';
}
print ' '."\n";
@@ -2328,7 +2328,7 @@ if ($action == 'create' || $action == 'adduserldap') {
print "\n";
// API key
- if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin)) {
+ if (!empty($conf->api->enabled) && ($user->id == $id || $user->admin || $user->rights->api->apikey->generate)) {
print ''.$langs->trans("ApiKey").' ';
print '';
print ' ';
diff --git a/htdocs/user/class/user.class.php b/htdocs/user/class/user.class.php
index 649b8b55502..2dbc2a3f020 100644
--- a/htdocs/user/class/user.class.php
+++ b/htdocs/user/class/user.class.php
@@ -663,26 +663,103 @@ class User extends CommonObject
* You can use it like this: if ($user->hasRight('module', 'level11')).
* It replaces old syntax: if ($user->rights->module->level1)
*
- * @param int $module Id of permission to add or 0 to add several permissions
- * @param string $permlevel1 Permission level1
+ * @param int $module Module of permission to check
+ * @param string $permlevel1 Permission level1 (Example: 'read', 'write', 'delete')
* @param string $permlevel2 Permission level2
* @return int 1 if user has permission, 0 if not.
* @see clearrights(), delrights(), getrights(), hasRight()
*/
public function hasRight($module, $permlevel1, $permlevel2 = '')
{
+ global $conf;
+
+ // For compatibility with bad naming permissions on module
+ $moduletomoduletouse = array(
+ 'contract' => 'contrat',
+ 'member' => 'adherent', // We must check $user->rights->adherent...
+ 'mo' => 'mrp',
+ 'order' => 'commande',
+ 'product' => 'produit', // We must check $user->rights->produit...
+ 'project' => 'projet',
+ 'shipping' => 'expedition',
+ 'task' => 'task@projet',
+ 'fichinter' => 'ficheinter',
+ 'invoice' => 'facture',
+ 'invoice_supplier' => 'fournisseur',
+ 'knowledgerecord' => 'knowledgerecord@knowledgemanagement'
+ );
+ if (!empty($moduletomoduletouse[$module])) {
+ $module = $moduletomoduletouse[$module];
+ }
+
+ // If module is abc@module, we check permission user->rights->module->abc->permlevel1
+ $tmp = explode('@', $module, 2);
+ if (! empty($tmp[1])) {
+ $module = $tmp[1];
+ $permlevel2 = $permlevel1;
+ $permlevel1 = $tmp[0];
+ }
+
+ //var_dump($module);
+ //var_dump($this->rights->$module);
+ if (!in_array($module, $conf->modules)) {
+ return 0;
+ }
+
+ // For compatibility with bad naming permissions on permlevel1
+ if ($permlevel1 == 'propale') {
+ $permlevel1 = 'propal';
+ }
+ if ($permlevel1 == 'member') {
+ $permlevel1 = 'adherent';
+ }
+ if ($permlevel1 == 'recruitmentcandidature') {
+ $permlevel1 = 'recruitmentjobposition';
+ }
+
+ //var_dump($module.' '.$permlevel1.' '.$permlevel2);
if (empty($module) || empty($this->rights) || empty($this->rights->$module) || empty($permlevel1)) {
return 0;
}
if ($permlevel2) {
- if (!empty($this->rights->$module->$permlevel1) && !empty($this->rights->$module->$permlevel1->$permlevel2)) {
- return $this->rights->$module->$permlevel1->$permlevel2;
+ if (!empty($this->rights->$module->$permlevel1)) {
+ if (!empty($this->rights->$module->$permlevel1->$permlevel2)) {
+ return $this->rights->$module->$permlevel1->$permlevel2;
+ }
+ // For backward compatibility with old permissions called "lire", "creer", "create", "supprimer"
+ // instead of "read", "write", "delete"
+ if ($permlevel2 == 'read' && !empty($this->rights->$module->$permlevel1->lire)) {
+ return $this->rights->$module->lire;
+ }
+ if ($permlevel2 == 'write' && !empty($this->rights->$module->$permlevel1->creer)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel2 == 'write' && !empty($this->rights->$module->$permlevel1->create)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel2 == 'delete' && !empty($this->rights->$module->$permlevel1->supprimer)) {
+ return $this->rights->$module->supprimer;
+ }
}
} else {
if (!empty($this->rights->$module->$permlevel1)) {
return $this->rights->$module->$permlevel1;
}
+ // For backward compatibility with old permissions called "lire", "creer", "create", "supprimer"
+ // instead of "read", "write", "delete"
+ if ($permlevel1 == 'read' && !empty($this->rights->$module->lire)) {
+ return $this->rights->$module->lire;
+ }
+ if ($permlevel1 == 'write' && !empty($this->rights->$module->creer)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel1 == 'write' && !empty($this->rights->$module->create)) {
+ return $this->rights->$module->create;
+ }
+ if ($permlevel1 == 'delete' && !empty($this->rights->$module->supprimer)) {
+ return $this->rights->$module->supprimer;
+ }
}
return 0;
diff --git a/htdocs/user/group/card.php b/htdocs/user/group/card.php
index 1f20b018f2e..4fb9c51644f 100644
--- a/htdocs/user/group/card.php
+++ b/htdocs/user/group/card.php
@@ -96,7 +96,7 @@ if (empty($reshook)) {
if (empty($id) && (($action != 'add' && $action != 'create') || $cancel)) {
$backtopage = $backurlforlist;
} else {
- $backtopage = dol_buildpath('/user/group/card.php', 1).'?id='.($id > 0 ? $id : '__ID__');
+ $backtopage = DOL_URL_ROOT.'/user/group/card.php?id='.($id > 0 ? $id : '__ID__');
}
}
}
@@ -380,11 +380,11 @@ if ($action == 'create') {
}
if ($caneditperms) {
- print ''.$langs->trans("Modify").' ';
+ print ''.$langs->trans("Modify").' ';
}
if ($candisableperms) {
- print ''.$langs->trans("DeleteGroup").' ';
+ print ''.$langs->trans("DeleteGroup").' ';
}
print "\n";
@@ -418,7 +418,7 @@ if ($action == 'create') {
print $form->select_dolusers('', 'user', 1, $exclude, 0, '', '', $object->entity, 0, 0, '', 0, '', 'maxwidth300');
print ' ';
print ' ';
- print ' ';
+ print ' ';
print ' '."\n";
print '