[%
USE Uapi;
USE JSON;
SET CPANEL.CPVAR.dprefix = "../../";
SET user = CPANEL.FORM.user;
SET is_me = !user;
SET config = Uapi.exec('DAV', 'get_calendar_contacts_config', { user => user });
SET horde_enabled = ExpVar.expand('$hashorde') ? 1 : 0;
SET cpdavd_enabled = ExpVar.expand('$hascpdavd') ? 1 : 0;
SET user = config.data.user;
SET title = (is_me ? locale.maketext('Calendars and Contacts') : locale.maketext('Calendars and Contacts for: [_1]', user));
SET has_feature = CPANEL.feature('caldavcarddav');
%]
[% WRAPPER '_assets/master.html.tt'
app_key = 'calendar_and_contacts'
page_title = title
include_legacy_stylesheets = 0
include_legacy_scripts = 1
include_cjt = 1
use_master_bootstrap = 0
page_stylesheets = [
'mail/calendars_and_contacts/index.css'
]
-%]
[% IF !has_feature %]
[% locale.maketext('Error:') %] [% locale.maketext('You do not have access to this feature!') %]
[% ELSIF !horde_enabled || !cpdavd_enabled %]
[% IF !horde_enabled %]
[% locale.maketext('Error:') %] [% locale.maketext('Your server administrator must enable [asis,Horde] to use this feature.') %]
[% END %]
[% IF !cpdavd_enabled %]
[% locale.maketext('Error:') %] [% locale.maketext('Your server administrator must enable the [asis,cpdavd] service to use this feature.') %]
[% END %]
[% ELSIF !config.status %]
[% locale.maketext('Error:') %] [% config.errors_as_string() FILTER html %]
[% ELSE %]
[% END %]
[% IF has_feature && horde_enabled; # No point in loading the other assets if this is dead in the water %]
[% PROCESS '_assets/cjt2_header_include.tt' %]
[% END %]
[% END #wrapper -%]