diff --git a/htdocs/accountancy/admin/account.php b/htdocs/accountancy/admin/account.php
index ac45b3993a4..690e9fad1f1 100644
--- a/htdocs/accountancy/admin/account.php
+++ b/htdocs/accountancy/admin/account.php
@@ -188,6 +188,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$resql = $db->query($sql);
$nbtotalofrecords = $db->num_rows($resql);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql .= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/accountancy/admin/fiscalyear.php b/htdocs/accountancy/admin/fiscalyear.php
index f3a6c9feb75..3910e1148b4 100644
--- a/htdocs/accountancy/admin/fiscalyear.php
+++ b/htdocs/accountancy/admin/fiscalyear.php
@@ -94,6 +94,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/accountancy/admin/productaccount.php b/htdocs/accountancy/admin/productaccount.php
index 7f48ad81ef8..eb4d331f228 100644
--- a/htdocs/accountancy/admin/productaccount.php
+++ b/htdocs/accountancy/admin/productaccount.php
@@ -256,7 +256,13 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
+
$sql .= $db->plimit($limit + 1, $offset);
dol_syslog("/accountancy/admin/productaccount.php:: sql=" . $sql, LOG_DEBUG);
diff --git a/htdocs/accountancy/customer/lines.php b/htdocs/accountancy/customer/lines.php
index b62b4e8f5ca..7bc929a7e6b 100644
--- a/htdocs/accountancy/customer/lines.php
+++ b/htdocs/accountancy/customer/lines.php
@@ -242,6 +242,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql .= $db->plimit($limit + 1, $offset);
@@ -334,7 +339,7 @@ if ($result) {
$facture_static->ref = $objp->ref;
$facture_static->id = $objp->facid;
$facture_static->type = $objp->ftype;
-
+
$product_static->ref = $objp->product_ref;
$product_static->id = $objp->product_id;
$product_static->type = $objp->type;
diff --git a/htdocs/accountancy/customer/list.php b/htdocs/accountancy/customer/list.php
index 378b62c05b8..f7485e701b7 100644
--- a/htdocs/accountancy/customer/list.php
+++ b/htdocs/accountancy/customer/list.php
@@ -289,6 +289,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql .= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/accountancy/expensereport/lines.php b/htdocs/accountancy/expensereport/lines.php
index 7ab29657172..93073a62bd4 100644
--- a/htdocs/accountancy/expensereport/lines.php
+++ b/htdocs/accountancy/expensereport/lines.php
@@ -208,6 +208,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql .= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/accountancy/expensereport/list.php b/htdocs/accountancy/expensereport/list.php
index a4d2ed81b56..2abd3fdc776 100644
--- a/htdocs/accountancy/expensereport/list.php
+++ b/htdocs/accountancy/expensereport/list.php
@@ -237,6 +237,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql .= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/accountancy/supplier/lines.php b/htdocs/accountancy/supplier/lines.php
index a55c15952dc..a3e71cea0af 100644
--- a/htdocs/accountancy/supplier/lines.php
+++ b/htdocs/accountancy/supplier/lines.php
@@ -241,6 +241,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql .= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/accountancy/supplier/list.php b/htdocs/accountancy/supplier/list.php
index aad7f514d50..4a52cb9a0e4 100644
--- a/htdocs/accountancy/supplier/list.php
+++ b/htdocs/accountancy/supplier/list.php
@@ -288,6 +288,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql .= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php
index aa6763654e3..13d0cbd30c5 100644
--- a/htdocs/adherents/list.php
+++ b/htdocs/adherents/list.php
@@ -262,6 +262,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
$resql = $db->query($sql);
if ($resql) $nbtotalofrecords = $db->num_rows($resql);
else dol_print_error($db);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
// Add limit
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/adherents/subscription/list.php b/htdocs/adherents/subscription/list.php
index 43311a0b1e2..bf15230d47e 100644
--- a/htdocs/adherents/subscription/list.php
+++ b/htdocs/adherents/subscription/list.php
@@ -145,6 +145,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/adherents/type.php b/htdocs/adherents/type.php
index 2ef18ca3ca8..b0b5eee67ed 100644
--- a/htdocs/adherents/type.php
+++ b/htdocs/adherents/type.php
@@ -487,6 +487,9 @@ if ($rowid > 0)
{
$sql.=" AND datefin < '".$db->idate($now)."'";
}
+
+ $sql.= " ".$db->order($sortfield,$sortorder);
+
// Count total nb of records
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@@ -494,9 +497,13 @@ if ($rowid > 0)
$resql = $db->query($sql);
if ($resql) $nbtotalofrecords = $db->num_rows($result);
else dol_print_error($db);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
- // Add order and limit
- $sql.= " ".$db->order($sortfield,$sortorder);
+
$sql.= " ".$db->plimit($conf->liste_limit+1, $offset);
$resql = $db->query($sql);
diff --git a/htdocs/admin/mails_senderprofile_list.php b/htdocs/admin/mails_senderprofile_list.php
index 2221c05a6b2..5f0288525a0 100644
--- a/htdocs/admin/mails_senderprofile_list.php
+++ b/htdocs/admin/mails_senderprofile_list.php
@@ -230,6 +230,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/admin/tools/listevents.php b/htdocs/admin/tools/listevents.php
index ac520ce22b3..48d3ef57fd5 100644
--- a/htdocs/admin/tools/listevents.php
+++ b/htdocs/admin/tools/listevents.php
@@ -184,6 +184,11 @@ $nbtotalofrecords = '';
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}*/
$sql.= $db->plimit($conf->liste_limit+1, $offset);
diff --git a/htdocs/assets/list.php b/htdocs/assets/list.php
index b3bc1886fc7..2b68a1b6782 100644
--- a/htdocs/assets/list.php
+++ b/htdocs/assets/list.php
@@ -225,6 +225,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/assets/type.php b/htdocs/assets/type.php
index f9e725acafa..c1a6d849c01 100644
--- a/htdocs/assets/type.php
+++ b/htdocs/assets/type.php
@@ -464,6 +464,9 @@ if ($rowid > 0)
{
$sql.=" AND datefin < '".$db->idate($now)."'";
}
+
+ $sql.= " ".$db->order($sortfield,$sortorder);
+
// Count total nb of records
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
@@ -471,9 +474,13 @@ if ($rowid > 0)
$resql = $db->query($sql);
if ($resql) $nbtotalofrecords = $db->num_rows($result);
else dol_print_error($db);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
- // Add order and limit
- $sql.= " ".$db->order($sortfield,$sortorder);
+
$sql.= " ".$db->plimit($conf->liste_limit+1, $offset);
$resql = $db->query($sql);
diff --git a/htdocs/barcode/codeinit.php b/htdocs/barcode/codeinit.php
index 5e684b4091d..806a88325fb 100644
--- a/htdocs/barcode/codeinit.php
+++ b/htdocs/barcode/codeinit.php
@@ -212,7 +212,8 @@ if ($conf->societe->enabled)
{
$nbno=$nbtotal=0;
- print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','object_company');
+ print load_fiche_titre($langs->trans("BarcodeInitForThirdparties"),'','title_companies');
+
print '
'."\n";
$sql="SELECT count(rowid) as nb FROM ".MAIN_DB_PREFIX."societe where barcode IS NULL or barcode = ''";
$resql=$db->query($sql);
@@ -253,7 +254,7 @@ if ($conf->product->enabled || $conf->product->service)
$nbno=$nbtotal=0;
- print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','object_product');
+ print load_fiche_titre($langs->trans("BarcodeInitForProductsOrServices"),'','title_products');
print '
'."\n";
$sql ="SELECT count(rowid) as nb, fk_product_type, datec";
diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php
index 71240d63d8f..5fa8d267830 100644
--- a/htdocs/categories/class/categorie.class.php
+++ b/htdocs/categories/class/categorie.class.php
@@ -895,24 +895,22 @@ class Categorie extends CommonObject
$sql.= ' AND s.rowid = sub.fk_categorie';
$sql.= ' AND sub.'.$subcol_name.' = '.$id;
+ $sql.= $this->db->order($sortfield, $sortorder);
+
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $this->db->query($sql);
$nbtotalofrecords = $this->db->num_rows($result);
- }
-
- $sql.= $this->db->order($sortfield, $sortorder);
- if ($limit) {
- if ($page < 0)
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
{
$page = 0;
+ $offset = 0;
}
- $offset = $limit * $page;
-
- $sql.= $this->db->plimit($limit + 1, $offset);
}
+ $sql.= $this->db->plimit($limit + 1, $offset);
+
$result = $this->db->query($sql);
if ($result)
{
diff --git a/htdocs/comm/action/list.php b/htdocs/comm/action/list.php
index ed8a27f2d3d..36630b93092 100644
--- a/htdocs/comm/action/list.php
+++ b/htdocs/comm/action/list.php
@@ -318,6 +318,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/comm/action/rapport/index.php b/htdocs/comm/action/rapport/index.php
index 84fb6c411c8..93cbae527f1 100644
--- a/htdocs/comm/action/rapport/index.php
+++ b/htdocs/comm/action/rapport/index.php
@@ -93,6 +93,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1,$offset);
diff --git a/htdocs/comm/mailing/cibles.php b/htdocs/comm/mailing/cibles.php
index 48949881659..676c9c3e98e 100644
--- a/htdocs/comm/mailing/cibles.php
+++ b/htdocs/comm/mailing/cibles.php
@@ -425,7 +425,13 @@ if ($object->fetch($id) >= 0)
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
+
//$nbtotalofrecords=$object->nbemail; // nbemail is a denormalized field storing nb of targets
$sql .= $db->plimit($limit+1, $offset);
diff --git a/htdocs/comm/propal/list.php b/htdocs/comm/propal/list.php
index 761107b73c3..78aa5a0d9cb 100644
--- a/htdocs/comm/propal/list.php
+++ b/htdocs/comm/propal/list.php
@@ -335,6 +335,12 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/commande/customer.php b/htdocs/commande/customer.php
index 205efc3ad91..2d97b06238b 100644
--- a/htdocs/commande/customer.php
+++ b/htdocs/commande/customer.php
@@ -102,6 +102,12 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/commande/list.php b/htdocs/commande/list.php
index 19640dc0ec0..5e3f9bade62 100644
--- a/htdocs/commande/list.php
+++ b/htdocs/commande/list.php
@@ -342,6 +342,12 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit + 1,$offset);
diff --git a/htdocs/compta/facture/invoicetemplate_list.php b/htdocs/compta/facture/invoicetemplate_list.php
index 3e751d97b01..3e077e8a749 100644
--- a/htdocs/compta/facture/invoicetemplate_list.php
+++ b/htdocs/compta/facture/invoicetemplate_list.php
@@ -273,14 +273,20 @@ else if ($search_year_date_when > 0)
$sql.= " AND f.date_when BETWEEN '".$db->idate(dol_get_first_day($search_year_date_when,1,false))."' AND '".$db->idate(dol_get_last_day($search_year_date_when,12,false))."'";
}
+$sql.= $db->order($sortfield, $sortorder);
+
$nbtotalofrecords = '';
if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
-$sql.= $db->order($sortfield, $sortorder);
$sql.= $db->plimit($limit+1,$offset);
$resql = $db->query($sql);
diff --git a/htdocs/compta/facture/list.php b/htdocs/compta/facture/list.php
index e8c34743441..61383941c10 100644
--- a/htdocs/compta/facture/list.php
+++ b/htdocs/compta/facture/list.php
@@ -515,6 +515,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1,$offset);
diff --git a/htdocs/compta/paiement/cheque/list.php b/htdocs/compta/paiement/cheque/list.php
index c936bfb4519..b9e8cac609a 100644
--- a/htdocs/compta/paiement/cheque/list.php
+++ b/htdocs/compta/paiement/cheque/list.php
@@ -117,6 +117,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/compta/paiement/list.php b/htdocs/compta/paiement/list.php
index 553c62b1d97..f001d84a27d 100644
--- a/htdocs/compta/paiement/list.php
+++ b/htdocs/compta/paiement/list.php
@@ -192,6 +192,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/compta/paiement/tovalidate.php b/htdocs/compta/paiement/tovalidate.php
index 43fa2e48212..031a0ff354a 100644
--- a/htdocs/compta/paiement/tovalidate.php
+++ b/htdocs/compta/paiement/tovalidate.php
@@ -85,6 +85,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit + 1,$offset);
diff --git a/htdocs/compta/prelevement/bons.php b/htdocs/compta/prelevement/bons.php
index 2e20701db59..02c6e7b08f0 100644
--- a/htdocs/compta/prelevement/bons.php
+++ b/htdocs/compta/prelevement/bons.php
@@ -87,6 +87,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit + 1,$offset);
diff --git a/htdocs/compta/prelevement/card.php b/htdocs/compta/prelevement/card.php
index ed0977ebabf..a6d739f1f0c 100644
--- a/htdocs/compta/prelevement/card.php
+++ b/htdocs/compta/prelevement/card.php
@@ -322,6 +322,11 @@ if ($id > 0 || $ref)
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/compta/prelevement/factures.php b/htdocs/compta/prelevement/factures.php
index 64811c7604a..d446e64fe9b 100644
--- a/htdocs/compta/prelevement/factures.php
+++ b/htdocs/compta/prelevement/factures.php
@@ -170,6 +170,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit + 1,$offset);
diff --git a/htdocs/compta/prelevement/fiche-rejet.php b/htdocs/compta/prelevement/fiche-rejet.php
index 82431e3bdd2..2fbaaf7fbcb 100644
--- a/htdocs/compta/prelevement/fiche-rejet.php
+++ b/htdocs/compta/prelevement/fiche-rejet.php
@@ -169,6 +169,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/compta/prelevement/list.php b/htdocs/compta/prelevement/list.php
index 3bed588e10e..10634670f5f 100644
--- a/htdocs/compta/prelevement/list.php
+++ b/htdocs/compta/prelevement/list.php
@@ -111,6 +111,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit + 1,$offset);
diff --git a/htdocs/contact/list.php b/htdocs/contact/list.php
index 3d1fa3dcaef..0660b394f1b 100644
--- a/htdocs/contact/list.php
+++ b/htdocs/contact/list.php
@@ -349,6 +349,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit+1, $offset);
diff --git a/htdocs/contrat/list.php b/htdocs/contrat/list.php
index d1f4dd262ed..b3ee34731cc 100644
--- a/htdocs/contrat/list.php
+++ b/htdocs/contrat/list.php
@@ -301,6 +301,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql.= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/contrat/services_list.php b/htdocs/contrat/services_list.php
index 9a4c21b145b..0fc475c19fb 100644
--- a/htdocs/contrat/services_list.php
+++ b/htdocs/contrat/services_list.php
@@ -257,6 +257,11 @@ if (empty($conf->global->MAIN_DISABLE_FULL_SCANLIST))
{
$result = $db->query($sql);
$nbtotalofrecords = $db->num_rows($result);
+ if (($page * $limit) > $nbtotalofrecords) // if total resultset is smaller then paging size (filtering), goto and load page 0
+ {
+ $page = 0;
+ $offset = 0;
+ }
}
$sql .= $db->plimit($limit + 1, $offset);
diff --git a/htdocs/core/class/CMailFile.class.php b/htdocs/core/class/CMailFile.class.php
index 42a219cd3ff..3bccc54204f 100644
--- a/htdocs/core/class/CMailFile.class.php
+++ b/htdocs/core/class/CMailFile.class.php
@@ -1155,7 +1155,7 @@ class CMailFile
$out.= "Content-Disposition: attachment; filename=\"".$filename_list[$i]."\"".$this->eol;
$out.= "Content-Type: " . $mimetype_list[$i] . "; name=\"".$filename_list[$i]."\"".$this->eol;
$out.= "Content-Transfer-Encoding: base64".$this->eol;
- $out.= "Content-Description: File Attachment".$this->eol;
+ $out.= "Content-Description: ".$filename_list[$i].$this->eol;
$out.= $this->eol;
$out.= $encoded;
$out.= $this->eol;
diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php
index 84c25573e85..6b0b2573042 100644
--- a/htdocs/core/class/commonobject.class.php
+++ b/htdocs/core/class/commonobject.class.php
@@ -3594,12 +3594,12 @@ abstract class CommonObject
* @param Societe $buyer Object thirdparty who buy
* @return void
*/
- function formAddObjectLine($dateSelector,$seller,$buyer)
+ function formAddObjectLine($dateSelector, $seller, $buyer)
{
global $conf,$user,$langs,$object,$hookmanager;
global $form,$bcnd,$var;
- //Line extrafield
+ // Line extrafield
require_once DOL_DOCUMENT_ROOT.'/core/class/extrafields.class.php';
$extrafieldsline = new ExtraFields($this->db);
$extralabelslines=$extrafieldsline->fetch_name_optionals_label($this->table_element_line);
@@ -6004,9 +6004,9 @@ abstract class CommonObject
} else {
$value = $this->array_options["options_" . $key]; // No GET, no POST, no default value, so we take value of object.
}
+ //var_dump($keyprefix.' - '.$key.' - '.$keysuffix.' - '.$keyprefix.'options_'.$key.$keysuffix.' - '.$this->array_options["options_".$key.$keysuffix].' - '.$getposttemp.' - '.$value);
break;
}
- //var_dump($value);
if ($extrafields->attributes[$this->table_element]['type'][$key] == 'separate')
{
@@ -6041,12 +6041,12 @@ abstract class CommonObject
// Convert date into timestamp format (value in memory must be a timestamp)
if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('date','datetime')))
{
- $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]);
+ $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?dol_mktime(GETPOST($keyprefix.'options_'.$key.$keysuffix."hour", 'int', 3), GETPOST($keyprefix.'options_'.$key.$keysuffix."min",'int',3), 0, GETPOST($keyprefix.'options_'.$key.$keysuffix."month",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."day",'int',3), GETPOST($keyprefix.'options_'.$key.$keysuffix."year",'int',3)):$this->db->jdate($this->array_options['options_'.$key]);
}
// Convert float submited string into real php numeric (value in memory must be a php numeric)
if (in_array($extrafields->attributes[$this->table_element]['type'][$key],array('price','double')))
{
- $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix,'int',3)):$this->array_options['options_'.$key];
+ $value = GETPOSTISSET($keyprefix.'options_'.$key.$keysuffix)?price2num(GETPOST($keyprefix.'options_'.$key.$keysuffix, 'alpha', 3)):$this->array_options['options_'.$key];
}
$labeltoshow = $langs->trans($label);
diff --git a/htdocs/core/class/extrafields.class.php b/htdocs/core/class/extrafields.class.php
index c5f87777d6d..153efd5b8c9 100644
--- a/htdocs/core/class/extrafields.class.php
+++ b/htdocs/core/class/extrafields.class.php
@@ -1846,13 +1846,14 @@ class ExtraFields
}
else if (in_array($key_type,array('price','double')))
{
- $value_arr=GETPOST("options_".$key);
+ $value_arr=GETPOST("options_".$key, 'alpha');
$value_key=price2num($value_arr);
}
else
{
$value_key=GETPOST("options_".$key);
}
+
$object->array_options["options_".$key]=$value_key;
}
diff --git a/htdocs/core/class/smtps.class.php b/htdocs/core/class/smtps.class.php
index f3e41d8d212..417f175422f 100644
--- a/htdocs/core/class/smtps.class.php
+++ b/htdocs/core/class/smtps.class.php
@@ -1410,7 +1410,7 @@ class SMTPs
$content = 'Content-Type: ' . $_msgData['mimeType'] . '; charset="' . $this->getCharSet() . '"' . "\r\n"
. 'Content-Transfer-Encoding: ' . $this->getTransEncodeType() . "\r\n"
. 'Content-Disposition: inline' . "\r\n"
- . 'Content-Description: message' . "\r\n";
+ . 'Content-Description: Message' . "\r\n";
if ( $this->getMD5flag() )
$content .= 'Content-MD5: ' . $_msgData['md5'] . "\r\n";
@@ -1459,7 +1459,7 @@ class SMTPs
. 'Content-Disposition: attachment; filename="' . $_data['fileName'] . '"' . "\r\n"
. 'Content-Type: ' . $_data['mimeType'] . '; name="' . $_data['fileName'] . '"' . "\r\n"
. 'Content-Transfer-Encoding: base64' . "\r\n"
- . 'Content-Description: File Attachment' . "\r\n";
+ . 'Content-Description: ' . $_data['fileName'] ."\r\n";
if ( $this->getMD5flag() )
$content .= 'Content-MD5: ' . $_data['md5'] . "\r\n";
diff --git a/htdocs/core/tpl/objectline_edit.tpl.php b/htdocs/core/tpl/objectline_edit.tpl.php
index 63321d16506..a6f5fef5310 100644
--- a/htdocs/core/tpl/objectline_edit.tpl.php
+++ b/htdocs/core/tpl/objectline_edit.tpl.php
@@ -132,7 +132,7 @@ $coldisplay=-1; // We remove first td
if ($object->element == 'supplier_proposal' || $object->element == 'order_supplier' || $object->element == 'invoice_supplier') // We must have same test in printObjectLines
{
?>
-