Skip to content
Snippets Groups Projects
Commit 75312655 authored by Laurent Destailleur's avatar Laurent Destailleur
Browse files

Qual: More robust error code management when a box is renamed.

parent c0221f69
Branches
Tags
No related merge requests found
...@@ -294,6 +294,8 @@ if ($resql) ...@@ -294,6 +294,8 @@ if ($resql)
} }
dol_include_once($sourcefile); dol_include_once($sourcefile);
if (class_exists($boxname))
{
$box=new $boxname($db,$obj->note); $box=new $boxname($db,$obj->note);
$enabled=true; $enabled=true;
...@@ -345,6 +347,7 @@ if ($resql) ...@@ -345,6 +347,7 @@ if ($resql)
print '</tr></form>'; print '</tr></form>';
} }
} }
}
$i++; $i++;
} }
...@@ -409,6 +412,8 @@ if ($resql) ...@@ -409,6 +412,8 @@ if ($resql)
} }
dol_include_once($sourcefile); dol_include_once($sourcefile);
if (class_exists($boxname))
{
$box=new $boxname($db,$obj->note); $box=new $boxname($db,$obj->note);
if (preg_match('/^([^@]+)@([^@]+)$/i',$box->boximg)) if (preg_match('/^([^@]+)@([^@]+)$/i',$box->boximg))
...@@ -439,6 +444,7 @@ if ($resql) ...@@ -439,6 +444,7 @@ if ($resql)
print '</td>'; print '</td>';
print '</tr>'."\n"; print '</tr>'."\n";
}
$i++; $i++;
$box_order++; $box_order++;
......
...@@ -214,7 +214,9 @@ class InfoBox ...@@ -214,7 +214,9 @@ class InfoBox
$sourcefile = DOL_DOCUMENT_ROOT."/core/boxes/".$boxname.".php"; $sourcefile = DOL_DOCUMENT_ROOT."/core/boxes/".$boxname.".php";
} }
include_once($sourcefile); dol_include_once($sourcefile);
if (class_exists($boxname))
{
$box=new $boxname($this->db,$obj->note); $box=new $boxname($this->db,$obj->note);
$box->rowid=$obj->rowid; $box->rowid=$obj->rowid;
...@@ -232,6 +234,7 @@ class InfoBox ...@@ -232,6 +234,7 @@ class InfoBox
} }
} }
if ($enabled) $boxes[]=$box; if ($enabled) $boxes[]=$box;
}
$j++; $j++;
} }
} }
...@@ -277,6 +280,8 @@ class InfoBox ...@@ -277,6 +280,8 @@ class InfoBox
} }
dol_include_once($sourcefile); dol_include_once($sourcefile);
if (class_exists($boxname))
{
$box=new $boxname($this->db,$obj->note); $box=new $boxname($this->db,$obj->note);
$box->rowid=$obj->rowid; $box->rowid=$obj->rowid;
...@@ -299,6 +304,7 @@ class InfoBox ...@@ -299,6 +304,7 @@ class InfoBox
} }
} }
if ($enabled) $boxes[]=$box; if ($enabled) $boxes[]=$box;
}
$j++; $j++;
} }
} }
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
*/ */
/** /**
* \file htdocs/core/boxes/box_services_vendus.php * \file htdocs/core/boxes/box_services_contracts.php
* \ingroup produits,services * \ingroup produits,services
* \brief Module de generation de l'affichage de la box services_vendus * \brief Module de generation de l'affichage de la box services_vendus
*/ */
...@@ -29,7 +29,7 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); ...@@ -29,7 +29,7 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
/** /**
* Class to manage the box to show last services lines * Class to manage the box to show last services lines
*/ */
class box_services_vendus extends ModeleBoxes class box_services_contracts extends ModeleBoxes
{ {
var $boxcode="lastproductsincontract"; var $boxcode="lastproductsincontract";
...@@ -46,7 +46,7 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php"); ...@@ -46,7 +46,7 @@ include_once(DOL_DOCUMENT_ROOT."/core/boxes/modules_boxes.php");
/** /**
* Constructor * Constructor
*/ */
function box_services_vendus() function box_services_contracts()
{ {
global $langs; global $langs;
$langs->load("boxes"); $langs->load("boxes");
......
...@@ -77,7 +77,7 @@ class modService extends DolibarrModules ...@@ -77,7 +77,7 @@ class modService extends DolibarrModules
// Boxes // Boxes
$this->boxes = array(); $this->boxes = array();
$this->boxes[0][1] = "box_services_vendus.php"; $this->boxes[0][1] = "box_services_contracts.php";
// Permissions // Permissions
$this->rights = array(); $this->rights = array();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment