diff --git a/htdocs/core/boxes/box_actions.php b/htdocs/core/boxes/box_actions.php index cbc8e7ee5b7..a1094a8274c 100644 --- a/htdocs/core/boxes/box_actions.php +++ b/htdocs/core/boxes/box_actions.php @@ -127,6 +127,8 @@ class box_actions extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoActionsToDo")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_activity.php b/htdocs/core/boxes/box_activity.php index d0b59b67dd7..50401f58694 100644 --- a/htdocs/core/boxes/box_activity.php +++ b/htdocs/core/boxes/box_activity.php @@ -131,6 +131,8 @@ class box_activity extends ModeleBoxes $i++; } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices")); + + $db->free($result); } else dol_print_error($db); diff --git a/htdocs/core/boxes/box_bookmarks.php b/htdocs/core/boxes/box_bookmarks.php index 1adc7f33657..f841786c8b8 100644 --- a/htdocs/core/boxes/box_bookmarks.php +++ b/htdocs/core/boxes/box_bookmarks.php @@ -74,7 +74,6 @@ class box_bookmarks extends ModeleBoxes $sql.= $db->plimit($max, 0); $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); @@ -103,6 +102,8 @@ class box_bookmarks extends ModeleBoxes if ($user->rights->bookmark->creer) $mytxt.=' '.$langs->trans("ClickToAdd"); $this->info_box_contents[$i][0] = array('td' => 'align="center" colspan="2"', 'url'=> DOL_URL_ROOT.'/bookmarks/liste.php', 'text'=>$mytxt); } + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_clients.php b/htdocs/core/boxes/box_clients.php index e0c745504b9..a2da1ae60e3 100644 --- a/htdocs/core/boxes/box_clients.php +++ b/htdocs/core/boxes/box_clients.php @@ -106,6 +106,8 @@ class box_clients extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedCustomers")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_commandes.php b/htdocs/core/boxes/box_commandes.php index 992f833cc12..9f3001f1c31 100644 --- a/htdocs/core/boxes/box_commandes.php +++ b/htdocs/core/boxes/box_commandes.php @@ -77,7 +77,6 @@ class box_commandes extends ModeleBoxes $sql.= $db->plimit($max, 0); $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); @@ -116,6 +115,8 @@ class box_commandes extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedOrders")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_comptes.php b/htdocs/core/boxes/box_comptes.php index 2df5f0dd002..fc5037a2ceb 100644 --- a/htdocs/core/boxes/box_comptes.php +++ b/htdocs/core/boxes/box_comptes.php @@ -89,7 +89,7 @@ class box_comptes extends ModeleBoxes $sql.= " ORDER BY label"; $sql.= $db->plimit($max, 0); - dol_syslog("Box_comptes::loadBox sql=".$sql); + dol_syslog(get_class($this)."::loadBox sql=".$sql); $result = $db->query($sql); if ($result) { @@ -146,6 +146,8 @@ class box_comptes extends ModeleBoxes 'text' => $totalamount ); } + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_contacts.php b/htdocs/core/boxes/box_contacts.php index a81695ca900..053d7d67329 100755 --- a/htdocs/core/boxes/box_contacts.php +++ b/htdocs/core/boxes/box_contacts.php @@ -117,6 +117,8 @@ class box_contacts extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedContacts")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_contracts.php b/htdocs/core/boxes/box_contracts.php index 7dea6ed7f04..4f534f2b49d 100644 --- a/htdocs/core/boxes/box_contracts.php +++ b/htdocs/core/boxes/box_contracts.php @@ -123,6 +123,8 @@ class box_contracts extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedContracts")); + + $db->free($resql); } else { diff --git a/htdocs/core/boxes/box_factures.php b/htdocs/core/boxes/box_factures.php index 383eae8e4bb..13a1dd2c223 100644 --- a/htdocs/core/boxes/box_factures.php +++ b/htdocs/core/boxes/box_factures.php @@ -129,6 +129,8 @@ class box_factures extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedInvoices")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_factures_fourn.php b/htdocs/core/boxes/box_factures_fourn.php index 458d9a66bca..e51e3d3288f 100644 --- a/htdocs/core/boxes/box_factures_fourn.php +++ b/htdocs/core/boxes/box_factures_fourn.php @@ -127,6 +127,8 @@ class box_factures_fourn extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoModifiedSupplierBills")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_factures_fourn_imp.php b/htdocs/core/boxes/box_factures_fourn_imp.php index 0961312be7d..ebe2f897b77 100644 --- a/htdocs/core/boxes/box_factures_fourn_imp.php +++ b/htdocs/core/boxes/box_factures_fourn_imp.php @@ -123,6 +123,8 @@ class box_factures_fourn_imp extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpaidSupplierBills")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_factures_imp.php b/htdocs/core/boxes/box_factures_imp.php index 252aa3a4da2..85a383b0ec9 100644 --- a/htdocs/core/boxes/box_factures_imp.php +++ b/htdocs/core/boxes/box_factures_imp.php @@ -125,6 +125,8 @@ class box_factures_imp extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoUnpaidCustomerBills")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_ficheinter.php b/htdocs/core/boxes/box_ficheinter.php index 765224baccc..5c4fe1ad035 100644 --- a/htdocs/core/boxes/box_ficheinter.php +++ b/htdocs/core/boxes/box_ficheinter.php @@ -50,12 +50,12 @@ class box_ficheinter extends ModeleBoxes function loadBox($max=10) { global $user, $langs, $db, $conf; - + $this->max=$max; include_once DOL_DOCUMENT_ROOT.'/fichinter/class/fichinter.class.php'; $ficheinterstatic=new Fichinter($db); - + $this->info_box_head = array('text' => $langs->trans("BoxTitleLastFicheInter",$max)); if ($user->rights->ficheinter->lire) @@ -92,7 +92,7 @@ class box_ficheinter extends ModeleBoxes $ficheinterstatic->statut=$objp->fk_statut; $ficheinterstatic->id=$objp->rowid; - + $this->info_box_contents[$i][0] = array('td' => 'align="left" width="16"', 'logo' => $this->boximg, 'url' => DOL_URL_ROOT."/ficheinter/fiche.php?id=".$objp->rowid); @@ -121,6 +121,8 @@ class box_ficheinter extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedContracts")); + + $db->free($resql); } else { diff --git a/htdocs/core/boxes/box_fournisseurs.php b/htdocs/core/boxes/box_fournisseurs.php index ceb9468a054..df6505e0c94 100644 --- a/htdocs/core/boxes/box_fournisseurs.php +++ b/htdocs/core/boxes/box_fournisseurs.php @@ -102,6 +102,8 @@ class box_fournisseurs extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedSuppliers")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_graph_invoices_permonth.php b/htdocs/core/boxes/box_graph_invoices_permonth.php index 5bce26306f3..968413be6c3 100644 --- a/htdocs/core/boxes/box_graph_invoices_permonth.php +++ b/htdocs/core/boxes/box_graph_invoices_permonth.php @@ -116,6 +116,8 @@ class box_graph_invoices_permonth extends ModeleBoxes } $this->info_box_contents[0][0] = array('td' => 'align="center"','text2'=>'xxxxxxx'); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_members.php b/htdocs/core/boxes/box_members.php index fdb6db8c7f5..b0b9ad39317 100755 --- a/htdocs/core/boxes/box_members.php +++ b/htdocs/core/boxes/box_members.php @@ -91,7 +91,6 @@ class box_members extends ModeleBoxes $sql.= $db->plimit($max, 0); $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); @@ -132,6 +131,8 @@ class box_members extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedCustomers")); + + $db->free($result); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_osc_client.php b/htdocs/core/boxes/box_osc_client.php index 3d1e2303f63..1d487b577ad 100644 --- a/htdocs/core/boxes/box_osc_client.php +++ b/htdocs/core/boxes/box_osc_client.php @@ -80,6 +80,8 @@ class box_osc_clients extends ModeleBoxes 'url' => DOL_URL_ROOT."/boutique/client/index.php"); $i++; } + + $db->free($resql); } else { $this->info_box_contents[0][0] = array( 'td' => 'align="left"', diff --git a/htdocs/core/boxes/box_produits.php b/htdocs/core/boxes/box_produits.php index c9e668b271e..0db58e0d797 100644 --- a/htdocs/core/boxes/box_produits.php +++ b/htdocs/core/boxes/box_produits.php @@ -135,6 +135,8 @@ class box_produits extends ModeleBoxes $i++; } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProducts")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_produits_alerte_stock.php b/htdocs/core/boxes/box_produits_alerte_stock.php index a003451d8e9..826f11b97e9 100644 --- a/htdocs/core/boxes/box_produits_alerte_stock.php +++ b/htdocs/core/boxes/box_produits_alerte_stock.php @@ -143,6 +143,8 @@ class box_produits_alerte_stock extends ModeleBoxes $i++; } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoTooLowStockProducts")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_propales.php b/htdocs/core/boxes/box_propales.php index 62d5c6d1f38..3c52900019a 100644 --- a/htdocs/core/boxes/box_propales.php +++ b/htdocs/core/boxes/box_propales.php @@ -75,7 +75,6 @@ class box_propales extends ModeleBoxes $sql.= $db->plimit($max, 0); $result = $db->query($sql); - if ($result) { $num = $db->num_rows($result); @@ -120,6 +119,8 @@ class box_propales extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProposals")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_prospect.php b/htdocs/core/boxes/box_prospect.php index 254370a4395..ec839323174 100644 --- a/htdocs/core/boxes/box_prospect.php +++ b/htdocs/core/boxes/box_prospect.php @@ -108,6 +108,8 @@ class box_prospect extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoRecordedProspects")); + + $db->free($resql); } else { diff --git a/htdocs/core/boxes/box_services_contracts.php b/htdocs/core/boxes/box_services_contracts.php index ae70de77059..d26c8ed0b91 100644 --- a/htdocs/core/boxes/box_services_contracts.php +++ b/htdocs/core/boxes/box_services_contracts.php @@ -42,7 +42,7 @@ class box_services_contracts extends ModeleBoxes var $info_box_head = array(); var $info_box_contents = array(); - + /** * Load data into info_box_contents array to show array later. * @@ -139,6 +139,8 @@ class box_services_contracts extends ModeleBoxes $i++; } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoContractedProducts")); + + $db->free($result); } else { diff --git a/htdocs/core/boxes/box_services_expired.php b/htdocs/core/boxes/box_services_expired.php index c162211404c..eb9b12a31bd 100644 --- a/htdocs/core/boxes/box_services_expired.php +++ b/htdocs/core/boxes/box_services_expired.php @@ -119,6 +119,8 @@ class box_services_expired extends ModeleBoxes } if ($num==0) $this->info_box_contents[$i][0] = array('td' => 'align="center"','text'=>$langs->trans("NoExpiredServices")); + + $db->free($resql); } else { diff --git a/htdocs/core/boxes/box_supplier_orders.php b/htdocs/core/boxes/box_supplier_orders.php index 794dc9c1dd4..74beff90c7f 100644 --- a/htdocs/core/boxes/box_supplier_orders.php +++ b/htdocs/core/boxes/box_supplier_orders.php @@ -35,7 +35,7 @@ class box_supplier_orders extends ModeleBoxes var $boximg = "object_order"; var $boxlabel="BoxLatestSupplierOrders"; var $depends = array("fournisseur"); - + var $db; var $param; var $info_box_head = array(); @@ -85,7 +85,7 @@ class box_supplier_orders extends ModeleBoxes { $objp = $db->fetch_object($result); $datem=$db->jdate($objp->tms); - + $urlo = DOL_URL_ROOT."/fourn/commande/fiche.php?id=".$objp->rowid; $urls = DOL_URL_ROOT."/fourn/fiche.php?socid=".$objp->socid; @@ -117,6 +117,8 @@ class box_supplier_orders extends ModeleBoxes if ($num == 0) $this->info_box_contents[$i][0] = array('td' => 'align="center"', 'text' => $langs->trans("NoSupplierOrder")); + + $db->free($result); } else {