33 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
47 if(!$this->__checkSession($sid))
60 $ilLog->write(
"SOAP getObjIdByImportId(): import_id = ".$import_id.
' obj_id = '.$obj_id);
62 return $obj_id ? $obj_id :
"0";
70 if(!$this->__checkSession($sid))
90 if ($tree->isInTree($ref_id))
95 return $new_refs ? $new_refs : array();
103 if(!$this->__checkSession($sid))
118 return $new_refs ? $new_refs : array();
134 if(!$this->__checkSession($sid))
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;
174 if(!$this->__checkSession($sid))
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');
218 if(!$this->__checkSession($sid))
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');
301 if(!$this->__checkSession($sid))
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)
404 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
411 $xml_writer->enableReferences(
false);
412 $xml_writer->setMode(ilObjectXmlWriter::MODE_SEARCH_RESULT);
413 $xml_writer->setHighlighter($highlighter);
416 $xml_writer->enablePermissionCheck(
true);
420 $xml_writer->setUserId($user_id);
421 $xml_writer->enableOperations(
true);
424 $xml_writer->setObjects($objs);
425 if($xml_writer->start())
427 #$GLOBALS['ilLog']->write(__METHOD__.': '.$xml_writer->xmlDumpMem(true));
428 return $xml_writer->getXML();
431 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
439 if(!$this->__checkSession($sid))
450 return $this->
__raiseError(
'No valid reference id given.',
453 if (intval(
$ref_id) == SYSTEM_FOLDER_ID) {
454 return $this->
__raiseError(
'No valid reference id given.',
466 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
467 if(in_array(
'parent', (array) $types))
469 $objs[] = $target_obj;
473 foreach($tree->getChilds(
$ref_id,
'title') as $child)
475 if($all or in_array($child[
'type'],$types))
484 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
490 $xml_writer->enableReferences(
false);
493 $xml_writer->enablePermissionCheck(
true);
494 $xml_writer->setObjects($objs);
495 $xml_writer->enableOperations(
true);
498 $xml_writer->setUserId($user_id);
501 if ($xml_writer->start())
503 #$GLOBALS['ilLog']->write(__METHOD__.': '.$xml_writer->getXML());
504 return $xml_writer->getXML();
507 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
515 if(!$this->__checkSession($sid))
522 $nodedata = $tree->getNodeData(
$ref_id);
523 $nodearray = $tree->getSubTree($nodedata);
526 $filter = (array) $types;
528 global $objDefinition;
529 foreach($nodearray as $node)
531 if(!$objDefinition->isAdministrationObject($node[
'type']) && !$objDefinition->isSystemObject($node[
'type']))
533 if(!in_array($node[
'type'], $filter))
544 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
547 $xml_writer->enablePermissionCheck(
true);
548 $xml_writer->setObjects($nodes);
549 $xml_writer->enableOperations(
false);
553 $xml_writer->setUserId($user_id);
556 if($xml_writer->start())
558 return $xml_writer->getXML();
561 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
569 if(!$this->__checkSession($sid))
575 return $this->
__raiseError(
'No valid xml string given.',
579 global $rbacsystem, $objDefinition,
$ilUser,
$lng, $ilObjDataCache;
589 return $this->
__raiseError(
"Parent with ID $a_target_id has been deleted.",
'Client');
592 $allowed_types = array(
'root',
'cat',
'grp',
'crs',
'fold');
593 if(!in_array($target_obj->getType(),$allowed_types))
595 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
599 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
601 foreach($allowed_subtypes as
$row)
603 if($row[
'name'] !=
'rolf')
605 $allowed[] = $row[
'name'];
609 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
613 $xml_parser->startParsing();
622 foreach($xml_parser->getObjectData() as $object_data)
631 if(!in_array($object_data[
'type'],$allowed))
633 return $this->
__raiseError(
'Objects of type: '.$object_data[
'type'].
' are not allowed to be subobjects of type '.
634 $target_obj->getType().
'!',
637 if(!$rbacsystem->checkAccess(
'create',$a_target_id,$object_data[
'type']))
639 return $this->
__raiseError(
'No permission to create objects of type '.$object_data[
'type'].
'!',
655 return $this->
__raiseError(
'An object with import id '.$object_data[
'import_id'].
' already exists!',
660 $class_name = $objDefinition->getClassName($object_data[
'type']);
661 $location = $objDefinition->getLocation($object_data[
'type']);
663 $class_constr =
"ilObj".$class_name;
664 require_once(
$location.
"/class.ilObj".$class_name.
".php");
666 $newObj =
new $class_constr();
668 if(isset($object_data[
'owner']) && strlen($object_data[
'owner']))
670 if((
int)$object_data[
'owner'])
673 $ilObjDataCache->lookupType((
int)$object_data[
'owner']) ==
'usr')
675 $newObj->setOwner((
int)$object_data[
'owner']);
683 $newObj->setOwner((
int)$usr_id);
688 $newObj->setType($object_data[
'type']);
689 if(strlen($object_data[
'import_id']))
691 $newObj->setImportId($object_data[
'import_id']);
693 $newObj->setTitle($object_data[
'title']);
694 $newObj->setDescription($object_data[
'description']);
696 $newObj->createReference();
697 $newObj->putInTree($a_target_id);
698 $newObj->setPermissions($a_target_id);
700 switch($object_data[
'type'])
704 $newObj->addMember($object_data[
'owner'] ? $object_data[
'owner'] : $ilUser->getId(),
705 $newObj->getDefaultAdminRole());
710 $newObj->getMemberObject()->add($ilUser->getId(),
IL_CRS_ADMIN);
715 $newObj->createLMTree();
718 $newObj->addTranslation($object_data[
"title"],$object_data[
"description"], $lng->getLangKey(), $lng->getLangKey());
734 if(!$this->__checkSession($sid))
738 if(!is_numeric($a_source_id))
743 if(!is_numeric($a_target_id))
749 global $objDefinition, $rbacsystem, $tree;
762 if(!$objDefinition->allowLink($source_obj->getType()) and
763 $source_obj->getType() !=
'cat' and
764 $source_obj->getType() !=
'crs')
766 return $this->
__raiseError(
'Linking of object type: '.$source_obj->getType().
' is not allowed',
770 $allowed_subtypes = $objDefinition->getSubObjects($target_obj->getType());
771 foreach($allowed_subtypes as
$row)
773 if($row[
'name'] !=
'rolf')
775 $allowed[] = $row[
'name'];
778 if(!in_array($source_obj->getType(),$allowed))
780 return $this->
__raiseError(
'Objects of type: '.$source_obj->getType().
' are not allowed to be subobjects of type '.
781 $target_obj->getType().
'!',
786 if(!$rbacsystem->checkAccess(
'create',$target_obj->getRefId(),$source_obj->getType()))
788 return $this->
__raiseError(
'No permission to create objects of type '.$source_obj->getType().
'!',
791 if(!$rbacsystem->checkAccess(
'delete',$source_obj->getRefId()))
793 return $this->
__raiseError(
'No permission to link object with id: '.$source_obj->getRefId().
'!',
798 if($source_obj->getType() !=
'cat' and $source_obj->getType() !=
'crs')
801 $possibleChilds = $tree->getChildsByType($target_obj->getRefId(), $source_obj->getType());
802 foreach ($possibleChilds as $child)
804 if ($child[
"obj_id"] == $source_obj->getId())
805 return $this->
__raiseError(
"Object already linked to target.",
"Client");
810 $new_ref_id = $source_obj->createReference();
811 $source_obj->putInTree($target_obj->getRefId());
812 $source_obj->setPermissions($target_obj->getRefId());
814 return $new_ref_id ? $new_ref_id :
"0";
818 switch($source_obj->getType())
821 include_once(
'./Modules/CategoryReference/classes/class.ilObjCategoryReference.php');
826 include_once(
'./Modules/CourseReference/classes/class.ilObjCourseReference.php');
831 $new_ref_id = $new_ref->createReference();
833 $new_ref->putInTree($target_obj->getRefId());
834 $new_ref->setPermissions($target_obj->getRefId());
836 $new_ref->setTargetId($source_obj->getId());
839 return $new_ref_id ? $new_ref_id : 0;
848 if(!$this->__checkSession($sid))
852 if(!is_numeric($reference_id))
857 global $tree, $rbacsystem, $rbacadmin;
861 return $this->
__raiseError(
'No valid reference id given.',
864 if(!$rbacsystem->checkAccess(
'delete',$del_obj->getRefId()))
866 return $this->
__raiseError(
'No permission to delete object with id: '.$del_obj->getRefId().
'!',
871 if($tree->isDeleted($reference_id))
873 return $this->
__raiseError(
'Node already deleted',
'Server');
876 if($del_obj->getType() ==
'rolf')
878 return $this->
__raiseError(
'Delete is not available for role folders.',
'Client');
881 $subnodes = $tree->getSubtree($tree->getNodeData($reference_id));
882 foreach($subnodes as $subnode)
884 $rbacadmin->revokePermission($subnode[
"child"]);
888 if(!$tree->saveSubTree($reference_id,
true))
890 return $this->
__raiseError(
'Node already deleted',
'Client');
901 if(!$this->__checkSession($sid))
905 if(!strlen($import_id))
907 return $this->
__raiseError(
'No import id given. Aborting!',
910 global $rbacsystem, $tree,
$ilLog;
915 return $this->
__raiseError(
'No object found with import id: '.$import_id,
920 $permission_ok =
false;
923 if($rbacsystem->checkAccess(
'delete',$ref_id))
925 $permission_ok =
true;
931 return $this->
__raiseError(
'No permission to delete the object with import id: '.$import_id,
936 foreach($ref_ids as $ref_id)
939 $node_data = $tree->getNodeData($ref_id);
940 $subtree_nodes = $tree->getSubtree($node_data);
942 foreach($subtree_nodes as $node)
944 $ilLog->write(
'Soap: removeFromSystemByImportId(). Deleting object with title id: '.$node[
'title']);
946 if(!is_object($tmp_obj))
948 return $this->
__raiseError(
'Cannot create instance of reference id: '.$node[
'ref_id'],
954 $tree->deleteTree($node_data);
967 if(!$this->__checkSession($sid))
973 return $this->
__raiseError(
'No valid xml string given.',
977 global $rbacreview, $rbacsystem,
$lng,$ilAccess;
979 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
983 $xml_parser->startParsing();
994 $object_datas = $xml_parser->getObjectData();
995 foreach($object_datas as & $object_data)
1004 if(!$object_data[
"obj_id"])
1006 return $this->
__raiseError(
'No obj_id in xml found.',
'Client');
1008 elseif ((
int) $object_data[
"obj_id"] == -1 && count($object_data[
"references"])>0)
1012 foreach ($object_data[
"references"] as $refid)
1022 if (!$obj_id_from_refid)
1024 return $this->
__raiseError(
'No obj_id found for reference id '.$object_data[
"references"][0],
'CLIENT_OBJECT_NOT_FOUND');
1028 $object_data[
"obj_id"] = $obj_id_from_refid;
1033 if ($tmp_obj == null)
1035 return $this->
__raiseError(
'No object for id '.$object_data[
'obj_id'].
'!',
'CLIENT_OBJECT_NOT_FOUND');
1039 $object_data[
"instance"] = $tmp_obj;
1042 if($object_data[
'type'] ==
'role')
1044 $rolf_ids = $rbacreview->getFoldersAssignedToRole($object_data[
'obj_id'],
true);
1045 $rolf_id = $rolf_ids[0];
1047 if(!$rbacsystem->checkAccess(
'write',$rolf_id))
1049 return $this->
__raiseError(
'No write permission for object with id '.$object_data[
'obj_id'].
'!',
'Client');
1054 $permission_ok =
false;
1057 if($ilAccess->checkAccess(
'write',
'',$ref_id))
1059 $permission_ok =
true;
1065 return $this->
__raiseError(
'No write permission for object with id '.$object_data[
'obj_id'].
'!',
'Client');
1070 if (count ($object_datas) > 0)
1072 foreach($object_datas as $object_data)
1076 $tmp_obj = $object_data[
"instance"];
1077 $tmp_obj->setTitle($object_data[
'title']);
1078 $tmp_obj->setDescription($object_data[
'description']);
1080 #$GLOBALS['ilLog']->write(__METHOD__.': type is '. $object_data['type']);
1081 #$GLOBALS['ilLog']->write(__METHOD__.': type is '. $a_xml);
1084 switch ($object_data[
'type'])
1087 $tmp_obj->updateTranslation($object_data[
"title"],$object_data[
"description"], $lng->getLangKey(), $lng->getLangKey());
1091 if(strlen($object_data[
'owner']) && is_numeric($object_data[
'owner']))
1093 $tmp_obj->setOwner($object_data[
'owner']);
1094 $tmp_obj->updateOwner();
1108 if(!$this->__checkSession($sid))
1113 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1114 global $rbacreview, $rbacadmin, $objDefinition, $rbacsystem,
$lng,
$ilUser, $tree;
1119 return $this->
__raiseError(
'No valid source given.',
'Client');
1125 return $this->
__raiseError(
'No valid target given.',
'Client');
1131 return $this->
__raiseError(
'Object is trashed.',
'Client');
1136 return $this->
__raiseError(
'Object is trashed.',
'Client');
1140 if ($this->
isFault($canAddType))
1147 foreach ($possibleChilds as $child)
1149 if ($child[
"obj_id"] ==
$ref_id)
1150 return $this->
__raiseError(
"Object already exists in target.",
"Client");
1156 return $this->
__raiseError(
"Cannot move object into itself.",
"Client");
1159 $old_parent = $tree->getParentId(
$ref_id);
1161 $rbacadmin->adjustMovedObjectPermissions(
$ref_id,$old_parent);
1163 include_once(
'./Services/AccessControl/classes/class.ilConditionHandler.php');
1178 if(!$this->__checkSession($sid))
1184 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1185 global $rbacreview, $objDefinition, $rbacsystem,
$lng,
$ilUser;
1187 include_once
'./webservice/soap/classes/class.ilCopyWizardSettingsXMLParser.php';
1190 $xml_parser->startParsing();
1192 return $this->
__raiseError($se->getMessage(),
"Client");
1196 if(!$rbacsystem->checkAccess(
'copy',$xml_parser->getSourceId()))
1198 return $this->
__raiseError(
"Missing copy permissions for object with reference id ".$xml_parser->getSourceId(),
'Client');
1202 $source_id = $xml_parser->getSourceId();
1209 return $this->
__raiseError(
'No valid source given.',
'Client');
1215 return $this->
__raiseError(
'No valid target given.',
'Client');
1220 if ($this->
isFault($canAddType))
1226 $options = $xml_parser->getOptions();
1231 $clientid = substr($sid, strpos($sid,
"::") + 2);
1232 $sessionid = str_replace(
"::".$clientid,
"", $sid);
1234 return $source_object->cloneAllObject($sessionid, $clientid,
1235 $source_object_type,
1244 $wizard_options->saveOwner($ilUser->getId());
1245 $wizard_options->saveRoot($source_id);
1247 foreach(
$options as $source_id => $option)
1249 $wizard_options->addEntry($source_id,$option);
1251 $wizard_options->read();
1254 $newObject = $source_object->cloneObject($xml_parser->getTargetId(), $copy_id);
1255 return is_object($newObject) ? $newObject->getRefId() : -1;
1264 if(!$this->__checkSession($sid))
1269 global $ilAccess, $objDefinition, $rbacsystem,
$lng,
$ilUser;
1271 if(!$rbacsystem->checkAccess(
'read',
$ref_id))
1273 return $this->
__raiseError(
"Missing read permissions for object with reference id ".
$ref_id,
'Client');
1278 return $this->
__raiseError(
"Object is in Trash",
'Client');
1281 $items = $tree->getPathFull(
$ref_id);
1283 include_once
'webservice/soap/classes/class.ilXMLResultSet.php';
1284 include_once
'webservice/soap/classes/class.ilXMLResultSetWriter.php';
1285 include_once
'Modules/Course/classes/class.ilCourseXMLWriter.php';
1288 $xmlResultSet->addColumn(
"ref_id");
1289 $xmlResultSet->addColumn(
"type");
1290 $xmlResultSet->addColumn(
"title");
1293 foreach ($items as $item) {
1294 if ($item[
"ref_id"] ==
$ref_id)
1296 if ($item[
"title"] ==
"ILIAS" && $item[
"type"] ==
"root")
1298 $item[
"title"] = $lng->txt(
"repository");
1302 $xmlResultSet->addRow(
$row);
1303 $row->setValue(
"ref_id", $item[
"ref_id"]);
1304 $row->setValue(
"type", $item[
"type"]);
1305 $row->setValue(
"title", $item[
"title"]);
1308 return $writer->getXML();
1315 global $objDefinition, $rbacsystem;
1317 $allowed_types = array(
'root',
'cat',
'grp',
'crs',
'fold');
1320 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
'Client');
1323 $allowed_subtypes = $objDefinition->getSubObjects(
$target_type);
1326 foreach($allowed_subtypes as
$row)
1328 if($row[
'name'] !=
'rolf')
1330 $allowed[] = $row[
'name'];
1334 if(!in_array($type, $allowed))
1336 return $this->
__raiseError(
'Objects of type: '.$type.
' are not allowed to be subobjects of type '.
$target_type.
'!',
'Client');
1338 if(!$rbacsystem->checkAccess(
'create',
$target_id, $type))
1340 return $this->
__raiseError(
'No permission to create objects of type '.$type.
'!',
'Client');
1350 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1354 if($a_action ==
'create')
1356 if(count($a_object_data[
'references']) > 1)
1358 if(in_array($a_object_data[
'type'],array(
'cat',
'crs',
'grp',
'fold')))
1360 return $this->
__raiseError(
"Cannot create references for type ".$a_object_data[
'type'],
1364 if(count($a_object_data[
'references']) == 1)
1366 if($a_target_id != $a_object_data[
'references'][0][
'parent_id'])
1368 return $this->
__raiseError(
"Cannot create references for type ".$a_object_data[
'type'],
1373 foreach($a_object_data[
'references'] as $ref_data)
1375 if(!$ref_data[
'parent_id'])
1377 return $this->
__raiseError(
'Element References: No parent Id given!',
'Client');
1382 if($this->
isFault($can_add_type))
1384 return $can_add_type;
1390 if($a_action ==
'update')
1392 foreach($a_object_data[
'references'] as $ref_data)
1394 if(!$ref_data[
'ref_id'])
1396 return $this->
__raiseError(
'Element References: No reference id given!',
'Client');
1399 if(!$ilAccess->checkAccess(
'write',
'',$ref_data[
'ref_id']))
1401 return $this->
__raiseError(
'No write permission for object with reference id '.$ref_data[
'ref_id'].
'!',
'Client');
1413 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1418 foreach($a_object_data[
'references'] as $ref_data)
1420 if(isset($ref_data[
'time_target']) )
1422 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1423 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
1427 $items->toggleChangeable(isset($ref_data[
'time_target'][
'changeable']) ? $ref_data[
'time_target'][
'changeable'] : $old[
'changeable']);
1428 $items->setTimingStart(isset($ref_data[
'time_target'][
'starting_time']) ? $ref_data[
'time_target'][
'starting_time'] : $old[
'timing_start']);
1429 $items->setTimingEnd(isset($ref_data[
'time_target'][
'ending_time']) ? $ref_data[
'time_target'][
'ending_time'] : $old[
'timing_end']);
1430 $items->toggleVisible(isset($ref_data[
'time_target'][
'timing_visibility']) ? $ref_data[
'time_target'][
'timing_visibility'] : $old[
'visible']);
1431 $items->setSuggestionStart(isset($ref_data[
'time_target'][
'suggestion_start']) ? $ref_data[
'time_target'][
'suggestion_start'] : $old[
'suggestion_start']);
1432 $items->setSuggestionEnd(isset($ref_data[
'time_target'][
'suggestion_end']) ? $ref_data[
'time_target'][
'suggestion_end'] : $old[
'suggestion_end']);
1433 $items->setEarliestStart(isset($ref_data[
'time_target'][
'earliest_start']) ? $ref_data[
'time_target'][
'earliest_start'] : $old[
'earliest_start']);
1434 $items->setLatestEnd(isset($ref_data[
'time_target'][
'latest_end']) ? $ref_data[
'time_target'][
'latest_end'] : $old[
'latest_end']);
1436 switch($ref_data[
'time_target'][
'timing_type'])
1439 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_DEACTIVATED.
' '.$ref_data[
'time_target'][
'timing_type']);
1444 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_ACTIVATION.
' '.$ref_data[
'time_target'][
'timing_type']);
1449 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_PRESETTING.
' '.$ref_data[
'time_target'][
'timing_type']);
1453 $items->update($ref_data[
'ref_id']);
1464 if(!isset($a_object_data[
'references']) or !count($a_object_data[
'references']))
1469 $original_id = $source->getRefId();
1471 foreach($a_object_data[
'references'] as $ref_data)
1473 $new_ref_id =
$ref_id = $original_id;
1474 if($tree->getParentId($original_id) != $ref_data[
'parent_id'])
1477 $new_ref_id = $source->createReference();
1478 $source->putInTree($ref_data[
'parent_id']);
1479 $source->setPermissions($ref_data[
'parent_id']);
1481 if(isset($ref_data[
'time_target']) )
1483 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1484 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
1486 if(!isset($ref_data[
'time_target'][
'starting_time']))
1488 $ref_data[
'time_target'][
'starting_time'] = time();
1490 if(!isset($ref_data[
'time_target'][
'ending_time']))
1492 $ref_data[
'time_target'][
'ending_time'] = time();
1496 $items->toggleChangeable($ref_data[
'time_target'][
'changeable']);
1497 $items->setTimingStart($ref_data[
'time_target'][
'starting_time']);
1498 $items->setTimingEnd($ref_data[
'time_target'][
'ending_time']);
1499 $items->toggleVisible($ref_data[
'time_target'][
'timing_visibility']);
1500 $items->setSuggestionStart($ref_data[
'time_target'][
'suggestion_start']);
1501 $items->setSuggestionEnd($ref_data[
'time_target'][
'suggestion_end']);
1502 $items->setEarliestStart($ref_data[
'time_target'][
'earliest_start']);
1503 $items->setLatestEnd($ref_data[
'time_target'][
'latest_end']);
1505 switch($ref_data[
'time_target'][
'timing_type'])
1508 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_DEACTIVATED.
' '.$ref_data[
'time_target'][
'timing_type']);
1513 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_ACTIVATION.
' '.$ref_data[
'time_target'][
'timing_type']);
1518 $ilLog->write(__METHOD__.ilObjectActivation::TIMINGS_PRESETTING.
' '.$ref_data[
'time_target'][
'timing_type']);
1522 $items->update($new_ref_id);