Custom object - Create relationships

Hi,
I created a new custom object and need to create relationships with the remaining objects (orders, shipments, etc.)
So:

  • I create the record in the llx_element_element table
  • I created the linkedobjectblock.tpl.php file in the mymodule/core/tpl folder
    and everything seems to be working fine.
    However, the problem is that ALL the pages for all the objects using the showLinkedObjectBlock function, link to my PHP, and from there I can’t get the translated description of the remaining objects (unless I use an if statement for each object).
    The result is this:

This is my code:

            if ($objecttype == 'supplierreturn')
                echo $langs->trans("SupplierReturn"); // My object is then transated
            else 
                echo $langs->trans($objecttype);     // Others objects are not

Has anyone solved this problem yet?

Thanks

Hello, did you define $langs as global variable in your function ? did you load your lang file ?

global $langs;
$langs->load('mylangfile@mymodule');