link-shared event display timezone selection implemented
This commit is contained in:
parent
8381f056be
commit
f3cb94ddae
5 changed files with 42 additions and 3 deletions
|
@ -173,6 +173,14 @@ button.category{margin:0 3px;}
|
|||
position:relative;
|
||||
top:0.5em;
|
||||
}
|
||||
header + .settings.timezonesettings {
|
||||
float:right;
|
||||
margin-top:-1.2em;
|
||||
}
|
||||
header + .settings.timezonesettings > .chzn-container {
|
||||
position:relative;
|
||||
top:0.5em;
|
||||
}
|
||||
|
||||
/* input fields take whole width */
|
||||
#event-title,
|
||||
|
|
|
@ -2,7 +2,12 @@ $(document).ready(function(){
|
|||
$('#timezone').change( function(){
|
||||
var post = $( '#timezone' ).serialize();
|
||||
$.post( OC.filePath('calendar', 'ajax/settings', 'settimezone.php'), post, function(data){
|
||||
$('#fullcalendar').fullCalendar('refetchEvents');
|
||||
// if we have #fullcalendar, reload it
|
||||
if ($('#fullcalendar').length > 0) {
|
||||
$('#fullcalendar').fullCalendar('refetchEvents');
|
||||
} else {
|
||||
location.reload();
|
||||
}
|
||||
return;
|
||||
});
|
||||
return false;
|
||||
|
@ -50,7 +55,9 @@ $(document).ready(function(){
|
|||
calendarcachecheck();
|
||||
});
|
||||
});
|
||||
calendarcachecheck();
|
||||
if ($('#fullcalendar').length > 0) {
|
||||
calendarcachecheck();
|
||||
}
|
||||
|
||||
});
|
||||
function calendarcachecheck(){
|
||||
|
|
|
@ -161,6 +161,7 @@ if (isset($rootLinkItem)) {
|
|||
} elseif ($linkItem['item_type'] === 'event') {
|
||||
OCP\Util::addStyle('calendar', 'style');
|
||||
OCP\Util::addStyle('calendar', 'tooltips');
|
||||
OCP\Util::addscript('calendar','settings');
|
||||
OCP\App::setActiveNavigationEntry('calendar_index');
|
||||
$tmpl = new OCP\Template('calendar', 'event', 'base');
|
||||
$tmpl->assign('link_shared_event', $linkItem);
|
||||
|
|
|
@ -36,7 +36,7 @@ $dtend = OC_Calendar_Object::getDTEndFromVEvent($vevent);
|
|||
switch($dtstart->getDateType()) {
|
||||
case Sabre\VObject\Property\DateTime::UTC:
|
||||
case Sabre\VObject\Property\DateTime::LOCALTZ:
|
||||
$timezone = new DateTimeZone(OC_Calendar_App::$tz);
|
||||
$timezone = new DateTimeZone($_['timezone']);
|
||||
$newDT = $dtstart->getDateTime();
|
||||
$newDT->setTimezone($timezone);
|
||||
$dtstart->setDateTime($newDT);
|
||||
|
@ -227,6 +227,8 @@ $tmpl = new OCP\Template('calendar', 'part.showevent');
|
|||
|
||||
$tmpl->assign('link_shared_event', $_['link_shared_event']);
|
||||
$tmpl->assign('link_shared_event_url', $_['link_shared_event_url']);
|
||||
$tmpl->assign('timezone', $_['timezone']);
|
||||
$tmpl->assign('timezones', $_['timezones']);
|
||||
|
||||
$tmpl->assign('eventid', $id);
|
||||
$tmpl->assign('permissions', $permissions);
|
||||
|
|
|
@ -9,6 +9,27 @@
|
|||
<div id="logo-claim" style="display:none;"><?php p($theme->getLogoClaim()); ?></div>
|
||||
<div><?php p($l->t('Event')) ?> "<?php p($_['link_shared_event']['item_target'])?>"; <?php p($l->t('download or use in your calendar application:'))?> <a class="download-link" href="<?php echo $_['link_shared_event_url']; ?>&download"><?php p($l->t('Download'))?></a></div>
|
||||
</header>
|
||||
<div class="settings timezonesettings">
|
||||
<label for="timezone" title="<?php p($l->t('Timezone settings')); ?>"><?php p($l->t('Timezone'))?></label>
|
||||
<select id="timezone" name="timezone">
|
||||
<?php
|
||||
$continent = '';
|
||||
foreach($_['timezones'] as $timezone):
|
||||
$ex=explode('/', $timezone, 2);//obtain continent,city
|
||||
if (!isset($ex[1])) {
|
||||
$ex[1] = $ex[0];
|
||||
$ex[0] = "Other";
|
||||
}
|
||||
if ($continent!=$ex[0]):
|
||||
if ($continent!="") print_unescaped('</optgroup>');
|
||||
print_unescaped('<optgroup label="'.OC_Util::sanitizeHTML($ex[0]).'">');
|
||||
endif;
|
||||
$city=strtr($ex[1], '_', ' ');
|
||||
$continent=$ex[0];
|
||||
print_unescaped('<option value="'.OC_Util::sanitizeHTML($timezone).'"'.($_['timezone'] == $timezone?' selected="selected"':'').'>'.OC_Util::sanitizeHTML($city).'</option>');
|
||||
endforeach;?>
|
||||
</select>
|
||||
</div>
|
||||
<?php } ?>
|
||||
<div id="event" class="event <?php if(isset($_['link_shared_event'])): ?>link-shared<?php endif; ?>" title="<?php p($l->t("View an event"));?>">
|
||||
<?php if (!isset($_['link_shared_event'])): ?>
|
||||
|
|
Loading…
Reference in a new issue