116 lines
5.1 KiB
PHP
116 lines
5.1 KiB
PHP
<?php
|
|
|
|
\OCP\Util::addScript('mail_calendar_sync', 'personal-settings');
|
|
\OCP\Util::addStyle('mail_calendar_sync', 'personal-settings');
|
|
?>
|
|
|
|
<div id="mail-calendar-sync-settings" class="section">
|
|
<h2>
|
|
<?php p($l->t('Mail Calendar Sync')); ?>
|
|
</h2>
|
|
|
|
<p class="settings-hint">
|
|
<?php p($l->t('Automatically apply calendar invitation responses (accept, decline, tentative) received via email to your calendar events. Emails are never deleted or modified.')); ?>
|
|
</p>
|
|
|
|
<div id="mcs-loading" class="mcs-loading">
|
|
<span class="icon-loading-small"></span>
|
|
<?php p($l->t('Loading configuration…')); ?>
|
|
</div>
|
|
|
|
<div id="mcs-config" style="display:none;">
|
|
<!-- Enable toggle -->
|
|
<div class="mcs-field">
|
|
<input type="checkbox" id="mcs-enabled" class="checkbox">
|
|
<label for="mcs-enabled"><?php p($l->t('Enable automatic calendar sync from mail')); ?></label>
|
|
</div>
|
|
|
|
<!-- Mail account selection -->
|
|
<div class="mcs-field" id="mcs-mail-section" style="display:none;">
|
|
<label for="mcs-mail-account"><?php p($l->t('Mail account')); ?></label>
|
|
<select id="mcs-mail-account">
|
|
<option value=""><?php p($l->t('Select a mail account…')); ?></option>
|
|
</select>
|
|
<p class="mcs-field-hint">
|
|
<?php p($l->t('Choose which mail account to scan for calendar invitation responses.')); ?>
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Calendar selection -->
|
|
<div class="mcs-field" id="mcs-calendar-section" style="display:none;">
|
|
<label for="mcs-calendar"><?php p($l->t('Target calendar')); ?></label>
|
|
<select id="mcs-calendar">
|
|
<option value=""><?php p($l->t('Select a calendar…')); ?></option>
|
|
</select>
|
|
<p class="mcs-field-hint">
|
|
<?php p($l->t('Choose which calendar to apply invitation responses to.')); ?>
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Sync interval -->
|
|
<div class="mcs-field" id="mcs-interval-section" style="display:none;">
|
|
<label for="mcs-sync-interval"><?php p($l->t('Sync frequency')); ?></label>
|
|
<select id="mcs-sync-interval">
|
|
<option value="300"><?php p($l->t('Every 5 minutes')); ?></option>
|
|
<option value="600"><?php p($l->t('Every 10 minutes')); ?></option>
|
|
<option value="900"><?php p($l->t('Every 15 minutes')); ?></option>
|
|
<option value="1800"><?php p($l->t('Every 30 minutes')); ?></option>
|
|
<option value="3600"><?php p($l->t('Every hour')); ?></option>
|
|
<option value="7200"><?php p($l->t('Every 2 hours')); ?></option>
|
|
<option value="14400"><?php p($l->t('Every 4 hours')); ?></option>
|
|
<option value="43200"><?php p($l->t('Every 12 hours')); ?></option>
|
|
<option value="86400"><?php p($l->t('Once a day')); ?></option>
|
|
</select>
|
|
<p class="mcs-field-hint">
|
|
<?php p($l->t('How often to check for new calendar invitation responses.')); ?>
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Auto-accept toggle -->
|
|
<div class="mcs-field" id="mcs-auto-accept-section" style="display:none;">
|
|
<input type="checkbox" id="mcs-auto-accept" class="checkbox">
|
|
<label for="mcs-auto-accept"><?php p($l->t('Automatically add new invitations to calendar')); ?></label>
|
|
<p class="mcs-field-hint">
|
|
<?php p($l->t('When enabled, new event invitations (REQUEST) will be automatically added to your calendar. When disabled, only responses to existing events will be processed.')); ?>
|
|
</p>
|
|
</div>
|
|
|
|
<!-- Save button -->
|
|
<div class="mcs-field" id="mcs-save-section" style="display:none;">
|
|
<button id="mcs-save" class="primary">
|
|
<?php p($l->t('Save')); ?>
|
|
</button>
|
|
<button id="mcs-trigger-sync" class="secondary">
|
|
<?php p($l->t('Sync now')); ?>
|
|
</button>
|
|
<span id="mcs-status" class="mcs-status"></span>
|
|
</div>
|
|
|
|
<!-- Sync details (shown after manual sync) -->
|
|
<div id="mcs-sync-details" style="display:none;">
|
|
<h3><?php p($l->t('Last sync details')); ?></h3>
|
|
<pre id="mcs-sync-log" class="mcs-sync-log"></pre>
|
|
</div>
|
|
</div>
|
|
|
|
<!-- Activity log -->
|
|
<div id="mcs-log-section" style="display:none;">
|
|
<h3><?php p($l->t('Recent activity')); ?></h3>
|
|
<table id="mcs-log-table" class="mcs-log-table">
|
|
<thead>
|
|
<tr>
|
|
<th><?php p($l->t('Date')); ?></th>
|
|
<th><?php p($l->t('Event')); ?></th>
|
|
<th><?php p($l->t('Action')); ?></th>
|
|
<th><?php p($l->t('Details')); ?></th>
|
|
</tr>
|
|
</thead>
|
|
<tbody id="mcs-log-body">
|
|
</tbody>
|
|
</table>
|
|
<p id="mcs-log-empty" style="display:none;">
|
|
<?php p($l->t('No recent activity.')); ?>
|
|
</p>
|
|
</div>
|
|
</div>
|