43 public function __construct($a_mode,$a_obj_type =
'',$a_obj_id =
'', $a_sub_type =
'', $a_sub_id =
'')
48 $this->mode = $a_mode;
49 $this->obj_type = $a_obj_type;
50 $this->obj_id = $a_obj_id;
51 $this->sub_type = $a_sub_type;
52 $this->sub_id = $a_sub_id;
75 $this->search_values = $a_values;
98 $this->selected_only = $a_val;
108 return $this->selected_only;
122 case self::MODE_EDITOR:
125 case self::MODE_SEARCH:
128 case self::MODE_INFO:
131 case self::MODE_REC_SELECTION:
134 case self::MODE_FILTER:
137 case self::MODE_TABLE_HEAD:
140 case self::MODE_TABLE_CELLS:
144 die(
'Not implemented yet');
156 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
157 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
163 foreach(
$_POST[
'md'] as $field_id => $value)
166 switch($def->getFieldType())
170 if(is_array($value) and
$_POST[
'md_activated'][$field_id])
172 $dt[
'year'] = (int) $value[
'date'][
'y'];
173 $dt[
'mon'] = (int) $value[
'date'][
'm'];
174 $dt[
'mday'] = (int) $value[
'date'][
'd'];
175 $dt[
'hours'] = (int) 0;
176 $dt[
'minutes'] = (int) 0;
177 $dt[
'seconds'] = (int) 0;
189 if(is_array($value) and
$_POST[
'md_activated'][$field_id])
191 $dt[
'year'] = (int) $value[
'date'][
'y'];
192 $dt[
'mon'] = (int) $value[
'date'][
'm'];
193 $dt[
'mday'] = (int) $value[
'date'][
'd'];
194 $dt[
'hours'] = (int) $value[
'time'][
'h'];
195 $dt[
'minutes'] = (int) $value[
'time'][
'm'];
196 $dt[
'seconds'] = (int) 0;
211 $val->setValue($value);
212 $this->values[] = $val;
227 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
228 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
244 if(!
$_POST[
'md_activated'][$start_id])
251 $end = $end + (60 * 60 *
$_POST[
'ecs_duration'][
'hh']) + (60 *
$_POST[
'ecs_duration'][
'mm']);
254 $val->setValue($end);
255 $this->values[] = $val;
267 foreach($this->values as $value)
284 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
294 foreach($recs as $record_obj)
297 $section->setTitle($record_obj->getTitle());
298 $section->setInfo($record_obj->getDescription());
301 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
309 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
312 switch($def->getFieldType())
315 $text =
new ilTextInputGUI($def->getTitle(),
'md['.$def->getFieldId().
']');
316 $text->setValue($value->getValue());
318 $text->setMaxLength(512);
319 $text->setDisabled($value->isDisabled());
320 $text->setInfo($def->getDescription());
321 $this->form->addItem($text);
325 $select =
new ilSelectInputGUI($def->getTitle(),
'md['.$def->getFieldId().
']');
326 $select->setOptions($def->getFieldValuesForSelect());
327 $select->setValue($value->getValue());
328 $select->setDisabled($value->isDisabled());
329 $select->setInfo($def->getDescription());
331 $this->form->addItem($select);
336 $unixtime = $value->getValue() ? $value->getValue() : mktime(8,0,0,date(
'm'),date(
'd'),date(
'Y'));
339 $time->setShowTime(
false);
340 $time->setStartYear(1901);
342 $time->enableDateActivation($this->lng->txt(
'enabled'),
343 'md_activated['.$def->getFieldId().
']',
344 $value->getValue() ? true :
false);
345 $time->setDisabled($value->isDisabled());
346 $time->setInfo($def->getDescription());
347 $this->form->addItem($time);
352 $unixtime = $value->getValue() ? $value->getValue() : mktime(8,0,0,date(
'm'),date(
'd'),date(
'Y'));
355 $time->setShowTime(
true);
357 $time->enableDateActivation($this->lng->txt(
'enabled'),
358 'md_activated['.$def->getFieldId().
']',
359 $value->getValue() ? true :
false);
360 $time->setDisabled($value->isDisabled());
361 $this->form->addItem($time);
377 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
381 $section->setTitle($record->getTitle());
386 if(!$field->isSearchable())
390 switch($field->getFieldType())
395 $group->setValue(isset($this->search_values[
'boolean'][$field->getFieldId()]) ?
396 $this->search_values[
'boolean'][$field->getFieldId()] : 0);
397 $radio_option =
new ilRadioOption($this->lng->txt(
"search_any_word"),0);
399 $group->addOption($radio_option);
400 $radio_option =
new ilRadioOption($this->lng->txt(
"search_all_words"),1);
402 $group->addOption($radio_option);
404 $text =
new ilTextInputGUI($field->getTitle(),$field->getFieldId());
405 $text->
setValue(isset($this->search_values[$field->getFieldId()]) ?
406 $this->search_values[$field->getFieldId()] :
409 $text->setMaxLength(255);
412 $text->addSubItem($group);
413 $this->form->addItem($text);
418 $select->
setValue(isset($this->search_values[$field->getFieldId()]) ?
419 $this->search_values[$field->getFieldId()] :
421 $options = array(0 => $this->lng->txt(
'search_any'));
423 foreach($field->getFieldValues() as $key => $value)
428 $this->form->addItem($select);
435 $check->setChecked(isset($this->search_values[$field->getFieldId()]) ?
436 $this->search_values[$field->getFieldId()] : 0);
438 $time =
new ilDateTimeInputGUI($this->lng->txt(
'from'),
'date_start['.$field->getFieldId().
']');
441 $time->setShowTime(
false);
445 $time->setShowTime(
true);
447 if(isset($this->search_values[
'date_start'][$field->getFieldId()]) and 0)
449 #$time->setUnixTime($this->toUnixTime($this->search_values['date_start'][$field->getFieldId()]['date'],$this->search_values['date_start'][$field->getFieldId()]['time'])); 455 $check->addSubItem($time);
457 $time =
new ilDateTimeInputGUI($this->lng->txt(
'until'),
'date_end['.$field->getFieldId().
']');
460 $time->setShowTime(
false);
464 $time->setShowTime(
true);
466 if(isset($this->search_values[
'date_end'][$field->getFieldId()]) and 0)
468 #$time->setUnixTime($this->toUnixTime($this->search_values['date_end'][$field->getFieldId()]['date'],$this->search_values['date_end'][$field->getFieldId()]['time'])); 474 $check->addSubItem($time);
476 $this->form->addItem($check);
485 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
488 $this->info->addSection($record_obj->getTitle());
490 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
493 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
496 switch($def->getFieldType())
499 if($value->getValue())
501 $this->info->addProperty($def->getTitle(),$value->getValue());
506 if($value->getValue())
508 $this->info->addProperty($def->getTitle(),$value->getValue());
513 if($value->getValue())
519 if($value->getValue())
539 return mktime($time[
'h'],$time[
'm'],0,$date[
'm'],$date[
'd'],$date[
'y']);
551 include_once(
'./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
552 include_once(
'./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
555 ($this->obj_type !=
'crs' and $this->obj_type !=
'rcrs')
594 $this->lng->loadLanguageModule(
'ecs');
596 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
599 $unixtime = $value_start->getValue() ? $value_start->getValue() : mktime(8,0,0,date(
'm'),date(
'd'),date(
'Y'));
601 $time =
new ilDateTimeInputGUI($this->lng->txt(
'ecs_event_appointment'),
'md['.$def->getFieldId().
']');
602 $time->setShowTime(
true);
604 $time->enableDateActivation($this->lng->txt(
'enabled'),
605 'md_activated['.$def->getFieldId().
']',
606 $value_start->getValue() ? true :
false);
607 $time->setDisabled($value_start->isDisabled());
610 if($field_id = $mapping->getMappingByECSName(
'end'))
614 list($hours,$minutes) = $this->
parseDuration($value_start->getValue(),$value_end->getValue());
618 $duration->setMinutes($minutes);
619 #$duration->setInfo($this->lng->txt('ecs_duration_info')); 620 $duration->setShowHours(
true);
621 $duration->setShowMinutes(
true);
622 $time->addSubItem($duration);
625 if($field_id = $mapping->getMappingByECSName(
'cycle'))
629 switch($cycle_def->getFieldType())
632 $text =
new ilTextInputGUI($cycle_def->getTitle(),
'md['.$cycle_def->getFieldId().
']');
633 $text->setValue($value->getValue());
635 $text->setMaxLength(512);
636 $text->setDisabled($value->isDisabled());
637 $time->addSubItem($text);
641 $select =
new ilSelectInputGUI($cycle_def->getTitle(),
'md['.$cycle_def->getFieldId().
']');
642 $select->setOptions($cycle_def->getFieldValuesForSelect());
643 $select->setValue($value->getValue());
644 $select->setDisabled($value->isDisabled());
645 $time->addSubItem($select);
649 if($field_id = $mapping->getMappingByECSName(
'room'))
653 switch($room_def->getFieldType())
656 $text =
new ilTextInputGUI($room_def->getTitle(),
'md['.$room_def->getFieldId().
']');
657 $text->setValue($value->getValue());
659 $text->setMaxLength(512);
660 $text->setDisabled($value->isDisabled());
661 $time->addSubItem($text);
665 $select =
new ilSelectInputGUI($room_def->getTitle(),
'md['.$room_def->getFieldId().
']');
666 $select->setOptions($cycle_def->getFieldValuesForSelect());
667 $select->setValue($value->getValue());
668 $select->setDisabled($value->isDisabled());
669 $time->addSubItem($select);
673 $this->form->addItem($time);
685 if($u_start >= $u_end)
689 $diff = $u_end - $u_start;
690 $hours = (int) ($diff / (60 * 60));
691 $min = (int) (($diff % 3600) / 60);
692 return array($hours,$min);
705 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
714 $sec_tit = ($a_sec_head ==
"")
715 ? $this->lng->txt(
"meta_adv_records")
723 $cb->
setInfo($record_obj->getDescription());
724 $cb->setValue($record_obj->getRecordId());
725 if (in_array($record_obj->getRecordId(), $selected))
727 $cb->setChecked(
true);
729 $this->form->addItem($cb);
742 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
753 $this->table_gui = $a_val;
763 return $this->table_gui;
773 $this->row_data = $a_val;
783 return $this->row_data;
796 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
805 foreach($recs as $record_obj)
807 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
815 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
817 switch($def->getFieldType())
820 $text =
new ilTextInputGUI($def->getTitle(),
'md_'.$def->getFieldId());
822 $text->setMaxLength(512);
823 $text->setSubmitFormOnEnter(
true);
824 $this->table_gui->addFilterItem($text);
825 $text->readFromSession();
826 $this->table_gui->filter[
'md_'.$def->getFieldId()] = $text->getValue();
830 include_once(
"./Services/Form/classes/class.ilSelectInputGUI.php");
832 $select->
setOptions($def->getFieldValuesForSelect());
833 $this->table_gui->addFilterItem($select);
834 $select->readFromSession();
835 $this->table_gui->filter[
'md_'.$def->getFieldId()] = $select->getValue();
839 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
840 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
843 $item->addCombinationItem(
"from", $combi_item, $this->lng->txt(
"from"));
845 $item->addCombinationItem(
"to", $combi_item, $this->lng->txt(
"to"));
848 $this->table_gui->addFilterItem($item);
849 $item->readFromSession();
850 $this->table_gui->filter[
'md_'.$def->getFieldId()] = $item->getValue();
854 include_once(
"./Services/Form/classes/class.ilCombinationInputGUI.php");
855 include_once(
"./Services/Form/classes/class.ilDateTimeInputGUI.php");
858 $combi_item->setShowTime(
true);
861 $combi_item->setShowTime(
true);
865 $this->table_gui->addFilterItem($item);
866 $item->readFromSession();
867 $this->table_gui->filter[
'md_'.$def->getFieldId()] = $item->getValue();
881 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
890 foreach($recs as $record_obj)
892 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
900 $this->table_gui->addColumn($def->getTitle(),
'md_'.$def->getFieldId());
916 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
925 foreach($recs as $record_obj)
927 include_once(
'Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
935 $html.=
"<td class='std'>".$data[
'md_'.$def->getFieldId()].
"</td>";
parseDuration($u_start, $u_end)
parse hours and minutes from duration
setTableGUI($a_val)
Set table.
static _getDefinitionsByRecordId($a_record_id)
get definitions
This class represents an option in a radio group.
parseTableCells()
Parse table cells.
const MAPPING_IMPORT_RCRS
toUnixTime($date, $time=array())
convert input array to unix time
setPropertyForm($form)
set property form object
static getInstance()
Get singleton instance.
handleECSDefinitions($a_definition)
handle ecs definitions
getRowData()
Get row data.
parseRecordSelection($a_sec_head="")
Parse property form in editor mode.
parseTableHead()
Parse property for table head.
static _getActiveSearchableRecords()
Get active searchable records.
loadECSDurationPost()
load ecs duration post
static _getActivatedRecordsByObjectType($a_obj_type, $a_sub_type="")
Get activated records by object type.
static _getInstanceByFieldId($a_field_id)
Get instance by field_id.
getSelectedOnly()
Get selected only flag.
setValue($a_value)
Set Value.
setInfoObject($info)
get info sections
if(!is_array($argv)) $options
__construct($a_mode, $a_obj_type='', $a_obj_id='', $a_sub_type='', $a_sub_id='')
Constructor.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
static formatDate(ilDateTime $date)
Format a date public.
static _getSelectedRecordsByObject($a_obj_type, $a_obj_id, $a_sub_type="")
Get selected records by object.
setSearchValues($a_values)
Set values for search form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
parseFilter()
Parse property for filter (table)
static _getInstance($a_obj_id, $a_field_id, $a_sub_type="", $a_sub_id=0)
Get instance.
static stripSlashesArray($a_arr, $a_strip_html=true, $a_allow="")
Strip slashes from array.
showECSStart($def)
Show special form for ecs start.
setRowData($a_val)
Set row data.
while($lm_rec=$ilDB->fetchAssoc($lm_set)) $data
loadFromPost()
Load values from post.
parseEditor()
Parse property form in editor mode.
static _getInstance()
Get Singleton instance.
setValue($a_value)
Set Value.
static saveObjRecSelection($a_obj_id, $a_sub_type="", $a_records)
Save repository object record selection.
parseSearch()
Parse search.
saveSelection()
Save selection per object.
static getObjRecSelection($a_obj_id, $a_sub_type="")
Get repository object record selection.
setSelectedOnly($a_val)
Set selected only flag.