4 include_once
'./Services/WebServices/ECS/classes/Mapping/class.ilECSNodeMappingAssignment.php';
26 $query =
'SELECT ref_id FROM ecs_node_mapping_a ' .
27 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
28 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
29 'AND cs_root = ' .
$ilDB->quote($a_tree_id,
'integer') .
' ' .
46 public static function lookupSettings($a_server_id, $a_mid, $a_tree_id, $a_node_id)
52 $query =
'SELECT title_update, position_update, tree_update FROM ecs_node_mapping_a ' .
53 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
54 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
55 'AND cs_root = ' .
$ilDB->quote($a_tree_id,
'integer') .
' ' .
56 'AND cs_id = ' .
$ilDB->quote($a_node_id,
'integer');
59 if (!
$res->numRows()) {
65 $settings[
'title_update'] =
$row->title_update;
66 $settings[
'position_update'] =
$row->position_update;
67 $settings[
'tree_update'] =
$row->tree_update;
69 return (array) $settings;
85 $query =
'SELECT cs_id FROM ecs_node_mapping_a ' .
86 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
87 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
88 'AND cs_root = ' .
$ilDB->quote($a_tree_id,
'integer') .
' ' .
92 $assignments = array();
94 $assignments[] =
$row->cs_id;
109 $ilDB = $DIC[
'ilDB'];
111 $query =
'SELECT cs_id FROM ecs_node_mapping_a ' .
112 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
113 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
114 'AND cs_root = ' .
$ilDB->quote($a_tree_id,
'integer') .
' ' .
115 'AND ref_id = ' .
$ilDB->quote($a_ref_id,
'integer') .
' ';
118 $assignments = array();
120 $assignments[] =
$row->cs_id;
135 $ilDB = $DIC[
'ilDB'];
137 $query =
'SELECT depth FROM ecs_node_mapping_a ' .
138 'JOIN ecs_cms_tree ON (tree = cs_root AND child = cs_id) ' .
139 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
140 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
141 'AND cs_root = ' .
$ilDB->quote($a_tree_id,
'integer') .
' ';
144 return $row->depth == 1;
156 $ilDB = $DIC[
'ilDB'];
158 $query =
'SELECT title_update FROM ecs_node_mapping_a ' .
159 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
160 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
161 'AND cs_root = ' .
$ilDB->quote($a_tree_id,
'integer') .
' ' .
162 'AND cs_id = ' .
$ilDB->quote(0,
'integer') .
' ';
165 return (
bool)
$row->title_update;
183 $ilDB = $DIC[
'ilDB'];
185 $query =
'SELECT cs_id FROM ecs_node_mapping_a ' .
186 'WHERE server_id = ' .
$ilDB->quote($a_server_id,
'integer') .
' ' .
187 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
188 'AND cs_root = ' .
$ilDB->quote($a_tree_id,
'integer') .
' ' .
189 'AND ref_id = ' .
$ilDB->quote($a_ref_id,
'integer') .
' ';
194 $cs_ids[] =
$row->cs_id;
213 $ilDB = $DIC[
'ilDB'];
215 $query =
'DELETE FROM ecs_node_mapping_a ' .
216 'WHERE server_id = ' .
$ilDB->quote($a_server_id) .
' ' .
217 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
218 'AND cs_root = ' .
$ilDB->quote($a_tree_id,
'integer') .
' ' .
219 'AND ' .
$ilDB->in(
'cs_id', $cs_ids,
false,
'integer');
236 $ilDB = $DIC[
'ilDB'];
238 $query =
'DELETE FROM ecs_node_mapping_a ' .
239 'WHERE server_id = ' .
$ilDB->quote($a_server_id) .
' ' .
240 'AND mid = ' .
$ilDB->quote($a_mid,
'integer') .
' ' .
241 'AND cs_root = ' .
$ilDB->quote($a_tree_id,
'integer') .
' ';
256 $ilDB = $DIC[
'ilDB'];
258 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsTree.php';
259 include_once
'./Services/WebServices/ECS/classes/Tree/class.ilECSCmsData.php';
262 foreach (self::lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id) as $assignment) {
267 $toDelete[] = $assignment;
271 $toDelete[] = $assignment;
277 $toDelete[] = $assignment;
281 $toDelete[] = $assignment;
285 self::deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $toDelete);
const MAPPING_PENDING_DISCONNECTABLE
static lookupStatusByCmsId($a_server_id, $a_mid, $a_tree_id, $cms_id)
Lookup status.
static deleteMappings($a_server_id, $a_mid, $a_tree_id)
Delete mappings $ilDB $ilDB.
static lookupDefaultTitleUpdate($a_server_id, $a_mid, $a_tree_id)
Lookup default title update setting.
static isWholeTreeMapped($a_server_id, $a_mid, $a_tree_id)
Check if whole tree is mapped.
foreach($_POST as $key=> $value) $res
static deleteDisconnectableMappings($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
delete disconnectable mappings
static deleteMappingsByCsId($a_server_id, $a_mid, $a_tree_id, $cs_ids)
Delete mappings $ilDB.
static hasAssignments($a_server_id, $a_mid, $a_tree_id)
Check if there is any assignment for a cms tree.
static lookupAssignmentsByRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Lookup assignments.
static lookupAssignmentIds($a_server_id, $a_mid, $a_tree_id)
Lookup assignments $ilDB.
static lookupSettings($a_server_id, $a_mid, $a_tree_id, $a_node_id)
Lookup Settings.
static lookupMappedItemsForRefId($a_server_id, $a_mid, $a_tree_id, $a_ref_id)
Get cs ids for ref_id <type> $ilDB.
const MAPPING_PENDING_NOT_DISCONNECTABLE