24include_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'),
377 include_once
'./Services/Calendar/classes/class.ilDatePresentation.php';
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)
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);
462 $values = array($a_value);
465 $values = explode(
',',$a_value);
467 foreach($values as $value)
469 $value = trim($value);
476 $attribute_value = trim($attribute_value);
477 if(strcasecmp($attribute_value,$value) == 0)
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))
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
static _after(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is after end This method does not consider tz offsets.
static _before(ilDateTime $start, ilDateTime $end, $a_compare_field='', $a_tz='')
compare two dates and check start is before end This method does not consider tz offsets.
Defines a rule for the assignment of ECS remote courses to categories.
setFieldName($a_field)
set field name
matchesValue($a_value, $a_type)
Check if value matches.
getFieldName()
get field name
getMappingValue()
get mapping value
setMappingId($a_id)
set mapping id
participantsToString()
get strong presentation of participants
getMappingId()
get mapping id
getByType()
get mapping by type
setDateRangeStart($start)
set date range start
getDateRangeEnd()
get date range end
conditionToString()
condition to string
getDateRangeStart()
get date range start
setByType($a_type)
set mapping by type
const ERR_MISSING_BY_TYPE
setMappingValue($a_value)
set mapping value
setDateRangeEnd($end)
set date range end
getContainerId()
get container id
setContainerId($a_id)
set container id
__construct($a_mapping_id=0)
Constructor.
setMappingType($a_type)
set mapping type
matches(array $a_matchable_content)
Check if rule matches a specific econtent.
getMappingAsArray()
get mapping values as array
getMappingType()
get mapping type
static lookupParticipantName($a_owner, $a_server_id)
Lookup participant name.
static _lookupObjId($a_id)
static _lookupType($a_id, $a_reference=false)
lookup object type