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);
347 foreach(
$res->getUniqueResults() as $entry)
356 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
359 $xml_writer->enablePermissionCheck(
true);
363 $xml_writer->setUserId($user_id);
364 $xml_writer->enableOperations(
true);
367 $xml_writer->setObjects($objs);
368 if($xml_writer->start())
370 return $xml_writer->getXML();
373 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
392 return $this->
__raiseError(
'No valid reference id given.',
395 if (intval(
$ref_id) == SYSTEM_FOLDER_ID) {
396 return $this->
__raiseError(
'No valid reference id given.',
404 $filter = is_array($types) ? $types : array();
407 foreach($tree->getChilds(
$ref_id,
'title') as $child)
409 if($all or in_array($child[
'type'],$types))
418 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
421 $xml_writer->enablePermissionCheck(
true);
422 $xml_writer->setObjects($objs);
423 $xml_writer->enableOperations(
true);
426 $xml_writer->setUserId($user_id);
429 if ($xml_writer->start())
431 return $xml_writer->getXML();
434 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
449 $nodedata = $tree->getNodeData(
$ref_id);
451 $nodearray = $tree->getSubTree($nodedata);
453 $filter = is_array($types)?$types: array (
"0"=>
"root",
"adm",
"lngf",
"mail",
454 "usrf",
"rolf",
"taxf",
"trac",
"pays",
455 "auth",
"objf",
"recf",
"assf",
456 "stys",
"seas",
"extt");
458 foreach ($nodearray as $node)
460 if (!in_array($node[
'type'], $filter))
470 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
473 $xml_writer->enablePermissionCheck(
true);
474 $xml_writer->setObjects($nodes);
475 $xml_writer->enableOperations(
false);
479 $xml_writer->setUserId($user_id);
482 if ($xml_writer->start())
484 return $xml_writer->getXML();
487 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
502 return $this->
__raiseError(
'No valid xml string given.',
506 global $rbacsystem, $objDefinition,$ilUser,
$lng, $ilObjDataCache;
516 return $this->
__raiseError(
"Parent with ID $a_target_id has been deleted.",
'Client');
519 $allowed_types = array(
'root',
'cat',
'grp',
'crs',
'fold');
520 if(!in_array($target_obj->getType(),$allowed_types))
522 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
526 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
528 foreach($allowed_subtypes as
$row)
530 if($row[
'name'] !=
'rolf')
532 $allowed[] = $row[
'name'];
536 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
540 $xml_parser->startParsing();
549 foreach($xml_parser->getObjectData() as $object_data)
558 if(!in_array($object_data[
'type'],$allowed))
560 return $this->
__raiseError(
'Objects of type: '.$object_data[
'type'].
' are not allowed to be subobjects of type '.
561 $target_obj->getType().
'!',
564 if(!$rbacsystem->checkAccess(
'create',$a_target_id,$object_data[
'type']))
566 return $this->
__raiseError(
'No permission to create objects of type '.$object_data[
'type'].
'!',
569 if($object_data[
'type'] ==
'crs')
571 return $this->
__raiseError(
'Cannot create course objects. Use method addCourse() ',
578 return $this->
__raiseError(
'An object with import id '.$object_data[
'import_id'].
' already exists!',
583 $class_name = $objDefinition->getClassName($object_data[
'type']);
584 $location = $objDefinition->getLocation($object_data[
'type']);
586 $class_constr =
"ilObj".$class_name;
587 require_once(
$location.
"/class.ilObj".$class_name.
".php");
589 $newObj =
new $class_constr();
591 if(isset($object_data[
'owner']) && strlen($object_data[
'owner']))
593 if((
int)$object_data[
'owner'])
596 $ilObjDataCache->lookupType((
int)$object_data[
'owner']) ==
'usr')
598 $newObj->setOwner((
int)$object_data[
'owner']);
606 $newObj->setOwner((
int)$usr_id);
611 $newObj->setType($object_data[
'type']);
612 if(strlen($object_data[
'import_id']))
614 $newObj->setImportId($object_data[
'import_id']);
616 $newObj->setTitle($object_data[
'title']);
617 $newObj->setDescription($object_data[
'description']);
619 $newObj->createReference();
620 $newObj->putInTree($a_target_id);
621 $newObj->setPermissions($a_target_id);
623 switch($object_data[
'type'])
627 $newObj->addMember($object_data[
'owner'] ? $object_data[
'owner'] : $ilUser->getId(),
628 $newObj->getDefaultAdminRole());
633 $newObj->createLMTree();
636 $newObj->addTranslation($object_data[
"title"],$object_data[
"description"], $lng->getLangKey(), $lng->getLangKey());
656 if(!is_numeric($a_source_id))
661 if(!is_numeric($a_target_id))
667 global $objDefinition, $rbacsystem, $tree;
680 if(!$objDefinition->allowLink($source_obj->getType()) and
681 $source_obj->getType() !=
'cat' and
682 $source_obj->getType() !=
'crs')
684 return $this->
__raiseError(
'Linking of object type: '.$source_obj->getType().
' is not allowed',
688 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
689 foreach($allowed_subtypes as
$row)
691 if($row[
'name'] !=
'rolf')
693 $allowed[] = $row[
'name'];
696 if(!in_array($source_obj->getType(),$allowed))
698 return $this->
__raiseError(
'Objects of type: '.$source_obj->getType().
' are not allowed to be subobjects of type '.
699 $target_obj->getType().
'!',
704 if(!$rbacsystem->checkAccess(
'create',$target_obj->getRefId(),$source_obj->getType()))
706 return $this->
__raiseError(
'No permission to create objects of type '.$source_obj->getType().
'!',
709 if(!$rbacsystem->checkAccess(
'delete',$source_obj->getRefId()))
711 return $this->
__raiseError(
'No permission to link object with id: '.$source_obj->getRefId().
'!',
716 if($source_obj->getType() !=
'cat' and $source_obj->getType() !=
'crs')
719 $possibleChilds = $tree->getChildsByType($target_obj->getRefId(), $source_obj->getType());
720 foreach ($possibleChilds as $child)
722 if ($child[
"obj_id"] == $source_obj->getId())
723 return $this->
__raiseError(
"Object already linked to target.",
"Client");
728 $new_ref_id = $source_obj->createReference();
729 $source_obj->putInTree($target_obj->getRefId());
730 $source_obj->setPermissions($target_obj->getRefId());
732 if($tree->checkForParentType($target_obj->getRefId(),
'crs'))
735 include_once
'./Modules/Course/classes/class.ilCourseItems.php';
739 return $new_ref_id ? $new_ref_id :
"0";
743 switch($source_obj->getType())
746 include_once(
'./Modules/CategoryReference/classes/class.ilObjCategoryReference.php');
751 include_once(
'./Modules/CourseReference/classes/class.ilObjCourseReference.php');
756 $new_ref_id = $new_ref->createReference();
758 $new_ref->putInTree($target_obj->getRefId());
759 $new_ref->setPermissions($target_obj->getRefId());
761 $new_ref->setTargetId($source_obj->getId());
764 return $new_ref_id ? $new_ref_id : 0;
777 if(!is_numeric($reference_id))
782 global $tree, $rbacsystem, $rbacadmin;
786 return $this->
__raiseError(
'No valid reference id given.',
789 if(!$rbacsystem->checkAccess(
'delete',$del_obj->getRefId()))
791 return $this->
__raiseError(
'No permission to delete object with id: '.$del_obj->getRefId().
'!',
796 if($tree->isDeleted($reference_id))
798 return $this->
__raiseError(
'Node already deleted',
'Server');
801 if($del_obj->getType() ==
'rolf')
803 return $this->
__raiseError(
'Delete is not available for role folders.',
'Client');
806 $subnodes = $tree->getSubtree($tree->getNodeData($reference_id));
807 foreach($subnodes as $subnode)
809 $rbacadmin->revokePermission($subnode[
"child"]);
813 if(!$tree->saveSubTree($reference_id))
815 return $this->
__raiseError(
'Node already deleted',
'Client');
830 if(!strlen($import_id))
832 return $this->
__raiseError(
'No import id given. Aborting!',
835 global $rbacsystem, $tree,
$ilLog;
840 return $this->
__raiseError(
'No object found with import id: '.$import_id,
845 $permission_ok =
false;
848 if($rbacsystem->checkAccess(
'delete',$ref_id))
850 $permission_ok =
true;
856 return $this->
__raiseError(
'No permission to delete the object with import id: '.$import_id,
861 foreach($ref_ids as $ref_id)
864 $node_data = $tree->getNodeData($ref_id);
865 $subtree_nodes = $tree->getSubtree($node_data);
867 foreach($subtree_nodes as $node)
869 $ilLog->write(
'Soap: removeFromSystemByImportId(). Deleting object with title id: '.$node[
'title']);
871 if(!is_object($tmp_obj))
873 return $this->
__raiseError(
'Cannot create instance of reference id: '.$node[
'ref_id'],
879 $tree->deleteTree($node_data);
898 return $this->
__raiseError(
'No valid xml string given.',
902 global $rbacreview, $rbacsystem,
$lng,$ilAccess;
904 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
908 $xml_parser->startParsing();
919 $object_datas = $xml_parser->getObjectData();
920 foreach($object_datas as & $object_data)
929 if(!$object_data[
"obj_id"])
931 return $this->
__raiseError(
'No obj_id in xml found.',
'Client');
933 elseif ((
int) $object_data[
"obj_id"] == -1 && count($object_data[
"references"])>0)
937 foreach ($object_data[
"references"] as $refid)
947 if (!$obj_id_from_refid)
949 return $this->
__raiseError(
'No obj_id found for reference id '.$object_data[
"references"][0],
'CLIENT_OBJECT_NOT_FOUND');
953 $object_data[
"obj_id"] = $obj_id_from_refid;
958 if ($tmp_obj == null)
960 return $this->
__raiseError(
'No object for id '.$object_data[
'obj_id'].
'!',
'CLIENT_OBJECT_NOT_FOUND');
964 $object_data[
"instance"] = $tmp_obj;
967 if($object_data[
'type'] ==
'role')
969 $rolf_ids = $rbacreview->getFoldersAssignedToRole($object_data[
'obj_id'],
true);
970 $rolf_id = $rolf_ids[0];
972 if(!$rbacsystem->checkAccess(
'write',$rolf_id))
974 return $this->
__raiseError(
'No write permission for object with id '.$object_data[
'obj_id'].
'!',
'Client');
979 $permission_ok =
false;
982 if($rbacsystem->checkAccess(
'write',$object_data[
'obj_id']))
984 $permission_ok =
true;
990 return $this->
__raiseError(
'No write permission for object with id '.$object_data[
'obj_id'].
'!',
'Client');
995 if (count ($object_datas) > 0)
997 foreach($object_datas as $object_data)
1001 $tmp_obj = $object_data[
"instance"];
1002 $tmp_obj->setTitle($object_data[
'title']);
1003 $tmp_obj->setDescription($object_data[
'description']);
1004 switch ($object_data[
'type'])
1007 $tmp_obj->updateTranslation($object_data[
"title"],$object_data[
"description"], $lng->getLangKey(), $lng->getLangKey());
1011 if(strlen($object_data[
'owner']) && is_numeric($object_data[
'owner']))
1013 $tmp_obj->setOwner($object_data[
'owner']);
1014 $tmp_obj->updateOwner();
1033 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1034 global $rbacreview, $rbacadmin, $objDefinition, $rbacsystem,
$lng, $ilUser, $tree;
1039 return $this->
__raiseError(
'No valid source given.',
'Client');
1045 return $this->
__raiseError(
'No valid target given.',
'Client');
1051 return $this->
__raiseError(
'Object is trashed.',
'Client');
1056 return $this->
__raiseError(
'Object is trashed.',
'Client');
1060 if ($this->
isFault($canAddType))
1067 foreach ($possibleChilds as $child)
1069 if ($child[
"obj_id"] ==
$ref_id)
1070 return $this->
__raiseError(
"Object already exists in target.",
"Client");
1074 $node_data = $tree->getNodeData(
$ref_id);
1075 $subtree_nodes = $tree->getSubTree($node_data);
1077 $all_node_data[] = $node_data;
1078 $all_subtree_nodes[] = $subtree_nodes;
1081 foreach ($subtree_nodes as $node)
1083 if($node[
'type'] ==
'rolf')
1088 if (!$rbacsystem->checkAccess(
'delete',$node[
"ref_id"]))
1090 $no_cut[] = $node[
"ref_id"];
1097 return $this->
__raiseError(
"Object contains references which you are not allowed to delete.",
"Client");
1103 return $this->
__raiseError(
"Cannot move object into itself.",
"Client");
1106 $old_parent = $tree->getParentId(
$ref_id);
1108 $rbacadmin->adjustMovedObjectPermissions(
$ref_id,$old_parent);
1110 include_once(
'classes/class.ilConditionHandler.php');
1131 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1132 global $rbacreview, $objDefinition, $rbacsystem,
$lng, $ilUser;
1134 include_once
'./webservice/soap/classes/class.ilCopyWizardSettingsXMLParser.php';
1137 $xml_parser->startParsing();
1139 return $this->
__raiseError($se->getMessage(),
"Client");
1143 if(!$rbacsystem->checkAccess(
'copy',$xml_parser->getSourceId()))
1145 return $this->
__raiseError(
"Missing copy permissions for object with reference id ".$xml_parser->getSourceId(),
'Client');
1149 $source_id = $xml_parser->getSourceId();
1156 return $this->
__raiseError(
'No valid source given.',
'Client');
1162 return $this->
__raiseError(
'No valid target given.',
'Client');
1167 if ($this->
isFault($canAddType))
1173 $options = $xml_parser->getOptions();
1178 $clientid = substr($sid, strpos($sid,
"::") + 2);
1179 $sessionid = str_replace(
"::".$clientid,
"", $sid);
1181 return $source_object->cloneAllObject($sessionid, $clientid,
1182 $source_object_type,
1191 $wizard_options->saveOwner($ilUser->getId());
1192 $wizard_options->saveRoot($source_id);
1194 foreach($options as $source_id => $option)
1196 $wizard_options->addEntry($source_id,$option);
1198 $wizard_options->read();
1201 $newObject = $source_object->cloneObject($xml_parser->getTargetId(), $copy_id);
1202 return is_object($newObject) ? $newObject->getRefId() : -1;
1216 global $ilAccess, $objDefinition, $rbacsystem,
$lng, $ilUser;
1218 if(!$rbacsystem->checkAccess(
'read',
$ref_id))
1220 return $this->
__raiseError(
"Missing read permissions for object with reference id ".
$ref_id,
'Client');
1225 return $this->
__raiseError(
"Object is in Trash",
'Client');
1228 $items = $tree->getPathFull(
$ref_id);
1230 include_once
'webservice/soap/classes/class.ilXMLResultSet.php';
1231 include_once
'webservice/soap/classes/class.ilXMLResultSetWriter.php';
1232 include_once
'Modules/Course/classes/class.ilCourseXMLWriter.php';
1235 $xmlResultSet->addColumn(
"ref_id");
1236 $xmlResultSet->addColumn(
"type");
1237 $xmlResultSet->addColumn(
"title");
1240 foreach ($items as $item) {
1241 if ($item[
"ref_id"] ==
$ref_id)
1243 if ($item[
"title"] ==
"ILIAS" && $item[
"type"] ==
"root")
1245 $item[
"title"] = $lng->txt(
"repository");
1249 $xmlResultSet->addRow(
$row);
1250 $row->setValue(
"ref_id", $item[
"ref_id"]);
1251 $row->setValue(
"type", $item[
"type"]);
1252 $row->setValue(
"title", $item[
"title"]);
1255 return $writer->getXML();
1262 global $objDefinition, $rbacsystem;
1264 $allowed_types = array(
'root',
'cat',
'grp',
'crs',
'fold');
1267 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
'Client');
1270 $allowed_subtypes = $objDefinition->getSubObjects(
$target_type);
1273 foreach($allowed_subtypes as
$row)
1275 if($row[
'name'] !=
'rolf')
1277 $allowed[] = $row[
'name'];
1281 if(!in_array(
$type, $allowed))
1287 return $this->
__raiseError(
'No permission to create objects of type '.
$type.
'!',
'Client');
1297 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1301 if($a_action ==
'create')
1303 if(count($a_object_data[
'references']) > 1)
1305 if(in_array($a_object_data[
'type'],array(
'cat',
'crs',
'grp',
'fold')))
1307 return $this->
__raiseError(
"Cannot create references for type ".$a_object_data[
'type'],
1311 if(count($a_object_data[
'references']) == 1)
1313 if($a_target_id != $a_object_data[
'references'][0][
'parent_id'])
1315 return $this->
__raiseError(
"Cannot create references for type ".$a_object_data[
'type'],
1320 foreach($a_object_data[
'references'] as $ref_data)
1322 if(!$ref_data[
'parent_id'])
1324 return $this->
__raiseError(
'Element References: No parent Id given!',
'Client');
1329 if($this->
isFault($can_add_type))
1331 return $can_add_type;
1337 if($a_action ==
'update')
1339 foreach($a_object_data[
'references'] as $ref_data)
1341 if(!$ref_data[
'ref_id'])
1343 return $this->
__raiseError(
'Element References: No reference id given!',
'Client');
1346 if(!$ilAccess->checkAccess(
'write',
'',$ref_data[
'ref_id']))
1348 return $this->
__raiseError(
'No write permission for object with reference id '.$ref_data[
'ref_id'].
'!',
'Client');
1360 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1365 foreach($a_object_data[
'references'] as $ref_data)
1367 if(isset($ref_data[
'time_target']) and ($crs_ref_id = $tree->checkForParentType($ref_data[
'ref_id'],
'crs')))
1370 include_once(
'./Modules/Course/classes/class.ilCourseItems.php');
1371 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1374 $items =
new ilCourseItems($crs_obj->getRefId(),$ref_data[
'parent_id']);
1375 $old = $items->
getItem($ref_data[
'ref_id']);
1377 $items->toggleChangeable(isset($ref_data[
'time_target'][
'changeable']) ? $ref_data[
'time_target'][
'changeable'] : $old[
'changeable']);
1378 $items->setTimingStart(isset($ref_data[
'time_target'][
'starting_time']) ? $ref_data[
'time_target'][
'starting_time'] : $old[
'timing_start']);
1379 $items->setTimingEnd(isset($ref_data[
'time_target'][
'ending_time']) ? $ref_data[
'time_target'][
'ending_time'] : $old[
'timing_end']);
1380 $items->toggleVisible(isset($ref_data[
'time_target'][
'timing_visibility']) ? $ref_data[
'time_target'][
'timing_visibility'] : $old[
'visible']);
1381 $items->setSuggestionStart(isset($ref_data[
'time_target'][
'suggestion_start']) ? $ref_data[
'time_target'][
'suggestion_start'] : $old[
'suggestion_start']);
1382 $items->setSuggestionEnd(isset($ref_data[
'time_target'][
'suggestion_end']) ? $ref_data[
'time_target'][
'suggestion_end'] : $old[
'suggestion_end']);
1383 $items->setEarliestStart(isset($ref_data[
'time_target'][
'earliest_start']) ? $ref_data[
'time_target'][
'earliest_start'] : $old[
'earliest_start']);
1384 $items->setLatestEnd(isset($ref_data[
'time_target'][
'latest_end']) ? $ref_data[
'time_target'][
'latest_end'] : $old[
'latest_end']);
1386 switch($ref_data[
'time_target'][
'timing_type'])
1389 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_DEACTIVATED.
' '.$ref_data[
'time_target'][
'timing_type']);
1394 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_ACTIVATION.
' '.$ref_data[
'time_target'][
'timing_type']);
1399 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_PRESETTING.
' '.$ref_data[
'time_target'][
'timing_type']);
1403 $items->update($ref_data[
'ref_id']);
1414 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1419 $original_id = $source->getRefId();
1421 foreach($a_object_data[
'references'] as $ref_data)
1423 $new_ref_id =
$ref_id = $original_id;
1424 if($tree->getParentId($original_id) != $ref_data[
'parent_id'])
1427 $new_ref_id = $source->createReference();
1428 $source->putInTree($ref_data[
'parent_id']);
1429 $source->setPermissions($ref_data[
'parent_id']);
1431 if(isset($ref_data[
'time_target']) and ($crs_ref_id = $tree->checkForParentType($new_ref_id,
'crs')))
1435 include_once(
'./Modules/Course/classes/class.ilCourseItems.php');
1436 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1438 $items =
new ilCourseItems($crs_obj->getRefId(),$ref_data[
'parent_id']);
1440 if(!isset($ref_data[
'time_target'][
'starting_time']))
1442 $ref_data[
'time_target'][
'starting_time'] = time();
1444 if(!isset($ref_data[
'time_target'][
'ending_time']))
1446 $ref_data[
'time_target'][
'ending_time'] = time();
1449 $items->toggleChangeable($ref_data[
'time_target'][
'changeable']);
1450 $items->setTimingStart($ref_data[
'time_target'][
'starting_time']);
1451 $items->setTimingEnd($ref_data[
'time_target'][
'ending_time']);
1452 $items->toggleVisible($ref_data[
'time_target'][
'timing_visibility']);
1453 $items->setSuggestionStart($ref_data[
'time_target'][
'suggestion_start']);
1454 $items->setSuggestionEnd($ref_data[
'time_target'][
'suggestion_end']);
1455 $items->setEarliestStart($ref_data[
'time_target'][
'earliest_start']);
1456 $items->setLatestEnd($ref_data[
'time_target'][
'latest_end']);
1458 switch($ref_data[
'time_target'][
'timing_type'])
1461 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_DEACTIVATED.
' '.$ref_data[
'time_target'][
'timing_type']);
1466 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_ACTIVATION.
' '.$ref_data[
'time_target'][
'timing_type']);
1471 $ilLog->write(__METHOD__.IL_CRS_TIMINGS_PRESETTING.
' '.$ref_data[
'time_target'][
'timing_type']);
1475 $items->update($new_ref_id);