Skip to content
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

Let plugin developers customise the list of "Report date to load by default" #5153

Closed
mattab opened this issue May 13, 2014 · 4 comments
Closed
Assignees
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Milestone

Comments

@mattab
Copy link
Member

mattab commented May 13, 2014

Tassoman requested in the forum the ability for plugin developers to customise the list of "Dates" that can be set as "Date to load by default" in the Piwik user settings.

This is useful for example to remove ability for users to set by default the Custom Date ranges, which can be performance intensive.

So let's add a new Event that will let plugin developers easily overwrite the list.

@mattab
Copy link
Member Author

mattab commented May 13, 2014

In 52ef3e5: Fixes #5153 New hook UsersManager.getDefaultDates that lets plugin developers customise the list of "Report date to load by default"

@tassoman
Copy link
Contributor

Thank you very much!

I was able to publish our first Piwik Plugin ever: RerUserDates, any feedback is welcome.

@tassoman
Copy link
Contributor

Ciao Matt, I'm removing ranges also from calendar because was asked first day as first issue since I published the plugin.

This ticket's fix worked for users profiles but, when user still have its default to prev7/prev30 range, I would force it to yesterday.

After setting user's default dates to yesterday in the GET request period argument still equals to range and discovers last seven days custom range.

Desired behavior would be having period equal day (instead of 1day ranges)

So how can I force period=day? I gave a look to Range Class but I can't really get into it. Maybe is an Api.get call? How can I do inside PHP?

@tassoman
Copy link
Contributor

After some deeper reading of Developer's Guides, I've integrated this feature since version 1.1.0 using Piwik class and redirectToModule method.

I feel writing Piwik Plugins very clear thin and straightforward. Also guides and documentation helps a lot. Grazie 1000!

RerUserDates plugin would help administrators minimizing problems derived by ticket #4768

@mattab mattab added this to the 2.3.0 - Piwik 2.3.0 milestone Jul 8, 2014
@mattab mattab self-assigned this Jul 8, 2014
sabl0r pushed a commit to sabl0r/piwik that referenced this issue Sep 23, 2014
… plugin developers customise the list of "Report date to load by default"
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Task Indicates an issue is neither a feature nor a bug and it's purely a "technical" change.
Projects
None yet
Development

No branches or pull requests

2 participants