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;
139 $this->range_dt_end = $end;
148 if($this->range_dt_end)
164 $this->field_name = $a_field;
202 $this->mapping_value = $a_value;
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'),
332 return self::ERR_INVALID_TYPE;
336 return self::ERR_INVALID_DATES;
340 return self::ERR_MISSING_VALUE;
345 return self::ERR_MISSING_VALUE;
349 return self::ERR_MISSING_BY_TYPE;
353 return self::ERR_MISSING_VALUE;
368 case self::TYPE_FIXED:
376 case self::TYPE_DURATION:
381 case self::TYPE_BY_TYPE:
382 return $lng->txt(
'type').
': '.$lng->txt(
'obj_'.$this->
getByType());
393 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
398 foreach($part as $part_id)
402 $part_string .=
', ';
406 $part_id_arr = explode(
'_', $part_id);
409 $part_string .= $name;
413 $part_string .= $part_id;
448 case self::ATTR_ARRAY:
449 $values = explode(
',',$a_value);
450 $ilLog->write(__METHOD__.
': Checking for value: '. $a_value);
451 $ilLog->write(__METHOD__.
': Checking against attribute values: '. $this->getMappingValue());
455 $ilLog->write(__METHOD__.
': Checking for value: '. $a_value);
456 $ilLog->write(__METHOD__.
': Checking against attribute values: '. $this->getMappingValue());
457 $values =
array($a_value);
460 case self::ATTR_STRING:
461 $values =
array($a_value);
464 $values = explode(
',',$a_value);
466 foreach($values as $value)
468 $value = trim($value);
471 case self::TYPE_FIXED:
475 $attribute_value = trim($attribute_value);
476 if(strcasecmp($attribute_value,$value) == 0)
483 case self::TYPE_DURATION:
484 include_once
'./Services/Calendar/classes/class.ilDateTime.php';
503 $res = $this->db->queryF(
'SELECT * FROM ecs_container_mapping WHERE mapping_id = %s',
507 while(
$row = $this->db->fetchObject(
$res))
getMappingValue()
get mapping value
static lookupParticipantName($a_owner, $a_server_id)
Lookup participant name.
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.
matchesValue($a_value, $a_type)
Check if value matches.
getFieldName()
get field name
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.
static formatPeriod(ilDateTime $start, ilDateTime $end)
Format a period of two date Shows: 14.
setContainerId($a_id)
set container id
Defines a rule for the assignment of ECS remote courses to categories.
getMappingAsArray()
get mapping values as array
matches(array $a_matchable_content)
Check if rule matches a specific econtent.
getContainerId()
get container id
setFieldName($a_field)
set field name
setByType($a_type)
set mapping by type
setDateRangeStart($start)
set date range start
setMappingId($a_id)
set mapping id
conditionToString()
condition to string
static _lookupObjId($a_id)
getByType()
get mapping by type
getMappingId()
get mapping id
participantsToString()
get strong presentation of participants
getDateRangeStart()
get date range start
getDateRangeEnd()
get date range end
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
setMappingValue($a_value)
set mapping value
setMappingType($a_type)
set mapping type
getMappingType()
get mapping type
const ERR_MISSING_BY_TYPE
Add data(end) time
Method that wraps PHPs time in order to allow simulations with the workflow.
setDateRangeEnd($end)
set date range end
__construct($a_mapping_id=0)
Constructor.