34 include_once
'./webservice/soap/classes/class.ilSoapAdministration.php';
43 if (!$this->__checkSession($sid)) {
48 'No import id given.',
56 $ilLog->write(
"SOAP getObjIdByImportId(): import_id = " . $import_id .
' obj_id = ' . $obj_id);
58 return $obj_id ? $obj_id :
"0";
66 if (!$this->__checkSession($sid)) {
71 'No import id given.',
83 foreach ($ref_ids as $ref_id) {
85 if ($tree->isInTree($ref_id)) {
86 $new_refs[] = $ref_id;
89 return $new_refs ? $new_refs :
array();
97 if (!$this->__checkSession($sid)) {
102 'No object id given.',
108 foreach ($ref_ids as $ref_id) {
109 $new_refs[] = $ref_id;
111 return $new_refs ? $new_refs :
array();
127 if (!$this->__checkSession($sid)) {
132 if (!count($ref_ids) || !is_array($ref_ids)) {
133 return $this->
__raiseError(
'No reference id(s) given.',
'Client');
137 if (count($ref_ids)) {
138 foreach ($ref_ids as $ref_id) {
139 $ref_id = trim($ref_id);
140 if (!is_numeric($ref_id)) {
141 return $this->
__raiseError(
'Reference ID has to be numeric. Value: ' . $ref_id,
'Client');
146 return $this->
__raiseError(
'No object found for reference ID. Value: ' . $ref_id,
'Client');
149 return $this->
__raiseError(
'No untrashed reference found for reference ID. Value: ' . $ref_id,
'Client');
151 $obj_ids[] = $obj_id;
164 if (!$this->__checkSession($sid)) {
167 if (!is_numeric($a_ref_id)) {
169 'No valid reference id given. Please choose an existing reference id of an ILIAS object',
175 return $this->
__raiseError(
'Cannot create object instance!',
'Server');
180 return $this->
__raiseError(
"Object with ID $a_ref_id has been deleted.",
'Client');
183 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
186 $xml_writer->enablePermissionCheck(
true);
188 $xml_writer->setUserId($user_id);
189 $xml_writer->enableOperations(
true);
191 $xml_writer->setObjects(
array($tmp_obj));
192 if ($xml_writer->start()) {
193 return $xml_writer->getXML();
196 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
204 if (!$this->__checkSession($sid)) {
207 if (!strlen($a_title)) {
209 'No valid query string given.',
214 include_once
'./Services/Search/classes/class.ilQueryParser.php';
217 $query_parser->setMinWordLength(0,
true);
219 $query_parser->parse();
220 if (!$query_parser->validate()) {
222 $query_parser->getMessage(),
227 include_once
'./Services/Search/classes/class.ilObjectSearchFactory.php';
229 include_once
'Services/Search/classes/Like/class.ilLikeObjectSearch.php';
232 #$object_search =& ilObjectSearchFactory::_getObjectSearchInstance($query_parser); 233 $object_search->setFields(
array(
'title'));
234 $object_search->appendToFilter(
'role');
235 $object_search->appendToFilter(
'rolt');
236 $res =&$object_search->performSearch();
238 $res->setUserId($user_id);
241 $res->filter(ROOT_FOLDER_ID,
true);
244 foreach (
$res->getUniqueResults() as $entry) {
245 if ($entry[
'type'] ==
'role' or $entry[
'type'] ==
'rolt') {
259 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
262 $xml_writer->enablePermissionCheck(
true);
264 $xml_writer->setUserId($user_id);
265 $xml_writer->enableOperations(
true);
267 $xml_writer->setObjects($objs);
268 if ($xml_writer->start()) {
269 return $xml_writer->getXML();
272 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
280 if (!$this->__checkSession($sid)) {
283 if (!is_array($types)) {
285 'Types must be an array of object types.',
289 if ($combination !=
'and' and $combination !=
'or') {
291 'No valid combination given. Must be "and" or "or".',
297 include_once
'./Services/Search/classes/class.ilSearchSettings.php';
301 $typeFilterQuery =
'';
302 if (is_array($types)) {
303 foreach ($types as $objectType) {
304 if (0 === strlen($typeFilterQuery)) {
305 $typeFilterQuery .=
'+( ';
307 $typeFilterQuery .=
'OR';
309 $typeFilterQuery .= (
' type:' . (
string) $objectType .
' ');
311 $typeFilterQuery .=
') ';
314 include_once
'./Services/Search/classes/Lucene/class.ilLuceneQueryParser.php';
316 $query_parser->parse();
318 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearcher.php';
322 include_once
'./Services/Search/classes/Lucene/class.ilLuceneSearchResultFilter.php';
323 include_once
'./Services/Search/classes/Lucene/class.ilLucenePathFilter.php';
325 $filter->setCandidates($searcher->getResult());
328 $result_ids = $filter->getResults();
331 foreach ((
array) $result_ids as $ref_id => $obj_id) {
337 include_once
'./Services/Search/classes/Lucene/class.ilLuceneHighlighterResultParser.php';
339 if ($filter->getResultObjIds()) {
340 $highlighter = $searcher->highlight($filter->getResultObjIds());
343 include_once
'./Services/Search/classes/class.ilQueryParser.php';
346 #$query_parser->setMinWordLength(3); 348 $query_parser->parse();
349 if (!$query_parser->validate()) {
351 $query_parser->getMessage(),
356 #include_once './Services/Search/classes/class.ilObjectSearchFactory.php'; 357 #$object_search =& ilObjectSearchFactory::_getObjectSearchInstance($query_parser); 359 include_once
'./Services/Search/classes/Like/class.ilLikeObjectSearch.php';
362 $object_search->setFilter($types);
364 $res =&$object_search->performSearch();
366 $res->setUserId($user_id);
369 $res->setMaxHits(100);
371 $res->filter(ROOT_FOLDER_ID, $combination ==
'and' ?
true :
false);
375 foreach (
$res->getUniqueResults() as $entry) {
387 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
393 $xml_writer->enableReferences(
false);
394 $xml_writer->setMode(ilObjectXmlWriter::MODE_SEARCH_RESULT);
395 $xml_writer->setHighlighter($highlighter);
398 $xml_writer->enablePermissionCheck(
true);
401 $xml_writer->setUserId($user_id);
402 $xml_writer->enableOperations(
true);
405 $xml_writer->setObjects($objs);
406 if ($xml_writer->start()) {
407 #$GLOBALS['ilLog']->write(__METHOD__.': '.$xml_writer->xmlDumpMem(true)); 408 return $xml_writer->getXML();
411 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
419 if (!$this->__checkSession($sid)) {
429 'No valid reference id given.',
433 if (intval($ref_id) == SYSTEM_FOLDER_ID) {
435 'No valid reference id given.',
447 include_once
'./Services/WebServices/FileManager/classes/class.ilFMSettings.php';
448 if (in_array(
'parent', (
array) $types)) {
449 $objs[] = $target_obj;
453 foreach ($tree->getChilds($ref_id,
'title') as $child) {
454 if ($all or in_array($child[
'type'], $types)) {
461 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
466 $xml_writer->enableReferences(
false);
469 $xml_writer->enablePermissionCheck(
true);
470 $xml_writer->setObjects($objs);
471 $xml_writer->enableOperations(
true);
473 $xml_writer->setUserId($user_id);
476 if ($xml_writer->start()) {
477 #$GLOBALS['ilLog']->write(__METHOD__.': '.$xml_writer->getXML()); 478 return $xml_writer->getXML();
481 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
489 if (!$this->__checkSession($sid)) {
495 $nodedata = $tree->getNodeData($ref_id);
496 $nodearray = $tree->getSubTree($nodedata);
499 $filter = (
array) $types;
501 global $objDefinition;
502 foreach ($nodearray as $node) {
503 if (!$objDefinition->isAdministrationObject($node[
'type']) && !$objDefinition->isSystemObject($node[
'type'])) {
504 if (!in_array($node[
'type'], $filter)) {
513 include_once
'./webservice/soap/classes/class.ilObjectXMLWriter.php';
516 $xml_writer->enablePermissionCheck(
true);
517 $xml_writer->setObjects($nodes);
518 $xml_writer->enableOperations(
false);
521 $xml_writer->setUserId($user_id);
524 if ($xml_writer->start()) {
525 return $xml_writer->getXML();
528 return $this->
__raiseError(
'Cannot create object xml !',
'Server');
531 public function addObject($sid, $a_target_id, $a_xml)
536 if (!$this->__checkSession($sid)) {
539 if (!strlen($a_xml)) {
541 'No valid xml string given.',
546 global $rbacsystem, $objDefinition,
$ilUser,
$lng, $ilObjDataCache;
550 'No valid target given.',
556 return $this->
__raiseError(
"Parent with ID $a_target_id has been deleted.",
'Client');
559 $allowed_types =
array(
'root',
'cat',
'grp',
'crs',
'fold');
560 if (!in_array($target_obj->getType(), $allowed_types)) {
562 'No valid target type. Target must be reference id of "course, group, category or folder"',
567 $allowed_subtypes = $target_obj->getPossibleSubObjects();
569 foreach ($allowed_subtypes as
$row) {
570 if ($row[
'name'] !=
'rolf') {
571 $allowed[] = $row[
'name'];
575 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
579 $xml_parser->startParsing();
581 return $this->
__raiseError($se->getMessage(),
'Client');
586 foreach ($xml_parser->getObjectData() as $object_data) {
593 if (!in_array($object_data[
'type'], $allowed)) {
595 'Objects of type: ' . $object_data[
'type'] .
' are not allowed to be subobjects of type ' .
596 $target_obj->getType() .
'!',
600 if (!$rbacsystem->checkAccess(
'create', $a_target_id, $object_data[
'type'])) {
602 'No permission to create objects of type ' . $object_data[
'type'] .
'!',
619 'An object with import id ' . $object_data[
'import_id'] .
' already exists!',
625 $class_name = $objDefinition->getClassName($object_data[
'type']);
626 $location = $objDefinition->getLocation($object_data[
'type']);
628 $class_constr =
"ilObj" . $class_name;
629 require_once(
$location .
"/class.ilObj" . $class_name .
".php");
631 $newObj =
new $class_constr();
633 if (isset($object_data[
'owner']) && strlen($object_data[
'owner'])) {
634 if ((
int) $object_data[
'owner']) {
636 $ilObjDataCache->lookupType((
int) $object_data[
'owner']) ==
'usr') {
637 $newObj->setOwner((
int) $object_data[
'owner']);
642 $newObj->setOwner((
int) $usr_id);
647 $newObj->setType($object_data[
'type']);
648 if (strlen($object_data[
'import_id'])) {
649 $newObj->setImportId($object_data[
'import_id']);
651 $newObj->setTitle($object_data[
'title']);
652 $newObj->setDescription($object_data[
'description']);
654 $newObj->createReference();
655 $newObj->putInTree($a_target_id);
656 $newObj->setPermissions($a_target_id);
658 switch ($object_data[
'type']) {
662 $object_data[
'owner'] ? $object_data[
'owner'] : $ilUser->getId(),
663 $newObj->getDefaultAdminRole()
669 $newObj->getMemberObject()->add($ilUser->getId(),
IL_CRS_ADMIN);
673 $newObj->createLMTree();
677 $newObj->addTranslation($object_data[
"title"], $object_data[
"description"], $lng->getLangKey(),
true);
683 $ref_id = $newObj->getRefId();
684 return $ref_id ? $ref_id :
"0";
692 if (!$this->__checkSession($sid)) {
695 if (!is_numeric($a_source_id)) {
697 'No source id given.',
701 if (!is_numeric($a_target_id)) {
703 'No target id given.',
708 global $objDefinition, $rbacsystem, $tree;
712 'No valid source id given.',
718 'No valid target id given.',
723 if (!$objDefinition->allowLink($source_obj->getType()) and
724 $source_obj->getType() !=
'cat' and
725 $source_obj->getType() !=
'crs') {
727 'Linking of object type: ' . $source_obj->getType() .
' is not allowed',
732 $allowed_subtypes = $target_obj->getPossibleSubObjects();
733 foreach ($allowed_subtypes as
$row) {
734 if ($row[
'name'] !=
'rolf') {
735 $allowed[] = $row[
'name'];
738 if (!in_array($source_obj->getType(), $allowed)) {
740 'Objects of type: ' . $source_obj->getType() .
' are not allowed to be subobjects of type ' .
741 $target_obj->getType() .
'!',
747 if (!$rbacsystem->checkAccess(
'create', $target_obj->getRefId(), $source_obj->getType())) {
749 'No permission to create objects of type ' . $source_obj->getType() .
'!',
753 if (!$rbacsystem->checkAccess(
'delete', $source_obj->getRefId())) {
755 'No permission to link object with id: ' . $source_obj->getRefId() .
'!',
761 if ($source_obj->getType() !=
'cat' and $source_obj->getType() !=
'crs') {
763 $possibleChilds = $tree->getChildsByType($target_obj->getRefId(), $source_obj->getType());
764 foreach ($possibleChilds as $child) {
765 if ($child[
"obj_id"] == $source_obj->getId()) {
766 return $this->
__raiseError(
"Object already linked to target.",
"Client");
772 $new_ref_id = $source_obj->createReference();
773 $source_obj->putInTree($target_obj->getRefId());
774 $source_obj->setPermissions($target_obj->getRefId());
776 return $new_ref_id ? $new_ref_id :
"0";
778 switch ($source_obj->getType()) {
780 include_once(
'./Modules/CategoryReference/classes/class.ilObjCategoryReference.php');
785 include_once(
'./Modules/CourseReference/classes/class.ilObjCourseReference.php');
789 include_once(
'./Modules/GroupReference/classes/class.ilObjGroupReference.php');
794 $new_ref_id = $new_ref->createReference();
796 $new_ref->putInTree($target_obj->getRefId());
797 $new_ref->setPermissions($target_obj->getRefId());
799 $new_ref->setTargetId($source_obj->getId());
802 return $new_ref_id ? $new_ref_id : 0;
811 if (!$this->__checkSession($sid)) {
814 if (!is_numeric($reference_id)) {
816 'No reference id given.',
820 global $tree, $rbacsystem, $rbacadmin;
824 'No valid reference id given.',
828 if (!$rbacsystem->checkAccess(
'delete', $del_obj->getRefId())) {
830 'No permission to delete object with id: ' . $del_obj->getRefId() .
'!',
836 if ($tree->isDeleted($reference_id)) {
837 return $this->
__raiseError(
'Node already deleted',
'Server');
840 if ($del_obj->getType() ==
'rolf') {
841 return $this->
__raiseError(
'Delete is not available for role folders.',
'Client');
844 $subnodes = $tree->getSubtree($tree->getNodeData($reference_id));
845 foreach ($subnodes as $subnode) {
846 $rbacadmin->revokePermission($subnode[
"child"]);
850 if (!$tree->saveSubTree($reference_id,
true)) {
851 return $this->
__raiseError(
'Node already deleted',
'Client');
862 if (!$this->__checkSession($sid)) {
865 if (!strlen($import_id)) {
867 'No import id given. Aborting!',
871 global $rbacsystem, $tree,
$ilLog;
876 'No object found with import id: ' . $import_id,
882 $permission_ok =
false;
884 if ($rbacsystem->checkAccess(
'delete', $ref_id)) {
885 $permission_ok =
true;
889 if (!$permission_ok) {
891 'No permission to delete the object with import id: ' . $import_id,
897 foreach ($ref_ids as $ref_id) {
899 $node_data = $tree->getNodeData($ref_id);
900 $subtree_nodes = $tree->getSubtree($node_data);
902 foreach ($subtree_nodes as $node) {
903 $ilLog->write(
'Soap: removeFromSystemByImportId(). Deleting object with title id: ' . $node[
'title']);
905 if (!is_object($tmp_obj)) {
907 'Cannot create instance of reference id: ' . $node[
'ref_id'],
914 $tree->deleteTree($node_data);
926 if (!$this->__checkSession($sid)) {
929 if (!strlen($a_xml)) {
931 'No valid xml string given.',
936 global $rbacreview, $rbacsystem,
$lng,$ilAccess;
938 include_once
'./webservice/soap/classes/class.ilObjectXMLParser.php';
941 $xml_parser->startParsing();
943 return $this->
__raiseError($se->getMessage(),
'Client');
950 $object_datas = $xml_parser->getObjectData();
951 foreach ($object_datas as &$object_data) {
958 if (!$object_data[
"obj_id"]) {
959 return $this->
__raiseError(
'No obj_id in xml found.',
'Client');
960 } elseif ((
int) $object_data[
"obj_id"] == -1 && count($object_data[
"references"])>0) {
963 foreach ($object_data[
"references"] as $refid) {
971 if (!$obj_id_from_refid) {
972 return $this->
__raiseError(
'No obj_id found for reference id ' . $object_data[
"references"][0],
'CLIENT_OBJECT_NOT_FOUND');
975 $object_data[
"obj_id"] = $obj_id_from_refid;
980 if ($tmp_obj == null) {
981 return $this->
__raiseError(
'No object for id ' . $object_data[
'obj_id'] .
'!',
'CLIENT_OBJECT_NOT_FOUND');
983 $object_data[
"instance"] = $tmp_obj;
986 if ($object_data[
'type'] ==
'role') {
987 $rolf_ids = $rbacreview->getFoldersAssignedToRole($object_data[
'obj_id'],
true);
988 $rolf_id = $rolf_ids[0];
990 if (!$rbacsystem->checkAccess(
'write', $rolf_id)) {
991 return $this->
__raiseError(
'No write permission for object with id ' . $object_data[
'obj_id'] .
'!',
'Client');
994 $permission_ok =
false;
996 if ($ilAccess->checkAccess(
'write',
'', $ref_id)) {
997 $permission_ok =
true;
1001 if (!$permission_ok) {
1002 return $this->
__raiseError(
'No write permission for object with id ' . $object_data[
'obj_id'] .
'!',
'Client');
1007 if (count($object_datas) > 0) {
1008 foreach ($object_datas as $object_data) {
1011 $tmp_obj = $object_data[
"instance"];
1012 $tmp_obj->setTitle($object_data[
'title']);
1013 $tmp_obj->setDescription($object_data[
'description']);
1015 #$GLOBALS['ilLog']->write(__METHOD__.': type is '. $object_data['type']); 1016 #$GLOBALS['ilLog']->write(__METHOD__.': type is '. $a_xml); 1019 switch ($object_data[
'type']) {
1021 $tmp_obj->updateTranslation($object_data[
"title"], $object_data[
"description"], $lng->getLangKey(), $lng->getLangKey());
1025 if (strlen($object_data[
'owner']) && is_numeric($object_data[
'owner'])) {
1026 $tmp_obj->setOwner($object_data[
'owner']);
1027 $tmp_obj->updateOwner();
1040 if (!$this->__checkSession($sid)) {
1044 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1045 global $rbacreview, $rbacadmin, $objDefinition, $rbacsystem,
$lng,
$ilUser, $tree;
1049 return $this->
__raiseError(
'No valid source given.',
'Client');
1054 return $this->
__raiseError(
'No valid target given.',
'Client');
1059 return $this->
__raiseError(
'Object is trashed.',
'Client');
1063 return $this->
__raiseError(
'Object is trashed.',
'Client');
1067 if ($this->
isFault($canAddType)) {
1072 $possibleChilds = $tree->getChildsByType(
$target_id, $ref_id);
1073 foreach ($possibleChilds as $child) {
1074 if ($child[
"obj_id"] == $ref_id) {
1075 return $this->
__raiseError(
"Object already exists in target.",
"Client");
1080 if ($tree->isGrandChild($ref_id,
$target_id)) {
1081 return $this->
__raiseError(
"Cannot move object into itself.",
"Client");
1084 $old_parent = $tree->getParentId($ref_id);
1086 $rbacadmin->adjustMovedObjectPermissions($ref_id, $old_parent);
1088 include_once(
'./Services/AccessControl/classes/class.ilConditionHandler.php');
1103 if (!$this->__checkSession($sid)) {
1108 include_once
'./webservice/soap/classes/class.ilSoapUtils.php';
1109 global $rbacreview, $objDefinition, $rbacsystem,
$lng,
$ilUser;
1111 include_once
'./webservice/soap/classes/class.ilCopyWizardSettingsXMLParser.php';
1114 $xml_parser->startParsing();
1116 return $this->
__raiseError($se->getMessage(),
"Client");
1120 if (!$rbacsystem->checkAccess(
'copy', $xml_parser->getSourceId())) {
1121 return $this->
__raiseError(
"Missing copy permissions for object with reference id " . $xml_parser->getSourceId(),
'Client');
1125 $source_id = $xml_parser->getSourceId();
1131 return $this->
__raiseError(
'No valid source given.',
'Client');
1136 return $this->
__raiseError(
'No valid target given.',
'Client');
1141 if ($this->
isFault($canAddType)) {
1146 $options = $xml_parser->getOptions();
1151 $clientid = substr($sid, strpos($sid,
"::") + 2);
1152 $sessionid = str_replace(
"::" . $clientid,
"", $sid);
1154 $ret = $source_object->cloneAllObject(
1157 $source_object_type,
1164 return $ret[
'ref_id'];
1169 $wizard_options->saveOwner($ilUser->getId());
1170 $wizard_options->saveRoot($source_id);
1172 foreach (
$options as $source_id => $option) {
1173 $wizard_options->addEntry($source_id, $option);
1175 $wizard_options->read();
1178 $newObject = $source_object->cloneObject($xml_parser->getTargetId(), $copy_id);
1179 return is_object($newObject) ? $newObject->getRefId() : -1;
1188 if (!$this->__checkSession($sid)) {
1192 global $ilAccess, $objDefinition, $rbacsystem,
$lng,
$ilUser;
1194 if (!$rbacsystem->checkAccess(
'read', $ref_id)) {
1195 return $this->
__raiseError(
"Missing read permissions for object with reference id " . $ref_id,
'Client');
1199 return $this->
__raiseError(
"Object is in Trash",
'Client');
1202 $items = $tree->getPathFull($ref_id);
1204 include_once
'webservice/soap/classes/class.ilXMLResultSet.php';
1205 include_once
'webservice/soap/classes/class.ilXMLResultSetWriter.php';
1206 include_once
'Modules/Course/classes/class.ilCourseXMLWriter.php';
1209 $xmlResultSet->addColumn(
"ref_id");
1210 $xmlResultSet->addColumn(
"type");
1211 $xmlResultSet->addColumn(
"title");
1214 foreach ($items as $item) {
1215 if ($item[
"ref_id"] == $ref_id) {
1218 if ($item[
"title"] ==
"ILIAS" && $item[
"type"] ==
"root") {
1219 $item[
"title"] = $lng->txt(
"repository");
1223 $xmlResultSet->addRow(
$row);
1224 $row->setValue(
"ref_id", $item[
"ref_id"]);
1225 $row->setValue(
"type", $item[
"type"]);
1226 $row->setValue(
"title", $item[
"title"]);
1229 return $writer->getXML();
1236 global $objDefinition, $rbacsystem;
1238 $allowed_types =
array(
'root',
'cat',
'grp',
'crs',
'fold');
1240 return $this->
__raiseError(
'No valid target type. Target must be reference id of "course, group, category or folder"',
'Client');
1243 $allowed_subtypes = $objDefinition->getSubObjects(
$target_type);
1246 foreach ($allowed_subtypes as
$row) {
1247 if ($row[
'name'] !=
'rolf') {
1248 $allowed[] = $row[
'name'];
1252 if (!in_array(
$type, $allowed)) {
1256 return $this->
__raiseError(
'No permission to create objects of type ' .
$type .
'!',
'Client');
1266 if (!isset($a_object_data[
'references']) or !count($a_object_data[
'references'])) {
1269 if ($a_action ==
'create') {
1270 if (count($a_object_data[
'references']) > 1) {
1271 if (in_array($a_object_data[
'type'],
array(
'cat',
'crs',
'grp',
'fold'))) {
1273 "Cannot create references for type " . $a_object_data[
'type'],
1278 if (count($a_object_data[
'references']) == 1) {
1279 if ($a_target_id != $a_object_data[
'references'][0][
'parent_id']) {
1281 "Cannot create references for type " . $a_object_data[
'type'],
1287 foreach ($a_object_data[
'references'] as $ref_data) {
1288 if (!$ref_data[
'parent_id']) {
1289 return $this->
__raiseError(
'Element References: No parent Id given!',
'Client');
1294 if ($this->
isFault($can_add_type)) {
1295 return $can_add_type;
1301 if ($a_action ==
'update') {
1302 foreach ($a_object_data[
'references'] as $ref_data) {
1303 if (!$ref_data[
'ref_id']) {
1304 return $this->
__raiseError(
'Element References: No reference id given!',
'Client');
1307 if (!$ilAccess->checkAccess(
'write',
'', $ref_data[
'ref_id'])) {
1308 return $this->
__raiseError(
'No write permission for object with reference id ' . $ref_data[
'ref_id'] .
'!',
'Client');
1320 if (!isset($a_object_data[
'references']) or !count($a_object_data[
'references'])) {
1324 foreach ($a_object_data[
'references'] as $ref_data) {
1325 if (isset($ref_data[
'time_target']) ) {
1326 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1327 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
1331 $items->toggleChangeable(isset($ref_data[
'time_target'][
'changeable']) ? $ref_data[
'time_target'][
'changeable'] :
$old[
'changeable']);
1332 $items->setTimingStart(isset($ref_data[
'time_target'][
'starting_time']) ? $ref_data[
'time_target'][
'starting_time'] : $old[
'timing_start']);
1333 $items->setTimingEnd(isset($ref_data[
'time_target'][
'ending_time']) ? $ref_data[
'time_target'][
'ending_time'] : $old[
'timing_end']);
1334 $items->toggleVisible(isset($ref_data[
'time_target'][
'timing_visibility']) ? $ref_data[
'time_target'][
'timing_visibility'] : $old[
'visible']);
1335 $items->setSuggestionStart(isset($ref_data[
'time_target'][
'suggestion_start']) ? $ref_data[
'time_target'][
'suggestion_start'] : $old[
'suggestion_start']);
1336 $items->setSuggestionEnd(isset($ref_data[
'time_target'][
'suggestion_end']) ? $ref_data[
'time_target'][
'suggestion_end'] : $old[
'suggestion_end']);
1337 $items->setEarliestStart(isset($ref_data[
'time_target'][
'earliest_start']) ? $ref_data[
'time_target'][
'earliest_start'] : $old[
'earliest_start']);
1338 $items->setLatestEnd(isset($ref_data[
'time_target'][
'latest_end']) ? $ref_data[
'time_target'][
'latest_end'] : $old[
'latest_end']);
1340 switch ($ref_data[
'time_target'][
'timing_type']) {
1356 $items->update($ref_data[
'ref_id']);
1367 if (!isset($a_object_data[
'references']) or !count($a_object_data[
'references'])) {
1371 $original_id =
$source->getRefId();
1373 foreach ($a_object_data[
'references'] as $ref_data) {
1374 $new_ref_id = $ref_id = $original_id;
1375 if ($tree->getParentId($original_id) != $ref_data[
'parent_id']) {
1377 $new_ref_id =
$source->createReference();
1378 $source->putInTree($ref_data[
'parent_id']);
1379 $source->setPermissions($ref_data[
'parent_id']);
1381 if (isset($ref_data[
'time_target']) ) {
1382 include_once(
'./webservice/soap/classes/class.ilObjectXMLWriter.php');
1383 include_once(
'./Services/Object/classes/class.ilObjectActivation.php');
1385 if (!isset($ref_data[
'time_target'][
'starting_time'])) {
1386 $ref_data[
'time_target'][
'starting_time'] =
time();
1388 if (!isset($ref_data[
'time_target'][
'ending_time'])) {
1389 $ref_data[
'time_target'][
'ending_time'] =
time();
1393 $items->toggleChangeable($ref_data[
'time_target'][
'changeable']);
1394 $items->setTimingStart($ref_data[
'time_target'][
'starting_time']);
1395 $items->setTimingEnd($ref_data[
'time_target'][
'ending_time']);
1396 $items->toggleVisible($ref_data[
'time_target'][
'timing_visibility']);
1397 $items->setSuggestionStart($ref_data[
'time_target'][
'suggestion_start']);
1398 $items->setSuggestionEnd($ref_data[
'time_target'][
'suggestion_end']);
1399 $items->setEarliestStart($ref_data[
'time_target'][
'earliest_start']);
1400 $items->setLatestEnd($ref_data[
'time_target'][
'latest_end']);
1402 switch ($ref_data[
'time_target'][
'timing_type']) {
1418 $items->update($new_ref_id);
static removeItemFromDesktops($a_id)
removes object from all user's desktops public
updateObjects($sid, $a_xml)
XML Writer for XMLResultSet.
Parses result XML from lucene search highlight.
static _hasUntrashedReference($a_obj_id)
checks wether an object has at least one reference that is not in trash
getRefIdsByObjId($sid, $obj_id)
static _exists($a_id, $a_reference=false, $a_type=null)
checks if an object exists in object_data
searchObjects($sid, $types, $key, $combination, $user_id)
getRefIdsByImportId($sid, $import_id)
deleteObject($sid, $reference_id)
static getInstance(ilLuceneQueryParser $qp)
Get singleton instance.
static getItem($a_ref_id)
Get item data.
const TIMINGS_DEACTIVATED
static _isInTrash($a_ref_id)
checks wether object is in trash
static _lookupId($a_user_str)
Lookup id by login.
getObjectByReference($sid, $a_ref_id, $user_id)
SaxParserException thrown by ilSaxParser if property throwException is set.
moveObject($sid, $ref_id, $target_id)
Exception class for ObjectXMLWriter and ObjectXMLParser.
updateReferences($a_object_data)
static _getAllReferences($a_id)
get all reference ids of object
getXMLTree($sid, $ref_id, $types, $user_id)
static _lookupObjectId($a_ref_id)
lookup object id
static _getInstance($a_copy_id)
Get instance of copy wizard options.
const TIMING_TEMPORARILY_AVAILABLE
static getInstance($a_user_id)
foreach($_POST as $key=> $value) $res
static _lookupObjId($a_id)
__raiseError($a_message, $a_code)
static _allocateCopyId()
Allocate a copy for further entries.
const IL_CRS_ADMIN
Base class for course and group participants.
static getTypeByRefId($a_ref_id, $stop_on_error=true)
get object type by reference id
addReference($sid, $a_source_id, $a_target_id)
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
static getInstance()
Get singleton instance.
getPathForRefId($sid, $ref_id)
getTreeChilds($sid, $ref_id, $types, $user_id)
static _adjustMovedObjectConditions($a_ref_id)
In the moment it is not allowed to create preconditions on objects that are located outside of a cour...
getObjIdsByRefIds($sid, $ref_ids)
Returns a array of object ids which match the references id, given by a comma seperated string...
initAuth($sid)
Init authentication.
getObjectsByTitle($sid, $a_title, $user_id)
static getInstanceByRefId($a_ref_id, $stop_on_error=true)
get an instance of an Ilias object by reference id
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
getObjIdByImportId($sid, $import_id)
copyObject($sid, $copy_settings_xml)
copy object in repository $sid session id $settings_xml contains copy wizard settings following ilias...
addReferences($source, $a_object_data)
Class ilObjectActivation.
canAddType($type, $target_type, $target_id)
validateReferences($a_action, $a_object_data, $a_target_id=0)
static _lookupObjIdByImportId($a_import_id)
if(!isset($_REQUEST['ReturnTo'])) if(!isset($_REQUEST['AuthId'])) $options
removeFromSystemByImportId($sid, $import_id)