Fix: Free memory after request
This commit is contained in:
parent
9fae9da6a1
commit
319295554d
@ -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"',
|
||||
|
||||
@ -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);
|
||||
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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"',
|
||||
|
||||
@ -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"',
|
||||
|
||||
@ -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"',
|
||||
|
||||
@ -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"',
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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"',
|
||||
|
||||
@ -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"',
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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"',
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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"',
|
||||
|
||||
@ -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"',
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
@ -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
|
||||
{
|
||||
|
||||
Loading…
Reference in New Issue
Block a user