25 include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
44 private $mode = self::MODE_SOAP;
65 parent::__construct();
67 $this->EXPORT_VERSION =
"2";
75 $this->mode = $a_mode;
85 if ($this->
getMode() == self::MODE_SOAP) {
90 if ($this->attach_users) {
99 include_once
'./Services/Container/classes/class.ilContainerSortingSettings.php';
103 } elseif ($this->
getMode() == self::MODE_EXPORT) {
108 include_once
'./Services/Container/classes/class.ilContainerSortingSettings.php';
117 #var_dump("<pre>", htmlentities($this->xmlDumpMem()),"<pre>"); 124 if ($a_tag ==
"Identifier" && $a_param ==
"Entry") {
125 $a_value =
"il_" . $this->
ilias->getSetting(
'inst_id') .
"_crs_" . $this->course_obj->getId();
134 $this->
xmlSetDtdDef(
"<!DOCTYPE Course PUBLIC \"-//ILIAS//DTD Course//EN\" \"" . ILIAS_HTTP_PATH .
"/xml/ilias_crs_5_0.dtd\">");
135 $this->
xmlSetGenCmt(
"Export of ILIAS course " . $this->course_obj->getId() .
" of installation " . $this->
ilias->getSetting(
'inst_id') .
".");
144 $attrs[
"exportVersion"] = $this->EXPORT_VERSION;
145 $attrs[
"id"] =
"il_" . $this->
ilias->getSetting(
'inst_id') .
'_crs_' . $this->course_obj->getId();
146 $attrs[
'showMembers'] = ($this->course_obj->getShowMembers() ?
'Yes' :
'No');
152 include_once
'Services/MetaData/classes/class.ilMD2XML.php';
154 $md2xml =
new ilMD2XML($this->course_obj->getId(), $this->course_obj->getId(),
'crs');
169 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
175 $admins = $this->course_obj->getMembersObject()->getAdmins();
176 $admins =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
179 $this->course_obj->getRefId(),
183 foreach ($admins as
$id) {
184 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' .
$id;
185 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
186 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
196 $tutors = $this->course_obj->getMembersObject()->getTutors();
197 $tutors =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
200 $this->course_obj->getRefId(),
203 foreach ($tutors as
$id) {
204 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' .
$id;
205 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
206 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
215 $members = $this->course_obj->getMembersObject()->getMembers();
216 $members =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
219 $this->course_obj->getRefId(),
222 foreach ($members as
$id) {
223 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' .
$id;
224 $attr[
'blocked'] = ($this->course_obj->getMembersObject()->isBlocked($id)) ?
'Yes' :
'No';
225 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
235 $subs = $this->course_obj->getMembersObject()->getSubscribers();
236 $subs =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
239 $this->course_obj->getRefId(),
243 foreach ($subs as
$id) {
244 $data = $this->course_obj->getMembersObject()->getSubscriberData($id);
246 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' .
$id;
247 $attr[
'subscriptionTime'] =
$data[
'time'];
257 include_once
'Modules/Course/classes/class.ilCourseWaitingList.php';
262 foreach ($wait as
$data) {
263 $is_accessible =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
266 $this->course_obj->getRefId(),
269 if (!count($is_accessible)) {
273 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' . $data[
'usr_id'];
274 $attr[
'position'] = $data[
'position'];
275 $attr[
'subscriptionTime'] = $data[
'time'];
290 if ($this->course_obj->getOfflineStatus()) {
292 } elseif ($this->course_obj->getActivationUnlimitedStatus()) {
296 $this->
xmlElement(
'Start', null, $this->course_obj->getActivationStart());
297 $this->
xmlElement(
'End', null, $this->course_obj->getActivationEnd());
298 $this->
xmlEndTag(
'TemporarilyAvailable');
303 $this->
xmlElement(
'Syllabus', null, $this->course_obj->getSyllabus());
304 $this->
xmlElement(
'ImportantInformation', null, $this->course_obj->getImportantInformation());
309 $this->
xmlElement(
'Name', null, $this->course_obj->getContactName());
310 $this->
xmlElement(
'Responsibility', null, $this->course_obj->getContactResponsibility());
311 $this->
xmlElement(
'Phone', null, $this->course_obj->getContactPhone());
312 $this->
xmlElement(
'Email', null, $this->course_obj->getContactEmail());
313 $this->
xmlElement(
'Consultation', null, $this->course_obj->getContactConsultation());
320 $attr[
'registrationType'] =
'Confirmation';
322 $attr[
'registrationType'] =
'Direct';
324 $attr[
'registrationType'] =
'Password';
327 $attr[
'maxMembers'] = $this->course_obj->isSubscriptionMembershipLimited() ?
328 $this->course_obj->getSubscriptionMaxMembers() : 0;
329 $attr[
'notification'] = $this->course_obj->getSubscriptionNotify() ?
'Yes' :
'No';
330 $attr[
'waitingList'] = $this->course_obj->enabledWaitingList() ?
'Yes' :
'No';
340 $this->
xmlElement(
'Start', null, $this->course_obj->getSubscriptionStart());
341 $this->
xmlElement(
'End', null, $this->course_obj->getSubscriptionEnd());
342 $this->
xmlEndTag(
'TemporarilyAvailable');
344 if (strlen($pwd = $this->course_obj->getSubscriptionPassword())) {
351 $this->
xmlElement(
'Start', null, ($this->course_obj->getCourseStart() && !$this->course_obj->getCourseStart()->isNull()) ? $this->course_obj->getCourseStart()->get(
IL_CAL_UNIX) : null);
352 $this->
xmlElement(
'End', null, ($this->course_obj->getCourseEnd() && !$this->course_obj->getCourseEnd()->isNull()) ? $this->course_obj->getCourseEnd()->get(
IL_CAL_UNIX) : null);
354 $this->
xmlElement(
'WaitingListAutoFill', null, (
int) $this->course_obj->hasWaitingListAutoFill());
355 $this->
xmlElement(
'CancellationEnd', null, ($this->course_obj->getCancellationEnd() && !$this->course_obj->getCancellationEnd()->isNull()) ? $this->course_obj->getCancellationEnd()->get(
IL_CAL_UNIX) : null);
356 $this->
xmlElement(
'MinMembers', null, (
int) $this->course_obj->getSubscriptionMinMembers());
358 $this->
xmlElement(
'ViewMode', null, $this->course_obj->getViewMode());
377 $this->attach_users = $value ? true :
false;
static _exportContainerSettings(ilXmlWriter $a_xml, $a_obj_id)
xmlStartTag($tag, $attrs=null, $empty=false, $encode=true, $escape=true)
Writes a starttag.
setAttachUsers($value)
write access to attach user property, if set to false no users will be attached.
xmlSetGenCmt($genCmt)
Sets generated comment.
xmlSetDtdDef($dtdDef)
Sets dtd definition.
xmlDumpMem($format=true)
Returns xml document from memory.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
if(!array_key_exists('StateId', $_REQUEST)) $id
static _appendXMLByObjId(ilXmlWriter $a_xml_writer, $a_obj_id)
Get xml of object values.
const IL_CRS_SUBSCRIPTION_CONFIRMATION
xmlEndTag($tag)
Writes an endtag.
__construct($course_obj)
constructor
getAllUsers()
get all users on waiting list
const IL_CRS_SUBSCRIPTION_UNLIMITED
redirection script todo: (a better solution should control the processing via a xml file) ...
xmlHeader()
Writes xml header public.
Create styles array
The data for the language used.
xmlElement($tag, $attrs=null, $data=null, $encode=true, $escape=true)
Writes a basic element (no children, just textual content)
modifyExportIdentifier($a_tag, $a_param, $a_value)
static _exportContainerSortingSettings(ilXmlWriter $xml, $obj_id)
sorting XML-export for all container objects
appendXML($a_str)
append xml string to document
const IL_CRS_SUBSCRIPTION_DIRECT
const IL_CRS_SUBSCRIPTION_DEACTIVATED
__buildAdvancedMetaData()
Build advanced meta data.