24 include_once
'./Services/Calendar/classes/class.ilDate.php';
69 $this->mapping_id = $a_mapping_id;
82 $this->mapping_id = $a_id;
101 $this->container_id = $a_id;
120 $this->range_dt_start = $start;
129 return $this->range_dt_start ? $this->range_dt_start :
new ilDate(time(),
IL_CAL_UNIX);
139 $this->range_dt_end = $end;
148 if($this->range_dt_end)
164 $this->field_name = $a_field;
183 $this->mapping_type = $a_type;
202 $this->mapping_value = $a_value;
230 $this->by_type = $a_type;
246 public function delete()
248 $sta = $this->db->manipulateF(
'DELETE FROM ecs_container_mapping WHERE mapping_id = %s ',
269 $sta = $this->db->manipulateF(
270 'UPDATE ecs_container_mapping SET '.
271 'container_id = %s, '.
273 'mapping_type = %s, '.
274 'mapping_value = %s, '.
275 'date_range_start = %s,'.
276 'date_range_end = %s '.
277 'WHERE mapping_id = %s',
278 array(
'integer',
'text',
'integer',
'text',
'integer',
'integer',
'integer'),
307 $mapping_id = $ilDB->nextId(
'ecs_container_mapping');
308 $sta = $this->db->manipulateF(
309 'INSERT INTO ecs_container_mapping '.
310 '(mapping_id,container_id,field_name,mapping_type,mapping_value,date_range_start,date_range_end) '.
311 'VALUES(%s,%s,%s,%s,%s,%s,%s) ',
312 array(
'integer',
'integer',
'text',
'integer',
'text',
'integer',
'integer'),
368 case self::TYPE_FIXED:
376 case self::TYPE_DURATION:
377 include_once
'./Services/Calendar/classes/class.ilDatePresentation.php';
382 case self::TYPE_BY_TYPE:
383 return $lng->txt(
'type').
': '.$lng->txt(
'obj_'.$this->
getByType());
394 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
399 foreach($part as $part_id)
403 $part_string .=
', ';
407 $part_id_arr = explode(
'_', $part_id);
410 $part_string .= $name;
414 $part_string .= $part_id;
426 public function matches(array $a_matchable_content)
449 case self::ATTR_ARRAY:
450 $values = explode(
',',$a_value);
451 $ilLog->write(__METHOD__.
': Checking for value: '. $a_value);
452 $ilLog->write(__METHOD__.
': Checking against attribute values: '. $this->getMappingValue());
456 $ilLog->write(__METHOD__.
': Checking for value: '. $a_value);
457 $ilLog->write(__METHOD__.
': Checking against attribute values: '. $this->getMappingValue());
458 $values = array($a_value);
461 case self::ATTR_STRING:
462 $values = array($a_value);
465 $values = explode(
',',$a_value);
467 foreach($values as $value)
469 $value = trim($value);
472 case self::TYPE_FIXED:
476 $attribute_value = trim($attribute_value);
477 if(strcasecmp($attribute_value,$value) == 0)
484 case self::TYPE_DURATION:
485 include_once
'./Services/Calendar/classes/class.ilDateTime.php';
504 $res = $this->db->queryF(
'SELECT * FROM ecs_container_mapping WHERE mapping_id = %s',
508 while(
$row = $this->db->fetchObject(
$res))