Skip to content

Commit

Permalink
refs matomo-org#1486 make it possible to reuse only phoneNumbers and …
Browse files Browse the repository at this point in the history
…emails without the html for graph type
  • Loading branch information
tsteur committed Jan 6, 2014
1 parent 0ba17e0 commit c2d8069
Show file tree
Hide file tree
Showing 7 changed files with 28 additions and 25 deletions.
2 changes: 1 addition & 1 deletion plugins/CustomAlerts
2 changes: 1 addition & 1 deletion plugins/Morpheus/javascripts/morpheus.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $(document).ready(function () {
}

initICheck();
$(document).bind('ScheduledRepot.edit', initICheck);
$(document).bind('ScheduledReport.edit', initICheck);

$('body').on('ifClicked', 'input', function () {
$(this).trigger('click');
Expand Down
1 change: 1 addition & 0 deletions plugins/ScheduledReports/Controller.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,7 @@ public function index()
$view->reportTypes = $reportTypes;
$view->defaultReportType = self::DEFAULT_REPORT_TYPE;
$view->defaultReportFormat = ScheduledReports::DEFAULT_REPORT_FORMAT;
$view->displayFormats = ScheduledReports::getDisplayFormats();

$reportsByCategoryByType = array();
$reportFormatsByReportType = array();
Expand Down
3 changes: 1 addition & 2 deletions plugins/ScheduledReports/ScheduledReports.php
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,6 @@ static public function template_reportParametersScheduledReports(&$out)
{
$view = new View('@ScheduledReports/reportParametersScheduledReports');
$view->currentUserEmail = Piwik::getCurrentUserEmail();
$view->displayFormats = self::getDisplayFormats();
$view->reportType = self::EMAIL_TYPE;
$view->defaultDisplayFormat = self::DEFAULT_DISPLAY_FORMAT;
$view->defaultEmailMe = self::EMAIL_ME_PARAMETER_DEFAULT_VALUE ? 'true' : 'false';
Expand Down Expand Up @@ -562,7 +561,7 @@ private static function checkAdditionalEmails($additionalEmails)
return $additionalEmails;
}

private static function getDisplayFormats()
public static function getDisplayFormats()
{
$displayFormats = array(
// ScheduledReports_AggregateReportsFormat_TablesOnly should be named ScheduledReports_DisplayFormat_GraphsOnlyForKeyMetrics
Expand Down
2 changes: 1 addition & 1 deletion plugins/ScheduledReports/javascripts/pdf.js
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ function initManagePdf() {
formSetEditReport(idReport);
$('.entityAddContainer').show();
$('#entityEditContainer').hide();
$(document).trigger('ScheduledRepot.edit', {});
$(document).trigger('ScheduledReport.edit', {});
});

// Switch Report Type
Expand Down
20 changes: 20 additions & 0 deletions plugins/ScheduledReports/templates/_addReport.twig
Original file line number Diff line number Diff line change
Expand Up @@ -100,6 +100,26 @@

{{ postEvent("Template.reportParametersScheduledReports") }}

<tr class='email'>
<td class="first">
{# ScheduledReports_AggregateReportsFormat should be named ScheduledReports_DisplayFormat #}
{{ 'ScheduledReports_AggregateReportsFormat'|translate }}
</td>
<td>
<select id="display_format">
{% for formatValue, formatLabel in displayFormats %}
<option {% if formatValue==1 %}selected{% endif %} value="{{ formatValue }}">{{ formatLabel }}</option>
{% endfor %}
</select>

<div class='report_evolution_graph'>
<br/>
<input type="checkbox" id="report_evolution_graph"/>
<label for="report_evolution_graph"><em>{{ 'ScheduledReports_EvolutionGraph'|translate(5) }}</em></label>
</div>
</td>
</tr>

<tr>
<td class="first">{{ 'ScheduledReports_ReportsIncluded'|translate }}</td>
<td>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@
$('#report_additional_emails').text(reportParameters.additionalEmails.join('\n'));
else
$('#report_additional_emails').html('');
$(document).trigger('ScheduledReport.edit', {});
};
getReportParametersFunctions['{{ reportType }}'] =
Expand Down Expand Up @@ -74,23 +76,4 @@
{{ 'ScheduledReports_AlsoSendReportToTheseEmails'|translate }}<br/>
<textarea cols="30" rows="3" id="report_additional_emails" class="inp"></textarea>
</td>
</tr>
<tr class='{{ reportType }}'>
<td class="first">
{# ScheduledReports_AggregateReportsFormat should be named ScheduledReports_DisplayFormat #}
{{ 'ScheduledReports_AggregateReportsFormat'|translate }}
</td>
<td>
<select id="display_format">
{% for formatValue, formatLabel in displayFormats %}
<option {% if formatValue==1 %}selected{% endif %} value="{{ formatValue }}">{{ formatLabel }}</option>
{% endfor %}
</select>

<div class='report_evolution_graph'>
<br/>
<input type="checkbox" id="report_evolution_graph"/>
<label for="report_evolution_graph"><em>{{ 'ScheduledReports_EvolutionGraph'|translate(5) }}</em></label>
</div>
</td>
</tr>
</tr>

0 comments on commit c2d8069

Please sign in to comment.