24 include_once
'./Services/WebServices/ECS/classes/class.ilECSCategoryMappingRule.php';
49 $res = $ilDB->query(
'SELECT mapping_id FROM ecs_container_mapping');
54 return $rules ? $rules : array();
68 if(is_null(self::$cached_active_rules))
72 foreach(self::$cached_active_rules as $rule)
74 if($rule->matches($a_matchable_content))
76 $ilLog->write(__METHOD__.
': Found assignment for field type: '.$rule->getFieldName());
77 return $rule->getContainerId();
79 $ilLog->write(__METHOD__.
': Category assignment failed for field: '.$rule->getFieldName());
82 $ilLog->write(__METHOD__.
': Using default container');
93 public static function handleUpdate($a_obj_id, $a_server_id, $a_matchable_content)
104 foreach($references as
$ref_id => $null)
106 if($tree->getParentId(
$ref_id) == $cat)
111 $ilLog->write(__METHOD__.
': Creating/Deleting references...');
112 include_once
'./Services/Object/classes/class.ilObjectFactory.php';
116 $ilLog->write(__METHOD__.
': Add new reference. STEP 1');
120 $new_ref_id = $obj_data->createReference();
121 $obj_data->putInTree($cat);
122 $obj_data->setPermissions($cat);
123 $ilLog->write(__METHOD__.
': Add new reference.');
127 foreach($references as
$ref_id => $null)
129 $parent = $tree->getParentId(
$ref_id);
134 if(!in_array($parent,$all_cats))
140 $to_delete->delete();
141 $ilLog->write(__METHOD__.
': Deleted deprecated reference.');
157 $res = $ilDB->query(
"SELECT container_id FROM ecs_container_mapping ");
160 $ref_ids[] =
$row->container_id;
162 return $ref_ids ? $ref_ids : array();
176 "community" => $lng->txt(
"ecs_field_community"),
177 "part_id" => $lng->txt(
"ecs_field_part_id"),
178 "type" => $lng->txt(
"type")
184 include_once(
'./Services/WebServices/ECS/classes/class.ilECSUtils.php');
186 foreach($course_fields as $field)
188 $options[$field] = $lng->txt(
"obj_rcrs").
" - ".$lng->txt(
"ecs_field_".$field);