From d2e35fc1f705efb8c6b8f64852a7d447a7035fc8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Josep=20Llu=C3=ADs?= Date: Thu, 2 Apr 2020 17:49:01 +0200 Subject: [PATCH] NEW: add addlinktonotes in members list --- htdocs/adherents/class/adherent.class.php | 29 ++++++++++++++++------- htdocs/adherents/list.php | 5 +++- 2 files changed, 25 insertions(+), 9 deletions(-) diff --git a/htdocs/adherents/class/adherent.class.php b/htdocs/adherents/class/adherent.class.php index fa8ae9fc2f3..538e433cd16 100644 --- a/htdocs/adherents/class/adherent.class.php +++ b/htdocs/adherents/class/adherent.class.php @@ -7,11 +7,12 @@ * Copyright (C) 2009-2017 Regis Houssin * Copyright (C) 2014-2018 Alexandre Spangaro * Copyright (C) 2015 Marcos García - * Copyright (C) 2015-2018 Frédéric France + * Copyright (C) 2015-2018 Frédéric France * Copyright (C) 2015 Raphaël Doursenaud * Copyright (C) 2016 Juanjo Menent - * Copyright (C) 2018-2019 Thibault FOUCART - * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2018-2019 Thibault FOUCART + * Copyright (C) 2019 Nicolas ZABOURI + * Copyright (C) 2020 Josep Lluís Amador * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1958,13 +1959,14 @@ class Adherent extends CommonObject * @param int $withpictoimg 0=No picto, 1=Include picto into link, 2=Only picto, -1=Include photo into link, -2=Only picto photo, -3=Only photo very small) * @param int $maxlen length max label * @param string $option Page for link ('card', 'category', 'subscription', ...) - * @param string $mode ''=Show firstname+lastname as label (using default order), 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref - * @param string $morecss Add more css on link - * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking - * @param int $notooltip 1=Disable tooltip + * @param string $mode ''=Show firstname+lastname as label (using default order), 'firstname'=Show only firstname, 'login'=Show login, 'ref'=Show ref + * @param string $morecss Add more css on link + * @param int $save_lastsearch_value -1=Auto, 0=No save of lastsearch_values when clicking, 1=Save lastsearch_values whenclicking + * @param int $notooltip 1=Disable tooltip + * @param int $addlinktonotes 1=Add link to notes * @return string Chaine avec URL */ - public function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1, $notooltip = 0) + public function getNomUrl($withpictoimg = 0, $maxlen = 0, $option = 'card', $mode = '', $morecss = '', $save_lastsearch_value = -1, $notooltip = 0, $addlinktonotes = 0) { global $conf, $langs; @@ -2046,6 +2048,17 @@ class Adherent extends CommonObject if ($withpictoimg) $result .= ''; $result .= $linkend; + if ($addlinktonotes) { + if ($this->note_private) { + $notetoshow = $langs->trans("ViewPrivateNote").':
'.dol_string_nohtmltag($this->note_private, 1); + $result .= ' '; + $result .= ''; + $result .= img_picto('', 'note'); + $result .= ''; + $result .= ''; + } + } + return $result; } diff --git a/htdocs/adherents/list.php b/htdocs/adherents/list.php index cbbf434709b..7a230d7d421 100644 --- a/htdocs/adherents/list.php +++ b/htdocs/adherents/list.php @@ -255,6 +255,7 @@ $sql = "SELECT d.rowid, d.login, d.lastname, d.firstname, d.gender, d.societe as $sql .= " d.civility, d.datefin, d.address, d.zip, d.town, d.state_id, d.country,"; $sql .= " d.email, d.phone, d.phone_perso, d.phone_mobile, d.skype, d.birth, d.public, d.photo,"; $sql .= " d.fk_adherent_type as type_id, d.morphy, d.statut, d.datec as date_creation, d.tms as date_update,"; +$sql .= " d.note_private, d.note_public,"; $sql .= " s.nom,"; $sql .= " t.libelle as type, t.subscription,"; $sql .= " state.code_departement as state_code, state.nom as state_name,"; @@ -686,6 +687,8 @@ while ($i < min($num, $limit)) $memberstatic->socid = $obj->fk_soc; $memberstatic->photo = $obj->photo; $memberstatic->morphy = $obj->morphy; + $memberstatic->note_public = $obj->note_public; + $memberstatic->note_private = $obj->note_private; if (!empty($obj->fk_soc)) { $memberstatic->fetch_thirdparty(); @@ -707,7 +710,7 @@ while ($i < min($num, $limit)) if (!empty($arrayfields['d.ref']['checked'])) { print ""; - print $memberstatic->getNomUrl(-1, 0, 'card', 'ref'); + print $memberstatic->getNomUrl(-1, 0, 'card', 'ref', '', -1, 0, 1); print "\n"; if (!$i) $totalarray['nbfield']++; }