Loading...
 
Skip to main content

add site name to Daily Reports

Status
Closed
Subject
add site name to Daily Reports
Version
11.x
Category
  • Less than 30-minutes fix
Feature
Daily reports
Resolution status
New
Submitted by
Clif Kussmaul
Lastmod by
Pascal St-Jean
Rating
(0)
Description

I host several tiki sites on the same hosting service, so it would be nice if the daily reports included the site name in the subject line and body.

I did this with 3 minor changes:

1. templates/mail/report.tpl - add site to report template

      1. diff report.tpl.orig report.tpl.new

1c1
< Report for %0{/tr}.{if $report_preferences.type eq 'html'}<br><br>{/if}


> Report on %0 for %1{/tr}.{if $report_preferences.type eq 'html'}<br><br>{/if}


2. lib/core/Reports/Send.php - add site to subject line (refactored)

      1. diff Send.php.orig Send.php.new

66,77c66,73
< if (is_array($reportCache) && count($reportCache) >= 1) {
< if (count($reportCache) == 1) {
< $subject = tr(
< 'Report from %0 (1 change)',
< TikiLib::date_format(
< $this->tikiPrefs'short_date_format',
< $this->dt->format('U'))
< );
< } else {
< $subject = tr(
< 'Report from %0 (%1 changes)',
< TikiLib::date_format(
< $this->tikiPrefs'short_date_format',
< $this->dt->format('U')),
< count($reportCache)
< );
< }
< else {
< $subject = tr(
< 'Report from %0 (no changes)',
< TikiLib::date_format(
< $this->tikiPrefs'short_date_format',
< $this->dt->format('U'))
< );


> $subject = tr('Report on %0 from %1 ',
> $this->tikiPrefs'browsertitle',
> TikiLib::date_format(
> $this->tikiPrefs'short_date_format',
> $this->dt->format('U'))
> );
> if (!is_array($reportCache)) {
> $subject .= tr('(no changes)');
> } elseif (count($reportCache) == 1) {
> $subject .= tr('(1 change)');
> } else {
> $subject .= tr('(%0 changes)', count($reportCache));
> }

3. lib/core/Reports/Send/EmailBuilder.php - set site for report

  1. diff EmailBuilder.php.orig EmailBuilder.php.new

37c37,38
<


> $smarty->assign('report_site',
> $this->tikilib->get_preference('browsertitle'));

Files
  1. Report
  2. Send
  3. EmailBuilder
Solution
http://sourceforge.net/p/tikiwiki/code/47047
Importance
3
Easy to solve?
9
Priority
27
Demonstrate Bug on Tiki 19+
Demonstrate Bug (older Tiki versions)
Ticket ID
4607
Created
Thursday 25 July, 2013 11:22:10 UTC
by Clif Kussmaul
LastModif
Saturday 06 July, 2024 10:21:44 UTC


Show PHP error messages