diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index e06ce655c73..7f9adb32266 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -2365,10 +2365,11 @@ class Adherent extends CommonObject ]; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/adherents/card.php?rowid='.((int) $this->id); if ($option == 'subscription') { @@ -2394,7 +2395,7 @@ class Adherent extends CommonObject $label = $langs->trans("ShowUser"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } diff --git a/htdocs/adherents/class/adherent_type.class.php b/htdocs/adherents/class/adherent_type.class.php index 141a2264113..cfcdf81a9b9 100644 --- a/htdocs/adherents/class/adherent_type.class.php +++ b/htdocs/adherents/class/adherent_type.class.php @@ -749,12 +749,12 @@ class AdherentType extends CommonObject ]; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $url = DOL_URL_ROOT.'/adherents/type.php?rowid='.((int) $this->id); if ($option != 'nolink') { // Add param to save lastsearch_values or not @@ -766,7 +766,10 @@ class AdherentType extends CommonObject $url .= '&save_lastsearch_values=1'; } } - $linkstart = ''; + $linkstart = ''; + $linkend = ''; $result .= $linkstart; diff --git a/htdocs/asset/class/asset.class.php b/htdocs/asset/class/asset.class.php index 8e69cb19a1a..e2d93806ca3 100644 --- a/htdocs/asset/class/asset.class.php +++ b/htdocs/asset/class/asset.class.php @@ -162,20 +162,6 @@ class Asset extends CommonObject */ public $oldcopy; - // /** - // * @var string Field with ID of parent key if this object has a parent - // */ - // public $fk_element = 'fk_asset'; - // /** - // * @var array List of child tables. To test if we can delete object. - // */ - // protected $childtables = array(); - // /** - // * @var array List of child tables. To know object to delete on cascade. - // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will - // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object - // */ - // protected $childtablesoncascade = array('asset_assetdet'); /** * @var AssetDepreciationOptions Used for computed fields of depreciation options class. diff --git a/htdocs/bom/class/bom.class.php b/htdocs/bom/class/bom.class.php index c00b9781756..45cbfdef383 100644 --- a/htdocs/bom/class/bom.class.php +++ b/htdocs/bom/class/bom.class.php @@ -1131,13 +1131,12 @@ class BOM extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - - $url = DOL_URL_ROOT.'/bom/bom_card.php?id='.$this->id; if ($option != 'nolink') { @@ -1157,7 +1156,7 @@ class BOM extends CommonObject $label = $langs->trans("ShowBillOfMaterials"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); diff --git a/htdocs/categories/class/categorie.class.php b/htdocs/categories/class/categorie.class.php index f69040b5f16..fc0246e1a02 100644 --- a/htdocs/categories/class/categorie.class.php +++ b/htdocs/categories/class/categorie.class.php @@ -1657,9 +1657,11 @@ class Categorie extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); // Check contrast with background and correct text color $forced_color = 'categtextwhite'; @@ -1669,7 +1671,9 @@ class Categorie extends CommonObject } } $link = ''; + $link .= '"'.$dataparams; + $link .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $link .= ' class="'.$classfortooltip.' '.$forced_color.'">'; $linkend = ''; $picto = 'category'; diff --git a/htdocs/comm/action/class/actioncomm.class.php b/htdocs/comm/action/class/actioncomm.class.php index 94daee3164e..5822e6dd9d2 100644 --- a/htdocs/comm/action/class/actioncomm.class.php +++ b/htdocs/comm/action/class/actioncomm.class.php @@ -1746,8 +1746,8 @@ class ActionComm extends CommonObject 'nofetch' => 1, ]; $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $tooltip = ''; } //if (!empty($conf->global->AGENDA_USE_EVENT_TYPE) && $this->type_color) // $linkclose = ' style="background-color:#'.$this->type_color.'"'; @@ -1757,7 +1757,7 @@ class ActionComm extends CommonObject $label = $langs->trans("ShowAction"); $linkclose .= ' alt="'.dol_escape_htmltag($tooltip, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($tooltip, 1, 0, '', 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classname.' '.$classfortooltip.'"'; } else { $linkclose .= ' class="'.$classname.'"'; diff --git a/htdocs/comm/mailing/class/mailing.class.php b/htdocs/comm/mailing/class/mailing.class.php index 75bfce98496..ef83c5d1470 100644 --- a/htdocs/comm/mailing/class/mailing.class.php +++ b/htdocs/comm/mailing/class/mailing.class.php @@ -792,10 +792,11 @@ class Mailing extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/comm/mailing/card.php?id='.$this->id; @@ -816,8 +817,8 @@ class Mailing extends CommonObject $label = $langs->trans("ShowEMailing"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } diff --git a/htdocs/comm/propal/class/propal.class.php b/htdocs/comm/propal/class/propal.class.php index 09bdfb94d73..3a247a11ec2 100644 --- a/htdocs/comm/propal/class/propal.class.php +++ b/htdocs/comm/propal/class/propal.class.php @@ -3796,10 +3796,11 @@ class Propal extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = ''; if ($user->rights->propal->lire) { @@ -3831,7 +3832,7 @@ class Propal extends CommonObject $label = $langs->trans("Proposal"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; } diff --git a/htdocs/commande/class/commande.class.php b/htdocs/commande/class/commande.class.php index 2b11588b854..f707714d772 100644 --- a/htdocs/commande/class/commande.class.php +++ b/htdocs/commande/class/commande.class.php @@ -3834,19 +3834,19 @@ class Commande extends CommonOrder $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $linkclose = ''; if (empty($notooltip) && $user->hasRight('commande', 'lire')) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label = $langs->trans("Order"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; $target_value = array('_self', '_blank', '_parent', '_top'); diff --git a/htdocs/compta/bank/class/account.class.php b/htdocs/compta/bank/class/account.class.php index e8b645db7bb..4b17f3baab0 100644 --- a/htdocs/compta/bank/class/account.class.php +++ b/htdocs/compta/bank/class/account.class.php @@ -1409,9 +1409,10 @@ class Account extends CommonObject /** * getTooltipContentArray - * @param array $params params to construct tooltip data - * @since v18 - * @return array + * + * @param array $params Params to construct tooltip data + * @since v18 + * @return array */ public function getTooltipContentArray($params) { @@ -1475,11 +1476,15 @@ class Account extends CommonObject ]; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $linkclose = '"'.$dataparams.' title="'.dol_escape_htmltag($label, 1).'" class="'.$classfortooltip.'">'; + $linkclose = ''; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.'">'; $url = DOL_URL_ROOT.'/compta/bank/card.php?id='.$this->id; if ($mode == 'transactions') { diff --git a/htdocs/compta/facture/class/facture.class.php b/htdocs/compta/facture/class/facture.class.php index 6aa633cc4da..5d69bb2b6dd 100644 --- a/htdocs/compta/facture/class/facture.class.php +++ b/htdocs/compta/facture/class/facture.class.php @@ -1896,10 +1896,11 @@ class Facture extends CommonInvoice $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $linkclose = ($target ? ' target="'.$target.'"' : ''); if (empty($notooltip) && $user->hasRight("facture", "read")) { @@ -1907,8 +1908,8 @@ class Facture extends CommonInvoice $label = $langs->trans("Invoice"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; } $linkstart = 'getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/contact/card.php?id='.$this->id; @@ -1521,7 +1522,7 @@ class Contact extends CommonObject $label = $langs->trans("ShowContact"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } diff --git a/htdocs/contrat/class/contrat.class.php b/htdocs/contrat/class/contrat.class.php index 8e6c2ea0161..e05aeb678ee 100644 --- a/htdocs/contrat/class/contrat.class.php +++ b/htdocs/contrat/class/contrat.class.php @@ -2075,19 +2075,19 @@ class Contrat extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $linkclose = ''; if (empty($notooltip) && $user->hasRight('contrat', 'lire')) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label = $langs->trans("ShowContract"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; } $linkstart = ' $this->element, ]; $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; } - $link = ''; + + $link = ''; $linkend = ''; $picto = 'service'; diff --git a/htdocs/core/class/commonobject.class.php b/htdocs/core/class/commonobject.class.php index 44e2b280391..e53cc85c21f 100644 --- a/htdocs/core/class/commonobject.class.php +++ b/htdocs/core/class/commonobject.class.php @@ -4650,7 +4650,7 @@ abstract class CommonObject } /** - * Function to check if an object is used by others. + * Function to check if an object is used by others (by children). * Check is done into this->childtables. There is no check into llx_element_element. * * @param int $id Force id of object @@ -4671,8 +4671,8 @@ abstract class CommonObject return -1; } - $arraytoscan = $this->childtables; - // For backward compatibility, we check if array is old format array('table1', 'table2', ...) + $arraytoscan = $this->childtables; // array('tablename'=>array('fk_element'=>'parentfield'), ...) or array('tablename'=>array('parent'=>table_parent, 'parentkey'=>'nameoffieldforparentfkkey'), ...) + // For backward compatibility, we check if array is old format array('tablename1', 'tablename2', ...) $tmparray = array_keys($this->childtables); if (is_numeric($tmparray[0])) { $arraytoscan = array_flip($this->childtables); @@ -4688,7 +4688,11 @@ abstract class CommonObject if (!empty($element['parent']) && !empty($element['parentkey'])) { $sql.= ", ".$this->db->prefix().$element['parent']." as p"; } - $sql.= " WHERE c.".$this->fk_element." = ".((int) $id); + if (!empty($element['fk_element'])) { + $sql.= " WHERE c.".$element['fk_element']." = ".((int) $id); + } else { + $sql.= " WHERE c.".$this->fk_element." = ".((int) $id); + } if (!empty($element['parent']) && !empty($element['parentkey'])) { $sql.= " AND c.".$element['parentkey']." = p.rowid"; } @@ -4702,6 +4706,7 @@ abstract class CommonObject $sql.= " AND c.entity = ".((int) $entity); } } + $resql = $this->db->query($sql); if ($resql) { $obj = $this->db->fetch_object($resql); @@ -9711,7 +9716,7 @@ abstract class CommonObject return -1; } } - } elseif (!empty($this->fk_element) && !empty($this->childtables)) { // If object has childs linked with a foreign key field, we check all child tables. + } elseif (!empty($this->childtables)) { // If object has childs linked with a foreign key field, we check all child tables. $objectisused = $this->isObjectUsed($this->id); if (!empty($objectisused)) { dol_syslog(get_class($this)."::deleteCommon Can't delete record as it has some child", LOG_WARNING); diff --git a/htdocs/core/class/timespent.class.php b/htdocs/core/class/timespent.class.php index f6ae2b45c71..0f91b53e26a 100755 --- a/htdocs/core/class/timespent.class.php +++ b/htdocs/core/class/timespent.class.php @@ -752,10 +752,11 @@ class TimeSpent extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = dol_buildpath('/timespent/timespent_card.php', 1).'?id='.$this->id; @@ -776,7 +777,7 @@ class TimeSpent extends CommonObject $label = $langs->trans("ShowTimeSpent"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); diff --git a/htdocs/delivery/class/delivery.class.php b/htdocs/delivery/class/delivery.class.php index 61309a1cfae..bf8f68b3bbf 100644 --- a/htdocs/delivery/class/delivery.class.php +++ b/htdocs/delivery/class/delivery.class.php @@ -775,10 +775,11 @@ class Delivery extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/delivery/card.php?id='.$this->id; @@ -794,7 +795,9 @@ class Delivery extends CommonObject } //} - $linkstart = ''; + $linkstart = ''; $linkend = ''; if ($withpicto) { diff --git a/htdocs/expedition/class/expedition.class.php b/htdocs/expedition/class/expedition.class.php index 936e46c1053..8f024665a77 100644 --- a/htdocs/expedition/class/expedition.class.php +++ b/htdocs/expedition/class/expedition.class.php @@ -1813,10 +1813,11 @@ class Expedition extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = ' data-params='.json_encode($params); - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/expedition/card.php?id='.$this->id; @@ -1841,8 +1842,8 @@ class Expedition extends CommonObject $label = $langs->trans("Shipment"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; } $linkstart = 'trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); if ($option != 'nolink') { // Add param to save lastsearch_values or not @@ -1794,8 +1795,8 @@ class ExpenseReport extends CommonObject $label = $langs->trans("ShowExpenseReport"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; } $linkstart = 'trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/fichinter/card.php?id='.$this->id; @@ -839,8 +840,8 @@ class Fichinter extends CommonObject $label = $langs->trans("ShowIntervention"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; } $linkstart = 'trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $url = DOL_URL_ROOT.'/fourn/commande/card.php?id='.$this->id; if ($option !== 'nolink') { @@ -962,8 +962,8 @@ class CommandeFournisseur extends CommonOrder $label = $langs->trans("ShowOrder"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; } $linkstart = 'trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $ref = $this->ref; if (empty($ref)) { $ref = $this->id; @@ -2846,8 +2846,8 @@ class FactureFournisseur extends CommonInvoice $label = $langs->trans("ShowSupplierInvoice"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; } $linkstart = 'getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/holiday/card.php?id='.$this->id; @@ -1380,7 +1382,9 @@ class Holiday extends CommonObject $url .= '&save_lastsearch_values=1'; } //} - $linkstart = ''; + $linkstart = ''; $linkend = ''; $result .= $linkstart; diff --git a/htdocs/knowledgemanagement/class/knowledgerecord.class.php b/htdocs/knowledgemanagement/class/knowledgerecord.class.php index d53a871a6ba..08df6d37f0f 100644 --- a/htdocs/knowledgemanagement/class/knowledgerecord.class.php +++ b/htdocs/knowledgemanagement/class/knowledgerecord.class.php @@ -778,9 +778,11 @@ class KnowledgeRecord extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = dol_buildpath('/knowledgemanagement/knowledgerecord_card.php', 1).'?id='.$this->id; @@ -801,8 +803,8 @@ class KnowledgeRecord extends CommonObject $label = $langs->trans("ShowKnowledgeRecord"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } diff --git a/htdocs/modulebuilder/template/class/myobject.class.php b/htdocs/modulebuilder/template/class/myobject.class.php index e1f65576cd0..0bcfa07c672 100644 --- a/htdocs/modulebuilder/template/class/myobject.class.php +++ b/htdocs/modulebuilder/template/class/myobject.class.php @@ -225,7 +225,7 @@ class MyObject extends CommonObject // /** // * @var array List of child tables. To test if we can delete object. // */ - // protected $childtables = array(); + // protected $childtables = array('mychildtable' => array('name'=>'MyObject', 'fk_element'=>'fk_myobject')); // /** // * @var array List of child tables. To know object to delete on cascade. @@ -803,10 +803,11 @@ class MyObject extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = dol_buildpath('/mymodule/myobject_card.php', 1).'?id='.$this->id; @@ -827,7 +828,7 @@ class MyObject extends CommonObject $label = $langs->trans("ShowMyObject"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); diff --git a/htdocs/mrp/class/mo.class.php b/htdocs/mrp/class/mo.class.php index ee30c468358..c5b1b061e54 100644 --- a/htdocs/mrp/class/mo.class.php +++ b/htdocs/mrp/class/mo.class.php @@ -1180,11 +1180,12 @@ class Mo extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $url = DOL_URL_ROOT.'/mrp/mo_card.php?id='.$this->id; if ($option == 'production') { $url = DOL_URL_ROOT.'/mrp/mo_production.php?id='.$this->id; @@ -1207,8 +1208,8 @@ class Mo extends CommonObject $label = $langs->trans("ShowMo"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } diff --git a/htdocs/opensurvey/class/opensurveysondage.class.php b/htdocs/opensurvey/class/opensurveysondage.class.php index 9c3ced9be54..770f16b07d2 100644 --- a/htdocs/opensurvey/class/opensurveysondage.class.php +++ b/htdocs/opensurvey/class/opensurveysondage.class.php @@ -474,10 +474,11 @@ class Opensurveysondage extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/opensurvey/card.php?id='.$this->id; @@ -496,8 +497,8 @@ class Opensurveysondage extends CommonObject $label = $langs->trans("ShowMyObject"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } diff --git a/htdocs/partnership/class/partnership.class.php b/htdocs/partnership/class/partnership.class.php index 63f0374f77f..8165e863c05 100644 --- a/htdocs/partnership/class/partnership.class.php +++ b/htdocs/partnership/class/partnership.class.php @@ -994,10 +994,11 @@ class Partnership extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/partnership/partnership_card.php?id='.$this->id; @@ -1018,8 +1019,8 @@ class Partnership extends CommonObject $label = $langs->trans("ShowPartnership"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } diff --git a/htdocs/product/class/product.class.php b/htdocs/product/class/product.class.php index c726ae0a8ac..f0e3f8f0b00 100644 --- a/htdocs/product/class/product.class.php +++ b/htdocs/product/class/product.class.php @@ -5161,19 +5161,19 @@ class Product extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $linkclose = ''; if (empty($notooltip)) { if (!empty($conf->global->MAIN_OPTIMIZEFORTEXTBROWSER)) { $label = $langs->trans("ShowProduct"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="nowraponall '.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ' class="nowraponall'.($morecss ? ' '.$morecss : '').'"'; diff --git a/htdocs/product/stock/class/entrepot.class.php b/htdocs/product/stock/class/entrepot.class.php index ff239307f02..2abe2007175 100644 --- a/htdocs/product/stock/class/entrepot.class.php +++ b/htdocs/product/stock/class/entrepot.class.php @@ -757,12 +757,12 @@ class Entrepot extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $url = DOL_URL_ROOT.'/product/stock/card.php?id='.$this->id; if ($option != 'nolink') { @@ -782,7 +782,7 @@ class Entrepot extends CommonObject $label = $langs->trans("Warehouse"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.'"'; } diff --git a/htdocs/product/stock/class/productlot.class.php b/htdocs/product/stock/class/productlot.class.php index 6818c5b8335..997b5ccba0a 100644 --- a/htdocs/product/stock/class/productlot.class.php +++ b/htdocs/product/stock/class/productlot.class.php @@ -933,12 +933,12 @@ class Productlot extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $url = DOL_URL_ROOT.'/product/stock/productlot_card.php?id='.$this->id; if ($option != 'nolink') { @@ -958,7 +958,7 @@ class Productlot extends CommonObject $label = $langs->trans("ShowMyObject"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); diff --git a/htdocs/projet/class/project.class.php b/htdocs/projet/class/project.class.php index f9e2656d1f5..b3c0c142f7a 100644 --- a/htdocs/projet/class/project.class.php +++ b/htdocs/projet/class/project.class.php @@ -1331,9 +1331,11 @@ class Project extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = ''; if ($option != 'nolink') { @@ -1364,8 +1366,8 @@ class Project extends CommonObject $label = $langs->trans("ShowProject"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } diff --git a/htdocs/projet/class/task.class.php b/htdocs/projet/class/task.class.php index 89a189a98c8..b8821fbd486 100644 --- a/htdocs/projet/class/task.class.php +++ b/htdocs/projet/class/task.class.php @@ -758,10 +758,11 @@ class Task extends CommonObjectLine $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/projet/tasks/'.$mode.'.php?id='.$this->id.($option == 'withproject' ? '&withproject=1' : ''); // Add param to save lastsearch_values or not @@ -779,8 +780,8 @@ class Task extends CommonObjectLine $label = $langs->trans("ShowTask"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.' nowraponall"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.' nowraponall"'; } else { $linkclose .= ' class="nowraponall"'; } diff --git a/htdocs/resource/class/dolresource.class.php b/htdocs/resource/class/dolresource.class.php index a2d8863f8ed..578594538cb 100644 --- a/htdocs/resource/class/dolresource.class.php +++ b/htdocs/resource/class/dolresource.class.php @@ -815,10 +815,11 @@ class Dolresource extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); $url = DOL_URL_ROOT.'/resource/card.php?id='.$this->id; @@ -839,8 +840,8 @@ class Dolresource extends CommonObject $label = $langs->trans("ShowMyObject"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= $dataparams.' title="'.dol_escape_htmltag($label, 1).'"'; - $linkclose .= ' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); + $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); } diff --git a/htdocs/salaries/class/salary.class.php b/htdocs/salaries/class/salary.class.php index d45e2bf00d5..4fbf69fd5ee 100644 --- a/htdocs/salaries/class/salary.class.php +++ b/htdocs/salaries/class/salary.class.php @@ -49,6 +49,19 @@ class Salary extends CommonObject public $tms; + // /** + // * @var array List of child tables. To test if we can delete object. + // */ + protected $childtables = array('payment_salary' => array('name'=>'SalaryPayment', 'fk_element'=>'fk_salary')); + + // /** + // * @var array List of child tables. To know object to delete on cascade. + // * If name matches '@ClassNAme:FilePathClass;ParentFkFieldName' it will + // * call method deleteByParentField(parentId, ParentFkFieldName) to fetch and delete child object + // */ + //protected $childtablesoncascade = array('mymodule_myobjectdet'); + + /** * @var int User ID */ @@ -282,44 +295,12 @@ class Salary extends CommonObject * Delete object in database * * @param User $user User that delete + * @param bool $notrigger false=launch triggers after, true=disable triggers * @return int <0 if KO, >0 if OK */ - public function delete($user) + public function delete($user, $notrigger = 0) { - global $conf, $langs; - - $error = 0; - - // Call trigger - $result = $this->call_trigger('SALARY_DELETE', $user); - if ($result < 0) return -1; - // End call triggers - - // Delete extrafields - /*if (!$error) - { - $sql = "DELETE FROM ".MAIN_DB_PREFIX."salary_extrafields"; - $sql .= " WHERE fk_object = ".((int) $this->id); - - $resql = $this->db->query($sql); - if (!$resql) - { - $this->errors[] = $this->db->lasterror(); - $error++; - } - }*/ - - $sql = "DELETE FROM ".MAIN_DB_PREFIX."salary"; - $sql .= " WHERE rowid=".((int) $this->id); - - dol_syslog(get_class($this)."::delete", LOG_DEBUG); - $resql = $this->db->query($sql); - if (!$resql) { - $this->error = "Error ".$this->db->lasterror(); - return -1; - } - - return 1; + return $this->deleteCommon($user, $notrigger); } @@ -539,12 +520,12 @@ class Salary extends CommonObject $dataparams = ''; if (getDolGlobalInt('MAIN_ENABLE_AJAX_TOOLTIP')) { $classfortooltip = 'classforajaxtooltip'; - $dataparams = " data-params='".json_encode($params)."'"; - // $label = $langs->trans('Loading'); + $dataparams = ' data-params="'.dol_escape_htmltag(json_encode($params)).'"'; + $label = ''; + } else { + $label = implode($this->getTooltipContentArray($params)); } - $label = implode($this->getTooltipContentArray($params)); - $url = DOL_URL_ROOT.'/salaries/card.php?id='.$this->id; if ($option != 'nolink') { @@ -564,7 +545,7 @@ class Salary extends CommonObject $label = $langs->trans("ShowMyObject"); $linkclose .= ' alt="'.dol_escape_htmltag($label, 1).'"'; } - $linkclose .= ' title="'.dol_escape_htmltag($label, 1).'"'; + $linkclose .= ($label ? ' title="'.dol_escape_htmltag($label, 1).'"' : ' title="tocomplete"'); $linkclose .= $dataparams.' class="'.$classfortooltip.($morecss ? ' '.$morecss : '').'"'; } else { $linkclose = ($morecss ? ' class="'.$morecss.'"' : ''); @@ -604,8 +585,8 @@ class Salary extends CommonObject $table = 'payment_salary'; $field = 'fk_salary'; - $sql = 'SELECT sum(amount) as amount'; - $sql .= ' FROM '.MAIN_DB_PREFIX.$table; + $sql = "SELECT sum(amount) as amount"; + $sql .= " FROM ".MAIN_DB_PREFIX.$table; $sql .= " WHERE ".$field." = ".((int) $this->id); dol_syslog(get_class($this)."::getSommePaiement", LOG_DEBUG); @@ -764,14 +745,20 @@ class Salary extends CommonObject $return .= '