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

Allow Email Reports to be sent in HTML #2318

Closed
julienmoumne opened this issue Apr 16, 2011 · 52 comments
Closed

Allow Email Reports to be sent in HTML #2318

julienmoumne opened this issue Apr 16, 2011 · 52 comments
Assignees
Labels
Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Milestone

Comments

@julienmoumne
Copy link
Member

See /trac/ticket/151#comment:11

Actions :

  • Refactor PDFRenderer as an implementation of an abstract report renderer class (Piwik_ReportRenderer)
  • Move PDFRenderer to core/ReportRenderer and rename it to Piwik_ReportRenderer_Pdf)
  • Add an HTML implementation to ReportRenderer (Piwik_ReportRenderer_Html)
  • Update PDFReport UI & database to allow sending reports in HTML
@julienmoumne
Copy link
Member Author

I have almost finished working on this ticket.

Images (Piwik logo, browser logos, ..) in emails have to link to a Piwik instance so they can be downloaded by email clients.

Should we add a config option with the URL of the piwik instance to use ? Or should we use

$_SERVER['SERVER_NAME']

or some sort?

@julienmoumne
Copy link
Member Author

I understand changing file names of a plugin is virtually impossible. (PDFReports -> EmailReports).

However, Is it ok to change

'name' => 'Pdf Export Plugin',

to

'name' => 'Email Report Plugin',

?

Same goes for

'PDFReports_PluginDescription' => 'Create and download your custom PDF reports, and have them emailed daily, weekly or monthly.',

'PDFReports_DefaultPDFContainingAllReports' => 'Default PDF containing all available reports.',

and many others

?

What about translations ?

@robocoder
Copy link
Contributor

Replying to JulienM:

Should we add a config option with the URL of the piwik instance to use ? Or should we use

$_SERVER['SERVER_NAME']

or some sort?

See Piwik_Url.

@robocoder
Copy link
Contributor

re: comment:2 it's easy to rename a plugin but a bit messy for the update script, and a PITA for translators.

That said, since pdf reports can also be downloaded, I would prefer simply "Reports".

@julienmoumne
Copy link
Member Author

Piwik_Url is what I was looking for thanks.

"Reports" is more correct indeed.

For translations, how about removing the translation for other languages so it appears as "not translated" in the translation ui ?

@julienmoumne
Copy link
Member Author

Attachment:
gmail-piwik-logo.jpg

@julienmoumne
Copy link
Member Author

Attachment:
gmail-browsers.jpg

@julienmoumne
Copy link
Member Author

Attachment:
msn-piwik-logo.jpg

@julienmoumne
Copy link
Member Author

Attachment:
msn-browsers.jpg

@julienmoumne
Copy link
Member Author

Attachment:
outlook2010-piwik-logo.jpg

@julienmoumne
Copy link
Member Author

Attachment:
outlook2010-browsers.jpg

@julienmoumne
Copy link
Member Author

Attachment:
thunderbird3piwik-logo.jpg

@julienmoumne
Copy link
Member Author

Attachment:
thunderbird3-browsers.jpg

@julienmoumne
Copy link
Member Author

Attachment:
yahoomail-piwik-logo.jpg

@julienmoumne
Copy link
Member Author

Attachment:
yahoomail-browsers.jpg

@julienmoumne
Copy link
Member Author

I've read the code managing database updates. I understand there is a way for plugins to define database updates the same way core does.

I have to add 'format' column to the pdf table. Should this go in core or plugin DB updates ?

@robocoder
Copy link
Contributor

core/Updates/

@mattab
Copy link
Member

mattab commented Apr 17, 2011

Excellent work mate...!

I tested report for komodo island and it worked well :)

Some feedback:

  • could logos have padding/margin right in outlook?
  • more padding in the first row
  • reuse colors / fonts / font-sizes of current Piwik UI so it looks as close as possible to current HTML
  • we could also modify PDF so they look the same as well
  • OK to modify translations for sure, but when you modify translations just change the Index of the translation, otherwise other 'outdated' translated strings will be reused. For example 'PDFReports_PluginDescription' could become 'PDFReports_PluginDescriptionReports' eg.
  • while "Reports" is maybe more correct, "Email reports" is better because it advertises the main purpose of the feature, which is to email reports. Downloading reports is rarely useful and mostly there for debugging
  • OK to put Updates in core/Updates rather than plugins/ as this is how we do it for all core plugins (when we don't it's either to show how it works, or by mistake)
    I also vote for including in 1.4 as 1.3 is now final and will be released anytime.

@julienmoumne
Copy link
Member Author

