blob: cddee36095edc1b015d6824d7becc33c3af939b2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
|
<tr class='{{ reportType }}'>
<td class="first">
{{ 'MobileMessaging_PhoneNumbers'|translate }}
</td>
<td>
<div class="entityInlineHelp">
{% if phoneNumbers|length == 0 %}
<div><span class="icon-info"></span> {{ 'MobileMessaging_MobileReport_NoPhoneNumbers'|translate }}
{% else %}
<ul class="clearfix">
{% for phoneNumber in phoneNumbers %}
<li class="clear"><label><input name='phoneNumbers' type='checkbox' id='{{ phoneNumber }}'/>{{ phoneNumber }}</label></li>
{% endfor %}
</ul>
<div><span class="icon-info"></span> {{ 'MobileMessaging_MobileReport_AdditionalPhoneNumbers'|translate }}
{% endif %}
<a href="{{ linkTo({'module':"MobileMessaging", 'action': 'index', 'updated':null}) }}">{{ 'MobileMessaging_MobileReport_MobileMessagingSettingsLink'|translate }}</a></div>
</div>
<script>
$(function () {
resetReportParametersFunctions ['{{ reportType }}'] = function () {
var reportParameters = {
'phoneNumbers': []
};
updateReportParametersFunctions['{{ reportType }}'](reportParameters);
};
updateReportParametersFunctions['{{ reportType }}'] = function (reportParameters) {
if (reportParameters == null) return;
$('[name=phoneNumbers]').removeProp('checked');
$(reportParameters.phoneNumbers).each(function (index, phoneNumber) {
$('#\\' + phoneNumber).prop('checked', 'checked');
});
$(document).trigger('ScheduledReport.edit', {});
};
getReportParametersFunctions['{{ reportType }}'] = function () {
var parameters = Object();
var selectedPhoneNumbers = $.map(
$('[name=phoneNumbers]').filter(function() {
return !this.disabled && this.checked;
}),
function (phoneNumber) {
return $(phoneNumber).attr('id');
}
);
// returning [''] when no phone numbers are selected avoids the "please provide a value for 'parameters'" error message
parameters.phoneNumbers = selectedPhoneNumbers.length > 0 ? selectedPhoneNumbers : [''];
return parameters;
};
});
</script>
</td>
</tr>
|