19 declare(strict_types=0);
37 private int $mode = self::MODE_SOAP;
50 $this->setting = $DIC->settings();
51 $this->
access = $DIC->access();
57 public function setMode(
int $a_mode): void
59 $this->mode = $a_mode;
69 if ($this->
getMode() == self::MODE_SOAP) {
74 if ($this->attach_users) {
86 } elseif ($this->
getMode() == self::MODE_EXPORT) {
102 if ($a_tag ==
"Identifier" && $a_param ==
"Entry") {
103 $a_value =
"il_" . $this->setting->get(
'inst_id') .
"_crs_" . $this->course_obj->getId();
112 $this->
xmlSetGenCmt(
"Export of ILIAS course " . $this->course_obj->getId() .
" of installation " . $this->setting->get(
'inst_id') .
".");
120 if ($desc = $this->course_obj->getDescription()) {
127 $attrs[
"exportVersion"] = self::EXPORT_VERSION;
128 $attrs[
"id"] =
"il_" . $this->setting->get(
'inst_id') .
'_crs_' . $this->course_obj->getId();
129 $attrs[
'showMembers'] = ($this->course_obj->getShowMembers() ?
'Yes' :
'No');
140 $admins = $this->course_obj->getMembersObject()->getAdmins();
141 $admins =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
144 $this->course_obj->getRefId(),
148 foreach ($admins as
$id) {
149 $attr[
'id'] =
'il_' . $this->setting->get(
'inst_id') .
'_usr_' .
$id;
150 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
151 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
152 $attr[
'contact'] = $this->course_obj->getMembersObject()->isContact($id) ?
'Yes' :
'No';
161 $tutors = $this->course_obj->getMembersObject()->getTutors();
162 $tutors = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
165 $this->course_obj->getRefId(),
168 foreach ($tutors as
$id) {
169 $attr[
'id'] =
'il_' . $this->setting->get(
'inst_id') .
'_usr_' .
$id;
170 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
171 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
172 $attr[
'contact'] = $this->course_obj->getMembersObject()->isContact($id) ?
'Yes' :
'No';
181 $members = $this->course_obj->getMembersObject()->getMembers();
182 $members =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
185 $this->course_obj->getRefId(),
188 foreach ($members as
$id) {
189 $attr[
'id'] =
'il_' . $this->setting->get(
'inst_id') .
'_usr_' .
$id;
190 $attr[
'blocked'] = ($this->course_obj->getMembersObject()->isBlocked($id)) ?
'Yes' :
'No';
191 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
200 $subs = $this->course_obj->getMembersObject()->getSubscribers();
201 $subs = $this->
access->filterUserIdsByRbacOrPositionOfCurrentUser(
204 $this->course_obj->getRefId(),
208 foreach ($subs as
$id) {
209 $data = $this->course_obj->getMembersObject()->getSubscriberData($id);
211 $attr[
'id'] =
'il_' . $this->setting->get(
'inst_id') .
'_usr_' .
$id;
212 $attr[
'subscriptionTime'] =
$data[
'time'];
223 foreach ($wait as
$data) {
224 $is_accessible =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
227 $this->course_obj->getRefId(),
230 if (count($is_accessible) === 0) {
234 $attr[
'id'] =
'il_' . $this->setting->get(
'inst_id') .
'_usr_' . $data[
'usr_id'];
235 $attr[
'position'] = $data[
'position'];
236 $attr[
'subscriptionTime'] = $data[
'time'];
249 if ($this->course_obj->getOfflineStatus()) {
251 } elseif ($this->course_obj->getActivationUnlimitedStatus()) {
255 $this->
xmlElement(
'Start',
null, $this->course_obj->getActivationStart());
256 $this->
xmlElement(
'End',
null, $this->course_obj->getActivationEnd());
257 $this->
xmlEndTag(
'TemporarilyAvailable');
262 $this->
xmlElement(
'Syllabus',
null, $this->course_obj->getSyllabus());
263 $this->
xmlElement(
'ImportantInformation',
null, $this->course_obj->getImportantInformation());
264 $this->
xmlElement(
'TargetGroup',
null, $this->course_obj->getTargetGroup());
268 $this->
xmlElement(
'Name',
null, $this->course_obj->getContactName());
269 $this->
xmlElement(
'Responsibility',
null, $this->course_obj->getContactResponsibility());
270 $this->
xmlElement(
'Phone',
null, $this->course_obj->getContactPhone());
271 $this->
xmlElement(
'Email',
null, $this->course_obj->getContactEmail());
272 $this->
xmlElement(
'Consultation',
null, $this->course_obj->getContactConsultation());
279 $attr[
'registrationType'] =
'Confirmation';
281 $attr[
'registrationType'] =
'Direct';
283 $attr[
'registrationType'] =
'Password';
286 $attr[
'maxMembers'] = $this->course_obj->isSubscriptionMembershipLimited() ?
287 $this->course_obj->getSubscriptionMaxMembers() : 0;
288 $attr[
'notification'] = $this->course_obj->getSubscriptionNotify() ?
'Yes' :
'No';
289 $attr[
'waitingList'] = $this->course_obj->enabledWaitingList() ?
'Yes' :
'No';
299 $this->
xmlElement(
'Start',
null, $this->course_obj->getSubscriptionStart());
300 $this->
xmlElement(
'End',
null, $this->course_obj->getSubscriptionEnd());
301 $this->
xmlEndTag(
'TemporarilyAvailable');
303 if (strlen($pwd = $this->course_obj->getSubscriptionPassword())) {
308 $this->
xmlStartTag(
'Period', [
'withTime' => $this->course_obj->getCourseStartTimeIndication() ? 1 : 0]);
312 $this->course_obj->getCourseStart()
313 ? $this->course_obj->getCourseStart()->get(
IL_CAL_UNIX)
319 $this->course_obj->getCourseEnd()
320 ? $this->course_obj->getCourseEnd()->get(
IL_CAL_UNIX)
324 $this->
xmlElement(
'WaitingListAutoFill',
null, (
int) $this->course_obj->hasWaitingListAutoFill());
328 ($this->course_obj->getCancellationEnd() && !$this->course_obj->getCancellationEnd()->isNull()) ? $this->course_obj->getCancellationEnd()->get(
IL_CAL_UNIX) :
null 330 $this->
xmlElement(
'MinMembers',
null, $this->course_obj->getSubscriptionMinMembers());
332 $this->
xmlElement(
'ViewMode',
null, $this->course_obj->getViewMode());
334 $this->
xmlElement(
'TimingMode',
null, $this->course_obj->getTimingMode());
338 'active' => $this->course_obj->getTutorialSupportBlockSettingValue()
344 'active' => $this->course_obj->isSessionLimitEnabled() ? 1 : 0,
345 'previous' => $this->course_obj->getNumberOfPreviousSessions(),
346 'next' => $this->course_obj->getNumberOfNextSessions()
353 'status' => $this->course_obj->getAutoNotification() ? 1 : 0
357 $this->
xmlElement(
'StatusDetermination',
null, (
int) $this->course_obj->getStatusDetermination());
358 $this->
xmlElement(
'MailToMembersType',
null, (
int) $this->course_obj->getMailToMembersType());
360 'enabled' => (
int) $this->course_obj->getEnableCourseMap(),
361 'latitude' => $this->course_obj->getLatitude(),
362 'longitude' => $this->course_obj->getLongitude(),
363 'location_zoom' => $this->course_obj->getLocationZoom()
376 $this->attach_users = (bool) $value;
const string EXPORT_VERSION
const IL_CRS_SUBSCRIPTION_DIRECT
const IL_CRS_SUBSCRIPTION_DEACTIVATED
__buildTitleDescription()
__construct(ilObjCourse $course_obj)
xmlSetGenCmt(string $genCmt)
Sets generated comment.
xmlEndTag(string $tag)
Writes an endtag.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static _exportContainerSortingSettings(ilXmlWriter $xml, int $obj_id)
sorting XML-export for all container objects
getAllUsers()
get all users on waiting list public
xmlHeader()
Writes xml header.
static _exportContainerSettings(ilXmlWriter $a_xml, int $a_obj_id)
static _appendXMLByObjId(ilXmlWriter $a_xml_writer, int $a_obj_id)
Get xml of object values.
modifyExportIdentifier($a_tag, $a_param, $a_value)
const IL_CRS_SUBSCRIPTION_UNLIMITED
$id
plugin.php for ilComponentBuildPluginInfoObjectiveTest::testAddPlugins
__construct(Container $dic, ilPlugin $plugin)
const IL_CRS_SUBSCRIPTION_CONFIRMATION
xmlStartTag(string $tag, ?array $attrs=null, bool $empty=false, bool $encode=true, bool $escape=true)
Writes a starttag.
xmlElement(string $tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
xmlDumpMem(bool $format=true)
Returns xml document from memory.
XML writer class Class to simplify manual writing of xml documents.
__buildAdvancedMetaData()