[%- # Imports USE Api2; USE DataURI; USE JSON; USE VarCache; USE Encoder; USE CPScalar; # Setup the spinner, include the DATAURI optimization SET spinner_url = '/images/report-spinner.gif'; IF CPANEL.ua_is_ie && CPANEL.ua_is_ie < 8; SET spinner_url = MagicRevision(spinner_url); ""; ELSE; SET spinner_url = DataURI.datauri(spinner_url, 'image/gif'); END; # Setup the titles for each type. SET archive_type_titles = { 'incoming' => locale.maketext('Incoming Email Messages'), 'outgoing' => locale.maketext('Outgoing Email Messages'), 'mailman' => locale.maketext('Outgoing Mailing List Email Messages'), }; %] [% PROCESS '_assets/_ajaxapp.html.tt' -%] [% SET api_response = Api2.exec( 'Email', 'get_archiving_configuration', { regex => form_regex, no_expvar => 1, api2_paginate => 1, api2_paginate_start => CPANEL.FORM.api2_paginate_start, api2_paginate_size => CPANEL.CPVAR.itemsperpage, api2_sort => 1, api2_sort_column => CPANEL.FORM.api2_sort_column || 'domain', api2_sort_reverse => CPANEL.FORM.api2_sort_reverse == '1', # Reverse is descending. }); -%] [% IF api_response.size -%] [% FOR dom = api_response -%] [% SET oddeven = loop.index % 2 ? 'odd' : 'even' -%] [%- SET archive_active = 0; FOR archive_type IN archive_types; SET archive_key = "archive_" _ archive_type.key; IF dom.$archive_key; SET archive_active = 1; LAST; END; END; %] [% dom.domain.html().breakOn('\.') %] [% locale.format_bytes(dom.diskused) %] [% FOREACH archive_type IN archive_types.pairs -%] [% SET archive_type_key = archive_type.key -%] [% SET archive_type_name = archive_type.value -%] [% SET archive_type_title = archive_type_titles.$archive_type_key -%] [% SET archive_type_dom_key = "archive_" _ archive_type.key -%] [% SET archive_type_dom_key_retain_days = "archive_" _ archive_type.key _ "_retain_days" -%]
[% SET retention_control_enabled = dom.$archive_type_dom_key -%] [% SET retention_control_key = "archive_" _ archive_type_key _ "_retain_days_" _ dom.domain -%] [% SET retention_control_value = dom.$archive_type_dom_key_retain_days -%] [% PROCESS mail/retention_control.html.tt -%]
[% END -%]
[% END -%] [% ELSE -%] [% SET err = form_regex ? locale.maketext('No configured domains match the search term “[_1]”.', form_regex) : locale.maketext('No domains configured.'); -%] [% err FILTER html %] [% END -%]