add ajaxtooltip on member type
This commit is contained in:
parent
2df357c7c2
commit
e96cafa952
@ -688,6 +688,27 @@ class AdherentType extends CommonObject
|
|||||||
//return $morphy;
|
//return $morphy;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* getTooltipContentArray
|
||||||
|
* @param array $params params to construct tooltip data
|
||||||
|
* @since v18
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
public function getTooltipContentArray($params)
|
||||||
|
{
|
||||||
|
global $conf, $langs, $user;
|
||||||
|
|
||||||
|
$datas = [];
|
||||||
|
|
||||||
|
$datas['picto'] = img_picto('', $this->picto).' <u class="paddingrightonly">'.$langs->trans("MemberType").'</u> '.$this->getLibStatut(4);
|
||||||
|
$datas['label'] = '<br>'.$langs->trans("Label").': '.$this->label;
|
||||||
|
if (isset($this->subscription)) {
|
||||||
|
$datas['subscription'] = '<br>'.$langs->trans("SubscriptionRequired").': '.yn($this->subscription);
|
||||||
|
}
|
||||||
|
|
||||||
|
return $datas;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return clicable name (with picto eventually)
|
* Return clicable name (with picto eventually)
|
||||||
*
|
*
|
||||||
@ -725,8 +746,16 @@ class AdherentType extends CommonObject
|
|||||||
$url .= '&save_lastsearch_values=1';
|
$url .= '&save_lastsearch_values=1';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
||||||
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
$params = [
|
||||||
|
'id' => $this->id,
|
||||||
|
'objecttype' => $this->element,
|
||||||
|
'option' => $option,
|
||||||
|
];
|
||||||
|
$linkstart = '<a href="'.$url.'" data-params='.json_encode($params).' id="' . uniqid($this->element) . '" title="'.$langs->trans('Loading').'" class="classforajaxtooltip">';
|
||||||
|
} else {
|
||||||
|
$linkstart = '<a href="'.$url.'" title="'.dol_escape_htmltag($label, 1).'" class="classfortooltip">';
|
||||||
|
}
|
||||||
$linkend = '</a>';
|
$linkend = '</a>';
|
||||||
|
|
||||||
$result .= $linkstart;
|
$result .= $linkstart;
|
||||||
@ -741,7 +770,6 @@ class AdherentType extends CommonObject
|
|||||||
return $result;
|
return $result;
|
||||||
}
|
}
|
||||||
|
|
||||||
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
|
||||||
/**
|
/**
|
||||||
* Return label of status (activity, closed)
|
* Return label of status (activity, closed)
|
||||||
*
|
*
|
||||||
@ -753,6 +781,7 @@ class AdherentType extends CommonObject
|
|||||||
return $this->LibStatut($this->status, $mode);
|
return $this->LibStatut($this->status, $mode);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// phpcs:disable PEAR.NamingConventions.ValidFunctionName.ScopeNotCamelCaps
|
||||||
/**
|
/**
|
||||||
* Return the label of a given status
|
* Return the label of a given status
|
||||||
*
|
*
|
||||||
|
|||||||
@ -141,7 +141,6 @@ if ($objecttype == 'facture' || $objecttype == 'invoice') {
|
|||||||
// Generic case for $classfile and $classname
|
// Generic case for $classfile and $classname
|
||||||
$classfile = strtolower($myobject);
|
$classfile = strtolower($myobject);
|
||||||
$classname = ucfirst($myobject);
|
$classname = ucfirst($myobject);
|
||||||
// print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname." classpath=".$classpath."\n";
|
|
||||||
|
|
||||||
if ($objecttype == 'invoice_supplier') {
|
if ($objecttype == 'invoice_supplier') {
|
||||||
$classfile = 'fournisseur.facture';
|
$classfile = 'fournisseur.facture';
|
||||||
@ -171,9 +170,17 @@ if ($objecttype == 'invoice_supplier') {
|
|||||||
$classpath = 'comm/mailing/class';
|
$classpath = 'comm/mailing/class';
|
||||||
$classfile = 'mailing';
|
$classfile = 'mailing';
|
||||||
$classname = 'Mailing';
|
$classname = 'Mailing';
|
||||||
|
} elseif ($objecttype == 'adherent_type') {
|
||||||
|
$langs->load('members');
|
||||||
|
$classpath = 'adherents/class';
|
||||||
|
$classfile = 'adherent_type';
|
||||||
|
$module = 'adherent';
|
||||||
|
$myobject = 'adherent_type';
|
||||||
|
$classname = 'AdherentType';
|
||||||
} elseif ($objecttype == 'contact') {
|
} elseif ($objecttype == 'contact') {
|
||||||
$module = 'societe';
|
$module = 'societe';
|
||||||
}
|
}
|
||||||
|
// print "objecttype=".$objecttype." module=".$module." subelement=".$subelement." classfile=".$classfile." classname=".$classname." classpath=".$classpath."\n";
|
||||||
|
|
||||||
if (isModEnabled($module)) {
|
if (isModEnabled($module)) {
|
||||||
$res = dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
$res = dol_include_once('/'.$classpath.'/'.$classfile.'.class.php');
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user