';
* Last modified proposals
*/
-$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, date_cloture as datec";
-$sql .= ", s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
-$sql .= " FROM ".MAIN_DB_PREFIX."propal as c";
-$sql .= ", ".MAIN_DB_PREFIX."societe as s";
+$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, date_cloture as datec, c.tms as datem,";
+$sql .= " s.nom as socname, s.rowid as socid, s.canvas, s.client, s.email, s.code_compta";
+$sql .= " FROM ".MAIN_DB_PREFIX."propal as c,";
+$sql .= " ".MAIN_DB_PREFIX."societe as s";
$sql .= " WHERE c.entity IN (".getEntity($propalstatic->element).")";
$sql .= " AND c.fk_soc = s.rowid";
// If the internal user must only see his customers, force searching by him
@@ -190,7 +190,8 @@ $sql .= $db->plimit($max, 0);
$resql = $db->query($sql);
if ($resql) {
$num = $db->num_rows($resql);
- startSimpleTable($langs->trans("LastModifiedProposals", $max), "", "", 3);
+
+ startSimpleTable($langs->trans("LastModifiedProposals", $max), "comm/propal/list.php", "sortfield=p.tms&sortorder=DESC", 2, -1, 'propal');
if ($num) {
$i = 0;
@@ -213,7 +214,7 @@ if ($resql) {
print '
';
- print '| ';
+ print ' | ';
print '';
print '';
print '| '.$propalstatic->getNomUrl(1).' | ';
@@ -224,8 +225,13 @@ if ($resql) {
print '';
print ''.$companystatic->getNomUrl(1, 'customer').' | ';
- print ''.dol_print_date($db->jdate($obj->datec), 'day').' | ';
- print ''.$propalstatic->LibStatut($obj->fk_statut, 3).' | ';
+
+ $datem = $db->jdate($obj->datem);
+ print '';
+ print dol_print_date($datem, 'day', 'tzuserrel');
+ print ' | ';
+
+ print ''.$propalstatic->LibStatut($obj->status, 3).' | ';
print ' ';
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 1769bafaaad..8f634db6ea0 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -73,6 +73,7 @@ $confirm = GETPOST('confirm', 'alpha');
$cancel = GETPOST('cancel', 'alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'proposallist';
+$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('mode', 'alpha');
// Search Fields
@@ -102,8 +103,8 @@ $search_product_category = GETPOSTINT('search_product_category');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST("search_state");
-$search_country = GETPOSTINT("search_country");
-$search_type_thirdparty = GETPOSTINT("search_type_thirdparty");
+$search_country = GETPOST("search_country", 'aZ09');
+$search_type_thirdparty = GETPOST("search_type_thirdparty", 'intcomma');
$search_date_startday = GETPOSTINT('search_date_startday');
$search_date_startmonth = GETPOSTINT('search_date_startmonth');
$search_date_startyear = GETPOSTINT('search_date_startyear');
@@ -128,12 +129,12 @@ $search_date_delivery_endmonth = GETPOSTINT('search_date_delivery_endmonth');
$search_date_delivery_endyear = GETPOSTINT('search_date_delivery_endyear');
$search_date_delivery_start = dol_mktime(0, 0, 0, $search_date_delivery_startmonth, $search_date_delivery_startday, $search_date_delivery_startyear);
$search_date_delivery_end = dol_mktime(23, 59, 59, $search_date_delivery_endmonth, $search_date_delivery_endday, $search_date_delivery_endyear);
-$search_availability = GETPOSTINT('search_availability');
-$search_categ_cus = GETPOSTINT("search_categ_cus");
-$search_fk_cond_reglement = GETPOSTINT("search_fk_cond_reglement");
-$search_fk_shipping_method = GETPOSTINT("search_fk_shipping_method");
-$search_fk_input_reason = GETPOSTINT("search_fk_input_reason");
-$search_fk_mode_reglement = GETPOSTINT("search_fk_mode_reglement");
+$search_availability = GETPOST('search_availability', 'intcomma');
+$search_categ_cus = GETPOST("search_categ_cus", 'intcomma');
+$search_fk_cond_reglement = GETPOST("search_fk_cond_reglement", 'intcomma');
+$search_fk_shipping_method = GETPOST("search_fk_shipping_method", 'intcomma');
+$search_fk_input_reason = GETPOST("search_fk_input_reason", 'intcomma');
+$search_fk_mode_reglement = GETPOST("search_fk_mode_reglement", 'intcomma');
$search_date_signature_startday = GETPOSTINT('search_date_signature_startday');
$search_date_signature_startmonth = GETPOSTINT('search_date_signature_startmonth');
$search_date_signature_startyear = GETPOSTINT('search_date_signature_startyear');
@@ -144,8 +145,6 @@ $search_date_signature_start = dol_mktime(0, 0, 0, $search_date_signature_startm
$search_date_signature_end = dol_mktime(23, 59, 59, $search_date_signature_endmonth, $search_date_signature_endday, $search_date_signature_endyear);
$search_status = GETPOST('search_status', 'alpha');
-$optioncss = GETPOST('optioncss', 'alpha');
-
// Pagination
$limit = GETPOSTINT('limit') ? GETPOSTINT('limit') : $conf->liste_limit;
$sortfield = GETPOST('sortfield', 'aZ09comma');
@@ -1254,7 +1253,7 @@ if (!empty($arrayfields['country.code_iso']['checked'])) {
// Company type
if (!empty($arrayfields['typent.code']['checked'])) {
print '';
- print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, (!getDolGlobalString('SOCIETE_SORT_ON_TYPEENT') ? 'ASC' : $conf->global->SOCIETE_SORT_ON_TYPEENT), '', 1);
+ print $form->selectarray("search_type_thirdparty", $formcompany->typent_array(0), $search_type_thirdparty, 1, 0, 0, '', 0, 0, 0, getDolGlobalString('SOCIETE_SORT_ON_TYPEENT', 'ASC'), 'maxwidth100', 1);
print ajax_combobox('search_type_thirdparty');
print ' | ';
}
@@ -1525,27 +1524,27 @@ if (!empty($arrayfields['state.nom']['checked'])) {
$totalarray['nbfield']++;
}
if (!empty($arrayfields['country.code_iso']['checked'])) {
- print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, 'class="center"', $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['country.code_iso']['label'], $_SERVER["PHP_SELF"], "country.code_iso", "", $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
}
if (!empty($arrayfields['typent.code']['checked'])) {
- print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, 'class="center"', $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['typent.code']['label'], $_SERVER["PHP_SELF"], "typent.code", "", $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
}
if (!empty($arrayfields['p.date']['checked'])) {
- print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, 'class="center"', $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['p.date']['label'], $_SERVER["PHP_SELF"], 'p.datep', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
}
if (!empty($arrayfields['p.fin_validite']['checked'])) {
- print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, 'class="center"', $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['p.fin_validite']['label'], $_SERVER["PHP_SELF"], 'dfv', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
}
if (!empty($arrayfields['p.date_livraison']['checked'])) {
- print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, 'class="center"', $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['p.date_livraison']['label'], $_SERVER["PHP_SELF"], 'p.date_livraison', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
}
if (!empty($arrayfields['p.date_signature']['checked'])) {
- print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, 'class="center"', $sortfield, $sortorder);
+ print_liste_field_titre($arrayfields['p.date_signature']['label'], $_SERVER["PHP_SELF"], 'p.date_signature', '', $param, '', $sortfield, $sortorder, 'center ');
$totalarray['nbfield']++;
}
if (!empty($arrayfields['ava.rowid']['checked'])) {
diff --git a/htdocs/comm/propal/stats/index.php b/htdocs/comm/propal/stats/index.php
index 76809fc222f..e9d884cffaa 100644
--- a/htdocs/comm/propal/stats/index.php
+++ b/htdocs/comm/propal/stats/index.php
@@ -248,7 +248,7 @@ $h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'propal_stats');
-print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
+print dol_get_fiche_head($head, 'byyear', '', -1);
print '';
diff --git a/htdocs/commande/index.php b/htdocs/commande/index.php
index 564cfcde895..c4c8daddf81 100644
--- a/htdocs/commande/index.php
+++ b/htdocs/commande/index.php
@@ -56,9 +56,8 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
-$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
-
// Maximum elements of the tables
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
$maxLatestEditCount = 5;
$maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
@@ -154,13 +153,11 @@ if (isModEnabled('order')) {
print ' ';
-$max = 5;
-
/*
* Latest modified orders
*/
-$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_cloture as datec, c.tms as datem,";
+$sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_cloture as datec, c.tms as datem,";
$sql .= " s.nom as name, s.rowid as socid";
$sql .= ", s.client";
$sql .= ", s.code_client";
@@ -184,12 +181,10 @@ $sql .= $db->plimit($max, 0);
$resql = $db->query($sql);
if ($resql) {
- print ' ';
- print ' ';
- print '';
- print '| '.$langs->trans("LastModifiedOrders", $max).' | ';
-
$num = $db->num_rows($resql);
+
+ startSimpleTable($langs->trans("LastModifiedOrders", $max), "commande/list.php", "sortfield=c.tms&sortorder=DESC", 2, -1, 'order');
+
if ($num) {
$i = 0;
while ($i < $num) {
@@ -228,24 +223,28 @@ if ($resql) {
print '';
print $companystatic->getNomUrl(1, 'company', 16);
print ' | ';
- print ''.dol_print_date($db->jdate($obj->datem), 'day').' | ';
- print ''.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).' | ';
+
+ $datem = $db->jdate($obj->datem);
+ print '';
+ print dol_print_date($datem, 'day', 'tzuserrel');
+ print ' | ';
+
+ print ''.$commandestatic->LibStatut($obj->status, $obj->facture, 3).' | ';
print '';
$i++;
}
}
- print " ";
+ finishSimpleTable(true);
} else {
dol_print_error($db);
}
-$max = 10;
/*
* Orders to process
*/
if (isModEnabled('order')) {
- $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
+ $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
$sql .= ", s.client";
$sql .= ", s.code_client";
$sql .= ", s.canvas";
@@ -314,7 +313,7 @@ if (isModEnabled('order')) {
print ' '.dol_print_date($db->jdate($obj->date), 'day').' | '."\n";
- print ' '.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).' | ';
+ print ' '.$commandestatic->LibStatut($obj->status, $obj->facture, 3).' | ';
print '';
$i++;
@@ -334,7 +333,7 @@ if (isModEnabled('order')) {
* Orders that are in process
*/
if (isModEnabled('order')) {
- $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
+ $sql = "SELECT c.rowid, c.entity, c.ref, c.fk_statut as status, c.facture, c.date_commande as date, s.nom as name, s.rowid as socid";
$sql .= ", s.client";
$sql .= ", s.code_client";
$sql .= ", s.canvas";
@@ -403,7 +402,7 @@ if (isModEnabled('order')) {
print ' '.dol_print_date($db->jdate($obj->date), 'day').' | '."\n";
- print ' '.$commandestatic->LibStatut($obj->fk_statut, $obj->facture, 3).' | ';
+ print ' '.$commandestatic->LibStatut($obj->status, $obj->facture, 3).' | ';
print '';
$i++;
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 05e3e590183..f40deda9bae 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -61,6 +61,7 @@ $show_files = GETPOSTINT('show_files');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'orderlist';
+$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('mode', 'alpha');
if (getDolGlobalInt('MAIN_SEE_SUBORDINATES')) {
@@ -82,8 +83,9 @@ $search_datedelivery_start = dol_mktime(0, 0, 0, GETPOSTINT('search_datedelivery
$search_datedelivery_end = dol_mktime(23, 59, 59, GETPOSTINT('search_datedelivery_end_month'), GETPOSTINT('search_datedelivery_end_day'), GETPOSTINT('search_datedelivery_end_year'));
$socid = GETPOSTINT('socid');
+
$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
-$search_product_category = GETPOSTINT('search_product_category');
+$search_product_category = GETPOST('search_product_category', 'intcomma');
$search_ref = GETPOST('search_ref', 'alpha') != '' ? GETPOST('search_ref', 'alpha') : GETPOST('sref', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha');
$search_company = GETPOST('search_company', 'alpha');
@@ -92,8 +94,8 @@ $search_parent_name = trim(GETPOST('search_parent_name', 'alphanohtml'));
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST('search_state', 'alpha');
-$search_country = GETPOSTINT('search_country');
-$search_type_thirdparty = GETPOSTINT('search_type_thirdparty');
+$search_country = GETPOST('search_country', 'aZ09');
+$search_type_thirdparty = GETPOST('search_type_thirdparty', 'intcomma');
$search_user = GETPOST('search_user', 'intcomma');
$search_sale = GETPOST('search_sale', 'intcomma');
$search_total_ht = GETPOST('search_total_ht', 'alpha');
@@ -108,18 +110,17 @@ $search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat',
$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
-$search_categ_cus = GETPOSTINT("search_categ_cus");
-$optioncss = GETPOST('optioncss', 'alpha');
-$search_billed = GETPOST('search_billed', 'int');
+$search_categ_cus = GETPOST("search_categ_cus", 'intcomma');
+$search_billed = GETPOST('search_billed', 'intcomma');
$search_status = GETPOST('search_status', 'intcomma');
$search_project_ref = GETPOST('search_project_ref', 'alpha');
$search_project = GETPOST('search_project', 'alpha');
$search_shippable = GETPOST('search_shippable', 'aZ09');
-$search_fk_cond_reglement = GETPOSTINT('search_fk_cond_reglement');
-$search_fk_shipping_method = GETPOSTINT('search_fk_shipping_method');
-$search_fk_mode_reglement = GETPOSTINT('search_fk_mode_reglement');
-$search_fk_input_reason = GETPOSTINT('search_fk_input_reason');
+$search_fk_cond_reglement = GETPOST('search_fk_cond_reglement', 'intcomma');
+$search_fk_shipping_method = GETPOST('search_fk_shipping_method', 'intcomma');
+$search_fk_mode_reglement = GETPOST('search_fk_mode_reglement', 'intcomma');
+$search_fk_input_reason = GETPOST('search_fk_input_reason', 'intcomma');
$diroutputmassaction = $conf->commande->multidir_output[$conf->entity].'/temp/massgeneration/'.$user->id;
@@ -231,7 +232,7 @@ $arrayfields = dol_sort_array($arrayfields, 'position');
// Security check
-$id = (GETPOST('orderid') ? GETPOSTINT('orderid') : GETPOSTINT('id'));
+$id = GETPOSTINT('orderid', GETPOSTINT('id'));
if ($user->socid) {
$socid = $user->socid;
}
diff --git a/htdocs/commande/list_det.php b/htdocs/commande/list_det.php
index bd076d8cccc..125bd7b584c 100644
--- a/htdocs/commande/list_det.php
+++ b/htdocs/commande/list_det.php
@@ -63,6 +63,8 @@ $show_files = GETPOSTINT('show_files');
$confirm = GETPOST('confirm', 'alpha');
$toselect = GETPOST('toselect', 'array');
$contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'orderlistdet';
+$optioncss = GETPOST('optioncss', 'alpha');
+
$productobuy = GETPOST('productobuy', 'alpha');
$productonly = GETPOST('productonly', 'alpha');
$disablelinefree = GETPOST('disablelinefree', 'alpha');
@@ -90,7 +92,9 @@ if (isModEnabled('category')) {
}
}
-// Détail commande
+$socid = GETPOSTINT('socid');
+
+// Search filters
$search_id = GETPOST('search_id', 'alpha');
$search_refProduct = GETPOST('search_refProduct', 'alpha');
$search_descProduct = GETPOST('search_descProduct', 'alpha');
@@ -102,10 +106,9 @@ $search_company_alias = GETPOST('search_company_alias', 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST("search_state", 'alpha');
-$search_country = GETPOSTINT("search_country");
-$search_type_thirdparty = GETPOSTINT("search_type_thirdparty");
-$sall = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
-$socid = GETPOSTINT('socid');
+$search_country = GETPOST("search_country", 'aZ09');
+$search_type_thirdparty = GETPOST("search_type_thirdparty", 'intcomma');
+$search_all = trim((GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml'));
$search_user = GETPOST('search_user', 'intcomma');
$search_sale = GETPOST('search_sale', 'intcomma');
$search_total_ht = GETPOST('search_total_ht', 'alpha');
@@ -118,8 +121,7 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a
$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_login = GETPOST('search_login', 'alpha');
-$search_categ_cus = GETPOSTINT("search_categ_cus");
-$optioncss = GETPOST('optioncss', 'alpha');
+$search_categ_cus = GETPOST("search_categ_cus", 'intcomma');
$search_billed = GETPOST('search_billed', 'intcomma') ? GETPOST('search_billed', 'intcomma') : GETPOST('billed', 'intcomma');
$search_status = GETPOST('search_status', 'intcomma');
$search_project_ref = GETPOST('search_project_ref', 'alpha');
@@ -373,7 +375,7 @@ $help_url = "EN:Module_Customers_Orders|FR:Module_Commandes_Clients|ES:Módulo_P
// llxHeader('',$title,$help_url);
$sql = 'SELECT';
-if ($sall || $search_product_category_array > 0 || $search_user > 0) {
+if ($search_all || $search_product_category_array > 0 || $search_user > 0) {
$sql = 'SELECT DISTINCT';
}
$sql .= ' s.rowid as socid, s.nom as name, s.name_alias as alias, s.email, s.phone, s.fax, s.address, s.town, s.zip, s.fk_pays, s.client, s.code_client,';
@@ -464,8 +466,8 @@ if ($search_ref) {
if ($search_ref_customer) {
$sql .= natural_search('c.ref_client', $search_ref_customer);
}
-if ($sall) {
- $sql .= natural_search(array_keys($fieldstosearchall), $sall);
+if ($search_all) {
+ $sql .= natural_search(array_keys($fieldstosearchall), $search_all);
}
if ($search_billed != '' && $search_billed >= 0) {
$sql .= ' AND c.facture = '.((int) $search_billed);
@@ -697,7 +699,7 @@ if ($resql) {
$arrayofselected = is_array($toselect) ? $toselect : array();
- if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $sall) {
+ if ($num == 1 && getDolGlobalString('MAIN_SEARCH_DIRECT_OPEN_IF_ONLY_ONE') && $search_all) {
$obj = $db->fetch_object($resql);
$id = $obj->rowid;
header("Location: ".DOL_URL_ROOT.'/commande/card.php?id='.$id);
@@ -714,8 +716,8 @@ if ($resql) {
if ($limit > 0 && $limit != $conf->liste_limit) {
$param .= '&limit='.((int) $limit);
}
- if ($sall) {
- $param .= '&sall='.urlencode($sall);
+ if ($search_all) {
+ $param .= '&search_all='.urlencode($search_all);
}
if ($socid > 0) {
$param .= '&socid='.urlencode((string) ($socid));
@@ -902,11 +904,11 @@ if ($resql) {
$trackid = 'ord'.$object->id;
include DOL_DOCUMENT_ROOT.'/core/tpl/massactions_pre.tpl.php';
- if ($sall) {
+ if ($search_all) {
foreach ($fieldstosearchall as $key => $val) {
$fieldstosearchall[$key] = $langs->trans($val);
}
- print ' '.$langs->trans("FilterOnInto", $sall).implode(', ', $fieldstosearchall).' ';
+ print ' '.$langs->trans("FilterOnInto", $search_all).implode(', ', $fieldstosearchall).' ';
}
$moreforfilter = '';
diff --git a/htdocs/commande/stats/index.php b/htdocs/commande/stats/index.php
index 778b7484187..6be0ad8950c 100644
--- a/htdocs/commande/stats/index.php
+++ b/htdocs/commande/stats/index.php
@@ -291,7 +291,7 @@ if ($mode == 'supplier') {
complete_head_from_modules($conf, $langs, null, $head, $h, $type);
-print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
+print dol_get_fiche_head($head, 'byyear', '', -1);
print ' ';
diff --git a/htdocs/compta/deplacement/stats/index.php b/htdocs/compta/deplacement/stats/index.php
index 970f2b25eb1..0fec14a005e 100644
--- a/htdocs/compta/deplacement/stats/index.php
+++ b/htdocs/compta/deplacement/stats/index.php
@@ -227,7 +227,7 @@ $h++;
complete_head_from_modules($conf, $langs, null, $head, $h, 'trip_stats');
-print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
+print dol_get_fiche_head($head, 'byyear', '', -1);
print ' ';
diff --git a/htdocs/compta/facture/class/facture-rec.class.php b/htdocs/compta/facture/class/facture-rec.class.php
index 3fefc83c6b7..09ee7806eed 100644
--- a/htdocs/compta/facture/class/facture-rec.class.php
+++ b/htdocs/compta/facture/class/facture-rec.class.php
@@ -1391,16 +1391,6 @@ class FactureRec extends CommonInvoice
$error++;
}
}
- if (!$error && !$notrigger) {
- // Call trigger
- $result = $facturerec->call_trigger('BILLREC_CREATEBILL', $user);
- if ($result < 0) {
- $this->errors = $facturerec->errors;
- $this->error = $facturerec->error;
- $error++;
- }
- // End call triggers
- }
} else {
$error++;
$this->error = "Failed to load invoice template with id=".$line->rowid.", entity=".$conf->entity."\n";
diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php
index 71480ff988b..883019bddc8 100644
--- a/htdocs/compta/facture/class/facture.class.php
+++ b/htdocs/compta/facture/class/facture.class.php
@@ -1090,7 +1090,6 @@ class Facture extends CommonInvoice
if ($result < 0) {
$error++;
}
- // End call triggers
}
if (!$error) {
diff --git a/htdocs/compta/facture/index.php b/htdocs/compta/facture/index.php
index ea2543aeb90..795e54bbc6c 100644
--- a/htdocs/compta/facture/index.php
+++ b/htdocs/compta/facture/index.php
@@ -41,9 +41,8 @@ if (isset($user->socid) && $user->socid > 0) {
$socid = $user->socid;
}
-$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
-
// Maximum elements of the tables
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
$maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? $max : $conf->global->MAIN_MAXLIST_OVERLOAD;
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index a6da251aa7c..00765962c66 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -106,16 +106,16 @@ $search_multicurrency_montant_ht = GETPOST('search_multicurrency_montant_ht', 'a
$search_multicurrency_montant_vat = GETPOST('search_multicurrency_montant_vat', 'alpha');
$search_multicurrency_montant_ttc = GETPOST('search_multicurrency_montant_ttc', 'alpha');
$search_status = GETPOST('search_status', 'intcomma');
-$search_paymentmode = GETPOSTINT('search_paymentmode');
-$search_paymentterms = GETPOSTINT('search_paymentterms');
+$search_paymentmode = GETPOST('search_paymentmode', 'intcomma');
+$search_paymentterms = GETPOST('search_paymentterms', 'intcomma');
$search_module_source = GETPOST('search_module_source', 'alpha');
$search_pos_source = GETPOST('search_pos_source', 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST("search_state");
-$search_country = GETPOST("search_country", 'alpha');
+$search_country = GETPOST("search_country", 'aZ09');
$search_customer_code = GETPOST("search_customer_code", 'alphanohtml');
-$search_type_thirdparty = GETPOSTINT("search_type_thirdparty");
+$search_type_thirdparty = GETPOST("search_type_thirdparty", 'intcomma');
$search_user = GETPOST('search_user', 'intcomma');
$search_sale = GETPOST('search_sale', 'intcomma');
$search_date_startday = GETPOSTINT('search_date_startday');
@@ -142,8 +142,8 @@ $search_datelimit_endmonth = GETPOSTINT('search_datelimit_endmonth');
$search_datelimit_endyear = GETPOSTINT('search_datelimit_endyear');
$search_datelimit_start = dol_mktime(0, 0, 0, $search_datelimit_startmonth, $search_datelimit_startday, $search_datelimit_startyear);
$search_datelimit_end = dol_mktime(23, 59, 59, $search_datelimit_endmonth, $search_datelimit_endday, $search_datelimit_endyear);
-$search_categ_cus = GETPOSTINT("search_categ_cus");
-$search_product_category = GETPOSTINT('search_product_category');
+$search_categ_cus = GETPOST("search_categ_cus", 'intcomma');
+$search_product_category = GETPOST('search_product_category', 'intcomma');
$search_fac_rec_source_title = GETPOST("search_fac_rec_source_title", 'alpha');
$search_late = GETPOST('search_late');
diff --git a/htdocs/compta/facture/stats/index.php b/htdocs/compta/facture/stats/index.php
index e49a7c328d4..db61864b6d8 100644
--- a/htdocs/compta/facture/stats/index.php
+++ b/htdocs/compta/facture/stats/index.php
@@ -263,7 +263,7 @@ if ($mode == 'supplier') {
complete_head_from_modules($conf, $langs, null, $head, $h, $type);
-print dol_get_fiche_head($head, 'byyear', $langs->trans("Statistics"), -1);
+print dol_get_fiche_head($head, 'byyear', '', -1);
print ' ';
diff --git a/htdocs/compta/index.php b/htdocs/compta/index.php
index 0d20375bcb5..1294ad99e78 100644
--- a/htdocs/compta/index.php
+++ b/htdocs/compta/index.php
@@ -67,9 +67,8 @@ if ($user->socid > 0) {
$socid = $user->socid;
}
-$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT');
-
// Maximum elements of the tables
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
$maxDraftCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
$maxLatestEditCount = 5;
$maxOpenCount = !getDolGlobalString('MAIN_MAXLIST_OVERLOAD') ? 500 : $conf->global->MAIN_MAXLIST_OVERLOAD;
diff --git a/htdocs/compta/paiement/cheque/index.php b/htdocs/compta/paiement/cheque/index.php
index 98d938a23af..bd110ba8169 100644
--- a/htdocs/compta/paiement/cheque/index.php
+++ b/htdocs/compta/paiement/cheque/index.php
@@ -177,8 +177,8 @@ foreach ($arrayofpaymentmodetomanage as $val) {
print ' '.$checkdepositstatic->getNomUrl(1).' | ';
print ''.dol_print_date($db->jdate($objp->db), 'day').' | ';
print ''.$accountstatic->getNomUrl(1).' | ';
- print ''.$objp->nbcheque.' | ';
- print ''.price($objp->amount).' | ';
+ print ''.dol_escape_htmltag($objp->nbcheque).' | ';
+ print ''.price($objp->amount).' | ';
print ''.$checkdepositstatic->LibStatut($objp->status, 3).' | ';
print '';
diff --git a/htdocs/compta/stats/casoc.php b/htdocs/compta/stats/casoc.php
index b7d157302c1..8c479edee29 100644
--- a/htdocs/compta/stats/casoc.php
+++ b/htdocs/compta/stats/casoc.php
@@ -87,7 +87,7 @@ $month = GETPOSTINT("month");
$search_societe = GETPOST("search_societe", 'alpha');
$search_zip = GETPOST("search_zip", 'alpha');
$search_town = GETPOST("search_town", 'alpha');
-$search_country = GETPOST("search_country", 'alpha');
+$search_country = GETPOST("search_country", 'aZ09');
$date_startyear = GETPOSTINT("date_startyear");
$date_startmonth = GETPOSTINT("date_startmonth");
$date_startday = GETPOSTINT("date_startday");
diff --git a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php
index ef2f7fe3177..c194bb4104e 100644
--- a/htdocs/compta/stats/supplier_turnover_by_thirdparty.php
+++ b/htdocs/compta/stats/supplier_turnover_by_thirdparty.php
@@ -69,7 +69,7 @@ $hookmanager->initHooks(array('supplierturnoverbythirdpartylist'));
$search_societe = GETPOST("search_societe", 'alpha');
$search_zip = GETPOST("search_zip", 'alpha');
$search_town = GETPOST("search_town", 'alpha');
-$search_country = GETPOST("search_country", 'alpha');
+$search_country = GETPOST("search_country", 'aZ09');
// Date range
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 43b6294a5b5..015b352dbc3 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -101,20 +101,20 @@ if (isModEnabled('socialnetworks')) {
}
}
$search_priv = GETPOST("search_priv", 'alpha');
-$search_sale = GETPOSTINT('search_sale');
-$search_categ = GETPOSTINT("search_categ");
-$search_categ_thirdparty = GETPOSTINT("search_categ_thirdparty");
-$search_categ_supplier = GETPOSTINT("search_categ_supplier");
+$search_sale = GETPOST('search_sale', 'intcomma');
+$search_categ = GETPOST("search_categ", 'intcomma');
+$search_categ_thirdparty = GETPOST("search_categ_thirdparty", 'intcomma');
+$search_categ_supplier = GETPOST("search_categ_supplier", 'intcomma');
$search_status = GETPOST("search_status", "intcomma");
$search_type = GETPOST('search_type', 'alpha');
$search_address = GETPOST('search_address', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_import_key = GETPOST("search_import_key", 'alpha');
-$search_country = GETPOST("search_country", 'intcomma');
+$search_country = GETPOST("search_country", 'aZ09');
$search_roles = GETPOST("search_roles", 'array');
$search_level = GETPOST("search_level", 'array');
-$search_stcomm = GETPOSTINT('search_stcomm');
+$search_stcomm = GETPOST('search_stcomm', 'intcomma');
$search_birthday_start = dol_mktime(0, 0, 0, GETPOSTINT('search_birthday_startmonth'), GETPOSTINT('search_birthday_startday'), GETPOSTINT('search_birthday_startyear'));
$search_birthday_end = dol_mktime(23, 59, 59, GETPOSTINT('search_birthday_endmonth'), GETPOSTINT('search_birthday_endday'), GETPOSTINT('search_birthday_endyear'));
diff --git a/htdocs/contrat/index.php b/htdocs/contrat/index.php
index 9f7089afc5f..90bfa1362bd 100644
--- a/htdocs/contrat/index.php
+++ b/htdocs/contrat/index.php
@@ -44,6 +44,8 @@ $page = GETPOSTISSET('pageplusone') ? (GETPOSTINT('pageplusone') - 1) : GETPOSTI
$statut = GETPOST('statut') ? GETPOST('statut') : 1;
+$max = getDolGlobalInt('MAIN_SIZE_SHORTLIST_LIMIT', 5);
+
// Security check
$socid = 0;
$id = GETPOSTINT('id');
@@ -58,6 +60,7 @@ $staticcontratligne = new ContratLigne($db);
$productstatic = new Product($db);
+
/*
* Action
*/
@@ -315,7 +318,6 @@ print '';
// Last modified contracts
-$max = 5;
$sql = 'SELECT ';
$sql .= " sum(".$db->ifsql("cd.statut=0", 1, 0).') as nb_initial,';
$sql .= " sum(".$db->ifsql("cd.statut=4 AND (cd.date_fin_validite IS NULL OR cd.date_fin_validite >= '".$db->idate($now)."')", 1, 0).') as nb_running,';
@@ -353,7 +355,7 @@ if ($result) {
print ' ';
print ' ';
- print '| '.$langs->trans("LastContracts", 5).' | ';
+ print '
|---|
| '.$langs->trans("LastContracts", $max).' | ';
print ''.$langs->trans("DateModification").' | ';
//print ''.$langs->trans("Status").' | ';
print ''.$langs->trans("Services").' | ';
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index 90d39b3846a..ba0653a55ed 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -56,22 +56,23 @@ $contextpage = GETPOST('contextpage', 'aZ') ? GETPOST('contextpage', 'aZ') : 'co
$optioncss = GETPOST('optioncss', 'alpha');
$mode = GETPOST('mode', 'alpha');
+$socid = GETPOSTINT('socid');
+
$search_name = GETPOST('search_name', 'alpha');
$search_email = GETPOST('search_email', 'alpha');
$search_town = GETPOST('search_town', 'alpha');
$search_zip = GETPOST('search_zip', 'alpha');
$search_state = GETPOST("search_state", 'alpha');
-$search_country = GETPOSTINT("search_country");
-$search_type_thirdparty = GETPOSTINT("search_type_thirdparty");
+$search_country = GETPOST("search_country", 'aZ09');
+$search_type_thirdparty = GETPOST("search_type_thirdparty", 'intcomma');
$search_contract = GETPOST('search_contract', 'alpha');
$search_ref_customer = GETPOST('search_ref_customer', 'alpha');
$search_ref_supplier = GETPOST('search_ref_supplier', 'alpha');
$search_all = (GETPOST('search_all', 'alphanohtml') != '') ? GETPOST('search_all', 'alphanohtml') : GETPOST('sall', 'alphanohtml');
$search_status = GETPOST('search_status', 'alpha');
-$socid = GETPOSTINT('socid');
$search_user = GETPOST('search_user', 'intcomma');
-$search_sale = GETPOSTINT('search_sale');
-$search_product_category = GETPOSTINT('search_product_category');
+$search_sale = GETPOST('search_sale', 'intcomma');
+$search_product_category = GETPOST('search_product_category', 'intcomma');
$search_dfmonth = GETPOSTINT('search_dfmonth');
$search_dfyear = GETPOSTINT('search_dfyear');
$search_op2df = GETPOST('search_op2df', 'alpha');
diff --git a/htdocs/core/class/conf.class.php b/htdocs/core/class/conf.class.php
index 5ade23faf61..711a0bb499d 100644
--- a/htdocs/core/class/conf.class.php
+++ b/htdocs/core/class/conf.class.php
@@ -158,7 +158,7 @@ class Conf extends stdClass
// TODO Remove this part.
/**
- * @var stdClass Supplier
+ * @var stdClass Supplier
*/
public $fournisseur;
@@ -582,10 +582,6 @@ class Conf extends stdClass
} elseif (preg_match('/^MAIN_MODULE_([0-9A-Z_]+)$/i', $key, $reg)) {
// If this is a module constant (must be at end)
$modulename = strtolower($reg[1]);
- $mapping = $this->deprecatedProperties();
- if (array_key_exists($modulename, $mapping)) {
- $modulename = $mapping[$modulename];
- }
$this->modules[$modulename] = $modulename; // Add this module in list of enabled modules
// deprecated in php 8.2
@@ -594,7 +590,18 @@ class Conf extends stdClass
$this->$modulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir...
}
$this->$modulename->enabled = true; // TODO Remove this
- //}
+
+ // Duplicate entry with the new name
+ $mapping = $this->deprecatedProperties();
+ if (array_key_exists($modulename, $mapping)) {
+ $newmodulename = $mapping[$modulename];
+ $this->modules[$newmodulename] = $newmodulename;
+
+ if (!isset($this->$newmodulename) || !is_object($this->$newmodulename)) {
+ $this->$newmodulename = new stdClass(); // We need this to use the ->enabled and the ->multidir, ->dir...
+ }
+ $this->$newmodulename->enabled = true; // TODO Remove this
+ }
}
}
}
diff --git a/htdocs/core/lib/functions.lib.php b/htdocs/core/lib/functions.lib.php
index d697c7595f3..9b7046edfed 100644
--- a/htdocs/core/lib/functions.lib.php
+++ b/htdocs/core/lib/functions.lib.php
@@ -6209,8 +6209,14 @@ function print_fleche_navigation($page, $file, $options = '', $nextpage = 0, $be
$pagesizechoices = getDolGlobalString('MAIN_PAGESIZE_CHOICES');
}
- print '
|---|
|