diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index 8daae94efe6..0193d9c1f75 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -389,11 +389,11 @@ if ($resql)
{
print '
';
print '' . $langs->trans("ACCOUNTING_MANAGE_ZERO") . ' ';
if (! empty($conf->global->ACCOUNTING_MANAGE_ZERO)) {
- 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/accountancy/bookkeeping/card.php b/htdocs/accountancy/bookkeeping/card.php
index 8974b65a68f..d94ce0ec315 100644
--- a/htdocs/accountancy/bookkeeping/card.php
+++ b/htdocs/accountancy/bookkeeping/card.php
@@ -531,11 +531,11 @@ if ($action == 'create')
print '' . $langs->trans("Status") . ' ';
print '';
if (empty($object->validated)) {
- print 'rowid . '&action=enable">';
+ print ' rowid . '&action=enable">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
} else {
- print 'rowid . '&action=disable">';
+ print ' rowid . '&action=disable">';
print img_picto($langs->trans("Activated"), 'switch_on');
print ' ';
}
diff --git a/htdocs/accountancy/class/accountancyexport.class.php b/htdocs/accountancy/class/accountancyexport.class.php
index b9339a8150b..8ca2de4a132 100644
--- a/htdocs/accountancy/class/accountancyexport.class.php
+++ b/htdocs/accountancy/class/accountancyexport.class.php
@@ -616,7 +616,7 @@ class AccountancyExport
$date = dol_print_date($line->doc_date, '%d/%m/%Y');
print $date . $separator;
- print $line->code_journal;
+ print $line->code_journal . $separator;
if (empty($line->subledger_account)) {
print length_accountg($line->numero_compte) . $separator;
} else {
diff --git a/htdocs/adherents/agenda.php b/htdocs/adherents/agenda.php
index 5b2c3e912dd..105251ec114 100644
--- a/htdocs/adherents/agenda.php
+++ b/htdocs/adherents/agenda.php
@@ -137,7 +137,7 @@ if ($object->id > 0)
print '
';
$object->info($id);
- print dol_print_object_info($object, 1);
+ dol_print_object_info($object, 1);
print '';
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index c310bb18627..5e7847efa82 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -65,7 +65,7 @@ class AdherentType extends CommonObject
* @var string Adherent type label
*/
public $label;
-
+
/**
* @var string Adherent type nature
*/
@@ -410,7 +410,7 @@ class AdherentType extends CommonObject
return -1;
}
}
-
+
/**
* Return translated label by the nature of a adherent (physical or moral)
*
@@ -422,7 +422,7 @@ class AdherentType extends CommonObject
global $langs;
if ($morphy == 'phy') { return $langs->trans("Physical"); }
elseif ($morphy == 'mor') { return $langs->trans("Moral"); }
- else return $langs->trans("Physical & Morale");
+ else return $langs->trans("Physical & Morale");
//return $morphy;
}
@@ -463,6 +463,7 @@ class AdherentType extends CommonObject
}
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Retourne chaine DN complete dans l'annuaire LDAP pour l'objet
*
@@ -472,7 +473,7 @@ class AdherentType extends CommonObject
* 2=Return key only (uid=qqq)
* @return string DN
*/
- private function _load_ldap_dn($info, $mode = 0)
+ public function _load_ldap_dn($info, $mode = 0)
{
// phpcs:enable
global $conf;
@@ -485,12 +486,13 @@ class AdherentType extends CommonObject
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
+ // phpcs:disable PEAR.NamingConventions.ValidFunctionName.PublicUnderscore
/**
* Initialize the info array (array of LDAP values) that will be used to call LDAP functions
*
* @return array Tableau info des attributs
*/
- private function _load_ldap_info()
+ public function _load_ldap_info()
{
// phpcs:enable
global $conf,$langs;
diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php
index 4a7229af5ef..5cad21cdd71 100644
--- a/htdocs/adherents/stats/index.php
+++ b/htdocs/adherents/stats/index.php
@@ -151,8 +151,7 @@ print '';
print '
';
print ''.$langs->trans("Filter").' ';
print ''.$langs->trans("Member").' ';
-$filter='s.client in (1,2,3)';
-print $form->select_company($id,'memberid',$filter,1);
+print $form->select_company($id,'memberid','',1);
print ' ';
print ''.$langs->trans("User").' ';
print $form->select_dolusers($userid, 'userid', 1, '', 0, '', '', 0, 0, 0, '', 0, '', 'maxwidth300');
diff --git a/htdocs/admin/bom.php b/htdocs/admin/bom.php
index b7f1f0e6db9..b6e62973cf7 100644
--- a/htdocs/admin/bom.php
+++ b/htdocs/admin/bom.php
@@ -275,7 +275,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/admin/chequereceipts.php b/htdocs/admin/chequereceipts.php
index e8e035f8b49..efc192e6de1 100644
--- a/htdocs/admin/chequereceipts.php
+++ b/htdocs/admin/chequereceipts.php
@@ -184,7 +184,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print ' ';
diff --git a/htdocs/admin/contract.php b/htdocs/admin/contract.php
index bf02df80b5b..63597eaa22b 100644
--- a/htdocs/admin/contract.php
+++ b/htdocs/admin/contract.php
@@ -256,7 +256,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/admin/emailcollector_card.php b/htdocs/admin/emailcollector_card.php
index a27be02acb0..6d1b640f45b 100644
--- a/htdocs/admin/emailcollector_card.php
+++ b/htdocs/admin/emailcollector_card.php
@@ -608,9 +608,8 @@ if ($object->id > 0 && (empty($action) || ($action != 'edit' && $action != 'crea
}
print '';
// Delete
- print '';
- print ' id.'&action=editoperation&operationid='.$ruleaction['id'].'">'.img_edit().' ';
- print ' ';
+ print ' ';
+ print 'id.'&action=editoperation&operationid='.$ruleaction['id'].'">'.img_edit().' ';
print ' id.'&action=deleteoperation&operationid='.$ruleaction['id'].'">'.img_delete().' ';
print ' ';
print ' ';
diff --git a/htdocs/admin/expedition.php b/htdocs/admin/expedition.php
index 04dcf3ddc36..23a154511c1 100644
--- a/htdocs/admin/expedition.php
+++ b/htdocs/admin/expedition.php
@@ -261,7 +261,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/admin/expensereport.php b/htdocs/admin/expensereport.php
index cac83ef8d8b..da77c0e78d3 100644
--- a/htdocs/admin/expensereport.php
+++ b/htdocs/admin/expensereport.php
@@ -267,7 +267,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/admin/external_rss.php b/htdocs/admin/external_rss.php
index b9b78e55ec9..94abf8df2ab 100644
--- a/htdocs/admin/external_rss.php
+++ b/htdocs/admin/external_rss.php
@@ -66,8 +66,8 @@ else
if ($action == 'add' || GETPOST("modify"))
{
- $external_rss_title = "external_rss_title_" . GETPOST("norss");
- $external_rss_urlrss = "external_rss_urlrss_" . GETPOST("norss");
+ $external_rss_title = "external_rss_title_" . GETPOST("norss", 'int');
+ $external_rss_urlrss = "external_rss_urlrss_" . GETPOST("norss", 'int');
if (! empty($_POST[$external_rss_urlrss]))
{
@@ -95,7 +95,7 @@ if ($action == 'add' || GETPOST("modify"))
{
// Ajoute boite box_external_rss dans definition des boites
$sql = "INSERT INTO ".MAIN_DB_PREFIX."boxes_def (file, note)";
- $sql.= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss").' ('.GETPOST($external_rss_title)).")')";
+ $sql.= " VALUES ('box_external_rss.php','".$db->escape(GETPOST("norss", 'int').' ('.GETPOST($external_rss_title, 'alpha')).")')";
if (! $db->query($sql))
{
dol_print_error($db);
@@ -103,8 +103,8 @@ if ($action == 'add' || GETPOST("modify"))
}
}
- $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"), GETPOST($external_rss_title), 'chaine', 0, '', $conf->entity);
- if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"), GETPOST($external_rss_urlrss), 'chaine', 0, '', $conf->entity);
+ $result1=dolibarr_set_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss", 'int'), GETPOST($external_rss_title, 'alpha'), 'chaine', 0, '', $conf->entity);
+ if ($result1) $result2=dolibarr_set_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss", 'int'), GETPOST($external_rss_urlrss, 'alpha'), 'chaine', 0, '', $conf->entity);
if ($result1 && $result2)
{
@@ -122,13 +122,13 @@ if ($action == 'add' || GETPOST("modify"))
if ($_POST["delete"])
{
- if(GETPOST("norss"))
+ if (GETPOST("norss", 'int'))
{
$db->begin();
// Supprime boite box_external_rss de definition des boites
$sql = "SELECT rowid FROM ".MAIN_DB_PREFIX."boxes_def";
- $sql.= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOST("norss"))." %'";
+ $sql.= " WHERE file = 'box_external_rss.php' AND note LIKE '".$db->escape(GETPOST("norss", 'int'))." %'";
$resql=$db->query($sql);
if ($resql)
@@ -168,8 +168,8 @@ if ($_POST["delete"])
}
- $result1=dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_" . GETPOST("norss"), $conf->entity);
- if ($result1) $result2=dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_" . GETPOST("norss"), $conf->entity);
+ $result1=dolibarr_del_const($db, "EXTERNAL_RSS_TITLE_".GETPOST("norss", 'int'), $conf->entity);
+ if ($result1) $result2=dolibarr_del_const($db, "EXTERNAL_RSS_URLRSS_".GETPOST("norss", 'int'), $conf->entity);
if ($result1 && $result2)
{
@@ -270,13 +270,13 @@ if ($resql)
print '';
print "".$langs->trans("Title")." ";
- print " global->$keyrsstitle . "\"> ";
+ print " global->$keyrsstitle) . "\"> ";
print " ";
print '';
print "".$langs->trans("URL")." ";
- print " global->$keyrssurl . "\"> ";
+ print " global->$keyrssurl) . "\"> ";
print " ";
diff --git a/htdocs/admin/facture.php b/htdocs/admin/facture.php
index 57a18afcbd3..765f2e6f995 100644
--- a/htdocs/admin/facture.php
+++ b/htdocs/admin/facture.php
@@ -352,7 +352,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
diff --git a/htdocs/admin/fichinter.php b/htdocs/admin/fichinter.php
index a407edd3864..27f105435d5 100644
--- a/htdocs/admin/fichinter.php
+++ b/htdocs/admin/fichinter.php
@@ -331,7 +331,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
diff --git a/htdocs/admin/holiday.php b/htdocs/admin/holiday.php
index 347d45d729d..e3571fdb253 100644
--- a/htdocs/admin/holiday.php
+++ b/htdocs/admin/holiday.php
@@ -257,7 +257,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/admin/livraison.php b/htdocs/admin/livraison.php
index d11d07c5f38..7635c9a3c19 100644
--- a/htdocs/admin/livraison.php
+++ b/htdocs/admin/livraison.php
@@ -252,7 +252,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
diff --git a/htdocs/admin/mailman.php b/htdocs/admin/mailman.php
index 517ec9b9dc5..4ee9e214890 100644
--- a/htdocs/admin/mailman.php
+++ b/htdocs/admin/mailman.php
@@ -162,7 +162,7 @@ if (! empty($conf->global->ADHERENT_USE_MAILMAN))
dol_fiche_head($head, 'mailman', $langs->trans("Setup"), 0, 'user');
//$link=img_picto($langs->trans("Active"),'tick').' ';
- $link='';
+ $link=' ';
//$link.=$langs->trans("Disable");
$link.=img_picto($langs->trans("Activated"), 'switch_on');
$link.=' ';
diff --git a/htdocs/admin/mails.php b/htdocs/admin/mails.php
index d74f10ca58c..bc12fd5ddd6 100644
--- a/htdocs/admin/mails.php
+++ b/htdocs/admin/mails.php
@@ -519,7 +519,7 @@ else
{
dol_fiche_head($head, 'common', '', -1);
- print $langs->trans("EMailsDesc")." \n";
+ print ''.$langs->trans("EMailsDesc")." \n";
print " \n";
print '';
diff --git a/htdocs/admin/mails_emailing.php b/htdocs/admin/mails_emailing.php
index 4ce8d8c0b72..1e54fdea3dd 100644
--- a/htdocs/admin/mails_emailing.php
+++ b/htdocs/admin/mails_emailing.php
@@ -396,7 +396,7 @@ else
{
dol_fiche_head($head, 'common_emailing', '', -1);
- print $langs->trans("EMailsDesc")." \n";
+ print ''.$langs->trans("EMailsDesc")." \n";
print " \n";
print '';
diff --git a/htdocs/admin/payment.php b/htdocs/admin/payment.php
index aaba339e30e..4e80fe55e25 100644
--- a/htdocs/admin/payment.php
+++ b/htdocs/admin/payment.php
@@ -183,7 +183,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
diff --git a/htdocs/admin/propal.php b/htdocs/admin/propal.php
index db41876b02c..843de325e73 100644
--- a/htdocs/admin/propal.php
+++ b/htdocs/admin/propal.php
@@ -314,7 +314,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/admin/reception_setup.php b/htdocs/admin/reception_setup.php
index f97c1d7823b..a1fd76e0d5d 100644
--- a/htdocs/admin/reception_setup.php
+++ b/htdocs/admin/reception_setup.php
@@ -266,7 +266,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print 'scandir.'&label='.urlencode($module->name).'">';
+ print ' scandir.'&label='.urlencode($module->name).'">';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/admin/spip.php b/htdocs/admin/spip.php
index 96552ed2c0d..e0b4b986969 100644
--- a/htdocs/admin/spip.php
+++ b/htdocs/admin/spip.php
@@ -64,10 +64,10 @@ if ($action == 'update' || $action == 'add')
$constnote=$_POST["constnote"][$key];
$res=dolibarr_set_const($db, $constname, $constvalue, $type[$consttype], 0, $constnote, $conf->entity);
-
+
if (! $res > 0) $error++;
}
-
+
if (! $error)
{
setEventMessages($langs->trans("SetupSaved"), null, 'mesgs');
@@ -123,9 +123,9 @@ $head = mailmanspip_admin_prepare_head();
if (! empty($conf->global->ADHERENT_USE_SPIP))
{
print '';
}
else
{
dol_fiche_head($head, 'spip', $langs->trans("Setup"), 0, 'user');
-
- $link='';
+
+ $link=' ';
//$link.=$langs->trans("Activate");
$link.=img_picto($langs->trans("Disabled"), 'switch_off');
$link.=' ';
print load_fiche_titre($langs->trans('SPIPTitle'), $link, '');
-
+
dol_fiche_end();
}
diff --git a/htdocs/admin/supplier_invoice.php b/htdocs/admin/supplier_invoice.php
index 6d8936fbe71..836afc27a7c 100644
--- a/htdocs/admin/supplier_invoice.php
+++ b/htdocs/admin/supplier_invoice.php
@@ -276,7 +276,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
diff --git a/htdocs/admin/supplier_order.php b/htdocs/admin/supplier_order.php
index c414eca8158..e895a0b4005 100644
--- a/htdocs/admin/supplier_order.php
+++ b/htdocs/admin/supplier_order.php
@@ -178,7 +178,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
// TODO We add/delete permission here until permission can have a condition on a global var
include_once DOL_DOCUMENT_ROOT.'/core/modules/modFournisseur.class.php';
$newmodule=new modFournisseur($db);
-
+
if ($conf->global->SUPPLIER_ORDER_3_STEPS_TO_BE_APPROVED)
{
// clear default rights array
@@ -191,7 +191,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
$newmodule->rights[$r][3] = 0;
$newmodule->rights[$r][4] = 'commande';
$newmodule->rights[$r][5] = 'approve2';
-
+
// Insert
$newmodule->insert_permissions(1);
}
@@ -199,7 +199,7 @@ elseif ($action == 'set_SUPPLIER_ORDER_OTHER')
{
// Remove all rights with Permission1190
$newmodule->delete_permissions();
-
+
// Add all right without Permission1190
$newmodule->insert_permissions(1);
}
@@ -306,7 +306,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print ''.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
diff --git a/htdocs/admin/supplier_payment.php b/htdocs/admin/supplier_payment.php
index 4cf53e6d82f..49af65bd786 100644
--- a/htdocs/admin/supplier_payment.php
+++ b/htdocs/admin/supplier_payment.php
@@ -268,7 +268,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
+ print 'scandir.'&label='.urlencode($module->name).'" alt="'.$langs->trans("Default").'">'.img_picto($langs->trans("Disabled"), 'switch_off').' ';
}
print '';
diff --git a/htdocs/admin/supplier_proposal.php b/htdocs/admin/supplier_proposal.php
index b757fb66673..8b17c860fd4 100644
--- a/htdocs/admin/supplier_proposal.php
+++ b/htdocs/admin/supplier_proposal.php
@@ -283,7 +283,7 @@ foreach ($dirmodels as $reldir)
}
else
{
- print '';
+ print ' ';
print img_picto($langs->trans("Disabled"), 'switch_off');
print ' ';
}
diff --git a/htdocs/admin/system/database-tables.php b/htdocs/admin/system/database-tables.php
index 8e018bc2255..c04c91e0e66 100644
--- a/htdocs/admin/system/database-tables.php
+++ b/htdocs/admin/system/database-tables.php
@@ -36,7 +36,13 @@ $action=GETPOST('action', 'alpha');
if ($action == 'convert')
{
- $db->query("alter table ".$_GET["table"]." ENGINE=INNODB");
+ $sql="ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." ENGINE=INNODB";
+ $db->query($sql);
+}
+if ($action == 'convertutf8')
+{
+ $sql="ALTER TABLE ".$db->escape(GETPOST("table", "aZ09"))." CHARACTER SET utf8 COLLATE utf8_unicode_ci";
+ $db->query($sql);
}
@@ -111,23 +117,28 @@ else
print ''.$obj->Name.' ';
print ''.$obj->Engine.' ';
- if (isset($row[1]) && $row[1] == "MyISAM")
+ if (isset($obj->Engine) && $obj->Engine == "MyISAM")
{
- print ''.$langs->trans("Convert").' ';
+ print ''.$langs->trans("Convert").' InnoDB ';
}
else
{
print ' ';
}
print ''.$obj->Row_format.' ';
- print ''.$obj->Rows.' ';
- print ''.$obj->Avg_row_length.' ';
- print ''.$obj->Data_length.' ';
- print ''.$obj->Max_data_length.' ';
- print ''.$obj->Index_length.' ';
- print ''.$obj->Auto_increment.' ';
- print ''.$obj->Check_time.' ';
- print ''.$obj->Collation.' ';
+ print ''.$obj->Rows.' ';
+ print ''.$obj->Avg_row_length.' ';
+ print ''.$obj->Data_length.' ';
+ print ''.$obj->Max_data_length.' ';
+ print ''.$obj->Index_length.' ';
+ print ''.$obj->Auto_increment.' ';
+ print ''.$obj->Check_time.' ';
+ print ''.$obj->Collation;
+ if (isset($obj->Collation) && ($obj->Collation == "utf8mb4_general_ci" || $obj->Collation == "utf8mb4_unicode_ci"))
+ {
+ print ''.$langs->trans("Convert").' UTF8 ';
+ }
+ print ' ';
print '';
$i++;
}
diff --git a/htdocs/admin/ticket.php b/htdocs/admin/ticket.php
index f9e985cec94..331d7e992ba 100644
--- a/htdocs/admin/ticket.php
+++ b/htdocs/admin/ticket.php
@@ -259,7 +259,7 @@ foreach ($dirmodels as $reldir) {
if ($conf->global->TICKET_ADDON == 'mod_' . $classname) {
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 '';
diff --git a/htdocs/admin/tools/export_files.php b/htdocs/admin/tools/export_files.php
index c593846a29d..c1ddedfea53 100644
--- a/htdocs/admin/tools/export_files.php
+++ b/htdocs/admin/tools/export_files.php
@@ -36,6 +36,8 @@ $export_type=GETPOST('export_type', 'alpha');
$file=GETPOST('zipfilename_template', 'alpha');
$compression = GETPOST('compression');
+$file = dol_sanitizeFileName($file);
+
$sortfield = GETPOST('sortfield', 'alpha');
$sortorder = GETPOST('sortorder', 'alpha');
$page = GETPOST("page", 'int');
@@ -57,10 +59,11 @@ $errormsg='';
if ($action == 'delete')
{
- $file=$conf->admin->dir_output.'/'.GETPOST('urlfile');
- $ret=dol_delete_file($file, 1);
- if ($ret) setEventMessages($langs->trans("FileWasRemoved", GETPOST('urlfile')), null, 'mesgs');
- else setEventMessages($langs->trans("ErrorFailToDeleteFile", GETPOST('urlfile')), null, 'errors');
+ $filerelative = dol_sanitizeFileName(GETPOST('urlfile', 'alpha'));
+ $filepath=$conf->admin->dir_output.'/'.$filerelative;
+ $ret=dol_delete_file($filepath, 1);
+ if ($ret) setEventMessages($langs->trans("FileWasRemoved", $filerelative), null, 'mesgs');
+ else setEventMessages($langs->trans("ErrorFailToDeleteFile", $filerelative), null, 'errors');
$action='';
}
diff --git a/htdocs/admin/workflow.php b/htdocs/admin/workflow.php
index b1e8c310ed0..806f53c463c 100644
--- a/htdocs/admin/workflow.php
+++ b/htdocs/admin/workflow.php
@@ -171,13 +171,13 @@ foreach($workflowcodes as $key => $params)
{
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/api/admin/index.php b/htdocs/api/admin/index.php
index 6d7ac9d2f85..ed23151d99b 100644
--- a/htdocs/api/admin/index.php
+++ b/htdocs/api/admin/index.php
@@ -108,13 +108,13 @@ print ''.$langs->trans("ApiProductionMode").' ';
$production_mode=(empty($conf->global->API_PRODUCTION_MODE)?false:true);
if ($production_mode)
{
- 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/bom/bom_agenda.php b/htdocs/bom/bom_agenda.php
index a1db711dd3e..a4bf134e3ce 100644
--- a/htdocs/bom/bom_agenda.php
+++ b/htdocs/bom/bom_agenda.php
@@ -23,25 +23,12 @@
*/
// Load Dolibarr environment
-$res=0;
-// Try main.inc.php into web root known defined into CONTEXT_DOCUMENT_ROOT (not always defined)
-if (! $res && ! empty($_SERVER["CONTEXT_DOCUMENT_ROOT"])) $res=@include $_SERVER["CONTEXT_DOCUMENT_ROOT"]."/main.inc.php";
-// Try main.inc.php into web root detected using web root calculated from SCRIPT_FILENAME
-$tmp=empty($_SERVER['SCRIPT_FILENAME'])?'':$_SERVER['SCRIPT_FILENAME'];$tmp2=realpath(__FILE__); $i=strlen($tmp)-1; $j=strlen($tmp2)-1;
-while($i > 0 && $j > 0 && isset($tmp[$i]) && isset($tmp2[$j]) && $tmp[$i]==$tmp2[$j]) { $i--; $j--; }
-if (! $res && $i > 0 && file_exists(substr($tmp, 0, ($i+1))."/main.inc.php")) $res=@include substr($tmp, 0, ($i+1))."/main.inc.php";
-if (! $res && $i > 0 && file_exists(dirname(substr($tmp, 0, ($i+1)))."/main.inc.php")) $res=@include dirname(substr($tmp, 0, ($i+1)))."/main.inc.php";
-// Try main.inc.php using relative path
-if (! $res && file_exists("../main.inc.php")) $res=@include "../main.inc.php";
-if (! $res && file_exists("../../main.inc.php")) $res=@include "../../main.inc.php";
-if (! $res && file_exists("../../../main.inc.php")) $res=@include "../../../main.inc.php";
-if (! $res) die("Include of main fails");
-
+require '../main.inc.php';
require_once DOL_DOCUMENT_ROOT.'/contact/class/contact.class.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/company.lib.php';
require_once DOL_DOCUMENT_ROOT.'/core/lib/functions2.lib.php';
-dol_include_once('/bom/class/bom.class.php');
-dol_include_once('/bom/lib/bom.lib.php');
+require_once DOL_DOCUMENT_ROOT.'/bom/class/bom.class.php';
+require_once DOL_DOCUMENT_ROOT.'/bom/lib/bom.lib.php';
// Load translation files required by the page
@@ -196,7 +183,7 @@ if ($object->id > 0)
print '
';
$object->info($object->id);
- print dol_print_object_info($object, 1);
+ dol_print_object_info($object, 1);
print '';
diff --git a/htdocs/cashdesk/admin/cashdesk.php b/htdocs/cashdesk/admin/cashdesk.php
index 4fcb7450e9d..cdba572f96c 100644
--- a/htdocs/cashdesk/admin/cashdesk.php
+++ b/htdocs/cashdesk/admin/cashdesk.php
@@ -121,7 +121,7 @@ print "\n";
print ''.$langs->trans("CashDeskThirdPartyForSell").' ';
print '';
-print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3) AND s.status = 1', 1, 0, 0, array(), 0);
+print $form->select_company($conf->global->CASHDESK_ID_THIRDPARTY, 'socid', '(s.client in (1,3) AND s.status = 1)', 1, 0, 0, array(), 0);
print ' ';
if (! empty($conf->banque->enabled))
{
diff --git a/htdocs/cashdesk/facturation_verif.php b/htdocs/cashdesk/facturation_verif.php
index a7aab12b2ef..6dbbdd4f900 100644
--- a/htdocs/cashdesk/facturation_verif.php
+++ b/htdocs/cashdesk/facturation_verif.php
@@ -49,11 +49,11 @@ switch($action)
// Recuperation des donnees en fonction de la source (liste deroulante ou champ texte) ...
if ( $_POST['hdnSource'] == 'LISTE' )
{
- $sql.= " AND p.rowid = ".$_POST['selProduit'];
+ $sql.= " AND p.rowid = ".((int) GETPOST('selProduit', 'int'));
}
elseif ( $_POST['hdnSource'] == 'REF' )
{
- $sql.= " AND p.ref = '".$_POST['txtRef']."'";
+ $sql.= " AND p.ref = '".$db->escape(GETPOST('txtRef', 'alpha'))."'";
}
$result = $db->query($sql);
diff --git a/htdocs/cashdesk/index.php b/htdocs/cashdesk/index.php
index 56da8496b9f..8bd64c76e2b 100644
--- a/htdocs/cashdesk/index.php
+++ b/htdocs/cashdesk/index.php
@@ -134,7 +134,7 @@ print '';
$disabled=0;
$langs->load("companies");
if (! empty($conf->global->CASHDESK_ID_THIRDPARTY)) $disabled=1; // If a particular third party is defined, we disable choice
-print $form->select_company(GETPOST('socid', 'int')?GETPOST('socid', 'int'):$conf->global->CASHDESK_ID_THIRDPARTY, 'socid', 's.client in (1,3) AND s.status = 1', !$disabled, $disabled, 1);
+print $form->select_company(GETPOST('socid', 'int')?GETPOST('socid', 'int'):$conf->global->CASHDESK_ID_THIRDPARTY, 'socid', '(s.client IN (1,3) AND s.status = 1)', !$disabled, $disabled, 1);
//print ' ';
print ' ';
print "\n";
diff --git a/htdocs/cashdesk/tpl/menu.tpl.php b/htdocs/cashdesk/tpl/menu.tpl.php
index d65a39fc6aa..bc8bb1bcaed 100644
--- a/htdocs/cashdesk/tpl/menu.tpl.php
+++ b/htdocs/cashdesk/tpl/menu.tpl.php
@@ -78,7 +78,7 @@ print '