25 include_once
"./Services/Xml/classes/class.ilXmlWriter.php";
44 private $mode = self::MODE_SOAP;
67 parent::__construct();
69 $this->EXPORT_VERSION =
"2";
77 $this->mode = $a_mode;
87 if ($this->
getMode() == self::MODE_SOAP) {
92 if ($this->attach_users) {
101 include_once
'./Services/Container/classes/class.ilContainerSortingSettings.php';
105 } elseif ($this->
getMode() == self::MODE_EXPORT) {
110 include_once
'./Services/Container/classes/class.ilContainerSortingSettings.php';
119 #var_dump("<pre>", htmlentities($this->xmlDumpMem()),"<pre>"); 126 if ($a_tag ==
"Identifier" && $a_param ==
"Entry") {
127 $a_value =
"il_" . $this->
ilias->getSetting(
'inst_id') .
"_crs_" . $this->course_obj->getId();
136 $this->
xmlSetDtdDef(
"<!DOCTYPE Course PUBLIC \"-//ILIAS//DTD Course//EN\" \"" . ILIAS_HTTP_PATH .
"/xml/ilias_crs_5_0.dtd\">");
137 $this->
xmlSetGenCmt(
"Export of ILIAS course " . $this->course_obj->getId() .
" of installation " . $this->
ilias->getSetting(
'inst_id') .
".");
146 $attrs[
"exportVersion"] = $this->EXPORT_VERSION;
147 $attrs[
"id"] =
"il_" . $this->
ilias->getSetting(
'inst_id') .
'_crs_' . $this->course_obj->getId();
148 $attrs[
'showMembers'] = ($this->course_obj->getShowMembers() ?
'Yes' :
'No');
154 include_once
'Services/MetaData/classes/class.ilMD2XML.php';
156 $md2xml =
new ilMD2XML($this->course_obj->getId(), $this->course_obj->getId(),
'crs');
171 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValues.php');
177 $admins = $this->course_obj->getMembersObject()->getAdmins();
178 $admins =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
181 $this->course_obj->getRefId(),
185 foreach ($admins as
$id) {
186 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' .
$id;
187 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
188 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
189 $attr[
'contact'] = $this->course_obj->getMembersObject()->isContact($id) ?
'Yes' :
'No';
199 $tutors = $this->course_obj->getMembersObject()->getTutors();
200 $tutors =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
203 $this->course_obj->getRefId(),
206 foreach ($tutors as
$id) {
207 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' .
$id;
208 $attr[
'notification'] = ($this->course_obj->getMembersObject()->isNotificationEnabled($id)) ?
'Yes' :
'No';
209 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
210 $attr[
'contact'] = $this->course_obj->getMembersObject()->isContact($id) ?
'Yes' :
'No';
219 $members = $this->course_obj->getMembersObject()->getMembers();
220 $members =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
223 $this->course_obj->getRefId(),
226 foreach ($members as
$id) {
227 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' .
$id;
228 $attr[
'blocked'] = ($this->course_obj->getMembersObject()->isBlocked($id)) ?
'Yes' :
'No';
229 $attr[
'passed'] = $this->course_obj->getMembersObject()->hasPassed($id) ?
'Yes' :
'No';
239 $subs = $this->course_obj->getMembersObject()->getSubscribers();
240 $subs =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
243 $this->course_obj->getRefId(),
247 foreach ($subs as
$id) {
248 $data = $this->course_obj->getMembersObject()->getSubscriberData($id);
250 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' .
$id;
251 $attr[
'subscriptionTime'] =
$data[
'time'];
261 include_once
'Modules/Course/classes/class.ilCourseWaitingList.php';
266 foreach ($wait as
$data) {
267 $is_accessible =
$GLOBALS[
'DIC']->access()->filterUserIdsByRbacOrPositionOfCurrentUser(
270 $this->course_obj->getRefId(),
273 if (!count($is_accessible)) {
277 $attr[
'id'] =
'il_' . $this->
ilias->getSetting(
'inst_id') .
'_usr_' . $data[
'usr_id'];
278 $attr[
'position'] = $data[
'position'];
279 $attr[
'subscriptionTime'] = $data[
'time'];
294 if ($this->course_obj->getOfflineStatus()) {
296 } elseif ($this->course_obj->getActivationUnlimitedStatus()) {
300 $this->
xmlElement(
'Start', null, $this->course_obj->getActivationStart());
301 $this->
xmlElement(
'End', null, $this->course_obj->getActivationEnd());
302 $this->
xmlEndTag(
'TemporarilyAvailable');
307 $this->
xmlElement(
'Syllabus', null, $this->course_obj->getSyllabus());
308 $this->
xmlElement(
'ImportantInformation', null, $this->course_obj->getImportantInformation());
313 $this->
xmlElement(
'Name', null, $this->course_obj->getContactName());
314 $this->
xmlElement(
'Responsibility', null, $this->course_obj->getContactResponsibility());
315 $this->
xmlElement(
'Phone', null, $this->course_obj->getContactPhone());
316 $this->
xmlElement(
'Email', null, $this->course_obj->getContactEmail());
317 $this->
xmlElement(
'Consultation', null, $this->course_obj->getContactConsultation());
324 $attr[
'registrationType'] =
'Confirmation';
326 $attr[
'registrationType'] =
'Direct';
328 $attr[
'registrationType'] =
'Password';
331 $attr[
'maxMembers'] = $this->course_obj->isSubscriptionMembershipLimited() ?
332 $this->course_obj->getSubscriptionMaxMembers() : 0;
333 $attr[
'notification'] = $this->course_obj->getSubscriptionNotify() ?
'Yes' :
'No';
334 $attr[
'waitingList'] = $this->course_obj->enabledWaitingList() ?
'Yes' :
'No';
344 $this->
xmlElement(
'Start', null, $this->course_obj->getSubscriptionStart());
345 $this->
xmlElement(
'End', null, $this->course_obj->getSubscriptionEnd());
346 $this->
xmlEndTag(
'TemporarilyAvailable');
348 if (strlen($pwd = $this->course_obj->getSubscriptionPassword())) {
355 $this->
xmlElement(
'Start', null, ($this->course_obj->getCourseStart() && !$this->course_obj->getCourseStart()->isNull()) ? $this->course_obj->getCourseStart()->get(
IL_CAL_UNIX) : null);
356 $this->
xmlElement(
'End', null, ($this->course_obj->getCourseEnd() && !$this->course_obj->getCourseEnd()->isNull()) ? $this->course_obj->getCourseEnd()->get(
IL_CAL_UNIX) : null);
358 $this->
xmlElement(
'WaitingListAutoFill', null, (
int) $this->course_obj->hasWaitingListAutoFill());
359 $this->
xmlElement(
'CancellationEnd', null, ($this->course_obj->getCancellationEnd() && !$this->course_obj->getCancellationEnd()->isNull()) ? $this->course_obj->getCancellationEnd()->get(
IL_CAL_UNIX) : null);
360 $this->
xmlElement(
'MinMembers', null, (
int) $this->course_obj->getSubscriptionMinMembers());
362 $this->
xmlElement(
'ViewMode', null, $this->course_obj->getViewMode());
365 $this->
xmlElement(
'ViewMode', null, $this->course_obj->getViewMode());
368 $this->
xmlElement(
'TimingMode', null, $this->course_obj->getTimingMode());
389 $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.
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.
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
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
const IL_CRS_SUBSCRIPTION_DEACTIVATED
__buildAdvancedMetaData()
Build advanced meta data.