Skip to content

Commit

Permalink
Add hook
Browse files Browse the repository at this point in the history
  • Loading branch information
eldy committed Jun 24, 2019
1 parent 3ca258c commit 43d65e8
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions htdocs/contrat/class/contrat.class.php
Expand Up @@ -1920,7 +1920,7 @@ public function LibStatut($statut, $mode)
*/
public function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_lastsearch_value = -1)
{
global $conf, $langs, $user, $hookmanager, $action;
global $conf, $langs, $user, $hookmanager;

$result='';

Expand Down Expand Up @@ -1962,14 +1962,6 @@ public function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_
}
$linkclose.= ' title="'.dol_escape_htmltag($label, 1).'"';
$linkclose.=' class="classfortooltip"';

if (is_object($hookmanager))
{
$hookmanager->initHooks(array('contractdao'));
$parameters=array('id'=>$this->id);
$reshook=$hookmanager->executeHooks('getnomurltooltip', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) $linkclose = $hookmanager->resPrint;
}
}

$linkstart = '<a href="'.$url.'"';
Expand All @@ -1981,6 +1973,16 @@ public function getNomUrl($withpicto = 0, $maxlength = 0, $notooltip = 0, $save_
if ($withpicto != 2) $result.= ($this->ref?$this->ref:$this->id);
$result .= $linkend;

global $action;
$hookmanager->initHooks(array('contractdao'));
$parameters=array('id'=>$this->id, 'getnomurl'=>$result);
$reshook=$hookmanager->executeHooks('getNomUrl', $parameters, $this, $action); // Note that $action and $object may have been modified by some hooks
if ($reshook > 0) {
$result = $hookmanager->resPrint;
} else {
$result .= $hookmanager->resPrint;
}

return $result;
}

Expand Down

0 comments on commit 43d65e8

Please sign in to comment.