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.ilSearchSettings.php';
322 include_once
'./Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
324 $query_parser->parse();
326 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
330 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
331 include_once
'./Services/Search/classes/Lucene/class.ilLucenePathFilter.php';
333 $filter->setCandidates($searcher->getResult());
336 $result_ids = $filter->getResults();
339 foreach ((array) $result_ids as
$ref_id => $obj_id) {
347 include_once
'./Services/Search/classes/Lucene/class.ilLuceneHighlighterResultParser.php';
349 if($filter->getResultObjIds())
351 $highlighter = $searcher->highlight($filter->getResultObjIds());
357 include_once
'./Services/Search/classes/class.ilQueryParser.php';
360 #$query_parser->setMinWordLength(3);
362 $query_parser->parse();
363 if(!$query_parser->validate())
369 #include_once './Services/Search/classes/class.ilObjectSearchFactory.php';
370 #$object_search =& ilObjectSearchFactory::_getObjectSearchInstance($query_parser);
372 include_once
'./Services/Search/classes/Like/class.ilLikeObjectSearch.php';
375 $object_search->setFilter($types);
377 $res =& $object_search->performSearch();
380 $res->setUserId($user_id);
383 $res->setMaxHits(100);
385 $res->filter(ROOT_FOLDER_ID,$combination ==
'and' ?
true :
false);
389 foreach(
$res->getUniqueResults() as $entry)
405 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
412 $xml_writer->enableReferences(
false);
413 $xml_writer->setMode(ilObjectXmlWriter::MODE_SEARCH_RESULT);
414 $xml_writer->setHighlighter($highlighter);
417 $xml_writer->enablePermissionCheck(
true);
421 $xml_writer->setUserId($user_id);
422 $xml_writer->enableOperations(
true);
425 $xml_writer->setObjects($objs);
427 if($xml_writer->start())
429 #$GLOBALS['ilLog']->write(__METHOD__.': '.$xml_writer->xmlDumpMem(true));
430 return $xml_writer->getXML();
433 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
452 return $this->
__raiseError(
'No valid reference id given.',
455 if (intval(
$ref_id) == SYSTEM_FOLDER_ID) {
456 return $this->
__raiseError(
'No valid reference id given.',
468 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
469 if(in_array(
'parent', (array) $types))
471 $objs[] = $target_obj;
475 foreach($tree->getChilds(
$ref_id,
'title') as $child)
477 if($all or in_array($child[
'type'],$types))
486 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
492 $xml_writer->enableReferences(
false);
495 $xml_writer->enablePermissionCheck(
true);
496 $xml_writer->setObjects($objs);
497 $xml_writer->enableOperations(
true);
500 $xml_writer->setUserId($user_id);
503 if ($xml_writer->start())
505 #$GLOBALS['ilLog']->write(__METHOD__.': '.$xml_writer->getXML());
506 return $xml_writer->getXML();
509 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
524 $nodedata = $tree->getNodeData(
$ref_id);
525 $nodearray = $tree->getSubTree($nodedata);
528 $filter = (array) $types;
530 global $objDefinition;
531 foreach($nodearray as $node)
533 if(!$objDefinition->isAdministrationObject($node[
'type']) && !$objDefinition->isSystemObject($node[
'type']))
535 if(!in_array($node[
'type'], $filter))
546 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
549 $xml_writer->enablePermissionCheck(
true);
550 $xml_writer->setObjects($nodes);
551 $xml_writer->enableOperations(
false);
555 $xml_writer->setUserId($user_id);
558 if($xml_writer->start())
560 return $xml_writer->getXML();
563 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
577 return $this->
__raiseError(
'No valid xml string given.',
581 global $rbacsystem, $objDefinition,
$ilUser,
$lng, $ilObjDataCache;
591 return $this->
__raiseError(
"Parent with ID $a_target_id has been deleted.",
'Client');
594 $allowed_types = array(
'root',
'cat',
'grp',
'crs',
'fold');
595 if(!in_array($target_obj->getType(),$allowed_types))
597 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
601 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
603 foreach($allowed_subtypes as
$row)
605 if($row[
'name'] !=
'rolf')
607 $allowed[] = $row[
'name'];
611 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
615 $xml_parser->startParsing();
624 foreach($xml_parser->getObjectData() as $object_data)
633 if(!in_array($object_data[
'type'],$allowed))
635 return $this->
__raiseError(
'Objects of type: '.$object_data[
'type'].
' are not allowed to be subobjects of type '.
636 $target_obj->getType().
'!',
639 if(!$rbacsystem->checkAccess(
'create',$a_target_id,$object_data[
'type']))
641 return $this->
__raiseError(
'No permission to create objects of type '.$object_data[
'type'].
'!',
657 return $this->
__raiseError(
'An object with import id '.$object_data[
'import_id'].
' already exists!',
662 $class_name = $objDefinition->getClassName($object_data[
'type']);
663 $location = $objDefinition->getLocation($object_data[
'type']);
665 $class_constr =
"ilObj".$class_name;
666 require_once(
$location.
"/class.ilObj".$class_name.
".php");
668 $newObj =
new $class_constr();
670 if(isset($object_data[
'owner']) && strlen($object_data[
'owner']))
672 if((
int)$object_data[
'owner'])
675 $ilObjDataCache->lookupType((
int)$object_data[
'owner']) ==
'usr')
677 $newObj->setOwner((
int)$object_data[
'owner']);
685 $newObj->setOwner((
int)$usr_id);
690 $newObj->setType($object_data[
'type']);
691 if(strlen($object_data[
'import_id']))
693 $newObj->setImportId($object_data[
'import_id']);
695 $newObj->setTitle($object_data[
'title']);
696 $newObj->setDescription($object_data[
'description']);
698 $newObj->createReference();
699 $newObj->putInTree($a_target_id);
700 $newObj->setPermissions($a_target_id);
702 switch($object_data[
'type'])
706 $newObj->addMember($object_data[
'owner'] ? $object_data[
'owner'] : $ilUser->getId(),
707 $newObj->getDefaultAdminRole());
712 $newObj->getMemberObject()->add($ilUser->getId(),
IL_CRS_ADMIN);
717 $newObj->createLMTree();
720 $newObj->addTranslation($object_data[
"title"],$object_data[
"description"], $lng->getLangKey(), $lng->getLangKey());
740 if(!is_numeric($a_source_id))
745 if(!is_numeric($a_target_id))
751 global $objDefinition, $rbacsystem, $tree;
764 if(!$objDefinition->allowLink($source_obj->getType()) and
765 $source_obj->getType() !=
'cat' and
766 $source_obj->getType() !=
'crs')
768 return $this->
__raiseError(
'Linking of object type: '.$source_obj->getType().
' is not allowed',
772 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
773 foreach($allowed_subtypes as
$row)
775 if($row[
'name'] !=
'rolf')
777 $allowed[] = $row[
'name'];
780 if(!in_array($source_obj->getType(),$allowed))
782 return $this->
__raiseError(
'Objects of type: '.$source_obj->getType().
' are not allowed to be subobjects of type '.
783 $target_obj->getType().
'!',
788 if(!$rbacsystem->checkAccess(
'create',$target_obj->getRefId(),$source_obj->getType()))
790 return $this->
__raiseError(
'No permission to create objects of type '.$source_obj->getType().
'!',
793 if(!$rbacsystem->checkAccess(
'delete',$source_obj->getRefId()))
795 return $this->
__raiseError(
'No permission to link object with id: '.$source_obj->getRefId().
'!',
800 if($source_obj->getType() !=
'cat' and $source_obj->getType() !=
'crs')
803 $possibleChilds = $tree->getChildsByType($target_obj->getRefId(), $source_obj->getType());
804 foreach ($possibleChilds as $child)
806 if ($child[
"obj_id"] == $source_obj->getId())
807 return $this->
__raiseError(
"Object already linked to target.",
"Client");
812 $new_ref_id = $source_obj->createReference();
813 $source_obj->putInTree($target_obj->getRefId());
814 $source_obj->setPermissions($target_obj->getRefId());
816 return $new_ref_id ? $new_ref_id :
"0";
820 switch($source_obj->getType())
823 include_once(
'./Modules/CategoryReference/classes/class.ilObjCategoryReference.php');
828 include_once(
'./Modules/CourseReference/classes/class.ilObjCourseReference.php');
833 $new_ref_id = $new_ref->createReference();
835 $new_ref->putInTree($target_obj->getRefId());
836 $new_ref->setPermissions($target_obj->getRefId());
838 $new_ref->setTargetId($source_obj->getId());
841 return $new_ref_id ? $new_ref_id : 0;
854 if(!is_numeric($reference_id))
859 global $tree, $rbacsystem, $rbacadmin;
863 return $this->
__raiseError(
'No valid reference id given.',
866 if(!$rbacsystem->checkAccess(
'delete',$del_obj->getRefId()))
868 return $this->
__raiseError(
'No permission to delete object with id: '.$del_obj->getRefId().
'!',
873 if($tree->isDeleted($reference_id))
875 return $this->
__raiseError(
'Node already deleted',
'Server');
878 if($del_obj->getType() ==
'rolf')
880 return $this->
__raiseError(
'Delete is not available for role folders.',
'Client');
883 $subnodes = $tree->getSubtree($tree->getNodeData($reference_id));
884 foreach($subnodes as $subnode)
886 $rbacadmin->revokePermission($subnode[
"child"]);
890 if(!$tree->saveSubTree($reference_id,
true))
892 return $this->
__raiseError(
'Node already deleted',
'Client');
907 if(!strlen($import_id))
909 return $this->
__raiseError(
'No import id given. Aborting!',
912 global $rbacsystem, $tree,
$ilLog;
917 return $this->
__raiseError(
'No object found with import id: '.$import_id,
922 $permission_ok =
false;
925 if($rbacsystem->checkAccess(
'delete',$ref_id))
927 $permission_ok =
true;
933 return $this->
__raiseError(
'No permission to delete the object with import id: '.$import_id,
938 foreach($ref_ids as $ref_id)
941 $node_data = $tree->getNodeData($ref_id);
942 $subtree_nodes = $tree->getSubtree($node_data);
944 foreach($subtree_nodes as $node)
946 $ilLog->write(
'Soap: removeFromSystemByImportId(). Deleting object with title id: '.$node[
'title']);
948 if(!is_object($tmp_obj))
950 return $this->
__raiseError(
'Cannot create instance of reference id: '.$node[
'ref_id'],
956 $tree->deleteTree($node_data);
975 return $this->
__raiseError(
'No valid xml string given.',
979 global $rbacreview, $rbacsystem,
$lng,$ilAccess;
981 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
985 $xml_parser->startParsing();
996 $object_datas = $xml_parser->getObjectData();
997 foreach($object_datas as & $object_data)
1006 if(!$object_data[
"obj_id"])
1008 return $this->
__raiseError(
'No obj_id in xml found.',
'Client');
1010 elseif ((
int) $object_data[
"obj_id"] == -1 && count($object_data[
"references"])>0)
1014 foreach ($object_data[
"references"] as $refid)
1024 if (!$obj_id_from_refid)
1026 return $this->
__raiseError(
'No obj_id found for reference id '.$object_data[
"references"][0],
'CLIENT_OBJECT_NOT_FOUND');
1030 $object_data[
"obj_id"] = $obj_id_from_refid;
1035 if ($tmp_obj == null)
1037 return $this->
__raiseError(
'No object for id '.$object_data[
'obj_id'].
'!',
'CLIENT_OBJECT_NOT_FOUND');
1041 $object_data[
"instance"] = $tmp_obj;
1044 if($object_data[
'type'] ==
'role')
1046 $rolf_ids = $rbacreview->getFoldersAssignedToRole($object_data[
'obj_id'],
true);
1047 $rolf_id = $rolf_ids[0];
1049 if(!$rbacsystem->checkAccess(
'write',$rolf_id))
1051 return $this->
__raiseError(
'No write permission for object with id '.$object_data[
'obj_id'].
'!',
'Client');
1056 $permission_ok =
false;
1059 if($ilAccess->checkAccess(
'write',
'',$ref_id))
1061 $permission_ok =
true;
1067 return $this->
__raiseError(
'No write permission for object with id '.$object_data[
'obj_id'].
'!',
'Client');
1072 if (count ($object_datas) > 0)
1074 foreach($object_datas as $object_data)
1078 $tmp_obj = $object_data[
"instance"];
1079 $tmp_obj->setTitle($object_data[
'title']);
1080 $tmp_obj->setDescription($object_data[
'description']);
1082 #$GLOBALS['ilLog']->write(__METHOD__.': type is '. $object_data['type']);
1083 #$GLOBALS['ilLog']->write(__METHOD__.': type is '. $a_xml);
1086 switch ($object_data[
'type'])
1089 $tmp_obj->updateTranslation($object_data[
"title"],$object_data[
"description"], $lng->getLangKey(), $lng->getLangKey());
1093 if(strlen($object_data[
'owner']) && is_numeric($object_data[
'owner']))
1095 $tmp_obj->setOwner($object_data[
'owner']);
1096 $tmp_obj->updateOwner();
1115 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1116 global $rbacreview, $rbacadmin, $objDefinition, $rbacsystem,
$lng,
$ilUser, $tree;
1121 return $this->
__raiseError(
'No valid source given.',
'Client');
1127 return $this->
__raiseError(
'No valid target given.',
'Client');
1133 return $this->
__raiseError(
'Object is trashed.',
'Client');
1138 return $this->
__raiseError(
'Object is trashed.',
'Client');
1142 if ($this->
isFault($canAddType))
1149 foreach ($possibleChilds as $child)
1151 if ($child[
"obj_id"] ==
$ref_id)
1152 return $this->
__raiseError(
"Object already exists in target.",
"Client");
1158 return $this->
__raiseError(
"Cannot move object into itself.",
"Client");
1161 $old_parent = $tree->getParentId(
$ref_id);
1163 $rbacadmin->adjustMovedObjectPermissions(
$ref_id,$old_parent);
1165 include_once(
'./Services/AccessControl/classes/class.ilConditionHandler.php');
1186 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1187 global $rbacreview, $objDefinition, $rbacsystem,
$lng,
$ilUser;
1189 include_once
'./webservice/soap/classes/class.ilCopyWizardSettingsXMLParser.php';
1192 $xml_parser->startParsing();
1194 return $this->
__raiseError($se->getMessage(),
"Client");
1198 if(!$rbacsystem->checkAccess(
'copy',$xml_parser->getSourceId()))
1200 return $this->
__raiseError(
"Missing copy permissions for object with reference id ".$xml_parser->getSourceId(),
'Client');
1204 $source_id = $xml_parser->getSourceId();
1211 return $this->
__raiseError(
'No valid source given.',
'Client');
1217 return $this->
__raiseError(
'No valid target given.',
'Client');
1222 if ($this->
isFault($canAddType))
1228 $options = $xml_parser->getOptions();
1233 $clientid = substr($sid, strpos($sid,
"::") + 2);
1234 $sessionid = str_replace(
"::".$clientid,
"", $sid);
1236 return $source_object->cloneAllObject($sessionid, $clientid,
1237 $source_object_type,
1246 $wizard_options->saveOwner($ilUser->getId());
1247 $wizard_options->saveRoot($source_id);
1249 foreach($options as $source_id => $option)
1251 $wizard_options->addEntry($source_id,$option);
1253 $wizard_options->read();
1256 $newObject = $source_object->cloneObject($xml_parser->getTargetId(), $copy_id);
1257 return is_object($newObject) ? $newObject->getRefId() : -1;
1271 global $ilAccess, $objDefinition, $rbacsystem,
$lng,
$ilUser;
1273 if(!$rbacsystem->checkAccess(
'read',
$ref_id))
1275 return $this->
__raiseError(
"Missing read permissions for object with reference id ".
$ref_id,
'Client');
1280 return $this->
__raiseError(
"Object is in Trash",
'Client');
1283 $items = $tree->getPathFull(
$ref_id);
1285 include_once
'webservice/soap/classes/class.ilXMLResultSet.php';
1286 include_once
'webservice/soap/classes/class.ilXMLResultSetWriter.php';
1287 include_once
'Modules/Course/classes/class.ilCourseXMLWriter.php';
1290 $xmlResultSet->addColumn(
"ref_id");
1291 $xmlResultSet->addColumn(
"type");
1292 $xmlResultSet->addColumn(
"title");
1295 foreach ($items as $item) {
1296 if ($item[
"ref_id"] ==
$ref_id)
1298 if ($item[
"title"] ==
"ILIAS" && $item[
"type"] ==
"root")
1300 $item[
"title"] = $lng->txt(
"repository");
1304 $xmlResultSet->addRow(
$row);
1305 $row->setValue(
"ref_id", $item[
"ref_id"]);
1306 $row->setValue(
"type", $item[
"type"]);
1307 $row->setValue(
"title", $item[
"title"]);
1310 return $writer->getXML();
1317 global $objDefinition, $rbacsystem;
1319 $allowed_types = array(
'root',
'cat',
'grp',
'crs',
'fold');
1322 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
'Client');
1325 $allowed_subtypes = $objDefinition->getSubObjects(
$target_type);
1328 foreach($allowed_subtypes as
$row)
1330 if($row[
'name'] !=
'rolf')
1332 $allowed[] = $row[
'name'];
1336 if(!in_array($type, $allowed))
1338 return $this->
__raiseError(
'Objects of type: '.$type.
' are not allowed to be subobjects of type '.
$target_type.
'!',
'Client');
1340 if(!$rbacsystem->checkAccess(
'create',
$target_id, $type))
1342 return $this->
__raiseError(
'No permission to create objects of type '.$type.
'!',
'Client');
1352 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1356 if($a_action ==
'create')
1358 if(count($a_object_data[
'references']) > 1)
1360 if(in_array($a_object_data[
'type'],array(
'cat',
'crs',
'grp',
'fold')))
1362 return $this->
__raiseError(
"Cannot create references for type ".$a_object_data[
'type'],
1366 if(count($a_object_data[
'references']) == 1)
1368 if($a_target_id != $a_object_data[
'references'][0][
'parent_id'])
1370 return $this->
__raiseError(
"Cannot create references for type ".$a_object_data[
'type'],
1375 foreach($a_object_data[
'references'] as $ref_data)
1377 if(!$ref_data[
'parent_id'])
1379 return $this->
__raiseError(
'Element References: No parent Id given!',
'Client');
1384 if($this->
isFault($can_add_type))
1386 return $can_add_type;
1392 if($a_action ==
'update')
1394 foreach($a_object_data[
'references'] as $ref_data)
1396 if(!$ref_data[
'ref_id'])
1398 return $this->
__raiseError(
'Element References: No reference id given!',
'Client');
1401 if(!$ilAccess->checkAccess(
'write',
'',$ref_data[
'ref_id']))
1403 return $this->
__raiseError(
'No write permission for object with reference id '.$ref_data[
'ref_id'].
'!',
'Client');
1415 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1420 foreach($a_object_data[
'references'] as $ref_data)
1422 if(isset($ref_data[
'time_target']) )
1424 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1425 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
1429 $items->toggleChangeable(isset($ref_data[
'time_target'][
'changeable']) ? $ref_data[
'time_target'][
'changeable'] : $old[
'changeable']);
1430 $items->setTimingStart(isset($ref_data[
'time_target'][
'starting_time']) ? $ref_data[
'time_target'][
'starting_time'] : $old[
'timing_start']);
1431 $items->setTimingEnd(isset($ref_data[
'time_target'][
'ending_time']) ? $ref_data[
'time_target'][
'ending_time'] : $old[
'timing_end']);
1432 $items->toggleVisible(isset($ref_data[
'time_target'][
'timing_visibility']) ? $ref_data[
'time_target'][
'timing_visibility'] : $old[
'visible']);
1433 $items->setSuggestionStart(isset($ref_data[
'time_target'][
'suggestion_start']) ? $ref_data[
'time_target'][
'suggestion_start'] : $old[
'suggestion_start']);
1434 $items->setSuggestionEnd(isset($ref_data[
'time_target'][
'suggestion_end']) ? $ref_data[
'time_target'][
'suggestion_end'] : $old[
'suggestion_end']);
1435 $items->setEarliestStart(isset($ref_data[
'time_target'][
'earliest_start']) ? $ref_data[
'time_target'][
'earliest_start'] : $old[
'earliest_start']);
1436 $items->setLatestEnd(isset($ref_data[
'time_target'][
'latest_end']) ? $ref_data[
'time_target'][
'latest_end'] : $old[
'latest_end']);
1438 switch($ref_data[
'time_target'][
'timing_type'])
1441 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_DEACTIVATED.
' '.$ref_data[
'time_target'][
'timing_type']);
1446 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_ACTIVATION.
' '.$ref_data[
'time_target'][
'timing_type']);
1451 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_PRESETTING.
' '.$ref_data[
'time_target'][
'timing_type']);
1455 $items->update($ref_data[
'ref_id']);
1466 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1471 $original_id = $source->getRefId();
1473 foreach($a_object_data[
'references'] as $ref_data)
1475 $new_ref_id =
$ref_id = $original_id;
1476 if($tree->getParentId($original_id) != $ref_data[
'parent_id'])
1479 $new_ref_id = $source->createReference();
1480 $source->putInTree($ref_data[
'parent_id']);
1481 $source->setPermissions($ref_data[
'parent_id']);
1483 if(isset($ref_data[
'time_target']) )
1485 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1486 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
1488 if(!isset($ref_data[
'time_target'][
'starting_time']))
1490 $ref_data[
'time_target'][
'starting_time'] = time();
1492 if(!isset($ref_data[
'time_target'][
'ending_time']))
1494 $ref_data[
'time_target'][
'ending_time'] = time();
1498 $items->toggleChangeable($ref_data[
'time_target'][
'changeable']);
1499 $items->setTimingStart($ref_data[
'time_target'][
'starting_time']);
1500 $items->setTimingEnd($ref_data[
'time_target'][
'ending_time']);
1501 $items->toggleVisible($ref_data[
'time_target'][
'timing_visibility']);
1502 $items->setSuggestionStart($ref_data[
'time_target'][
'suggestion_start']);
1503 $items->setSuggestionEnd($ref_data[
'time_target'][
'suggestion_end']);
1504 $items->setEarliestStart($ref_data[
'time_target'][
'earliest_start']);
1505 $items->setLatestEnd($ref_data[
'time_target'][
'latest_end']);
1507 switch($ref_data[
'time_target'][
'timing_type'])
1510 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_DEACTIVATED.
' '.$ref_data[
'time_target'][
'timing_type']);
1515 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_ACTIVATION.
' '.$ref_data[
'time_target'][
'timing_type']);
1520 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_PRESETTING.
' '.$ref_data[
'time_target'][
'timing_type']);
1524 $items->update($new_ref_id);