57 public function __construct($a_mode,$a_obj_type =
'',$a_obj_id =
'')
62 $this->mode = $a_mode;
63 $this->obj_type = $a_obj_type;
64 $this->obj_id = $a_obj_id;
87 $this->search_values = $a_values;
114 case self::MODE_EDITOR:
117 case self::MODE_SEARCH:
120 case self::MODE_INFO:
124 die(
'Not implemented yet');
136 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
137 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
143 foreach(
$_POST[
'md'] as $field_id => $value)
146 switch($def->getFieldType())
150 if(is_array($value) and
$_POST[
'md_activated'][$field_id])
152 $dt[
'year'] = (int) $value[
'date'][
'y'];
153 $dt[
'mon'] = (int) $value[
'date'][
'm'];
154 $dt[
'mday'] = (int) $value[
'date'][
'd'];
155 $dt[
'hours'] = (int) 0;
156 $dt[
'minutes'] = (int) 0;
157 $dt[
'seconds'] = (int) 0;
169 if(is_array($value) and
$_POST[
'md_activated'][$field_id])
171 $dt[
'year'] = (int) $value[
'date'][
'y'];
172 $dt[
'mon'] = (int) $value[
'date'][
'm'];
173 $dt[
'mday'] = (int) $value[
'date'][
'd'];
174 $dt[
'hours'] = (int) $value[
'time'][
'h'];
175 $dt[
'minutes'] = (int) $value[
'time'][
'm'];
176 $dt[
'seconds'] = (int) 0;
191 $val->setValue($value);
192 $this->values[] = $val;
207 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
208 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
224 if(!
$_POST[
'md_activated'][$start_id])
231 $end = $end + (60 * 60 *
$_POST[
'ecs_duration'][
'hh']) + (60 *
$_POST[
'ecs_duration'][
'mm']);
234 $val->setValue($end);
235 $this->values[] = $val;
247 foreach($this->values as $value)
264 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
268 $section->setTitle($record_obj->getTitle());
269 $section->setInfo($record_obj->getDescription());
272 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
280 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
283 switch($def->getFieldType())
286 $text =
new ilTextInputGUI($def->getTitle(),
'md['.$def->getFieldId().
']');
287 $text->setValue($value->getValue());
289 $text->setMaxLength(512);
290 $text->setDisabled($value->isDisabled());
291 $text->setInfo($def->getDescription());
292 $this->form->addItem($text);
296 $select =
new ilSelectInputGUI($def->getTitle(),
'md['.$def->getFieldId().
']');
297 $select->setOptions($def->getFieldValuesForSelect());
298 $select->setValue($value->getValue());
299 $select->setDisabled($value->isDisabled());
300 $select->setInfo($def->getDescription());
302 $this->form->addItem($select);
307 $unixtime = $value->getValue() ? $value->getValue() : mktime(8,0,0,date(
'm'),date(
'd'),date(
'Y'));
310 $time->setShowTime(
false);
312 $time->enableDateActivation($this->lng->txt(
'enabled'),
313 'md_activated['.$def->getFieldId().
']',
314 $value->getValue() ?
true :
false);
315 $time->setDisabled($value->isDisabled());
316 $time->setInfo($def->getDescription());
317 $this->form->addItem($time);
322 $unixtime = $value->getValue() ? $value->getValue() : mktime(8,0,0,date(
'm'),date(
'd'),date(
'Y'));
325 $time->setShowTime(
true);
327 $time->enableDateActivation($this->lng->txt(
'enabled'),
328 'md_activated['.$def->getFieldId().
']',
329 $value->getValue() ?
true :
false);
330 $time->setDisabled($value->isDisabled());
331 $this->form->addItem($time);
347 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
351 $section->setTitle($record->getTitle());
356 if(!$field->isSearchable())
360 switch($field->getFieldType())
365 $group->setValue(isset($this->search_values[
'boolean'][$field->getFieldId()]) ?
366 $this->search_values[
'boolean'][$field->getFieldId()] : 0);
367 $radio_option =
new ilRadioOption($this->lng->txt(
"search_any_word"),0);
369 $group->addOption($radio_option);
370 $radio_option =
new ilRadioOption($this->lng->txt(
"search_all_words"),1);
372 $group->addOption($radio_option);
374 $text =
new ilTextInputGUI($field->getTitle(),$field->getFieldId());
375 $text->
setValue(isset($this->search_values[$field->getFieldId()]) ?
376 $this->search_values[$field->getFieldId()] :
379 $text->setMaxLength(255);
382 $text->addSubItem($group);
383 $this->form->addItem($text);
388 $select->
setValue(isset($this->search_values[$field->getFieldId()]) ?
389 $this->search_values[$field->getFieldId()] :
391 $options = array(0 => $this->lng->txt(
'search_any'));
393 foreach($field->getFieldValues() as $key => $value)
395 $options[$counter++] = $value;
397 $select->setOptions($options);
398 $this->form->addItem($select);
405 $check->setChecked(isset($this->search_values[$field->getFieldId()]) ?
406 $this->search_values[$field->getFieldId()] : 0);
408 $time =
new ilDateTimeInputGUI($this->lng->txt(
'from'),
'date_start['.$field->getFieldId().
']');
411 $time->setShowTime(
false);
415 $time->setShowTime(
true);
417 if(isset($this->search_values[
'date_start'][$field->getFieldId()]) and 0)
419 #$time->setUnixTime($this->toUnixTime($this->search_values['date_start'][$field->getFieldId()]['date'],$this->search_values['date_start'][$field->getFieldId()]['time']));
425 $check->addSubItem($time);
427 $time =
new ilDateTimeInputGUI($this->lng->txt(
'until'),
'date_end['.$field->getFieldId().
']');
430 $time->setShowTime(
false);
434 $time->setShowTime(
true);
436 if(isset($this->search_values[
'date_end'][$field->getFieldId()]) and 0)
438 #$time->setUnixTime($this->toUnixTime($this->search_values['date_end'][$field->getFieldId()]['date'],$this->search_values['date_end'][$field->getFieldId()]['time']));
444 $check->addSubItem($time);
446 $this->form->addItem($check);
455 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
458 $this->info->addSection($record_obj->getTitle());
460 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
463 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
466 switch($def->getFieldType())
469 if($value->getValue())
471 $this->info->addProperty($def->getTitle(),$value->getValue());
476 if($value->getValue())
478 $this->info->addProperty($def->getTitle(),$value->getValue());
483 if($value->getValue())
489 if($value->getValue())
509 return mktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
521 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
522 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
525 ($this->obj_type !=
'crs' and $this->obj_type !=
'rcrs')
564 $this->lng->loadLanguageModule(
'ecs');
566 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
569 $unixtime = $value_start->getValue() ? $value_start->getValue() : mktime(8,0,0,date(
'm'),date(
'd'),date(
'Y'));
571 $time =
new ilDateTimeInputGUI($this->lng->txt(
'ecs_event_appointment'),
'md['.$def->getFieldId().
']');
572 $time->setShowTime(
true);
574 $time->enableDateActivation($this->lng->txt(
'enabled'),
575 'md_activated['.$def->getFieldId().
']',
576 $value_start->getValue() ?
true :
false);
577 $time->setDisabled($value_start->isDisabled());
580 if($field_id = $mapping->getMappingByECSName(
'end'))
584 list($hours,$minutes) = $this->
parseDuration($value_start->getValue(),$value_end->getValue());
588 $duration->setMinutes($minutes);
589 #$duration->setInfo($this->lng->txt('ecs_duration_info'));
590 $duration->setShowHours(
true);
591 $duration->setShowMinutes(
true);
592 $time->addSubItem($duration);
595 if($field_id = $mapping->getMappingByECSName(
'cycle'))
599 switch($cycle_def->getFieldType())
602 $text =
new ilTextInputGUI($cycle_def->getTitle(),
'md['.$cycle_def->getFieldId().
']');
603 $text->setValue($value->getValue());
605 $text->setMaxLength(512);
606 $text->setDisabled($value->isDisabled());
607 $time->addSubItem($text);
611 $select =
new ilSelectInputGUI($cycle_def->getTitle(),
'md['.$cycle_def->getFieldId().
']');
612 $select->setOptions($cycle_def->getFieldValuesForSelect());
613 $select->setValue($value->getValue());
614 $select->setDisabled($value->isDisabled());
615 $time->addSubItem($select);
619 if($field_id = $mapping->getMappingByECSName(
'room'))
623 switch($room_def->getFieldType())
626 $text =
new ilTextInputGUI($room_def->getTitle(),
'md['.$room_def->getFieldId().
']');
627 $text->setValue($value->getValue());
629 $text->setMaxLength(512);
630 $text->setDisabled($value->isDisabled());
631 $time->addSubItem($text);
635 $select =
new ilSelectInputGUI($room_def->getTitle(),
'md['.$room_def->getFieldId().
']');
636 $select->setOptions($cycle_def->getFieldValuesForSelect());
637 $select->setValue($value->getValue());
638 $select->setDisabled($value->isDisabled());
639 $time->addSubItem($select);
643 $this->form->addItem($time);
655 if($u_start >= $u_end)
659 $diff = $u_end - $u_start;
660 $hours = (int) ($diff / (60 * 60));
661 $min = (int) (($diff % 3600) / 60);
662 return array($hours,$min);