33 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
60 $ilLog->write(
"SOAP getObjIdByImportId(): import_id = ".$import_id.
' obj_id = '.$obj_id);
62 return $obj_id ? $obj_id :
"0";
90 if ($tree->isInTree($ref_id))
95 return $new_refs ? $new_refs : array();
118 return $new_refs ? $new_refs : array();
140 if(!count($ref_ids) || !is_array ($ref_ids))
142 return $this->
__raiseError(
'No reference id(s) given.',
'Client');
146 if (count($ref_ids)) {
149 $ref_id = trim($ref_id);
150 if (!is_numeric($ref_id)){
151 return $this->
__raiseError(
'Reference ID has to be numeric. Value: '.$ref_id,
'Client');
156 return $this->
__raiseError(
'No object found for reference ID. Value: '.$ref_id,
'Client');
159 return $this->
__raiseError(
'No untrashed reference found for reference ID. Value: '.$ref_id,
'Client');
161 $obj_ids[] = $obj_id;
178 if(!is_numeric($a_ref_id))
180 return $this->
__raiseError(
'No valid reference id given. Please choose an existing reference id of an ILIAS object',
186 return $this->
__raiseError(
'Cannot create object instance!',
'Server');
192 return $this->
__raiseError(
"Object with ID $a_ref_id has been deleted.",
'Client');
195 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
198 $xml_writer->enablePermissionCheck(
true);
201 $xml_writer->setUserId($user_id);
202 $xml_writer->enableOperations(
true);
204 $xml_writer->setObjects(array($tmp_obj));
205 if($xml_writer->start())
207 return $xml_writer->getXML();
210 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
222 if(!strlen($a_title))
224 return $this->
__raiseError(
'No valid query string given.',
228 include_once
'./Services/Search/classes/class.ilQueryParser.php';
231 $query_parser->setMinWordLength(0,
true);
233 $query_parser->parse();
234 if(!$query_parser->validate())
240 include_once
'./Services/Search/classes/class.ilObjectSearchFactory.php';
242 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
245 #$object_search =& ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
246 $object_search->setFields(array(
'title'));
247 $object_search->appendToFilter(
'role');
248 $object_search->appendToFilter(
'rolt');
249 $res =& $object_search->performSearch();
252 $res->setUserId($user_id);
255 $res->filter(ROOT_FOLDER_ID,
true);
258 foreach(
$res->getUniqueResults() as $entry)
260 if($entry[
'type'] ==
'role' or $entry[
'type'] ==
'rolt')
278 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
281 $xml_writer->enablePermissionCheck(
true);
284 $xml_writer->setUserId($user_id);
285 $xml_writer->enableOperations(
true);
287 $xml_writer->setObjects($objs);
288 if($xml_writer->start())
290 return $xml_writer->getXML();
293 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
305 if(!is_array($types))
307 return $this->
__raiseError(
'Types must be an array of object types.',
310 if($combination !=
'and' and $combination !=
'or')
312 return $this->
__raiseError(
'No valid combination given. Must be "and" or "or".',
317 include_once
'./Services/Search/classes/class.ilQueryParser.php';
320 #$query_parser->setMinWordLength(3);
322 $query_parser->parse();
323 if(!$query_parser->validate())
329 #include_once './Services/Search/classes/class.ilObjectSearchFactory.php';
330 #$object_search =& ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
332 include_once
'./Services/Search/classes/Like/class.ilLikeObjectSearch.php';
335 $object_search->setFilter($types);
337 $res =& $object_search->performSearch();
340 $res->setUserId($user_id);
342 $res->setMaxHits(999999);
343 $res->filter(ROOT_FOLDER_ID,$combination ==
'and' ?
true :
false);
348 foreach(
$res->getUniqueResults() as $entry)
361 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
364 $xml_writer->enablePermissionCheck(
true);
368 $xml_writer->setUserId($user_id);
369 $xml_writer->enableOperations(
true);
372 $xml_writer->setObjects($objs);
373 if($xml_writer->start())
375 return $xml_writer->getXML();
378 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
397 return $this->
__raiseError(
'No valid reference id given.',
400 if (intval(
$ref_id) == SYSTEM_FOLDER_ID) {
401 return $this->
__raiseError(
'No valid reference id given.',
409 $filter = is_array($types) ? $types : array();
412 foreach($tree->getChilds(
$ref_id,
'title') as $child)
414 if($all or in_array($child[
'type'],$types))
423 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
426 $xml_writer->enablePermissionCheck(
true);
427 $xml_writer->setObjects($objs);
428 $xml_writer->enableOperations(
true);
431 $xml_writer->setUserId($user_id);
434 if ($xml_writer->start())
436 return $xml_writer->getXML();
439 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
454 $nodedata = $tree->getNodeData(
$ref_id);
456 $nodearray = $tree->getSubTree($nodedata);
458 $filter = is_array($types)?$types: array (
"0"=>
"root",
"adm",
"lngf",
"mail",
459 "usrf",
"rolf",
"taxf",
"trac",
"pays",
460 "auth",
"chac",
"objf",
"recf",
"assf",
461 "stys",
"seas",
"extt");
463 foreach ($nodearray as $node)
465 if (!in_array($node[
'type'],
$filter))
475 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
478 $xml_writer->enablePermissionCheck(
true);
479 $xml_writer->setObjects($nodes);
480 $xml_writer->enableOperations(
false);
484 $xml_writer->setUserId($user_id);
487 if ($xml_writer->start())
489 return $xml_writer->getXML();
492 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
507 return $this->
__raiseError(
'No valid xml string given.',
511 global $rbacsystem, $objDefinition,$ilUser,
$lng, $ilObjDataCache;
521 return $this->
__raiseError(
"Parent with ID $a_target_id has been deleted.",
'Client');
524 $allowed_types = array(
'root',
'cat',
'grp',
'crs',
'fold');
525 if(!in_array($target_obj->getType(),$allowed_types))
527 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
531 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
533 foreach($allowed_subtypes as
$row)
535 if($row[
'name'] !=
'rolf')
537 $allowed[] = $row[
'name'];
541 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
545 $xml_parser->startParsing();
554 foreach($xml_parser->getObjectData() as $object_data)
563 if(!in_array($object_data[
'type'],$allowed))
565 return $this->
__raiseError(
'Objects of type: '.$object_data[
'type'].
' are not allowed to be subobjects of type '.
566 $target_obj->getType().
'!',
569 if(!$rbacsystem->checkAccess(
'create',$a_target_id,$object_data[
'type']))
571 return $this->
__raiseError(
'No permission to create objects of type '.$object_data[
'type'].
'!',
574 if($object_data[
'type'] ==
'crs')
576 return $this->
__raiseError(
'Cannot create course objects. Use method addCourse() ',
583 return $this->
__raiseError(
'An object with import id '.$object_data[
'import_id'].
' already exists!',
588 $class_name = $objDefinition->getClassName($object_data[
'type']);
589 $location = $objDefinition->getLocation($object_data[
'type']);
591 $class_constr =
"ilObj".$class_name;
592 require_once(
$location.
"/class.ilObj".$class_name.
".php");
594 $newObj =
new $class_constr();
596 if(isset($object_data[
'owner']) && strlen($object_data[
'owner']))
598 if((
int)$object_data[
'owner'])
601 $ilObjDataCache->lookupType((
int)$object_data[
'owner']) ==
'usr')
603 $newObj->setOwner((
int)$object_data[
'owner']);
611 $newObj->setOwner((
int)$usr_id);
616 $newObj->setType($object_data[
'type']);
617 if(strlen($object_data[
'import_id']))
619 $newObj->setImportId($object_data[
'import_id']);
621 $newObj->setTitle($object_data[
'title']);
622 $newObj->setDescription($object_data[
'description']);
624 $newObj->createReference();
625 $newObj->putInTree($a_target_id);
626 $newObj->setPermissions($a_target_id);
627 $newObj->initDefaultRoles();
629 switch($object_data[
'type'])
633 $newObj->addMember($object_data[
'owner'] ? $object_data[
'owner'] : $ilUser->getId(),
634 $newObj->getDefaultAdminRole());
639 $newObj->createLMTree();
642 $newObj->addTranslation($object_data[
"title"],$object_data[
"description"], $lng->getLangKey(), $lng->getLangKey());
662 if(!is_numeric($a_source_id))
667 if(!is_numeric($a_target_id))
673 global $objDefinition, $rbacsystem, $tree;
686 if(!$objDefinition->allowLink($source_obj->getType()) and
687 $source_obj->getType() !=
'cat' and
688 $source_obj->getType() !=
'crs')
690 return $this->
__raiseError(
'Linking of object type: '.$source_obj->getType().
' is not allowed',
694 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
695 foreach($allowed_subtypes as
$row)
697 if($row[
'name'] !=
'rolf')
699 $allowed[] = $row[
'name'];
702 if(!in_array($source_obj->getType(),$allowed))
704 return $this->
__raiseError(
'Objects of type: '.$source_obj->getType().
' are not allowed to be subobjects of type '.
705 $target_obj->getType().
'!',
710 if(!$rbacsystem->checkAccess(
'create',$target_obj->getRefId(),$source_obj->getType()))
712 return $this->
__raiseError(
'No permission to create objects of type '.$source_obj->getType().
'!',
715 if(!$rbacsystem->checkAccess(
'delete',$source_obj->getRefId()))
717 return $this->
__raiseError(
'No permission to link object with id: '.$source_obj->getRefId().
'!',
722 if($source_obj->getType() !=
'cat' and $source_obj->getType() !=
'crs')
725 $possibleChilds = $tree->getChildsByType($target_obj->getRefId(), $source_obj->getType());
726 foreach ($possibleChilds as $child)
728 if ($child[
"obj_id"] == $source_obj->getId())
729 return $this->
__raiseError(
"Object already linked to target.",
"Client");
734 $new_ref_id = $source_obj->createReference();
735 $source_obj->putInTree($target_obj->getRefId());
736 $source_obj->setPermissions($target_obj->getRefId());
737 $source_obj->initDefaultRoles();
739 if($tree->checkForParentType($target_obj->getRefId(),
'crs'))
742 include_once
'./Modules/Course/classes/class.ilCourseItems.php';
746 return $new_ref_id ? $new_ref_id :
"0";
750 switch($source_obj->getType())
753 include_once(
'./Modules/CategoryReference/classes/class.ilObjCategoryReference.php');
758 include_once(
'./Modules/CourseReference/classes/class.ilObjCourseReference.php');
763 $new_ref_id = $new_ref->createReference();
765 $new_ref->putInTree($target_obj->getRefId());
766 $new_ref->setPermissions($target_obj->getRefId());
767 $new_ref->initDefaultRoles();
769 $new_ref->setTargetId($source_obj->getId());
772 return $new_ref_id ? $new_ref_id : 0;
785 if(!is_numeric($reference_id))
790 global $tree, $rbacsystem, $rbacadmin;
794 return $this->
__raiseError(
'No valid reference id given.',
797 if(!$rbacsystem->checkAccess(
'delete',$del_obj->getRefId()))
799 return $this->
__raiseError(
'No permission to delete object with id: '.$del_obj->getRefId().
'!',
804 if($tree->isDeleted($reference_id))
806 return $this->
__raiseError(
'Node already deleted',
'Server');
809 if($del_obj->getType() ==
'rolf')
811 return $this->
__raiseError(
'Delete is not available for role folders.',
'Client');
814 $subnodes = $tree->getSubtree($tree->getNodeData($reference_id));
815 foreach($subnodes as $subnode)
817 $rbacadmin->revokePermission($subnode[
"child"]);
821 if(!$tree->saveSubTree($reference_id))
823 return $this->
__raiseError(
'Node already deleted',
'Client');
838 if(!strlen($import_id))
840 return $this->
__raiseError(
'No import id given. Aborting!',
843 global $rbacsystem, $tree,
$ilLog;
848 return $this->
__raiseError(
'No object found with import id: '.$import_id,
853 $permission_ok =
false;
856 if($rbacsystem->checkAccess(
'delete',$ref_id))
858 $permission_ok =
true;
864 return $this->
__raiseError(
'No permission to delete the object with import id: '.$import_id,
869 foreach($ref_ids as $ref_id)
872 $node_data = $tree->getNodeData($ref_id);
873 $subtree_nodes = $tree->getSubtree($node_data);
875 foreach($subtree_nodes as $node)
877 $ilLog->write(
'Soap: removeFromSystemByImportId(). Deleting object with title id: '.$node[
'title']);
879 if(!is_object($tmp_obj))
881 return $this->
__raiseError(
'Cannot create instance of reference id: '.$node[
'ref_id'],
887 $tree->deleteTree($node_data);
906 return $this->
__raiseError(
'No valid xml string given.',
910 global $rbacreview, $rbacsystem,
$lng,$ilAccess;
912 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
916 $xml_parser->startParsing();
927 $object_datas = $xml_parser->getObjectData();
928 foreach($object_datas as & $object_data)
937 if(!$object_data[
"obj_id"])
939 return $this->
__raiseError(
'No obj_id in xml found.',
'Client');
941 elseif ((
int) $object_data[
"obj_id"] == -1 && count($object_data[
"references"])>0)
945 foreach ($object_data[
"references"] as $refid)
955 if (!$obj_id_from_refid)
957 return $this->
__raiseError(
'No obj_id found for reference id '.$object_data[
"references"][0],
'CLIENT_OBJECT_NOT_FOUND');
961 $object_data[
"obj_id"] = $obj_id_from_refid;
966 if ($tmp_obj == null)
968 return $this->
__raiseError(
'No object for id '.$object_data[
'obj_id'].
'!',
'CLIENT_OBJECT_NOT_FOUND');
972 $object_data[
"instance"] = $tmp_obj;
975 if($object_data[
'type'] ==
'role')
977 $rolf_ids = $rbacreview->getFoldersAssignedToRole($object_data[
'obj_id'],
true);
978 $rolf_id = $rolf_ids[0];
980 if(!$rbacsystem->checkAccess(
'write',$rolf_id))
982 return $this->
__raiseError(
'No write permission for object with id '.$object_data[
'obj_id'].
'!',
'Client');
987 $permission_ok =
false;
990 if($rbacsystem->checkAccess(
'write',$object_data[
'obj_id']))
992 $permission_ok =
true;
998 return $this->
__raiseError(
'No write permission for object with id '.$object_data[
'obj_id'].
'!',
'Client');
1003 if (count ($object_datas) > 0)
1005 foreach($object_datas as $object_data)
1009 $tmp_obj = $object_data[
"instance"];
1010 $tmp_obj->setTitle($object_data[
'title']);
1011 $tmp_obj->setDescription($object_data[
'description']);
1012 switch ($object_data[
'type'])
1015 $tmp_obj->updateTranslation($object_data[
"title"],$object_data[
"description"], $lng->getLangKey(), $lng->getLangKey());
1019 if(strlen($object_data[
'owner']) && is_numeric($object_data[
'owner']))
1021 $tmp_obj->setOwner($object_data[
'owner']);
1022 $tmp_obj->updateOwner();
1041 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1042 global $rbacreview, $rbacadmin, $objDefinition, $rbacsystem,
$lng, $ilUser, $tree;
1047 return $this->
__raiseError(
'No valid source given.',
'Client');
1053 return $this->
__raiseError(
'No valid target given.',
'Client');
1059 return $this->
__raiseError(
'Object is trashed.',
'Client');
1064 return $this->
__raiseError(
'Object is trashed.',
'Client');
1068 if ($this->
isFault($canAddType))
1075 foreach ($possibleChilds as $child)
1077 if ($child[
"obj_id"] ==
$ref_id)
1078 return $this->
__raiseError(
"Object already exists in target.",
"Client");
1082 $node_data = $tree->getNodeData(
$ref_id);
1083 $subtree_nodes = $tree->getSubTree($node_data);
1085 $all_node_data[] = $node_data;
1086 $all_subtree_nodes[] = $subtree_nodes;
1089 foreach ($subtree_nodes as $node)
1091 if($node[
'type'] ==
'rolf')
1096 if (!$rbacsystem->checkAccess(
'delete',$node[
"ref_id"]))
1098 $no_cut[] = $node[
"ref_id"];
1105 return $this->
__raiseError(
"Object contains references which you are not allowed to delete.",
"Client");
1111 return $this->
__raiseError(
"Cannot move object into itself.",
"Client");
1114 $old_parent = $tree->getParentId(
$ref_id);
1116 $rbacadmin->adjustMovedObjectPermissions(
$ref_id,$old_parent);
1118 include_once(
'classes/class.ilConditionHandler.php');
1139 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1140 global $rbacreview, $objDefinition, $rbacsystem,
$lng, $ilUser;
1142 include_once
'./webservice/soap/classes/class.ilCopyWizardSettingsXMLParser.php';
1145 $xml_parser->startParsing();
1147 return $this->
__raiseError($se->getMessage(),
"Client");
1151 if(!$rbacsystem->checkAccess(
'copy',$xml_parser->getSourceId()))
1153 return $this->
__raiseError(
"Missing copy permissions for object with reference id ".$xml_parser->getSourceId(),
'Client');
1157 $source_id = $xml_parser->getSourceId();
1164 return $this->
__raiseError(
'No valid source given.',
'Client');
1170 return $this->
__raiseError(
'No valid target given.',
'Client');
1175 if ($this->
isFault($canAddType))
1181 $options = $xml_parser->getOptions();
1186 $clientid = substr($sid, strpos($sid,
"::") + 2);
1187 $sessionid = str_replace(
"::".$clientid,
"", $sid);
1189 return $source_object->cloneAllObject($sessionid, $clientid,
1190 $source_object_type,
1199 $wizard_options->saveOwner($ilUser->getId());
1200 $wizard_options->saveRoot($source_id);
1202 foreach($options as $source_id => $option)
1204 $wizard_options->addEntry($source_id,$option);
1206 $wizard_options->read();
1209 $newObject = $source_object->cloneObject($xml_parser->getTargetId(), $copy_id);
1210 return is_object($newObject) ? $newObject->getRefId() : -1;
1224 global $ilAccess, $objDefinition, $rbacsystem,
$lng, $ilUser;
1226 if(!$rbacsystem->checkAccess(
'read',
$ref_id))
1228 return $this->
__raiseError(
"Missing read permissions for object with reference id ".
$ref_id,
'Client');
1233 return $this->
__raiseError(
"Object is in Trash",
'Client');
1236 $items = $tree->getPathFull(
$ref_id);
1238 include_once
'webservice/soap/classes/class.ilXMLResultSet.php';
1239 include_once
'webservice/soap/classes/class.ilXMLResultSetWriter.php';
1240 include_once
'Modules/Course/classes/class.ilCourseXMLWriter.php';
1243 $xmlResultSet->addColumn(
"ref_id");
1244 $xmlResultSet->addColumn(
"type");
1245 $xmlResultSet->addColumn(
"title");
1248 foreach ($items as $item) {
1249 if ($item[
"ref_id"] ==
$ref_id)
1251 if ($item[
"title"] ==
"ILIAS" && $item[
"type"] ==
"root")
1253 $item[
"title"] = $lng->txt(
"repository");
1257 $xmlResultSet->addRow(
$row);
1258 $row->setValue(
"ref_id", $item[
"ref_id"]);
1259 $row->setValue(
"type", $item[
"type"]);
1260 $row->setValue(
"title", $item[
"title"]);
1263 return $writer->getXML();
1270 global $objDefinition, $rbacsystem;
1272 $allowed_types = array(
'root',
'cat',
'grp',
'crs',
'fold');
1275 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
'Client');
1278 $allowed_subtypes = $objDefinition->getSubObjects(
$target_type);
1281 foreach($allowed_subtypes as
$row)
1283 if($row[
'name'] !=
'rolf')
1285 $allowed[] = $row[
'name'];
1289 if(!in_array(
$type, $allowed))
1295 return $this->
__raiseError(
'No permission to create objects of type '.
$type.
'!',
'Client');
1305 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1309 if($a_action ==
'create')
1311 if(count($a_object_data[
'references']) > 1)
1313 if(in_array($a_object_data[
'type'],array(
'cat',
'crs',
'grp',
'fold')))
1315 return $this->
__raiseError(
"Cannot create references for type ".$a_object_data[
'type'],
1319 if(count($a_object_data[
'references']) == 1)
1321 if($a_target_id != $a_object_data[
'references'][0][
'parent_id'])
1323 return $this->
__raiseError(
"Cannot create references for type ".$a_object_data[
'type'],
1328 foreach($a_object_data[
'references'] as $ref_data)
1330 if(!$ref_data[
'parent_id'])
1332 return $this->
__raiseError(
'Element References: No parent Id given!',
'Client');
1337 if($this->
isFault($can_add_type))
1339 return $can_add_type;
1345 if($a_action ==
'update')
1347 foreach($a_object_data[
'references'] as $ref_data)
1349 if(!$ref_data[
'ref_id'])
1351 return $this->
__raiseError(
'Element References: No reference id given!',
'Client');
1354 if(!$ilAccess->checkAccess(
'write',
'',$ref_data[
'ref_id']))
1356 return $this->
__raiseError(
'No write permission for object with reference id '.$ref_data[
'ref_id'].
'!',
'Client');
1368 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1373 foreach($a_object_data[
'references'] as $ref_data)
1375 if(isset($ref_data[
'time_target']) and ($crs_ref_id = $tree->checkForParentType($ref_data[
'ref_id'],
'crs')))
1378 include_once(
'./Modules/Course/classes/class.ilCourseItems.php');
1379 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1382 $items =
new ilCourseItems($crs_obj,$ref_data[
'parent_id']);
1383 $old = $items->getItem($ref_data[
'ref_id']);
1385 $items->toggleChangeable(isset($ref_data[
'time_target'][
'changeable']) ? $ref_data[
'time_target'][
'changeable'] : $old[
'changeable']);
1386 $items->setTimingStart(isset($ref_data[
'time_target'][
'starting_time']) ? $ref_data[
'time_target'][
'starting_time'] : $old[
'timing_start']);
1387 $items->setTimingEnd(isset($ref_data[
'time_target'][
'ending_time']) ? $ref_data[
'time_target'][
'ending_time'] : $old[
'timing_end']);
1388 $items->toggleVisible(isset($ref_data[
'time_target'][
'timing_visibility']) ? $ref_data[
'time_target'][
'timing_visibility'] : $old[
'visible']);
1389 $items->setSuggestionStart(isset($ref_data[
'time_target'][
'suggestion_start']) ? $ref_data[
'time_target'][
'suggestion_start'] : $old[
'suggestion_start']);
1390 $items->setSuggestionEnd(isset($ref_data[
'time_target'][
'suggestion_end']) ? $ref_data[
'time_target'][
'suggestion_end'] : $old[
'suggestion_end']);
1391 $items->setEarliestStart(isset($ref_data[
'time_target'][
'earliest_start']) ? $ref_data[
'time_target'][
'earliest_start'] : $old[
'earliest_start']);
1392 $items->setLatestEnd(isset($ref_data[
'time_target'][
'latest_end']) ? $ref_data[
'time_target'][
'latest_end'] : $old[
'latest_end']);
1394 switch($ref_data[
'time_target'][
'timing_type'])
1397 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_DEACTIVATED.
' '.$ref_data[
'time_target'][
'timing_type']);
1402 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_ACTIVATION.
' '.$ref_data[
'time_target'][
'timing_type']);
1407 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_PRESETTING.
' '.$ref_data[
'time_target'][
'timing_type']);
1411 $items->update($ref_data[
'ref_id']);
1422 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1427 $original_id = $source->getRefId();
1429 foreach($a_object_data[
'references'] as $ref_data)
1431 $new_ref_id =
$ref_id = $original_id;
1432 if($tree->getParentId($original_id) != $ref_data[
'parent_id'])
1435 $new_ref_id = $source->createReference();
1436 $source->putInTree($ref_data[
'parent_id']);
1437 $source->setPermissions($ref_data[
'parent_id']);
1438 $source->initDefaultRoles();
1440 if(isset($ref_data[
'time_target']) and ($crs_ref_id = $tree->checkForParentType($new_ref_id,
'crs')))
1444 include_once(
'./Modules/Course/classes/class.ilCourseItems.php');
1445 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1447 $items =
new ilCourseItems($crs_obj,$ref_data[
'parent_id']);
1449 if(!isset($ref_data[
'time_target'][
'starting_time']))
1451 $ref_data[
'time_target'][
'starting_time'] = time();
1453 if(!isset($ref_data[
'time_target'][
'ending_time']))
1455 $ref_data[
'time_target'][
'ending_time'] = time();
1458 $items->toggleChangeable($ref_data[
'time_target'][
'changeable']);
1459 $items->setTimingStart($ref_data[
'time_target'][
'starting_time']);
1460 $items->setTimingEnd($ref_data[
'time_target'][
'ending_time']);
1461 $items->toggleVisible($ref_data[
'time_target'][
'timing_visibility']);
1462 $items->setSuggestionStart($ref_data[
'time_target'][
'suggestion_start']);
1463 $items->setSuggestionEnd($ref_data[
'time_target'][
'suggestion_end']);
1464 $items->setEarliestStart($ref_data[
'time_target'][
'earliest_start']);
1465 $items->setLatestEnd($ref_data[
'time_target'][
'latest_end']);
1467 switch($ref_data[
'time_target'][
'timing_type'])
1470 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_DEACTIVATED.
' '.$ref_data[
'time_target'][
'timing_type']);
1475 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_ACTIVATION.
' '.$ref_data[
'time_target'][
'timing_type']);
1480 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_PRESETTING.
' '.$ref_data[
'time_target'][
'timing_type']);
1484 $items->update($new_ref_id);