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) {
163 $this->field_name = $a_field;
201 $this->mapping_value = $a_value;
245 public function delete()
247 $sta = $this->db->manipulateF(
248 'DELETE FROM ecs_container_mapping WHERE mapping_id = %s ',
266 $sta = $this->db->manipulateF(
267 'UPDATE ecs_container_mapping SET ' .
268 'container_id = %s, ' .
269 'field_name = %s, ' .
270 'mapping_type = %s, ' .
271 'mapping_value = %s, ' .
272 'date_range_start = %s,' .
273 'date_range_end = %s ' .
274 'WHERE mapping_id = %s',
275 array(
'integer',
'text',
'integer',
'text',
'integer',
'integer',
'integer'),
301 $mapping_id = $ilDB->nextId(
'ecs_container_mapping');
302 $sta = $this->db->manipulateF(
303 'INSERT INTO ecs_container_mapping ' .
304 '(mapping_id,container_id,field_name,mapping_type,mapping_value,date_range_start,date_range_end) ' .
305 'VALUES(%s,%s,%s,%s,%s,%s,%s) ',
306 array(
'integer',
'integer',
'text',
'integer',
'text',
'integer',
'integer'),
325 return self::ERR_INVALID_TYPE;
328 return self::ERR_INVALID_DATES;
331 return self::ERR_MISSING_VALUE;
335 return self::ERR_MISSING_VALUE;
338 return self::ERR_MISSING_BY_TYPE;
341 return self::ERR_MISSING_VALUE;
355 case self::TYPE_FIXED:
362 case self::TYPE_DURATION:
368 case self::TYPE_BY_TYPE:
369 return $lng->txt(
'type') .
': ' . $lng->txt(
'obj_' . $this->
getByType());
380 include_once
'./Services/WebServices/ECS/classes/class.ilECSUtils.php';
385 foreach ($part as $part_id) {
387 $part_string .=
', ';
391 $part_id_arr = explode(
'_', $part_id);
393 $part_string .=
$name;
395 $part_string .= $part_id;
409 if (isset($a_matchable_content[$this->
getFieldName()])) {
428 case self::ATTR_ARRAY:
429 $values = explode(
',', $a_value);
430 $ilLog->write(__METHOD__ .
': Checking for value: ' . $a_value);
431 $ilLog->write(__METHOD__ .
': Checking against attribute values: ' . $this->
getMappingValue());
435 $ilLog->write(__METHOD__ .
': Checking for value: ' . $a_value);
436 $ilLog->write(__METHOD__ .
': Checking against attribute values: ' . $this->
getMappingValue());
437 $values =
array($a_value);
440 case self::ATTR_STRING:
441 $values =
array($a_value);
444 $values = explode(
',', $a_value);
446 foreach ($values as $value) {
447 $value = trim($value);
449 case self::TYPE_FIXED:
452 $attribute_value = trim($attribute_value);
453 if (strcasecmp($attribute_value, $value) == 0) {
459 case self::TYPE_DURATION:
460 include_once
'./Services/Calendar/classes/class.ilDateTime.php';
478 $res = $this->db->queryF(
479 'SELECT * FROM ecs_container_mapping WHERE mapping_id = %s',
483 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.
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
foreach($_POST as $key=> $value) $res
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
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
Format a period of two date Shows: 14.
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.