Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
Stud.IP
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Jan-Hendrik Willms
Stud.IP
Commits
2d2951ec
Commit
2d2951ec
authored
4 months ago
by
Moritz Strohm
Browse files
Options
Downloads
Patches
Plain Diff
fixed problems regarding moving single dates and displaying the amount of repetitions, fixes #4724
Closes #4724 Merge request
studip/studip!3617
parent
b710bd4d
No related branches found
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
app/controllers/calendar/date.php
+1
-1
1 addition, 1 deletion
app/controllers/calendar/date.php
lib/models/calendar/CalendarDate.php
+20
-10
20 additions, 10 deletions
lib/models/calendar/CalendarDate.php
with
21 additions
and
11 deletions
app/controllers/calendar/date.php
+
1
−
1
View file @
2d2951ec
...
@@ -655,7 +655,7 @@ class Calendar_DateController extends AuthenticatedController
...
@@ -655,7 +655,7 @@ class Calendar_DateController extends AuthenticatedController
throw
new
InvalidArgumentException
();
throw
new
InvalidArgumentException
();
}
}
if
(
$this
->
date
->
repetition_type
)
{
if
(
$this
->
date
->
repetition_type
!==
'SINGLE'
)
{
PageLayout
::
setTitle
(
_
(
'Verschieben eines Termins aus einer Terminserie'
));
PageLayout
::
setTitle
(
_
(
'Verschieben eines Termins aus einer Terminserie'
));
//Show the dialog to decide what shall be done with the repetition.
//Show the dialog to decide what shall be done with the repetition.
if
(
Request
::
submitted
(
'move'
))
{
if
(
Request
::
submitted
(
'move'
))
{
...
...
This diff is collapsed.
Click to expand it.
lib/models/calendar/CalendarDate.php
+
20
−
10
View file @
2d2951ec
...
@@ -477,9 +477,10 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -477,9 +477,10 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
if
(
$this
->
interval
==
'1'
)
{
if
(
$this
->
interval
==
'1'
)
{
//Each day
//Each day
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
_
(
'Täglich (%u Termine)'
),
_
(
'Täglich (%u Termine)'
),
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
CalendarDate
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
CalendarDate
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
@@ -492,10 +493,11 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -492,10 +493,11 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
}
else
{
}
else
{
//Every %u day
//Every %u day
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
_
(
'Jeden %1$u. Tag (%2$u Termine)'
),
_
(
'Jeden %1$u. Tag (%2$u Termine)'
),
$this
->
interval
,
$this
->
interval
,
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
@@ -535,10 +537,11 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -535,10 +537,11 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
if
(
$this
->
interval
==
'1'
)
{
if
(
$this
->
interval
==
'1'
)
{
//Each week
//Each week
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
ngettext
(
'Einmal am folgenden %s'
,
'Jeden %1$s (%2$u Termine)'
,
$this
->
number_of_dates
-
1
),
ngettext
(
'Einmal am folgenden %s'
,
'Jeden %1$s (%2$u Termine)'
,
$this
->
number_of_dates
-
1
),
$weekday_string
,
$weekday_string
,
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
@@ -555,11 +558,12 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -555,11 +558,12 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
}
else
{
}
else
{
//Every %u week
//Every %u week
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
_
(
'Jeden %1$u. %2$s (%3$u Termine)'
),
_
(
'Jeden %1$u. %2$s (%3$u Termine)'
),
$this
->
interval
,
$this
->
interval
,
$weekday_string
,
$weekday_string
,
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
@@ -637,11 +641,12 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -637,11 +641,12 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
//in a specific month.
//in a specific month.
if
(
$this
->
offset
<
0
)
{
if
(
$this
->
offset
<
0
)
{
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
_
(
'Jedes Jahr im %1$s am letzten %2$s (%3$u Termine)'
),
_
(
'Jedes Jahr im %1$s am letzten %2$s (%3$u Termine)'
),
getMonthName
(
$this
->
month
,
false
),
getMonthName
(
$this
->
month
,
false
),
getWeekday
(
$this
->
days
,
false
),
getWeekday
(
$this
->
days
,
false
),
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
@@ -659,12 +664,13 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -659,12 +664,13 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
}
}
}
else
{
}
else
{
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
_
(
'Jedes Jahr im %1$s am %2$u. %3$s (%4$u Termine'
),
_
(
'Jedes Jahr im %1$s am %2$u. %3$s (%4$u Termine'
),
getMonthName
(
$this
->
month
,
false
),
getMonthName
(
$this
->
month
,
false
),
$this
->
offset
,
$this
->
offset
,
getWeekday
(
$this
->
days
,
false
),
getWeekday
(
$this
->
days
,
false
),
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
@@ -686,11 +692,12 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -686,11 +692,12 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
}
else
{
}
else
{
//Repetition on one specific day of month.
//Repetition on one specific day of month.
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
_
(
'Jedes Jahr am %1$u. %2$s (%3$u Termine)'
),
_
(
'Jedes Jahr am %1$u. %2$s (%3$u Termine)'
),
$this
->
offset
,
$this
->
offset
,
getMonthName
(
$this
->
month
,
false
),
getMonthName
(
$this
->
month
,
false
),
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
@@ -714,12 +721,13 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -714,12 +721,13 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
//in a specific month.
//in a specific month.
if
(
$this
->
offset
<
0
)
{
if
(
$this
->
offset
<
0
)
{
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
_
(
'Jedes %1$u. Jahr im %2$s am letzten %3$s (%4$u Termine)'
),
_
(
'Jedes %1$u. Jahr im %2$s am letzten %3$s (%4$u Termine)'
),
$this
->
interval
,
$this
->
interval
,
getMonthName
(
$this
->
month
,
false
),
getMonthName
(
$this
->
month
,
false
),
getWeekday
(
$this
->
days
,
false
),
getWeekday
(
$this
->
days
,
false
),
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
@@ -739,13 +747,14 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -739,13 +747,14 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
}
}
}
else
{
}
else
{
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
_
(
'Jedes %1$u. Jahr im %2$s am %3$u. %4$s (%5$u Termine)'
),
_
(
'Jedes %1$u. Jahr im %2$s am %3$u. %4$s (%5$u Termine)'
),
$this
->
interval
,
$this
->
interval
,
getMonthName
(
$this
->
month
,
false
),
getMonthName
(
$this
->
month
,
false
),
$this
->
offset
,
$this
->
offset
,
getWeekday
(
$this
->
days
,
false
),
getWeekday
(
$this
->
days
,
false
),
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
@@ -769,12 +778,13 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
...
@@ -769,12 +778,13 @@ class CalendarDate extends SimpleORMap implements PrivacyObject
}
else
{
}
else
{
//Repetition on one specific day of month.
//Repetition on one specific day of month.
if
(
$this
->
number_of_dates
>
1
)
{
if
(
$this
->
number_of_dates
>
1
)
{
$number_of_exceptions
=
CalendarDateException
::
countByCalendar_date_id
(
$this
->
id
);
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
_
(
'Jedes %1$u. Jahr am %2$u. %3$s (%4$u Termine)'
),
_
(
'Jedes %1$u. Jahr am %2$u. %3$s (%4$u Termine)'
),
$this
->
interval
,
$this
->
interval
,
$this
->
offset
,
$this
->
offset
,
getMonthName
(
$this
->
month
,
false
),
getMonthName
(
$this
->
month
,
false
),
$this
->
number_of_dates
$this
->
number_of_dates
-
$number_of_exceptions
);
);
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
}
elseif
(
$this
->
repetition_end
<
self
::
NEVER_ENDING
)
{
$repetition_string
=
sprintf
(
$repetition_string
=
sprintf
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment