Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

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

Closed
mattab opened this Issue · 4 comments

2 participants

@mattab
Owner

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
Owner

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

@tassoman

Thank you very much!

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

@tassoman

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

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
@mattab mattab self-assigned this
@sabl0r sabl0r referenced this issue from a commit in sabl0r/piwik
@mattab mattab Fixes #5153 New hook UsersManager.getDefaultDates that lets plugin de…
…velopers customise the list of "Report date to load by default"
52ef3e5
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.