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
Iterations
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Deploy
Model registry
Analyze
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
Uni Osnabrück
Stud.IP
Commits
66ac0dec
Commit
66ac0dec
authored
9 months ago
by
Elmar Ludwig
Browse files
Options
Downloads
Patches
Plain Diff
update calender API usage, picked from
41b3733f
parent
f05211e3
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
lib/extern/modules/ExternModuleTemplatePersondetails.class.php
+22
-15
22 additions, 15 deletions
...xtern/modules/ExternModuleTemplatePersondetails.class.php
lib/extern/modules/views/persondetails.inc.php
+15
-10
15 additions, 10 deletions
lib/extern/modules/views/persondetails.inc.php
with
37 additions
and
25 deletions
lib/extern/modules/ExternModuleTemplatePersondetails.class.php
+
22
−
15
View file @
66ac0dec
...
...
@@ -606,30 +606,37 @@ class ExternModuleTemplatePersondetails extends ExternModule {
private
function
getContentAppointments
()
{
if
(
Config
::
get
()
->
CALENDAR_ENABLE
)
{
$events
=
SingleCalendar
::
getEventList
(
$this
->
user_id
,
time
(),
time
()
+
60
*
60
*
24
*
7
,
null
,
[
'class'
=>
'PUBLIC'
],
[
'CalendarEvent'
]);
$list_start
=
new
DateTime
();
$list_end
=
clone
$list_start
;
$list_end
=
$list_end
->
add
(
new
DateInterval
(
'P7D'
));
$events
=
CalendarDateAssignment
::
getEvents
(
$list_start
,
$list_end
,
$this
->
user_id
,
[
'PUBLIC'
]);
$content
[
'APPOINTMENTS'
][
'LIST-START'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
' %X'
,
time
()));
$content
[
'APPOINTMENTS'
][
'LIST-END'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
' %X'
,
time
()
+
60
*
60
*
24
*
7
));
if
(
sizeof
(
$events
))
{
$i
=
0
;
foreach
(
$events
as
$event
)
{
if
(
$event
->
isDayEvent
())
{
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DATE'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
),
$event
->
getStart
())
.
' ('
.
_
(
"ganztägig"
)
.
')'
);
$event
=
$event
->
calendar_date
;
if
(
!
$event
)
{
continue
;
}
if
(
$event
->
isWholeDay
())
{
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DATE'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
),
$event
->
begin
)
.
' ('
.
_
(
"ganztägig"
)
.
')'
);
}
else
{
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DATE'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
" %X"
,
$event
->
getStart
()
));
if
(
date
(
"dmY"
,
$event
->
getStart
()
)
==
date
(
"dmY"
,
$event
->
getEnd
()
))
{
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DATE'
]
.
=
ExternModule
::
ExtHtmlReady
(
strftime
(
" - %X"
,
$event
->
getEnd
()
));
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DATE'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
" %X"
,
$event
->
begin
));
if
(
date
(
"dmY"
,
$event
->
begin
)
==
date
(
"dmY"
,
$event
->
end
))
{
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DATE'
]
.
=
ExternModule
::
ExtHtmlReady
(
strftime
(
" - %X"
,
$event
->
end
));
}
else
{
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DATE'
]
.
=
ExternModule
::
ExtHtmlReady
(
strftime
(
" - "
.
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
" %X"
,
$event
->
getEnd
()
));
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DATE'
]
.
=
ExternModule
::
ExtHtmlReady
(
strftime
(
" - "
.
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
" %X"
,
$event
->
end
));
}
}
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'TITLE'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
getT
itle
()
);
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DESCRIPTION'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
getD
escription
()
);
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'LOCATION'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
getL
ocation
()
);
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'REPETITION'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
toStringRecurrence
());
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'CATEGORY'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
toStringCategories
());
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'PRIORITY'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
toStringPriority
(
));
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'START'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
" %X"
,
$event
->
getStart
()
));
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'END'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
" %X"
,
$event
->
getEnd
()
));
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'TITLE'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
t
itle
);
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'DESCRIPTION'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
d
escription
);
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'LOCATION'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
l
ocation
);
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'REPETITION'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
getRepetitionAsString
());
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'CATEGORY'
]
=
ExternModule
::
ExtHtmlReady
(
$event
->
getCategoryAsString
());
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'PRIORITY'
]
=
ExternModule
::
ExtHtmlReady
(
_
(
'Keine Angabe'
));
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'START'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
" %X"
,
$event
->
begin
));
$content
[
'APPOINTMENTS'
][
'ALL-APPOINTMENTS'
][
'SINGLE-APPOINTMENT'
][
$i
][
'END'
]
=
ExternModule
::
ExtHtmlReady
(
strftime
(
$this
->
config
->
getValue
(
'Main'
,
'dateformat'
)
.
" %X"
,
$event
->
end
));
$i
++
;
}
}
else
{
...
...
This diff is collapsed.
Click to expand it.
lib/extern/modules/views/persondetails.inc.php
+
15
−
10
View file @
66ac0dec
...
...
@@ -266,9 +266,10 @@ function termine (&$module, $row, $alias_content, $text_div, $text_div_end)
$subheadline_div_end
=
""
;
}
$event_list
=
SingleCalendar
::
getEventList
(
$row
[
'user_id'
],
time
(),
time
()
+
60
*
60
*
24
*
7
,
null
,
[
'class'
=>
'PUBLIC'
],
[
'CalendarEvent'
]);
$list_start
=
new
DateTime
();
$list_end
=
clone
$list_start
;
$list_end
=
$list_end
->
add
(
new
DateInterval
(
'P7D'
));
$event_list
=
CalendarDateAssignment
::
getEvents
(
$list_start
,
$list_end
,
$row
[
'user_id'
],
[
'PUBLIC'
]);
if
(
sizeof
(
$event_list
))
{
echo
"<tr><td width=
\"
100%
\"
>
\n
"
;
echo
"<table"
.
$module
->
config
->
getAttributes
(
"TableParagraph"
,
"table"
)
.
">
\n
"
;
...
...
@@ -278,22 +279,26 @@ function termine (&$module, $row, $alias_content, $text_div, $text_div_end)
echo
"
$alias_content
</font></td></tr>
\n
"
;
foreach
(
$event_list
as
$event
)
{
$event
=
$event
->
calendar_date
;
if
(
!
$event
)
{
continue
;
}
echo
"<tr"
.
$module
->
config
->
getAttributes
(
"TableParagraphSubHeadline"
,
"tr"
)
.
">"
;
echo
"<td"
.
$module
->
config
->
getAttributes
(
"TableParagraphSubHeadline"
,
"td"
)
.
">"
;
echo
$subheadline_div
;
echo
"<font"
.
$module
->
config
->
getAttributes
(
"TableParagraphSubHeadline"
,
"font"
)
.
">"
;
echo
strftime
(
$module
->
config
->
getValue
(
"Main"
,
"dateformat"
)
.
" %H:%M"
,
$event
->
getStart
()
);
if
(
date
(
"dmY"
,
$event
->
getStart
()
)
==
date
(
"dmY"
,
$event
->
getEnd
()
))
echo
strftime
(
" - %H:%M"
,
$event
->
getEnd
()
);
echo
strftime
(
$module
->
config
->
getValue
(
"Main"
,
"dateformat"
)
.
" %H:%M"
,
$event
->
begin
);
if
(
date
(
"dmY"
,
$event
->
begin
)
==
date
(
"dmY"
,
$event
->
end
))
echo
strftime
(
" - %H:%M"
,
$event
->
end
);
else
echo
strftime
(
" - "
.
$module
->
config
->
getValue
(
"Main"
,
"dateformat"
)
.
" %H:%M"
,
$event
->
getEnd
()
);
echo
" "
.
htmlReady
(
$event
->
getT
itle
()
);
echo
strftime
(
" - "
.
$module
->
config
->
getValue
(
"Main"
,
"dateformat"
)
.
" %H:%M"
,
$event
->
end
);
echo
" "
.
htmlReady
(
$event
->
t
itle
);
echo
"</font>
$subheadline_div_end
</td></tr>
\n
"
;
if
(
$event
->
getD
escription
()
)
{
if
(
$event
->
d
escription
)
{
echo
"<tr"
.
$module
->
config
->
getAttributes
(
"TableParagraphText"
,
"tr"
)
.
">"
;
echo
"<td"
.
$module
->
config
->
getAttributes
(
"TableParagraphText"
,
"td"
)
.
">"
;
echo
"
$text_div
<font"
.
$module
->
config
->
getAttributes
(
"TableParagraphText"
,
"font"
)
.
">"
;
echo
htmlReady
(
$event
->
getD
escription
()
);
echo
htmlReady
(
$event
->
d
escription
);
echo
"</font>
$text_div_end
</td></tr>
\n
"
;
}
}
...
...
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