New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Display aliases instead of user logins on annotations #11062 #11653
Conversation
Release Piwik 3.0.2-b6
Release Piwik 3.0.2-rc1
Release Piwik 3.0.2
Release Piwik 3.0.3-b1
Release Piwik 3.0.3-b2
Release Piwik 3.0.3
Release Piwik 3.0.4-b1
…egular user cannot access the details of a superuser in which case the superuser login is still used..
…s when creating new annotation.
Thanks for the pull request @andocobo Could you please explain a bit why you think this change is useful and makes things better? It seems like a good idea but I can't yet explain why |
Haha thanks Matthieu,
This is my first attempt at contributing to an open source project, so I just went for an issue tagged 'easy pick'. To be honest, I don't know too much about why this is useful beyond what I read on the issue, it seems users are generally referred to by their alias in Piwik, but on annotations they were being referred to by their user names - it just makes it more consistent as far as I can see.
Cheers,
Andrew Coe
Web designer and developer
Email: andrew@quillstudios.com.au
Mobile: 0404 439 937
Web: www.quillstudios.com.au
On 17 May 2017 at 6:33:58 am, Matthieu Aubry (notifications@github.com) wrote:
Thanks for the pull request @andocobo
Could you please explain a bit why you think this change is useful and makes things better? It seems like a good idea but I can't yet explain why
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
|
* Output: | ||
* - List of users with logins and aliases | ||
*/ | ||
private function getAnnotationUsers($annotations = '') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should use an empty array as default for $annotations
, otherwise the foreach below might fail
@@ -114,6 +119,8 @@ public function saveAnnotation() | |||
// save the annotation | |||
$view->annotation = Request::processRequest("Annotations.save"); | |||
|
|||
$view->users = $this->getAnnotationUsers(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Any reason for calling this without a parameter? If you want to reset $view->users
, simply set it to an empty array.
Hi @andocobo |
Closing this one as user aliases are going to be removed |
This pull request replaces the user logins with user aliases in annotations. If a user cannot access the user alias of another user (eg. regular users trying to access a superuser's alias) then annotations fallback to using the user login.
It adds one new private method in the annotations controller to retrieve annotation related user info from the database.