Improper use of delete() function and ldap with multientity bug corrections

- In some cases of improper use of the delete () function, the complete directory of propale objects, invoice or order was deleted.

Ex in agefodd module:
	$obj_link=new Propal($db);
        $obj_link->id=$agf->propalid;
        $resultdel=$obj_link->delete($user);

To prevent misuse of the function, the reference is not considered given



- Add entitytotest test, because a LDAP user can override the entity restriction without this test