ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilObjCalendarSettingsGUI Class Reference
+ Inheritance diagram for ilObjCalendarSettingsGUI:
+ Collaboration diagram for ilObjCalendarSettingsGUI:

Public Member Functions

 __construct ($a_data, $a_id, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor.
 executeCommand ()
 Execute command.
 getAdminTabs ()
 Get tabs.
 settings ()
 Edit settings.
- Public Member Functions inherited from ilObjectGUI
 ilObjectGUI ($a_data, $a_id=0, $a_call_by_reference=true, $a_prepare_output=true)
 Constructor public.
 withReferences ()
 determines wether objects are referenced or not (got ref ids or not)
 setCreationMode ($a_mode=true)
 if true, a creation screen is displayed the current $_GET[ref_id] don't belong to the current class! the mode is determined in ilrepositorygui
 getCreationMode ()
 get creation mode
 getAdminTabs (&$tabs_gui)
 administration tabs show only permissions and trash folder
 getHTML ()
 undeleteObject ()
 Get objects back from trash.
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled
 cancelDeleteObject ()
 cancel deletion of object
 removeFromSystemObject ()
 remove objects from trash bin and all entries therefore every object needs a specific deleteObject() method
 createObject ()
 create new object form
 cancelObject ($in_rep=false)
 cancel action and go back to previous page public
 saveObject ()
 save object
 editObject ()
 edit object
 updateObject ()
 updates object entry in object_data
 getFormAction ($a_cmd, $a_formaction="")
 get form action for command (command is method name without "Object", e.g.
 isVisible ($a_ref_id, $a_type)
 viewObject ()
 list childs of current object
 deleteObject ($a_error=false)
 Display deletion confirmation screen.
 trashObject ()
 Show trash content of object.
 getTemplateFile ($a_cmd, $a_type="")
 get a template blockfile format: tpl.
 cloneAllObject ()
 Clone single (not container object) Method is overwritten in ilContainerGUI.
 copyWizardHasOptions ($a_mode)
 Check if there is any modules specific option.

Protected Member Functions

 save ()
 save settings
 initCalendarSettings ()
 init calendar settings
 initFormSettings ()
 Init settings property form.
- Protected Member Functions inherited from ilObjectGUI
 assignObject ()
 prepareOutput ()
 prepare output
 setTitleAndDescription ()
 called by prepare output
 showUpperIcon ()
 setTabs ()
 set admin tabs public
 setAdminTabs ()
 set admin tabs public
 setLocator ()
 set Locator
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 omitLocator ($a_omit=true)
 addAdminLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded)
 displayEditForm ($fields)
 display edit form (usually called by editObject)
 afterUpdate ()
 setFormAction ($a_cmd, $a_formaction)
 set specific form action for command
 getReturnLocation ($a_cmd, $a_location="")
 get return location for command (command is method name without "Object", e.g.
 setReturnLocation ($a_cmd, $a_location)
 set specific return location for command
 getTargetFrame ($a_cmd, $a_target_frame="")
 get target frame for command (command is method name without "Object", e.g.
 setTargetFrame ($a_cmd, $a_target_frame)
 set specific target frame for command
 showPossibleSubObjects ()
 show possible subobjects (pulldown menu)
 getTitlesByRefId ($a_ref_ids)
 get Titles of objects this method is used for error messages in methods cut/copy/paste
 getTabs (&$tabs_gui)
 get tabs abstract method.
 __showButton ($a_cmd, $a_text, $a_target= '')
 hitsperpageObject ()
__initTableGUI ()
 __setTableGUIBasicData (&$tbl, &$result_set, $a_from="")
 standard implementation for tables use 'from' variable use different initial setting of table
 __showClipboardTable ($a_result_set, $a_from="")
 redirectToRefId ($a_ref_id, $a_cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current $_GET["ref_id"] value
 fillCloneTemplate ($a_tpl_varname, $a_type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning.
 fillCloneSearchTemplate ($a_tpl_varname, $a_type)
 Add an object search in case the number of existing objects is too big to offer a selection list.
 searchCloneSourceObject ()
 Search clone source by title.
 buildCloneSelect ($existing_objs)
 Build a select box for clonable objects (permission write)
 getCenterColumnHTML ()
 Get center column.
 getRightColumnHTML ()
 Display right column.
 setColumnSettings ($column_gui)
 May be overwritten in subclasses.
 checkPermission ($a_perm, $a_cmd="")

Additional Inherited Members

- Data Fields inherited from ilObjectGUI
const COPY_WIZARD_NEEDS_PAGE = 1
 $ilias
 $objDefinition
 $tpl
 $tree
 $lng
 $data
 $object
 $ref_id
 $obj_id
 $maxcount
 $formaction
 $return_location
 $target_frame
 $tab_target_script
 $actions
 $sub_objects
 $omit_locator = false

Detailed Description

Constructor & Destructor Documentation

ilObjCalendarSettingsGUI::__construct (   $a_data,
  $a_id,
  $a_call_by_reference = true,
  $a_prepare_output = true 
)

Constructor.

public

Definition at line 44 of file class.ilObjCalendarSettingsGUI.php.

References ilObjectGUI\$lng, and ilObjectGUI\ilObjectGUI().

{
global $lng;
$this->type = 'cals';
parent::ilObjectGUI($a_data, $a_id, $a_call_by_reference, $a_prepare_output);
$this->lng = $lng;
$this->lng->loadLanguageModule('dateplaner');
$this->lng->loadLanguageModule('jscalendar');
}

+ Here is the call graph for this function:

Member Function Documentation

ilObjCalendarSettingsGUI::executeCommand ( )

Execute command.

public

Reimplemented from ilObjectGUI.

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

References $cmd, $ilErr, $ret, initCalendarSettings(), and ilObjectGUI\prepareOutput().

{
global $ilErr,$ilAccess;
$next_class = $this->ctrl->getNextClass($this);
$cmd = $this->ctrl->getCmd();
$this->prepareOutput();
if(!$ilAccess->checkAccess('read','',$this->object->getRefId()))
{
$ilErr->raiseError($this->lng->txt('no_permission'),$ilErr->WARNING);
}
switch($next_class)
{
case 'ilpermissiongui':
$this->tabs_gui->setTabActive('perm_settings');
include_once("Services/AccessControl/classes/class.ilPermissionGUI.php");
$perm_gui =& new ilPermissionGUI($this);
$ret =& $this->ctrl->forwardCommand($perm_gui);
break;
default:
$this->tabs_gui->setTabActive('settings');
if(!$cmd || $cmd == 'view')
{
$cmd = "settings";
}
$this->$cmd();
break;
}
return true;
}

+ Here is the call graph for this function:

ilObjCalendarSettingsGUI::getAdminTabs ( )

Get tabs.

public

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

{
global $rbacsystem, $ilAccess;
if ($ilAccess->checkAccess("read",'',$this->object->getRefId()))
{
$this->tabs_gui->addTarget("settings",
$this->ctrl->getLinkTarget($this, "settings"),
array("settings", "view"));
}
if ($ilAccess->checkAccess('edit_permission','',$this->object->getRefId()))
{
$this->tabs_gui->addTarget("perm_settings",
$this->ctrl->getLinkTargetByClass('ilpermissiongui',"perm"),
array(),'ilpermissiongui');
}
}
ilObjCalendarSettingsGUI::initCalendarSettings ( )
protected

init calendar settings

protected

Definition at line 234 of file class.ilObjCalendarSettingsGUI.php.

References ilCalendarSettings\_getInstance(), and settings().

Referenced by executeCommand().

{
include_once('Services/Calendar/classes/class.ilCalendarSettings.php');
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCalendarSettingsGUI::initFormSettings ( )
protected

Init settings property form.

protected

Definition at line 245 of file class.ilObjCalendarSettingsGUI.php.

References $cache, ilTimeZone\_getDefaultTimeZone(), ilCalendarUtil\_getShortTimeZoneList(), ilCalendarUtil\getHourSelection(), ilSelectInputGUI\setOptions(), settings(), ilCheckboxInputGUI\setValue(), ilRadioGroupInputGUI\setValue(), ilNonEditableValueGUI\setValue(), ilCalendarSettings\TIME_FORMAT_12, and ilCalendarSettings\TIME_FORMAT_24.

Referenced by settings().

{
if(is_object($this->form))
{
return true;
}
include_once('Services/Calendar/classes/class.ilCalendarUtil.php');
include_once('Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
$this->form->setTitle($this->lng->txt('cal_global_settings'));
$this->form->addCommandButton('save',$this->lng->txt('save'));
#$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
$check = new ilCheckboxInputGUI($this->lng->txt('enable_calendar'),'enable');
$check->setValue(1);
$check->setChecked($this->settings->isEnabled() ? true : false);
$this->form->addItem($check);
$server_tz = new ilNonEditableValueGUI($this->lng->txt('cal_server_tz'));
$this->form->addItem($server_tz);
$select = new ilSelectInputGUI($this->lng->txt('cal_def_timezone'),'default_timezone');
$select->setInfo($this->lng->txt('cal_def_timezone_info'));
$select->setValue($this->settings->getDefaultTimeZone());
$this->form->addItem($select);
$select = new ilSelectInputGUI($this->lng->txt('cal_def_time_format'),'default_time_format');
$select->setOptions(array(
$select->setInfo($this->lng->txt('cal_def_time_format_info'));
$select->setValue($this->settings->getDefaultTimeFormat());
$this->form->addItem($select);
$radio = new ilRadioGroupInputGUI($this->lng->txt('cal_def_week_start'),'default_week_start');
$radio->setValue($this->settings->getDefaultWeekStart());
$option = new ilRadioOption($this->lng->txt('l_su'),0);
$radio->addOption($option);
$option = new ilRadioOption($this->lng->txt('l_mo'),1);
$radio->addOption($option);
// Calendar cache
$cache = new ilRadioGroupInputGUI($this->lng->txt('cal_cache'),'cache');
$cache->setValue((int) $this->settings->isCacheUsed());
$cache->setInfo($this->lng->txt('cal_cache_info'));
$cache->setRequired(true);
$sync_cache = new ilRadioOption($this->lng->txt('cal_cache_disabled'),0);
$cache->addOption($sync_cache);
$sync_cache = new ilRadioOption($this->lng->txt('cal_cache_enabled'),1);
$cache->addOption($sync_cache);
$cache_t = new ilNumberInputGUI('','cache_time');
$cache_t->setValue($this->settings->getCacheMinutes());
$cache_t->setMinValue(0);
$cache_t->setSize(3);
$cache_t->setMaxLength(3);
$cache_t->setSuffix($this->lng->txt('form_minutes'));
$sync_cache->addSubItem($cache_t);
$this->form->addItem($cache);
// enable milestone planning in groups
$checkm = new ilCheckboxInputGUI($this->lng->txt('cal_enable_group_milestones'),'enable_grp_milestones');
$checkm->setValue(1);
$checkm->setChecked($this->settings->getEnableGroupMilestones() ? true : false);
$checkm->setInfo($this->lng->txt('cal_enable_group_milestones_desc'));
$this->form->addItem($checkm);
$this->form->addItem($radio);
// Day start
$day_start = new ilSelectInputGUI($this->lng->txt('cal_day_start'),'dst');
$day_start->setOptions(
ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())
);
$day_start->setValue($this->settings->getDefaultDayStart());
$this->form->addItem($day_start);
$day_end = new ilSelectInputGUI($this->lng->txt('cal_day_end'),'den');
$day_end->setOptions(
ilCalendarUtil::getHourSelection($this->settings->getDefaultTimeFormat())
);
$day_end->setValue($this->settings->getDefaultDayEnd());
$this->form->addItem($day_end);
// Synchronisation cache
$sec = new ilFormSectionHeaderGUI();
$sec->setTitle($this->lng->txt('cal_sync_header'));
$this->form->addItem($sec);
$cache = new ilRadioGroupInputGUI($this->lng->txt('cal_sync_cache'),'sync_cache');
$cache->setValue((int) $this->settings->isSynchronisationCacheEnabled());
$cache->setInfo($this->lng->txt('cal_sync_cache_info'));
$cache->setRequired(true);
$sync_cache = new ilRadioOption($this->lng->txt('cal_sync_disabled'),0);
$cache->addOption($sync_cache);
$sync_cache = new ilRadioOption($this->lng->txt('cal_sync_enabled'),1);
$cache->addOption($sync_cache);
$cache_t = new ilNumberInputGUI('','sync_cache_time');
$cache_t->setValue($this->settings->getSynchronisationCacheMinutes());
$cache_t->setMinValue(0);
$cache_t->setSize(3);
$cache_t->setMaxLength(3);
$cache_t->setSuffix($this->lng->txt('form_minutes'));
$sync_cache->addSubItem($cache_t);
$this->form->addItem($cache);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilObjCalendarSettingsGUI::save ( )
protected

save settings

protected

Definition at line 202 of file class.ilObjCalendarSettingsGUI.php.

References $_POST, ilUtil\sendFailure(), ilUtil\sendSuccess(), settings(), and ilUtil\stripSlashes().

{
$this->settings->setEnabled((int) $_POST['enable']);
$this->settings->setDefaultWeekStart((int) $_POST['default_week_start']);
$this->settings->setDefaultTimeZone(ilUtil::stripSlashes($_POST['default_timezone']));
$this->settings->setDefaultTimeFormat((int) $_POST['default_time_format']);
$this->settings->setEnableGroupMilestones((int) $_POST['enable_grp_milestones']);
$this->settings->setDefaultDayStart((int) $_POST['dst']);
$this->settings->setDefaultDayEnd((int) $_POST['den']);
$this->settings->enableSynchronisationCache((bool) $_POST['sync_cache']);
$this->settings->setSynchronisationCacheMinutes((int) $_POST['sync_cache_time']);
$this->settings->setCacheMinutes((int) $_POST['cache_time']);
$this->settings->useCache((bool) $_POST['cache']);
if(((int) $_POST['den']) < (int) $_POST['dst'])
{
ilUtil::sendFailure($this->lng->txt('cal_dstart_dend_warn'));
$this->settings();
return false;
}
$this->settings->save();
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->settings();
}

+ Here is the call graph for this function:

ilObjCalendarSettingsGUI::settings ( )

Edit settings.

Definition at line 128 of file class.ilObjCalendarSettingsGUI.php.

References initFormSettings().

Referenced by initCalendarSettings(), initFormSettings(), and save().

{
include_once('./Services/Calendar/classes/class.ilDateTime.php');
include_once('./Services/Calendar/classes/iCal/class.ilICalParser.php');
include_once('./Services/Calendar/classes/class.ilCalendarRecurrenceCalculator.php');
include_once('./Services/Calendar/classes/class.ilCalendarRecurrence.php');
include_once('./Services/Calendar/classes/class.ilCalendarEntry.php');
#$parser = new ilICalParser('./extern/Feiertage.ics',ilICalParser::INPUT_FILE);
#$parser->setCategoryId(6);
#$parser->parse();
/*
$calc = new ilCalendarRecurrenceCalculator(
new ilCalendarEntry(273),
new ilCalendarRecurrence(43));
$list = $calc->calculateDateList(
new ilDateTime('2008-04-01',IL_CAL_DATE),
new ilDateTime('2008-04-31',IL_CAL_DATE));
*/
#echo "RESULT: ".$list;
/*
$zeit = microtime(true);
for($i = 0;$i < 1;$i++)
{
$calc = new ilCalendarRecurrenceCalculator(
new ilCalendarEntry(1061),
new ilCalendarRecurrence(72));
$list = $calc->calculateDateList(
new ilDateTime('2008-03-01',IL_CAL_DATE),
new ilDateTime('2008-03-31',IL_CAL_DATE));
}
echo "NEEDS: ".(microtime(true) - $zeit).' seconds.<br>';
foreach($list->get() as $event)
{
echo $event->get(IL_CAL_DATETIME,'',$this->settings->getDefaultTimeZone()).'<br />';
}
*/
#$parser = new ilICalParser('./extern/fc.ics',ilICalParser::INPUT_FILE);
#$parser->setCategoryId(11);
#$parser = new ilICalParser('./Feiertage.ics',ilICalParser::INPUT_FILE);
#$parser->parse();
#$entry = new ilCalendarEntry(927);
/*
$timezone = "US/Alaska";
echo $entry->getTitle().'<br>';
echo $entry->getStart()->get(IL_CAL_DATE,'',$timezone).'<br>';
echo $entry->getStart()->get(IL_CAL_DATETIME,'',$timezone).'<br>';
echo $entry->getEnd()->get(IL_CAL_DATE,'',$timezone).'<br>';
echo $entry->getEnd()->get(IL_CAL_DATETIME,'',$timezone).'<br>';
$entry = new ilCalendarEntry(928);
echo $entry->getTitle().'<br>';
echo $entry->getStart()->get(IL_CAL_DATE,'',$timezone).'<br>';
echo $entry->getStart()->get(IL_CAL_DATETIME,'',$timezone).'<br>';
echo $entry->getEnd()->get(IL_CAL_DATE,'',$timezone).'<br>';
echo $entry->getEnd()->get(IL_CAL_DATETIME,'',$timezone).'<br>';
*/
$this->tabs_gui->setTabActive('settings');
$this->initFormSettings();
$this->tpl->addBlockFile('ADM_CONTENT','adm_content','tpl.settings.html','Services/Calendar');
$this->tpl->setVariable('CAL_SETTINGS',$this->form->getHTML());
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:


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