ILIAS  Release_4_4_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilAdvancedMDRecordGUI Class Reference
+ Collaboration diagram for ilAdvancedMDRecordGUI:

Public Member Functions

 __construct ($a_mode, $a_obj_type= '', $a_obj_id= '', $a_sub_type= '', $a_sub_id= '')
 Constructor.
 setPropertyForm ($form)
 set property form object
 setSearchValues ($a_values)
 Set values for search form.
 setInfoObject ($info)
 get info sections
 setSelectedOnly ($a_val)
 Set selected only flag.
 getSelectedOnly ()
 Get selected only flag.
 parse ()
 Get HTML.
 loadFromPost ()
 Load values from post.
 saveValues ()
 Save values.
 parseRecordSelection ($a_sec_head="")
 Parse property form in editor mode.
 saveSelection ()
 Save selection per object.
 setTableGUI ($a_val)
 Set table.
 getTableGUI ()
 Get table.
 setRowData ($a_val)
 Set row data.
 getRowData ()
 Get row data.

Data Fields

const MODE_EDITOR = 1
const MODE_SEARCH = 2
const MODE_INFO = 3
const MODE_REC_SELECTION = 4
const MODE_FILTER = 5
const MODE_TABLE_HEAD = 6
const MODE_TABLE_CELLS = 7

Protected Member Functions

 loadECSDurationPost ()
 load ecs duration post
 parseDuration ($u_start, $u_end)
 parse hours and minutes from duration

Protected Attributes

 $lng

Private Member Functions

 parseEditor ()
 Parse property form in editor mode.
 parseSearch ()
 Parse search.
 parseInfoPage ()
 toUnixTime ($date, $time=array())
 convert input array to unix time
 handleECSDefinitions ($a_definition)
 handle ecs definitions
 showECSStart ($def)
 Show special form for ecs start.
 parseFilter ()
 Parse property for filter (table)
 parseTableHead ()
 Parse property for table head.
 parseTableCells ()
 Parse table cells.

Private Attributes

 $mode
 $obj_type
 $sub_type
 $obj_id
 $form
 $values = array()
 $search_values = array()

Detailed Description

Author
Stefan Meyer meyer.nosp@m.@lei.nosp@m.fos.c.nosp@m.om
Version
$Id$

Definition at line 14 of file class.ilAdvancedMDRecordGUI.php.

Constructor & Destructor Documentation

ilAdvancedMDRecordGUI::__construct (   $a_mode,
  $a_obj_type = '',
  $a_obj_id = '',
  $a_sub_type = '',
  $a_sub_id = '' 
)

Constructor.

public

Parameters
intmode either MODE_EDITOR or MODE_SEARCH
intobj_type

Definition at line 43 of file class.ilAdvancedMDRecordGUI.php.

References $lng.

{
global $lng;
$this->lng = $lng;
$this->mode = $a_mode;
$this->obj_type = $a_obj_type;
$this->obj_id = $a_obj_id;
$this->sub_type = $a_sub_type;
$this->sub_id = $a_sub_id;
}

Member Function Documentation

ilAdvancedMDRecordGUI::getRowData ( )

Get row data.

Returns
array assoc array of row data (containing md record data)

Definition at line 781 of file class.ilAdvancedMDRecordGUI.php.

Referenced by parseTableCells().

{
return $this->row_data;
}

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::getSelectedOnly ( )

Get selected only flag.

Returns
boolean retrieve only records, that are selected by the object

Definition at line 106 of file class.ilAdvancedMDRecordGUI.php.

Referenced by parseEditor(), parseFilter(), parseTableCells(), and parseTableHead().

{
return $this->selected_only;
}

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::getTableGUI ( )

Get table.

Returns
object table gui class

Definition at line 761 of file class.ilAdvancedMDRecordGUI.php.

{
return $this->table_gui;
}
ilAdvancedMDRecordGUI::handleECSDefinitions (   $a_definition)
private

handle ecs definitions

private

Parameters
objectilAdvMDFieldDefinition
Returns

Definition at line 549 of file class.ilAdvancedMDRecordGUI.php.

References ilECSServerSettings\getInstance().

Referenced by parseEditor(), parseFilter(), parseTableCells(), and parseTableHead().

