add ajax tooltip on partnership
This commit is contained in:
parent
3f8aaf5cbc
commit
2c7a01848c
@ -145,6 +145,7 @@ class Partnership extends CommonObject
|
|||||||
public $last_check_backlink;
|
public $last_check_backlink;
|
||||||
public $reason_decline_or_cancel;
|
public $reason_decline_or_cancel;
|
||||||
public $fk_soc;
|
public $fk_soc;
|
||||||
|
public $fk_member;
|
||||||
// END MODULEBUILDER PROPERTIES
|
// END MODULEBUILDER PROPERTIES
|
||||||
|
|
||||||
|
|
||||||
@ -938,6 +939,29 @@ class Partnership extends CommonObject
|
|||||||
return $this->setStatusCommon($user, self::STATUS_APPROVED, $notrigger, 'PARTNERSHIP_REOPEN');
|
return $this->setStatusCommon($user, self::STATUS_APPROVED, $notrigger, 'PARTNERSHIP_REOPEN');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getTooltipContentArray
|
||||||
|
*
|
||||||
|
* @param array $params ex option, infologin
|
||||||
|
* @since v18
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getTooltipContentArray($params)
|
||||||
|
{
|
||||||
|
global $langs;
|
||||||
|
|
||||||
|
$langs->load('partnership');
|
||||||
|
|
||||||
|
$datas = [];
|
||||||
|
$datas['picto'] = img_picto('', $this->picto).' <u>'.$langs->trans("Partnership").'</u>';
|
||||||
|
if (isset($this->status)) {
|
||||||
|
$datas['picto'] .= ' '.$this->getLibStatut(5);
|
||||||
|
}
|
||||||
|
$datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
||||||
|
|
||||||
|
return $datas;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return a link to the object card (with optionaly the picto)
|
* Return a link to the object card (with optionaly the picto)
|
||||||
*
|
*
|
||||||
@ -957,13 +981,19 @@ class Partnership extends CommonObject
|
|||||||
}
|
}
|
||||||
|
|
||||||
$result = '';
|
$result = '';
|
||||||
|
$params = [
|
||||||
$label = img_picto('', $this->picto).' <u>'.$langs->trans("Partnership").'</u>';
|
'id' => $this->id,
|
||||||
if (isset($this->status)) {
|
'objecttype' => $this->element,
|
||||||
$label .= ' '.$this->getLibStatut(5);
|
'option' => $option,
|
||||||
|
];
|
||||||
|
$classfortooltip = 'classfortooltip';
|
||||||
|
$dataparams = '';
|
||||||
|
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||||
|
$classfortooltip = 'classforajaxtooltip';
|
||||||
|
$dataparams = ' data-params='.json_encode($params);
|
||||||
|
// $label = $langs->trans('Loading');
|
||||||
}
|
}
|
||||||
$label .= '<br>';
|
$label = implode($this->getTooltipContentArray($params));
|
||||||
$label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
|
||||||
|
|
||||||
$url = DOL_URL_ROOT.'/partnership/partnership_card.php?id='.$this->id;
|
$url = DOL_URL_ROOT.'/partnership/partnership_card.php?id='.$this->id;
|
||||||
|
|
||||||
@ -984,8 +1014,8 @@ class Partnership extends CommonObject
|
|||||||
$label = $langs->trans("ShowPartnership");
|
$label = $langs->trans("ShowPartnership");
|
||||||
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
||||||
}
|
}
|
||||||
$linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
$linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
|
||||||
$linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
|
$linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
|
||||||
} else {
|
} else {
|
||||||
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
||||||
}
|
}
|
||||||
@ -1006,7 +1036,7 @@ class Partnership extends CommonObject
|
|||||||
|
|
||||||
if (empty($this->showphoto_on_popup)) {
|
if (empty($this->showphoto_on_popup)) {
|
||||||
if ($withpicto) {
|
if ($withpicto) {
|
||||||
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : 'class="'.(($withpicto != 2) ? 'paddingright ' : '').'classfortooltip"'), 0, 0, $notooltip ? 0 : 1);
|
$result .= img_object(($notooltip ? '' : $label), ($this->picto ? $this->picto : 'generic'), ($notooltip ? (($withpicto != 2) ? 'class="paddingright"' : '') : $dataparams.' class="'.(($withpicto != 2) ? 'paddingright ' : '').$classfortooltip.'"'), 0, 0, $notooltip ? 0 : 1);
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if ($withpicto) {
|
if ($withpicto) {
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user