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) {
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'),
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;
407 public function matches(array $a_matchable_content)
409 if (isset($a_matchable_content[$this->
getFieldName()])) {
429 $values = explode(
',', $a_value);
430 $ilLog->write(__METHOD__ .
': Checking for value: ' . $a_value);
435 $ilLog->write(__METHOD__ .
': Checking for value: ' . $a_value);
437 $values = array($a_value);
441 $values = array($a_value);
444 $values = explode(
',', $a_value);
446 foreach ($values as $value) {
447 $value = trim($value);
452 $attribute_value = trim($attribute_value);
453 if (strcasecmp($attribute_value, $value) == 0) {
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)) {
An exception for terminatinating execution or to throw for unit testing.
static formatPeriod(ilDateTime $start, ilDateTime $end, $a_skip_starting_day=false)
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
foreach($_POST as $key=> $value) $res