Now the ground work is done it's very easy to add new formats. I'm going to implement Piwik_ReportRenderer_Odt (using http://www.odtphp.com/) if that's ok.

@julienmoumne
Copy link
Member Author

  • logo padding ok for all clients
  • TH padding ok for all clients
  • new scheme applied to html and pdf as well
  • added core/Updates/1.4-rc1.php

@robocoder
Copy link
Contributor

It looks like the ODTPHP is license incompatible with the GPLv3. Also, development on the library seems to have tapered off -- what version of the Open Document Format does it support?

In the meantime, feel free to add support for odt, but check for the presence of the library in the event we can't include the library in the distribution.

@julienmoumne
Copy link
Member Author

How about http://phpdocwriter.sourceforge.net/ ?

@robocoder
Copy link
Contributor

phpdocwriter is LGPL (ok), but also hasn't been updated in a while.

If odtphp is a better library, you could try asking the devs to update the license (eg from "GPLv2" to "GPLv2 or above").

@julienmoumne
Copy link
Member Author

phpdocwriter generates .sxw files [http://phpdocwriter.sourceforge.net/phpdocwriter/examples/ex6.php] so I'm going to send an email to the developers of ODTPHP

@julienmoumne
Copy link
Member Author

On this page [they link to http://www.gnu.org/copyleft/gpl.html.

In [they also link to http://www.gnu.org/copyleft/gpl.html.

[http://www.gnu.org/copyleft/gpl.html] seems to be v3.

Do they only need to update the text in [http://www.odtphp.com/index.php?i=credits] from

OdtPHP is released under the terms of the GNU Public License. To get more informations about the GPL license, click here. 

to

OdtPHP is released under the terms of the GNU Public License. To get more informations about the GPLv3 license, click here. 

?

@robocoder
Copy link
Contributor

It must have been the sleep deprivation -- I swear I saw "v2" somewhere. Thanks for double checking. Go head.

@julienmoumne
Copy link
Member Author

I'm running into a bit of trouble with that library.

To zip/unzip odt data they use the PclZip library.

With the latest packaged version (1.0.1) it is not possible to override the temp directory used by PclZip.

Looking at the latest revision http://odtphp.svn.sourceforge.net/viewvc/odtphp?view=revision&revision=51 second point:

- Option to choose tmp directory by appplication works correctly now

shows they have fixed the issue.

However, it has not been packaged yet.

Should I update the file myself or drop the idea of having odt export for lack of quality libraries?

@robocoder
Copy link
Contributor

grab the latest from their svn

@julienmoumne
Copy link
Member Author

I should have investigated before. This library doesn't allow table generation with a variable number of columns.

They suggest to use http://pear.php.net/package/OpenDocument/

@julienmoumne
Copy link
Member Author

No table support in this library.

@mattab
Copy link
Member

mattab commented Apr 27, 2011

(In [4568]) Fixing Notice:</strong> <i>Undefined variable: reportFont</i> in <b>/home/www/dev5.piwik.org/core/ReportRenderer/Pdf.php</b> on line <b>95</b> Refs #2318

@mattab
Copy link
Member

mattab commented Apr 27, 2011

Regression in PDF: in Greek for example, letters now appear as ???? after 1.4-rc2 upgrade (reproducible on localhost). Before, it used to display OK. Maybe a refactoring miss out?

@julienmoumne
Copy link
Member Author

(In [4577]) fixes #2318 refs #2320 : revert font to the one used before trying to make style uniform

@julienmoumne
Copy link
Member Author

(In [4619]) refs #2318 fixing font-size incorrectly interpreted in gmail

@julienmoumne
Copy link
Member Author

(In [4659]) refs #2318 font & size enhancements

@julienmoumne
Copy link
Member Author

(In [5313]) refs #2318 fix for r4518, xss protection broke URLs in HTML Reports, applying same protection as in datatable_cell.tpl

@julienmoumne
Copy link
Member Author

(In [5415]) fixes #2706

@julienmoumne
Copy link
Member Author

(In [5582]) * fixes #2706, #2828, #2704, refs #1721, #2637, #2711, #2318, #71 : horizontal static graph implemented

@julienmoumne
Copy link
Member Author

(In [6849]) refs #3323 #3088 #2708 #71 #2318

  • generate and compare HTML, PDF & SMS reports in Test_Piwik_Integration_EcommerceOrderWithItems & Test_Piwik_Integration_TwoVisitors_TwoWebsites_DifferentDays
  • report content as return value of PDFReports->generateReport() with new output type OUTPUT_RETURN

@julienmoumne
Copy link
Member Author

(In [6938])

refs #3227

  • include back <ImageGraphUrl>

refs #2318

  • reset smarty cycle between each report

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Critical Indicates the severity of an issue is very critical and the issue has a very high priority. Enhancement For new feature suggestions that enhance Matomo's capabilities or add a new report, new API etc.
Projects
None yet
Development

No branches or pull requests

3 participants