diff --git a/dev/setup/codesniffer/README b/dev/setup/codesniffer/README
index 087fb318f6f..2fdc66b9d1f 100644
--- a/dev/setup/codesniffer/README
+++ b/dev/setup/codesniffer/README
@@ -10,6 +10,11 @@ To run phpcs:
> cd dolibarrgitrepo
> phpcs --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 .
+To fix with phpcbf:
+> cd dolibarrgitrepo
+> phpcbf --standard=dev/setup/codesniffer/ruleset.xml --extensions=php --parallel=8 .
+
+
Note with Eclipse: You must setup the PTI plugin of Eclipse into PHPCodeSniffer menu with:
* tab value to 4
* path of code sniffer standard to dev/codesniffer
diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php
index 2ffc1e2c9fd..0104f8f36e8 100644
--- a/htdocs/adherents/class/adherent_type.class.php
+++ b/htdocs/adherents/class/adherent_type.class.php
@@ -366,7 +366,7 @@ class AdherentType extends CommonObject
$sql .= "libelle = '".$this->db->escape($this->label)."',";
$sql .= "morphy = '".$this->db->escape($this->morphy)."',";
$sql .= "subscription = '".$this->db->escape($this->subscription)."',";
- $sql .= "amount = '".$this->db->escape($this->amount)."',";
+ $sql .= "amount = ".((empty($this->amount) && $this->amount == '') ? 'null' : ((float) $this->amount)).",";
$sql .= "duration = '".$this->db->escape($this->duration_value.$this->duration_unit)."',";
$sql .= "note = '".$this->db->escape($this->note)."',";
$sql .= "vote = ".(integer) $this->db->escape($this->vote).",";
diff --git a/htdocs/adherents/stats/index.php b/htdocs/adherents/stats/index.php
index 11c0025dcc5..e820d0a0d23 100644
--- a/htdocs/adherents/stats/index.php
+++ b/htdocs/adherents/stats/index.php
@@ -198,8 +198,8 @@ foreach ($data as $val) {
//print '';
print '';
print '
';
print '';
print '| ';
- print $langs->trans('Date');
+ print $langs->trans('DatePropal');
print ' | ';
if ($action != 'editdate' && $object->statut == Propal::STATUS_DRAFT && $usercancreate) {
print 'id.'">'.img_edit($langs->trans('SetDate'), 1).' | ';
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 43c83117457..e1ec555837f 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -10,7 +10,7 @@
* Copyright (C) 2012 Christophe Battarel
* Copyright (C) 2013 Cédric Salvador
* Copyright (C) 2015 Jean-François Ferry
- * Copyright (C) 2016-2018 Ferran Marcet
+ * Copyright (C) 2016-2021 Ferran Marcet
* Copyright (C) 2017-2018 Charlene Benke
* Copyright (C) 2018 Nicolas ZABOURI
* Copyright (C) 2019 Alexandre Spangaro
@@ -182,7 +182,7 @@ $arrayfields = array(
'state.nom'=>array('label'=>"StateShort", 'checked'=>0),
'country.code_iso'=>array('label'=>"Country", 'checked'=>0),
'typent.code'=>array('label'=>"ThirdPartyType", 'checked'=>$checkedtypetiers),
- 'p.date'=>array('label'=>"Date", 'checked'=>1),
+ 'p.date'=>array('label'=>"DatePropal", 'checked'=>1),
'p.fin_validite'=>array('label'=>"DateEnd", 'checked'=>1),
'p.date_livraison'=>array('label'=>"DeliveryDate", 'checked'=>0),
'ava.rowid'=>array('label'=>"AvailabilityPeriod", 'checked'=>0),
@@ -711,24 +711,12 @@ if ($resql) {
if ($sall) {
$param .= '&sall='.urlencode($sall);
}
- if ($search_date_start) {
- $param .= '&search_date_start='.urlencode($search_date_start);
- }
- if ($search_date_end) {
- $param .= '&search_date_end='.urlencode($search_date_end);
- }
- if ($search_dateend_start) {
- $param .= '&search_dateend_start='.urlencode($search_dateend_start);
- }
- if ($search_dateend_end) {
- $param .= '&search_dateend_end='.urlencode($search_dateend_end);
- }
- if ($search_datedelivery_start) {
- $param .= '&search_datedelivery_start='.urlencode($search_datedelivery_start);
- }
- if ($search_datedelivery_end) {
- $param .= '&search_datedelivery_end='.urlencode($search_datedelivery_end);
- }
+ if ($search_date_start) $param .= '&search_date_startday='.urlencode(dol_print_date($search_date_start, '%d')).'&search_date_startmonth='.urlencode(dol_print_date($search_date_start, '%m')).'&search_date_startyear='.urlencode(dol_print_date($search_date_start, '%Y'));
+ if ($search_date_end) $param .= '&search_date_endday='.urlencode(dol_print_date($search_date_end, '%d')).'&search_date_endmonth='.urlencode(dol_print_date($search_date_end, '%m')).'&search_date_endyear='.urlencode(dol_print_date($search_date_end, '%Y'));
+ if ($search_dateend_start) $param .= '&search_dateend_startday='.urlencode(dol_print_date($search_dateend_start, '%d')).'&search_dateend_startmonth='.urlencode(dol_print_date($search_dateend_start, '%m')).'&search_dateend_startyear='.urlencode(dol_print_date($search_dateend_start, '%Y'));
+ if ($search_dateend_end) $param .= '&search_dateend_endday='.urlencode(dol_print_date($search_dateend_end, '%d')).'&search_dateend_endmonth='.urlencode(dol_print_date($search_dateend_end, '%m')).'&search_dateend_endyear='.urlencode(dol_print_date($search_dateend_end, '%Y'));
+ if ($search_datedelivery_start) $param .= '&search_datedelivery_startday='.urlencode(dol_print_date($search_datedelivery_start, '%d')).'&search_datedelivery_startmonth='.urlencode(dol_print_date($search_datedelivery_start, '%m')).'&search_datedelivery_startyear='.urlencode(dol_print_date($search_datedelivery_start, '%Y'));
+ if ($search_datedelivery_end) $param .= '&search_datedelivery_endday='.urlencode(dol_print_date($search_datedelivery_end, '%d')).'&search_datedelivery_endmonth='.urlencode(dol_print_date($search_datedelivery_end, '%m')).'&search_datedelivery_endyear='.urlencode(dol_print_date($search_datedelivery_end, '%Y'));
if ($search_ref) {
$param .= '&search_ref='.urlencode($search_ref);
}
@@ -787,37 +775,37 @@ if ($resql) {
$param .= '&search_categ_cus='.urlencode($search_categ_cus);
}
if ($search_product_category != '') {
- $param .= '&search_product_category='.$search_product_category;
+ $param .= '&search_product_category='.urlencode($search_product_category);
}
if ($search_fk_cond_reglement > 0) {
- $param .= '&search_fk_cond_reglement='.$search_fk_cond_reglement;
+ $param .= '&search_fk_cond_reglement='.urlencode($search_fk_cond_reglement);
}
if ($search_fk_shipping_method > 0) {
- $param .= '&search_fk_shipping_method='.$search_fk_shipping_method;
+ $param .= '&search_fk_shipping_method='.urlencode($search_fk_shipping_method);
}
if ($search_fk_input_reason > 0) {
- $param .= '&search_fk_input_reason='.$search_fk_input_reason;
+ $param .= '&search_fk_input_reason='.urlencode($search_fk_input_reason);
}
if ($search_fk_mode_reglement > 0) {
- $param .= '&search_fk_mode_reglement='.$search_fk_mode_reglement;
+ $param .= '&search_fk_mode_reglement='.urlencode($search_fk_mode_reglement);
}
if ($search_type_thirdparty > 0) {
- $param .= '&search_type_thirdparty='.$search_type_thirdparty;
+ $param .= '&search_type_thirdparty='.urlencode($search_type_thirdparty);
}
if ($search_town) {
- $param .= '&search_town='.$search_town;
+ $param .= '&search_town='.urlencode($search_town);
}
if ($search_zip) {
- $param .= '&search_zip='.$search_zip;
+ $param .= '&search_zip='.urlencode($search_zip);
}
if ($search_state) {
- $param .= '&search_state='.$search_state;
+ $param .= '&search_state='.urlencode($search_state);
}
if ($search_town) {
- $param .= '&search_town='.$search_town;
+ $param .= '&search_town='.urlencode($search_town);
}
if ($search_country) {
- $param .= '&search_country='.$search_country;
+ $param .= '&search_country='.urlencode($search_country);
}
// Add $param from extra fields
@@ -825,23 +813,22 @@ if ($resql) {
// List of mass actions available
$arrayofmassactions = array(
- 'generate_doc'=>img_picto('', 'pdf').' '.$langs->trans("ReGeneratePDF"),
- 'builddoc'=>img_picto('', 'pdf').' '.$langs->trans("PDFMerge"),
-
+ 'generate_doc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("ReGeneratePDF"),
+ 'builddoc'=>img_picto('', 'pdf', 'class="pictofixedwidth"').$langs->trans("PDFMerge"),
);
if ($permissiontosendbymail) {
- $arrayofmassactions['presend']=img_picto('', 'email').' '.$langs->trans("SendByMail");
+ $arrayofmassactions['presend']=img_picto('', 'email', 'class="pictofixedwidth"').$langs->trans("SendByMail");
}
if ($permissiontovalidate) {
- $arrayofmassactions['prevalidate']=img_picto('', 'check').' '.$langs->trans("Validate");
+ $arrayofmassactions['prevalidate']=img_picto('', 'check', 'class="pictofixedwidth"').$langs->trans("Validate");
}
if ($permissiontoclose) {
- $arrayofmassactions['presign']=img_picto('', 'propal').' '.$langs->trans("Sign");
- $arrayofmassactions['nopresign']=img_picto('', 'propal').' '.$langs->trans("NoSign");
- $arrayofmassactions['setbilled'] =img_picto('', 'bill').' '.$langs->trans("ClassifyBilled");
+ $arrayofmassactions['presign']=img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("Sign");
+ $arrayofmassactions['nopresign']=img_picto('', 'propal', 'class="pictofixedwidth"').$langs->trans("NoSign");
+ $arrayofmassactions['setbilled'] =img_picto('', 'bill', 'class="pictofixedwidth"').$langs->trans("ClassifyBilled");
}
if ($permissiontodelete) {
- $arrayofmassactions['predelete'] = img_picto('', 'delete').' '.$langs->trans("Delete");
+ $arrayofmassactions['predelete'] = img_picto('', 'delete', 'class="pictofixedwidth"').$langs->trans("Delete");
}
if (in_array($massaction, array('presend', 'predelete', 'closed'))) {
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 3747b2107b2..5bb8e6ccb0c 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -9,7 +9,7 @@
* Copyright (C) 2015-2018 Frédéric France
* Copyright (C) 2015 Marcos García
* Copyright (C) 2015 Jean-François Ferry
- * Copyright (C) 2016 Ferran Marcet
+ * Copyright (C) 2016-2021 Ferran Marcet
* Copyright (C) 2018 Charlene Benke
* Copyright (C) 2021 Anthony Berton
*
@@ -706,10 +706,10 @@ if ($resql) {
$param .= '&search_status='.urlencode($search_status);
}
if ($search_datecloture_start) {
- $param .= '&search_datecloture_start='.urlencode($search_datecloture_start);
+ $param .= '&search_datecloture_startday='.dol_print_date($search_datecloture_start, '%d').'&search_datecloture_startmonth='.dol_print_date($search_datecloture_start, '%m').'&search_datecloture_startyear='.dol_print_date($search_datecloture_start, '%Y');
}
if ($search_datecloture_end) {
- $param .= '&search_datecloture_end='.urlencode($search_datecloture_end);
+ $param .= '&search_datecloture_endday='.dol_print_date($search_datecloture_end, '%d').'&search_datecloture_endmonth='.dol_print_date($search_datecloture_end, '%m').'&search_datecloture_endyear='.dol_print_date($search_datecloture_end, '%Y');
}
if ($search_dateorder_start) {
$param .= '&search_dateorder_start_day='.dol_print_date($search_dateorder_start, '%d').'&search_dateorder_start_month='.dol_print_date($search_dateorder_start, '%m').'&search_dateorder_start_year='.dol_print_date($search_dateorder_start, '%Y');
@@ -805,16 +805,16 @@ if ($resql) {
$param .= '&search_billed='.urlencode($search_billed);
}
if ($search_fk_cond_reglement > 0) {
- $param .= '&search_fk_cond_reglement='.$search_fk_cond_reglement;
+ $param .= '&search_fk_cond_reglement='.urlencode($search_fk_cond_reglement);
}
if ($search_fk_shipping_method > 0) {
- $param .= '&search_fk_shipping_method='.$search_fk_shipping_method;
+ $param .= '&search_fk_shipping_method='.urlencode($search_fk_shipping_method);
}
if ($search_fk_mode_reglement > 0) {
- $param .= '&search_fk_mode_reglement='.$search_fk_mode_reglement;
+ $param .= '&search_fk_mode_reglement='.urlencode($search_fk_mode_reglement);
}
if ($search_fk_input_reason > 0) {
- $param .= '&search_fk_input_reason='.$search_fk_input_reason;
+ $param .= '&search_fk_input_reason='.urlencode($search_fk_input_reason);
}
// Add $param from extra fields
@@ -887,7 +887,6 @@ if ($resql) {
}
if ($massaction == 'createbills') {
- //var_dump($_REQUEST);
print '';
print '';
diff --git a/htdocs/compta/bank/card.php b/htdocs/compta/bank/card.php
index bf30b1831f9..30aa32a8d58 100644
--- a/htdocs/compta/bank/card.php
+++ b/htdocs/compta/bank/card.php
@@ -829,7 +829,7 @@ if ($action == 'create') {
print '
|