Skip to content

Commit

Permalink
Fix hack to solve link to restrictions
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jul 18, 2017
1 parent 4e45c7f commit 2a50a78
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions htdocs/core/class/html.form.class.php
Expand Up @@ -5458,6 +5458,14 @@ function showLinkToObjectBlock($object, $restrictlinksto=array(), $excludelinkst
{
$listofidcompanytoscan=$object->thirdparty->id;
if (($object->thirdparty->parent > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PARENT_IN_LINKTO)) $listofidcompanytoscan.=','.$object->thirdparty->parent;
if (($object->fk_project > 0) && ! empty($conf->global->THIRDPARTY_INCLUDE_PROJECT_THIRDPARY_IN_LINKTO))
{
include_once DOL_DOCUMENT_ROOT.'/projet/class/project.class.php';
$tmpproject=new Project($this->db);
$tmpproject->fetch($object->fk_project);
if ($tmpproject->socid > 0 && ($tmpproject->socid != $object->thirdparty->id)) $listofidcompanytoscan.=','.$tmpproject->socid;
unset($tmpproject);
}

$possiblelinks=array(
'propal'=>array('enabled'=>$conf->propal->enabled, 'perms'=>1, 'label'=>'LinkToProposal', 'sql'=>"SELECT s.rowid as socid, s.nom as name, s.client, t.rowid, t.ref, t.ref_client, t.total_ht FROM ".MAIN_DB_PREFIX."societe as s, ".MAIN_DB_PREFIX."propal as t WHERE t.fk_soc = s.rowid AND t.fk_soc IN (".$listofidcompanytoscan.') AND t.entity IN ('.getEntity('propal',1).')'),
Expand Down

0 comments on commit 2a50a78

Please sign in to comment.