{
include_once('./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
include_once('./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
if(ilECSServerSettings::getInstance()->activeServerExists() or
($this->obj_type != 'crs' and $this->obj_type != 'rcrs')
)
{
return false;
}
return false;
/*
$mapping = ilECSDataMappingSettings::_getInstance();
if($mapping->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'begin') == $a_definition->getFieldId())
{
$this->showECSStart($a_definition);
return true;
}
if($mapping->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'end') == $a_definition->getFieldId())
{
return true;
}
if($mapping->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'cycle') == $a_definition->getFieldId())
{
return true;
}
if($mapping->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'room') == $a_definition->getFieldId())
{
return true;
}
*/
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::loadECSDurationPost ( )
protected

load ecs duration post

protected

Parameters
@return

Definition at line 225 of file class.ilAdvancedMDRecordGUI.php.

References $_POST, ilAdvancedMDValue\_getInstance(), ilECSDataMappingSettings\_getInstance(), ilECSServerSettings\getInstance(), ilECSDataMappingSetting\MAPPING_IMPORT_RCRS, and toUnixTime().

Referenced by loadFromPost().

{
include_once('./Services/WebServices/ECS/classes/class.ilECSDataMappingSettings.php');
include_once('./Services/WebServices/ECS/classes/class.ilECSServerSettings.php');
if(!ilECSServerSettings::getInstance()->activeServerExists())
{
return false;
}
if(!$start_id = $mapping->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'begin'))
{
return false;
}
if(!$end_id = $mapping->getMappingByECSName(ilECSDataMappingSetting::MAPPING_IMPORT_RCRS, 'end'))
{
return false;
}
if(!$_POST['md_activated'][$start_id])
{
$end = 0;
}
else
{
$end = $this->toUnixTime($_POST['md'][$start_id]['date'],$_POST['md'][$start_id]['time']);
$end = $end + (60 * 60 * $_POST['ecs_duration']['hh']) + (60 * $_POST['ecs_duration']['mm']);
}
$val = ilAdvancedMDValue::_getInstance($this->obj_id,$end_id);
$val->setValue($end);
$this->values[] = $val;
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::loadFromPost ( )

Load values from post.

public

Definition at line 154 of file class.ilAdvancedMDRecordGUI.php.

References $_POST, ilAdvancedMDValue\_getInstance(), ilAdvancedMDFieldDefinition\_getInstanceByFieldId(), IL_CAL_FKT_GETDATE, IL_CAL_UNIX, loadECSDurationPost(), ilUtil\stripSlashes(), ilAdvancedMDFieldDefinition\TYPE_DATE, and ilAdvancedMDFieldDefinition\TYPE_DATETIME.

Referenced by ilObjCategoryGUI\updateInfoObject(), ilObjCourseGUI\updateInfoObject(), ilRemoteObjectBaseGUI\updateObject(), and ilGlossaryTermGUI\updateTerm().

{
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
if(!isset($_POST['md']))
{
return false;
}
foreach($_POST['md'] as $field_id => $value)
{
switch($def->getFieldType())
{
if(is_array($value) and $_POST['md_activated'][$field_id])
{
$dt['year'] = (int) $value['date']['y'];
$dt['mon'] = (int) $value['date']['m'];
$dt['mday'] = (int) $value['date']['d'];
$dt['hours'] = (int) 0;
$dt['minutes'] = (int) 0;
$dt['seconds'] = (int) 0;
$date = new ilDate($dt,IL_CAL_FKT_GETDATE);
$value = $date->get(IL_CAL_UNIX);
}
else
{
$value = 0;
}
break;
if(is_array($value) and $_POST['md_activated'][$field_id])
{
$dt['year'] = (int) $value['date']['y'];
$dt['mon'] = (int) $value['date']['m'];
$dt['mday'] = (int) $value['date']['d'];
$dt['hours'] = (int) $value['time']['h'];
$dt['minutes'] = (int) $value['time']['m'];
$dt['seconds'] = (int) 0;
$date = new ilDateTime($dt,IL_CAL_FKT_GETDATE);
$value = $date->get(IL_CAL_UNIX);
}
else
{
$value = 0;
}
break;
default:
$value = ilUtil::stripSlashes($value);
break;
}
$val = ilAdvancedMDValue::_getInstance($this->obj_id,$field_id,$this->sub_type,$this->sub_id);
$val->setValue($value);
$this->values[] = $val;
unset($value);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::parse ( )

Get HTML.

public

Parameters

Definition at line 118 of file class.ilAdvancedMDRecordGUI.php.

References parseEditor(), parseFilter(), parseInfoPage(), parseRecordSelection(), parseSearch(), parseTableCells(), and parseTableHead().

{
switch($this->mode)
{
case self::MODE_EDITOR:
return $this->parseEditor();
case self::MODE_SEARCH:
return $this->parseSearch();
case self::MODE_INFO:
return $this->parseInfoPage();
case self::MODE_REC_SELECTION:
return $this->parseRecordSelection();
case self::MODE_FILTER:
return $this->parseFilter();
case self::MODE_TABLE_HEAD:
return $this->parseTableHead();
case self::MODE_TABLE_CELLS:
return $this->parseTableCells();
default:
die('Not implemented yet');
}
}

+ Here is the call graph for this function:

ilAdvancedMDRecordGUI::parseDuration (   $u_start,
  $u_end 
)
protected

parse hours and minutes from duration

protected

Parameters
@return

Definition at line 683 of file class.ilAdvancedMDRecordGUI.php.

Referenced by showECSStart().

{
if($u_start >= $u_end)
{
return array(0,0);
}
$diff = $u_end - $u_start;
$hours = (int) ($diff / (60 * 60));
$min = (int) (($diff % 3600) / 60);
return array($hours,$min);
}

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::parseEditor ( )
private

Parse property form in editor mode.

private

Definition at line 280 of file class.ilAdvancedMDRecordGUI.php.

References $ilUser, $section, $sub_type, ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), ilAdvancedMDFieldDefinition\_getDefinitionsByRecordId(), ilAdvancedMDValue\_getInstance(), ilAdvancedMDRecord\_getSelectedRecordsByObject(), getSelectedOnly(), handleECSDefinitions(), IL_CAL_UNIX, ilAdvancedMDFieldDefinition\TYPE_DATE, ilAdvancedMDFieldDefinition\TYPE_DATETIME, ilAdvancedMDFieldDefinition\TYPE_SELECT, and ilAdvancedMDFieldDefinition\TYPE_TEXT.

Referenced by parse().

{
global $ilUser;
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
if ($this->getSelectedOnly())
{
$recs = ilAdvancedMDRecord::_getSelectedRecordsByObject($this->obj_type, $this->obj_id, $this->sub_type);
}
else
{
$recs = ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type, $this->sub_type);
}
foreach($recs as $record_obj)
{
$section->setTitle($record_obj->getTitle());
$section->setInfo($record_obj->getDescription());
$this->form->addItem($section);
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record_obj->getRecordId()) as $def)
{
if($this->handleECSDefinitions($def))
{
continue;
}
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
$value = ilAdvancedMDValue::_getInstance($this->obj_id,$def->getFieldId(),$this->sub_type,$this->sub_id);
switch($def->getFieldType())
{
$text = new ilTextInputGUI($def->getTitle(),'md['.$def->getFieldId().']');
$text->setValue($value->getValue());
$text->setSize(40);
$text->setMaxLength(512);
$text->setDisabled($value->isDisabled());
$text->setInfo($def->getDescription());
$this->form->addItem($text);
break;
$select = new ilSelectInputGUI($def->getTitle(),'md['.$def->getFieldId().']');
$select->setOptions($def->getFieldValuesForSelect());
$select->setValue($value->getValue());
$select->setDisabled($value->isDisabled());
$select->setInfo($def->getDescription());
$this->form->addItem($select);
break;
$unixtime = $value->getValue() ? $value->getValue() : mktime(8,0,0,date('m'),date('d'),date('Y'));
$time = new ilDateTimeInputGUI($def->getTitle(),'md['.$def->getFieldId().']');
$time->setShowTime(false);
$time->setStartYear(1901);
$time->setDate(new ilDate($unixtime,IL_CAL_UNIX));
$time->enableDateActivation($this->lng->txt('enabled'),
'md_activated['.$def->getFieldId().']',
$value->getValue() ? true : false);
$time->setDisabled($value->isDisabled());
$time->setInfo($def->getDescription());
$this->form->addItem($time);
break;
$unixtime = $value->getValue() ? $value->getValue() : mktime(8,0,0,date('m'),date('d'),date('Y'));
$time = new ilDateTimeInputGUI($def->getTitle(),'md['.$def->getFieldId().']');
$time->setShowTime(true);
$time->setDate(new ilDateTime($unixtime,IL_CAL_UNIX,$ilUser->getTimeZone()));
$time->enableDateActivation($this->lng->txt('enabled'),
'md_activated['.$def->getFieldId().']',
$value->getValue() ? true : false);
$time->setDisabled($value->isDisabled());
$this->form->addItem($time);
break;
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::parseFilter ( )
private

Parse property for filter (table)

private

Definition at line 792 of file class.ilAdvancedMDRecordGUI.php.

References $ilUser, ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), ilAdvancedMDFieldDefinition\_getDefinitionsByRecordId(), ilAdvancedMDRecord\_getSelectedRecordsByObject(), ilCombinationInputGUI\addCombinationItem(), ilCombinationInputGUI\COMPARISON_ASCENDING, getSelectedOnly(), handleECSDefinitions(), ilDateTimeInputGUI\MODE_INPUT, ilSelectInputGUI\setOptions(), ilTextInputGUI\setSize(), ilAdvancedMDFieldDefinition\TYPE_DATE, ilAdvancedMDFieldDefinition\TYPE_DATETIME, ilAdvancedMDFieldDefinition\TYPE_SELECT, and ilAdvancedMDFieldDefinition\TYPE_TEXT.

Referenced by parse().

{
global $ilUser;
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
if ($this->getSelectedOnly())
{
$recs = ilAdvancedMDRecord::_getSelectedRecordsByObject($this->obj_type, $this->obj_id, $this->sub_type);
}
else
{
$recs = ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type, $this->sub_type);
}
foreach($recs as $record_obj)
{
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record_obj->getRecordId()) as $def)
{
if($this->handleECSDefinitions($def))
{
continue;
}
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
switch($def->getFieldType())
{
$text = new ilTextInputGUI($def->getTitle(),'md_'.$def->getFieldId());
$text->setSize(20);
$text->setMaxLength(512);
$text->setSubmitFormOnEnter(true);
$this->table_gui->addFilterItem($text);
$text->readFromSession();
$this->table_gui->filter['md_'.$def->getFieldId()] = $text->getValue();
break;
include_once("./Services/Form/classes/class.ilSelectInputGUI.php");
$select = new ilSelectInputGUI($def->getTitle(),'md_'.$def->getFieldId());
$select->setOptions($def->getFieldValuesForSelect());
$this->table_gui->addFilterItem($select);
$select->readFromSession();
$this->table_gui->filter['md_'.$def->getFieldId()] = $select->getValue();
break;
include_once("./Services/Form/classes/class.ilCombinationInputGUI.php");
include_once("./Services/Form/classes/class.ilDateTimeInputGUI.php");
$item = new ilCombinationInputGUI($def->getTitle(), 'md_'.$def->getFieldId());
$combi_item = new ilDateTimeInputGUI("", 'md_'.$def->getFieldId()."_from");
$item->addCombinationItem("from", $combi_item, $this->lng->txt("from"));
$combi_item = new ilDateTimeInputGUI("", 'md_'.$def->getFieldId()."_to");
$item->addCombinationItem("to", $combi_item, $this->lng->txt("to"));
$this->table_gui->addFilterItem($item);
$item->readFromSession();
$this->table_gui->filter['md_'.$def->getFieldId()] = $item->getValue();
break;
include_once("./Services/Form/classes/class.ilCombinationInputGUI.php");
include_once("./Services/Form/classes/class.ilDateTimeInputGUI.php");
$item = new ilCombinationInputGUI($def->getTitle(), 'md_'.$def->getFieldId());
$combi_item = new ilDateTimeInputGUI("", 'md_'.$def->getFieldId()."_from");
$combi_item->setShowTime(true);
$item->addCombinationItem("from", $combi_item, $this->lng->txt("from"));
$combi_item = new ilDateTimeInputGUI("", 'md_'.$def->getFieldId()."_to");
$combi_item->setShowTime(true);
$item->addCombinationItem("to", $combi_item, $this->lng->txt("to"));
$this->table_gui->addFilterItem($item);
$item->readFromSession();
$this->table_gui->filter['md_'.$def->getFieldId()] = $item->getValue();
break;
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::parseInfoPage ( )
private

Definition at line 483 of file class.ilAdvancedMDRecordGUI.php.

References ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), ilAdvancedMDFieldDefinition\_getDefinitionsByRecordId(), ilAdvancedMDValue\_getInstance(), ilDatePresentation\formatDate(), IL_CAL_UNIX, ilAdvancedMDFieldDefinition\TYPE_DATE, ilAdvancedMDFieldDefinition\TYPE_DATETIME, ilAdvancedMDFieldDefinition\TYPE_SELECT, and ilAdvancedMDFieldDefinition\TYPE_TEXT.

Referenced by parse().

{
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
foreach(ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type, $this->sub_type) as $record_obj)
{
$this->info->addSection($record_obj->getTitle());
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record_obj->getRecordId()) as $def)
{
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
$value = ilAdvancedMDValue::_getInstance($this->obj_id,$def->getFieldId());
switch($def->getFieldType())
{
if($value->getValue())
{
$this->info->addProperty($def->getTitle(),$value->getValue());
}
break;
if($value->getValue())
{
$this->info->addProperty($def->getTitle(),$value->getValue());
}
break;
if($value->getValue())
{
$this->info->addProperty($def->getTitle(),ilDatePresentation::formatDate(new ilDate($value->getValue(),IL_CAL_UNIX)));
}
break;
if($value->getValue())
{
$this->info->addProperty($def->getTitle(),ilDatePresentation::formatDate(new ilDateTime($value->getValue(),IL_CAL_UNIX)));
}
break;
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::parseRecordSelection (   $a_sec_head = "")

Parse property form in editor mode.

private

Definition at line 701 of file class.ilAdvancedMDRecordGUI.php.

References $ilUser, $section, ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), ilAdvancedMDRecord\getObjRecSelection(), and ilFormPropertyGUI\setInfo().

Referenced by parse().

{
global $ilUser;
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
$first = true;
foreach(ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type, $this->sub_type) as $record_obj)
{
$selected = ilAdvancedMDRecord::getObjRecSelection($this->obj_id, $this->sub_type);
if ($first)
{
$first = false;
$sec_tit = ($a_sec_head == "")
? $this->lng->txt("meta_adv_records")
: $a_sec_head;
$section->setTitle($sec_tit);
$this->form->addItem($section);
}
// checkbox for each active record
$cb = new ilCheckboxInputGUI($record_obj->getTitle(), "amet_use_rec[]");
$cb->setInfo($record_obj->getDescription());
$cb->setValue($record_obj->getRecordId());
if (in_array($record_obj->getRecordId(), $selected))
{
$cb->setChecked(true);
}
$this->form->addItem($cb);
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::parseSearch ( )
private

Parse search.

private

Parameters

Definition at line 375 of file class.ilAdvancedMDRecordGUI.php.

References $options, $section, ilAdvancedMDRecord\_getActiveSearchableRecords(), ilAdvancedMDFieldDefinition\_getDefinitionsByRecordId(), IL_CAL_UNIX, ilTextInputGUI\setValue(), ilCheckboxInputGUI\setValue(), ilSelectInputGUI\setValue(), ilRadioOption\setValue(), ilAdvancedMDFieldDefinition\TYPE_DATE, ilAdvancedMDFieldDefinition\TYPE_DATETIME, ilAdvancedMDFieldDefinition\TYPE_SELECT, and ilAdvancedMDFieldDefinition\TYPE_TEXT.

Referenced by parse().

{
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
{
$section->setTitle($record->getTitle());
$this->form->addItem($section);
foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record->getRecordId()) as $field)
{
if(!$field->isSearchable())
{
continue;
}
switch($field->getFieldType())
{
$group = new ilRadioGroupInputGUI('','boolean['.$field->getFieldId().']');
$group->setValue(isset($this->search_values['boolean'][$field->getFieldId()]) ?
$this->search_values['boolean'][$field->getFieldId()] : 0);
$radio_option = new ilRadioOption($this->lng->txt("search_any_word"),0);
$radio_option->setValue(0);
$group->addOption($radio_option);
$radio_option = new ilRadioOption($this->lng->txt("search_all_words"),1);
$radio_option->setValue(1);
$group->addOption($radio_option);
$text = new ilTextInputGUI($field->getTitle(),$field->getFieldId());
$text->setValue(isset($this->search_values[$field->getFieldId()]) ?
$this->search_values[$field->getFieldId()] :
'');
$text->setSize(30);
$text->setMaxLength(255);
$text->addSubItem($group);
$this->form->addItem($text);
break;
$select = new ilSelectInputGUI($field->getTitle(),$field->getFieldId());
$select->setValue(isset($this->search_values[$field->getFieldId()]) ?
$this->search_values[$field->getFieldId()] :
0);
$options = array(0 => $this->lng->txt('search_any'));
$counter = 1;
foreach($field->getFieldValues() as $key => $value)
{
$options[$counter++] = $value;
}
$select->setOptions($options);
$this->form->addItem($select);
break;
$check = new ilCheckboxInputGUI($field->getTitle(),$field->getFieldId());
$check->setValue(1);
$check->setChecked(isset($this->search_values[$field->getFieldId()]) ?
$this->search_values[$field->getFieldId()] : 0);
$time = new ilDateTimeInputGUI($this->lng->txt('from'),'date_start['.$field->getFieldId().']');
if($field->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE)
{
$time->setShowTime(false);
}
else
{
$time->setShowTime(true);
}
if(isset($this->search_values['date_start'][$field->getFieldId()]) and 0)
{
#$time->setUnixTime($this->toUnixTime($this->search_values['date_start'][$field->getFieldId()]['date'],$this->search_values['date_start'][$field->getFieldId()]['time']));
}
else
{
$time->setDate(new ilDateTime(mktime(8,0,0,date('m'),date('d'),date('Y')),IL_CAL_UNIX));
}
$check->addSubItem($time);
$time = new ilDateTimeInputGUI($this->lng->txt('until'),'date_end['.$field->getFieldId().']');
if($field->getFieldType() == ilAdvancedMDFieldDefinition::TYPE_DATE)
{
$time->setShowTime(false);
}
else
{
$time->setShowTime(true);
}
if(isset($this->search_values['date_end'][$field->getFieldId()]) and 0)
{
#$time->setUnixTime($this->toUnixTime($this->search_values['date_end'][$field->getFieldId()]['date'],$this->search_values['date_end'][$field->getFieldId()]['time']));
}
else
{
$time->setDate(new ilDateTime(mktime(16,0,0,date('m'),date('d'),date('Y')),IL_CAL_UNIX));
}
$check->addSubItem($time);
$this->form->addItem($check);
break;
}
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::parseTableCells ( )
private

Parse table cells.

Definition at line 908 of file class.ilAdvancedMDRecordGUI.php.

References $ilUser, ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), ilAdvancedMDFieldDefinition\_getDefinitionsByRecordId(), ilAdvancedMDRecord\_getSelectedRecordsByObject(), getRowData(), getSelectedOnly(), and handleECSDefinitions().

Referenced by parse().

{
global $ilUser;
$data = $this->getRowData();
$html = "";
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
if ($this->getSelectedOnly())
{
$recs = ilAdvancedMDRecord::_getSelectedRecordsByObject($this->obj_type, $this->obj_id, $this->sub_type);
}
else
{
$recs = ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type, $this->sub_type);
}
foreach($recs as $record_obj)
{
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record_obj->getRecordId()) as $def)
{
if($this->handleECSDefinitions($def))
{
continue;
}
$html.= "<td class='std'>".$data['md_'.$def->getFieldId()]."</td>";
}
}
return $html;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::parseTableHead ( )
private

Parse property for table head.

Definition at line 877 of file class.ilAdvancedMDRecordGUI.php.

References $ilUser, ilAdvancedMDRecord\_getActivatedRecordsByObjectType(), ilAdvancedMDFieldDefinition\_getDefinitionsByRecordId(), ilAdvancedMDRecord\_getSelectedRecordsByObject(), getSelectedOnly(), and handleECSDefinitions().

Referenced by parse().

{
global $ilUser;
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
if ($this->getSelectedOnly())
{
$recs = ilAdvancedMDRecord::_getSelectedRecordsByObject($this->obj_type, $this->obj_id, $this->sub_type);
}
else
{
$recs = ilAdvancedMDRecord::_getActivatedRecordsByObjectType($this->obj_type, $this->sub_type);
}
foreach($recs as $record_obj)
{
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDFieldDefinition.php');
foreach(ilAdvancedMDFieldDefinition::_getDefinitionsByRecordId($record_obj->getRecordId()) as $def)
{
if($this->handleECSDefinitions($def))
{
continue;
}
$this->table_gui->addColumn($def->getTitle(),'md_'.$def->getFieldId());
}
}
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::saveSelection ( )

Save selection per object.

Parameters
@return

Definition at line 739 of file class.ilAdvancedMDRecordGUI.php.

References $_POST, ilAdvancedMDRecord\saveObjRecSelection(), and ilUtil\stripSlashesArray().

Referenced by ilObjGlossaryGUI\saveProperties().

{
$sel = ilUtil::stripSlashesArray($_POST["amet_use_rec"]);
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDRecord.php');
ilAdvancedMDRecord::saveObjRecSelection($this->obj_id, $this->sub_type, $sel);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::saveValues ( )

Save values.

public

Definition at line 265 of file class.ilAdvancedMDRecordGUI.php.

{
foreach($this->values as $value)
{
$value->save();
}
return true;
}
ilAdvancedMDRecordGUI::setInfoObject (   $info)

get info sections

public

Parameters
objectinstance of ilInfoScreenGUI

Definition at line 86 of file class.ilAdvancedMDRecordGUI.php.

Referenced by ilRemoteObjectBaseGUI\infoScreen(), ilObjCourseGUI\infoScreen(), and ilObjCategoryGUI\infoScreen().

{
$this->info = $info;
}

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::setPropertyForm (   $form)

set property form object

public

Parameters

Definition at line 62 of file class.ilAdvancedMDRecordGUI.php.

References $form.

Referenced by ilGlossaryTermGUI\getEditTermForm(), ilRemoteObjectBaseGUI\initEditForm(), ilObjCategoryGUI\initExtendedSettings(), ilObjCourseGUI\initInfoEditor(), and ilObjGlossaryGUI\initSettingsForm().

{
$this->form = $form;
}

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::setRowData (   $a_val)

Set row data.

Parameters
array$a_valassoc array of row data (containing md record data)

Definition at line 771 of file class.ilAdvancedMDRecordGUI.php.

{
$this->row_data = $a_val;
}
ilAdvancedMDRecordGUI::setSearchValues (   $a_values)

Set values for search form.

public

Definition at line 73 of file class.ilAdvancedMDRecordGUI.php.

{
$this->search_values = $a_values;
}
ilAdvancedMDRecordGUI::setSelectedOnly (   $a_val)

Set selected only flag.

Parameters
boolean$a_valretrieve only records, that are selected by the object

Definition at line 96 of file class.ilAdvancedMDRecordGUI.php.

Referenced by ilPresentationListTableGUI\initFilter().

{
$this->selected_only = $a_val;
}

+ Here is the caller graph for this function:

ilAdvancedMDRecordGUI::setTableGUI (   $a_val)

Set table.

Parameters
object$a_valtable gui class

Definition at line 751 of file class.ilAdvancedMDRecordGUI.php.

{
$this->table_gui = $a_val;
}
ilAdvancedMDRecordGUI::showECSStart (   $def)
private

Show special form for ecs start.

private

Parameters
objectilAdvMDFieldDefinition

Definition at line 590 of file class.ilAdvancedMDRecordGUI.php.

References $ilUser, ilAdvancedMDValue\_getInstance(), ilECSDataMappingSettings\_getInstance(), IL_CAL_UNIX, parseDuration(), ilDurationInputGUI\setHours(), ilAdvancedMDFieldDefinition\TYPE_SELECT, and ilAdvancedMDFieldDefinition\TYPE_TEXT.

{
global $ilUser;
$this->lng->loadLanguageModule('ecs');
include_once('Services/AdvancedMetaData/classes/class.ilAdvancedMDValue.php');
$value_start = ilAdvancedMDValue::_getInstance($this->obj_id,$def->getFieldId());
$unixtime = $value_start->getValue() ? $value_start->getValue() : mktime(8,0,0,date('m'),date('d'),date('Y'));
$time = new ilDateTimeInputGUI($this->lng->txt('ecs_event_appointment'),'md['.$def->getFieldId().']');
$time->setShowTime(true);
$time->setDate(new ilDateTime($unixtime,IL_CAL_UNIX));
$time->enableDateActivation($this->lng->txt('enabled'),
'md_activated['.$def->getFieldId().']',
$value_start->getValue() ? true : false);
$time->setDisabled($value_start->isDisabled());
if($field_id = $mapping->getMappingByECSName('end'))
{
$value_end = ilAdvancedMDValue::_getInstance($this->obj_id,$field_id);
list($hours,$minutes) = $this->parseDuration($value_start->getValue(),$value_end->getValue());
$duration = new ilDurationInputGUI($this->lng->txt('ecs_duration'),'ecs_duration');
$duration->setHours($hours);
$duration->setMinutes($minutes);
#$duration->setInfo($this->lng->txt('ecs_duration_info'));
$duration->setShowHours(true);
$duration->setShowMinutes(true);
$time->addSubItem($duration);
}
if($field_id = $mapping->getMappingByECSName('cycle'))
{
$value = ilAdvancedMDValue::_getInstance($this->obj_id,$field_id);
$cycle_def = new ilAdvancedMDFieldDefinition($field_id);
switch($cycle_def->getFieldType())
{
$text = new ilTextInputGUI($cycle_def->getTitle(),'md['.$cycle_def->getFieldId().']');
$text->setValue($value->getValue());
$text->setSize(20);
$text->setMaxLength(512);
$text->setDisabled($value->isDisabled());
$time->addSubItem($text);
break;
$select = new ilSelectInputGUI($cycle_def->getTitle(),'md['.$cycle_def->getFieldId().']');
$select->setOptions($cycle_def->getFieldValuesForSelect());
$select->setValue($value->getValue());
$select->setDisabled($value->isDisabled());
$time->addSubItem($select);
break;
}
}
if($field_id = $mapping->getMappingByECSName('room'))
{
$value = ilAdvancedMDValue::_getInstance($this->obj_id,$field_id);
$room_def = new ilAdvancedMDFieldDefinition($field_id);
switch($room_def->getFieldType())
{
$text = new ilTextInputGUI($room_def->getTitle(),'md['.$room_def->getFieldId().']');
$text->setValue($value->getValue());
$text->setSize(20);
$text->setMaxLength(512);
$text->setDisabled($value->isDisabled());
$time->addSubItem($text);
break;
$select = new ilSelectInputGUI($room_def->getTitle(),'md['.$room_def->getFieldId().']');
$select->setOptions($cycle_def->getFieldValuesForSelect());
$select->setValue($value->getValue());
$select->setDisabled($value->isDisabled());
$time->addSubItem($select);
break;
}
}
$this->form->addItem($time);
}

+ Here is the call graph for this function:

ilAdvancedMDRecordGUI::toUnixTime (   $date,
  $time = array() 
)
private

convert input array to unix time

private

Parameters

Definition at line 537 of file class.ilAdvancedMDRecordGUI.php.

Referenced by loadECSDurationPost().

{
return mktime($time['h'],$time['m'],0,$date['m'],$date['d'],$date['y']);
}

+ Here is the caller graph for this function:

Field Documentation

ilAdvancedMDRecordGUI::$form
private

Definition at line 31 of file class.ilAdvancedMDRecordGUI.php.

Referenced by setPropertyForm().

ilAdvancedMDRecordGUI::$lng
protected

Definition at line 24 of file class.ilAdvancedMDRecordGUI.php.

Referenced by __construct().

ilAdvancedMDRecordGUI::$mode
private

Definition at line 26 of file class.ilAdvancedMDRecordGUI.php.

ilAdvancedMDRecordGUI::$obj_id
private

Definition at line 29 of file class.ilAdvancedMDRecordGUI.php.

ilAdvancedMDRecordGUI::$obj_type
private

Definition at line 27 of file class.ilAdvancedMDRecordGUI.php.

ilAdvancedMDRecordGUI::$search_values = array()
private

Definition at line 33 of file class.ilAdvancedMDRecordGUI.php.

ilAdvancedMDRecordGUI::$sub_type
private

Definition at line 28 of file class.ilAdvancedMDRecordGUI.php.

Referenced by parseEditor().

ilAdvancedMDRecordGUI::$values = array()
private

Definition at line 32 of file class.ilAdvancedMDRecordGUI.php.

const ilAdvancedMDRecordGUI::MODE_FILTER = 5
const ilAdvancedMDRecordGUI::MODE_INFO = 3
const ilAdvancedMDRecordGUI::MODE_REC_SELECTION = 4
const ilAdvancedMDRecordGUI::MODE_SEARCH = 2
const ilAdvancedMDRecordGUI::MODE_TABLE_CELLS = 7

Definition at line 22 of file class.ilAdvancedMDRecordGUI.php.

const ilAdvancedMDRecordGUI::MODE_TABLE_HEAD = 6

Definition at line 21 of file class.ilAdvancedMDRecordGUI.php.


The documentation for this class was generated from the following file: