diff --git a/htdocs/adherents/adherent.class.php b/htdocs/adherents/adherent.class.php index fe964d354e1..bd48308c5b1 100644 --- a/htdocs/adherents/adherent.class.php +++ b/htdocs/adherents/adherent.class.php @@ -70,7 +70,7 @@ class Adherent var $morphy; var $public; - var $commentaire; + var $commentaire; // Note var $statut; // -1=brouillon, 0=résilié, 1=validé,payé var $photo; @@ -410,6 +410,35 @@ class Adherent } + /** + \brief Fonction qui met à jour le commentaire d'un adhérent + \param note Note + \param user Utilisateur qui réalise la mise a jour + \return int <0 si KO, >0 si OK + */ + function update_note($note,$user) + { + $this->db->begin(); + + $sql = "UPDATE ".MAIN_DB_PREFIX."adherent SET"; + $sql.= " note='".addslashes($note)."'"; + $sql.= " WHERE rowid = ".$this->id; + + dolibarr_syslog("Adherent::update_note sql=$sql"); + $result = $this->db->query($sql); + if (! $result) + { + $this->error=$this->db->error(); + $this->db->rollback(); + return -1; + } + + $this->commentaire = $note; + + $this->db->commit(); + return 1; + } + /** \brief Fonction qui met à jour l'adhérent \param user Utilisateur qui réalise la mise a jour diff --git a/htdocs/adherents/fiche.php b/htdocs/adherents/fiche.php index 3b6139b2182..398621d58b2 100644 --- a/htdocs/adherents/fiche.php +++ b/htdocs/adherents/fiche.php @@ -586,7 +586,7 @@ if ($action == 'edit') print ''; // Prenom - print ''.$langs->trans("Firstname").''; + print ''.$langs->trans("Firstname").''; print ''; // Login diff --git a/htdocs/adherents/note.php b/htdocs/adherents/note.php index cfd31651968..e0127190277 100644 --- a/htdocs/adherents/note.php +++ b/htdocs/adherents/note.php @@ -114,7 +114,7 @@ if ($id) print ''.$langs->trans("Login").''.$adh->login.' '; // Note - print ''.$langs->trans("Note").' :'; + print ''.$langs->trans("Note").''; print ''; if ($action == 'edit' && $user->rights->adherent->creer) { diff --git a/htdocs/lib/member.lib.php b/htdocs/lib/member.lib.php index aac86c5720f..d9509197494 100644 --- a/htdocs/lib/member.lib.php +++ b/htdocs/lib/member.lib.php @@ -50,6 +50,11 @@ function member_prepare_head($member) $h++; } + $head[$h][0] = DOL_URL_ROOT.'/adherents/note.php?id='.$member->id; + $head[$h][1] = $langs->trans("Note"); + $head[$h][2] = 'note'; + $h++; + $head[$h][0] = DOL_URL_ROOT.'/adherents/card_subscriptions.php?rowid='.$member->id; $head[$h][1] = $langs->trans("Subscriptions"); $head[$h][2] = 'subscription';