|
@@ -52,6 +52,9 @@ class Dolresource extends CommonObject
|
|
|
|
|
|
public $type_label;
|
|
public $type_label;
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * @var string description
|
|
|
|
+ */
|
|
public $description;
|
|
public $description;
|
|
|
|
|
|
public $fk_country;
|
|
public $fk_country;
|
|
@@ -761,6 +764,33 @@ class Dolresource extends CommonObject
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+ /**
|
|
|
|
+ * getTooltipContentArray
|
|
|
|
+ *
|
|
|
|
+ * @param array $params ex option, infologin
|
|
|
|
+ * @since v18
|
|
|
|
+ * @return array
|
|
|
|
+ */
|
|
|
|
+ public function getTooltipContentArray($params)
|
|
|
|
+ {
|
|
|
|
+ global $conf, $langs;
|
|
|
|
+
|
|
|
|
+ $langs->load('resource');
|
|
|
|
+
|
|
|
|
+ $datas = [];
|
|
|
|
+
|
|
|
|
+ $datas['picto'] = img_picto('', $this->picto).' <u>'.$langs->trans("Resource").'</u>';
|
|
|
|
+ $datas['ref'] = '<br><b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
|
|
|
+ /*if (isset($this->status)) {
|
|
|
|
+ $datas['status'] = '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
|
|
|
+ }*/
|
|
|
|
+ if (isset($this->type_label)) {
|
|
|
|
+ $datas['label'] = '<br><b>'.$langs->trans("ResourceType").":</b> ".$this->type_label;
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+ return $datas;
|
|
|
|
+ }
|
|
|
|
+
|
|
/**
|
|
/**
|
|
* Return clicable link of object (with eventually picto)
|
|
* Return clicable link of object (with eventually picto)
|
|
*
|
|
*
|
|
@@ -777,15 +807,18 @@ class Dolresource extends CommonObject
|
|
global $conf, $langs, $hookmanager;
|
|
global $conf, $langs, $hookmanager;
|
|
|
|
|
|
$result = '';
|
|
$result = '';
|
|
- $label = img_picto('', $this->picto).' <u>'.$langs->trans("Resource").'</u>';
|
|
|
|
- $label .= '<br>';
|
|
|
|
- $label .= '<b>'.$langs->trans('Ref').':</b> '.$this->ref;
|
|
|
|
- /*if (isset($this->status)) {
|
|
|
|
- $label.= '<br><b>' . $langs->trans("Status").":</b> ".$this->getLibStatut(5);
|
|
|
|
- }*/
|
|
|
|
- if (isset($this->type_label)) {
|
|
|
|
- $label .= '<br><b>'.$langs->trans("ResourceType").":</b> ".$this->type_label;
|
|
|
|
- }
|
|
|
|
|
|
+ $params = [
|
|
|
|
+ 'id' => $this->id,
|
|
|
|
+ 'objecttype' => $this->element,
|
|
|
|
+ ];
|
|
|
|
+ $classfortooltip = 'classfortooltip';
|
|
|
|
+ $dataparams = '';
|
|
|
|
+ if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) {
|
|
|
|
+ $classfortooltip = 'classforajaxtooltip';
|
|
|
|
+ $dataparams = ' data-params='.json_encode($params);
|
|
|
|
+ // $label = $langs->trans('Loading');
|
|
|
|
+ }
|
|
|
|
+ $label = implode($this->getTooltipContentArray($params));
|
|
|
|
|
|
$url = DOL_URL_ROOT.'/resource/card.php?id='.$this->id;
|
|
$url = DOL_URL_ROOT.'/resource/card.php?id='.$this->id;
|
|
|
|
|
|
@@ -806,8 +839,8 @@ class Dolresource extends CommonObject
|
|
$label = $langs->trans("ShowMyObject");
|
|
$label = $langs->trans("ShowMyObject");
|
|
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
|
$linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"';
|
|
}
|
|
}
|
|
- $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"';
|
|
|
|
- $linkclose .= ' class="classfortooltip'.($morecss ? ' '.$morecss : '').'"';
|
|
|
|
|
|
+ $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"';
|
|
|
|
+ $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"';
|
|
} else {
|
|
} else {
|
|
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
|
$linkclose = ($morecss ? ' class="'.$morecss.'"' : '');
|
|
}
|
|
}
|
|
@@ -820,7 +853,7 @@ class Dolresource extends CommonObject
|
|
|
|
|
|
$result .= $linkstart;
|
|
$result .= $linkstart;
|
|
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);
|
|
}
|
|
}
|
|
if ($withpicto != 2) {
|
|
if ($withpicto != 2) {
|
|
$result .= $this->ref;
|
|
$result .= $this->ref;
|