summaryrefslogtreecommitdiffstats
path: root/apps/calendar
diff options
context:
space:
mode:
authorGeorg Ehrke <ownclouddev@georgswebsite.de>2011-12-26 19:59:15 +0100
committerGeorg Ehrke <ownclouddev@georgswebsite.de>2011-12-26 19:59:15 +0100
commitffa835c56f4575b3e6e40a1d2247f7b374fdc892 (patch)
tree3c07488f59680e25c7f2c79c7b9a573b223d0b6d /apps/calendar
parentd582f7576c1f70aae4cd866032d2630e6f0e7a9b (diff)
downloadnextcloud-server-ffa835c56f4575b3e6e40a1d2247f7b374fdc892.tar.gz
nextcloud-server-ffa835c56f4575b3e6e40a1d2247f7b374fdc892.zip
fix the default setting for yearly repeating events
Diffstat (limited to 'apps/calendar')
-rw-r--r--apps/calendar/ajax/neweventform.php2
-rw-r--r--apps/calendar/js/calendar.js10
-rw-r--r--apps/calendar/lib/object.php14
3 files changed, 13 insertions, 13 deletions
diff --git a/apps/calendar/ajax/neweventform.php b/apps/calendar/ajax/neweventform.php
index 1812407dd6e..88468dd3dbf 100644
--- a/apps/calendar/ajax/neweventform.php
+++ b/apps/calendar/ajax/neweventform.php
@@ -69,6 +69,6 @@ $tmpl->assign('repeat_end', 'never');
$tmpl->assign('repeat_count', '10');
$tmpl->assign('repeat_weekofmonth', 'auto');
$tmpl->assign('repeat_date', '');
-$tmpl->assign('repeat_year', 'byyearday');
+$tmpl->assign('repeat_year', 'bydate');
$tmpl->printpage();
?>
diff --git a/apps/calendar/js/calendar.js b/apps/calendar/js/calendar.js
index 93dddf516f9..892dbd79e42 100644
--- a/apps/calendar/js/calendar.js
+++ b/apps/calendar/js/calendar.js
@@ -292,7 +292,6 @@ Calendar={
}
if($('#repeat option:selected').val() == 'yearly'){
$('#advanced_year').css('display', 'block');
- $('#advanced_byyearday').css('display', 'block');
}
if($('#repeat option:selected').val() == 'doesnotrepeat'){
$('#advanced_options_repeating').slideUp('slow');
@@ -312,14 +311,13 @@ Calendar={
$('#advanced_bymonth').css('display', 'none');
$('#advanced_byweekno').css('display', 'none');
$('#advanced_bymonthday').css('display', 'none');
- if($('#advanced_year option:selected').val() == 'byyearday'){
- $('#advanced_byyearday').css('display', 'block');
+ if($('#advanced_year_select option:selected').val() == 'byyearday'){
+ //$('#advanced_byyearday').css('display', 'block');
}
- if($('#advanced_year option:selected').val() == 'byweekno'){
+ if($('#advanced_year_select option:selected').val() == 'byweekno'){
$('#advanced_byweekno').css('display', 'block');
-
}
- if($('#advanced_year option:selected').val() == 'bydaymonth'){
+ if($('#advanced_year_select option:selected').val() == 'bydaymonth'){
$('#advanced_bymonth').css('display', 'block');
$('#advanced_bymonthday').css('display', 'block');
$('#advanced_weekday').css('display', 'block');
diff --git a/apps/calendar/lib/object.php b/apps/calendar/lib/object.php
index c5ae760d00f..b53feb0bf0e 100644
--- a/apps/calendar/lib/object.php
+++ b/apps/calendar/lib/object.php
@@ -438,6 +438,7 @@ class OC_Calendar_Object{
public static function getYearOptions($l10n){
return array(
+ 'bydate' => $l10n->t('by events date'),
'byyearday' => $l10n->t('by yearday(s)'),
'byweekno' => $l10n->t('by weeknumber(s)'),
'bydaymonth' => $l10n->t('by day and month')
@@ -700,12 +701,13 @@ class OC_Calendar_Object{
break;
case 'yearly':
$rrule .= 'FREQ=YEARLY';
- if($request['advanced_year_select'] == 'byyearday'){
- $byyearday = '';
- foreach($request['byyearday'] as $yearday){
- if($byyearday == ''){
- $byyearday = $yearday;
- }else{
+ if($request['advanced_year_select'] == 'bydate'){
+
+ }elseif($request['advanced_year_select'] == 'byyearday'){
+ list($_day, $_month, $_year) = explode('-', $from);
+ $byyearday = date('z', mktime(0,0,0, $_month, $_day, $_year)) + 1;
+ if(array_key_exists('byyearday', $request)){
+ foreach($request['byyearday'] as $yearday){
$byyearday .= ',' . $yearday;
}
}