From b3a3370f56f9e8def5dbbdcb3ca7dcce6d67f356 Mon Sep 17 00:00:00 2001 From: Pierre Date: Sun, 21 Jan 2018 20:20:10 +0100 Subject: [PATCH] Created a function to quickly access user name. --- assets/js/common/shorcuts.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/assets/js/common/shorcuts.js b/assets/js/common/shorcuts.js index 31ffe20c..658c6039 100644 --- a/assets/js/common/shorcuts.js +++ b/assets/js/common/shorcuts.js @@ -60,6 +60,16 @@ function userID(){ return ComunicWeb.user.userLogin.getUserID(); } +/** + * Returns the full name of a user + * + * @param {Object} infos Informations about the user + * @return {String} The full name of the user + */ +function userFullName(infos){ + return infos.firstName + " " + infos.lastName; +} + /** * Return the ID of a user, or its path, depending of what * is available