ILIAS  Release_4_0_x_branch Revision 61816
 All Data Structures Namespaces Files Functions Variables Groups Pages
ilCourseItemAdministrationGUI Class Reference

Class ilCourseAvailabilityGUI. More...

+ Inheritance diagram for ilCourseItemAdministrationGUI:
+ Collaboration diagram for ilCourseItemAdministrationGUI:

Public Member Functions

 ilObjCourseItemAdministrationGUI (&$container_obj, $a_item_id)
 Constructor public.
 ilCourseItemAdministrationGUI (&$container_obj, $a_item_id)
 Constructor public.
executeCommand ()
 execute command
 getItemId ()
 cancel ()
 edit ()
 edit timings
 update ()
 update
 moveUp ()
 moveDown ()
 __checkItemId ()
 __initItem ()
 __setTabs ()
- 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.

Data Fields

 $container_obj
 $tpl
 $ctrl
 $lng
- 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

Protected Member Functions

 initFormEdit ()
 init form edit
 getValues ()
 get values
- 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="")

Detailed Description

Class ilCourseAvailabilityGUI.

Class ilCourseItemAdministrationGUI.

Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
Id:
class.ilCourseAvailabilityGUI.php 12859 2006-12-15 17:11:50Z smeyer
Author
Stefan Meyer smeye.nosp@m.r@da.nosp@m.tabay.nosp@m..de
Version
Id:
class.ilCourseItemAdministrationGUI.php 20542 2009-07-13 13:02:59Z smeyer

ilCourseItemAdministrationGUI: ilConditionHandlerInterface

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

Member Function Documentation

ilCourseItemAdministrationGUI::__checkItemId ( )

Definition at line 353 of file class.ilCourseItemAdministrationGUI.php.

References ilObjectGUI\$tree, and getItemId().

Referenced by executeCommand().

{
global $tree;
if(!$this->getItemId())
{
return false;
}
// Item has to be within course
if(!$tree->checkForParentType($this->getItemId(),'crs'))
{
return false;
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseItemAdministrationGUI::__initItem ( )

Definition at line 369 of file class.ilCourseItemAdministrationGUI.php.

References ilObjectGUI\$tree, and ilObjectFactory\getInstanceByRefId().

Referenced by ilCourseItemAdministrationGUI().

{
global $ilObjDataCache,$tree;
include_once "./Modules/Course/classes/class.ilCourseItems.php";
if(!is_object($this->items_obj))
{
$parent_ref = $tree->getParentId($this->item_id);
$cont_obj = ilObjectFactory::getInstanceByRefId($parent_ref,false);
if($cont_obj->getType() == 'crs')
{
$this->items_obj =& new ilCourseItems($cont_obj,$cont_obj->getRefId());
}
else
{
// lookup crs_obj
$crs_ref_id = $tree->checkForParentType($cont_obj->getRefId(),'crs');
$crs_obj = ilObjectFactory::getInstanceByRefId($crs_ref_id);
$this->items_obj =& new ilCourseItems($crs_obj,$cont_obj->getRefId());
}
/*
if($ilObjDataCache->lookupType($this->container_obj->getId()) == 'crs')
{
$this->items_obj =& new ilCourseItems($this->container_obj,$this->container_obj->getRefId());
}
else
{
// lookup crs_obj
$crs_ref_id = $tree->checkForParentType($this->container_obj->getRefId(),'crs');
$crs_obj = ilObjectFactory::getInstanceByRefId($crs_ref_id);
$this->items_obj =& new ilCourseItems($crs_obj,$this->container_obj->getRefId());
}
*/
}
return true;
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseItemAdministrationGUI::__setTabs ( )

Definition at line 410 of file class.ilCourseItemAdministrationGUI.php.

References $_GET.

Referenced by executeCommand().

{
global $rbacsystem,$ilUser;
$this->tabs_gui->clearTargets();
$this->tabs_gui->setBackTarget($this->lng->txt('back_to_'.$this->container_obj->getType().'_content'),
'repository.php?ref_id='.$this->container_obj->getRefId());
$this->tabs_gui->addTarget("timings",
$this->ctrl->getLinkTarget($this,'edit'),
"edit", get_class($this));
$this->ctrl->setParameterByClass('ilconditionhandlerinterface','item_id',(int) $_GET['item_id']);
$this->tabs_gui->addTarget("preconditions",
$this->ctrl->getLinkTargetByClass('ilConditionHandlerInterface','listConditions'),
"", "ilConditionHandlerInterface");
return true;
}

+ Here is the caller graph for this function:

ilCourseItemAdministrationGUI::cancel ( )

Definition at line 111 of file class.ilCourseItemAdministrationGUI.php.

{
$this->ctrl->returnToParent($this);
}
ilCourseItemAdministrationGUI::edit ( )

edit timings

public

Returns

Definition at line 122 of file class.ilCourseItemAdministrationGUI.php.

References $ilErr, $tpl, getValues(), and initFormEdit().

Referenced by update().

{
global $ilErr,$ilAccess,$ilObjDataCache,$tpl;
if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
}
$this->initFormEdit();
$this->getValues();
$tpl->setContent($this->form->getHTML());
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

& ilCourseItemAdministrationGUI::executeCommand ( )

execute command

Reimplemented from ilObjectGUI.

Definition at line 66 of file class.ilCourseItemAdministrationGUI.php.

References $_GET, $cmd, __checkItemId(), __setTabs(), and ilUtil\sendFailure().

{
global $ilTabs;
$this->__setTabs();
$cmd = $this->ctrl->getCmd();
// Check if item id is given and valid
if(!$this->__checkItemId())
{
ilUtil::sendFailure($this->lng->txt("crs_no_item_id_given"),true);
$this->ctrl->returnToParent($this);
}
switch($this->ctrl->getNextClass($this))
{
case 'ilconditionhandlerinterface':
// preconditions for single course items
include_once './classes/class.ilConditionHandlerInterface.php';
$this->ctrl->saveParameter($this,'item_id',$_GET['item_id']);
$new_gui =& new ilConditionHandlerInterface($this,(int) $_GET['item_id']);
$this->ctrl->forwardCommand($new_gui);
$this->tabs_gui->setTabActive('preconditions');
break;
default:
$this->tabs_gui->setTabActive('timings');
if(!$cmd)
{
$cmd = 'edit';
}
$this->$cmd();
$this->tabs_gui->setTabActive('timings');
break;
}
}

+ Here is the call graph for this function:

ilCourseItemAdministrationGUI::getItemId ( )

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

Referenced by __checkItemId(), getValues(), initFormEdit(), moveDown(), moveUp(), and update().

{
return $this->item_id;
}

+ Here is the caller graph for this function:

ilCourseItemAdministrationGUI::getValues ( )
protected

get values

protected

Returns

Definition at line 217 of file class.ilCourseItemAdministrationGUI.php.

References ilObjectGUI\$data, $start, getItemId(), IL_CAL_DATE, IL_CAL_FKT_DATE, and IL_CAL_UNIX.

Referenced by edit().

{
global $ilUser;
$item_data = $this->items_obj->getItem($this->getItemId());
$data['timing_type'] = $item_data['timing_type'];
$data['visible'] = $item_data['visible'];
$data['changeable'] = $item_data['changeable'];
$start = new ilDateTime($item_data['timing_start'],IL_CAL_UNIX);
$data['timing_start']['date'] = $start->get(IL_CAL_FKT_DATE,'Y-m-d',$ilUser->getTimeZone());
$data['timing_start']['time'] = $start->get(IL_CAL_FKT_DATE,'H:i:s',$ilUser->getTimeZone());
$end = new ilDateTime($item_data['timing_end'],IL_CAL_UNIX);
$data['timing_end']['date'] = $end->get(IL_CAL_FKT_DATE,'Y-m-d',$ilUser->getTimeZone());
$data['timing_end']['time'] = $end->get(IL_CAL_FKT_DATE,'H:i:s',$ilUser->getTimeZone());
$start = new ilDate(date('Y-m-d',$item_data['suggestion_start']),IL_CAL_DATE);
$data['sug_start']['date'] = $start->get(IL_CAL_FKT_DATE,'Y-m-d','UTC');
$end = new ilDate(date('Y-m-d',$item_data['suggestion_end']),IL_CAL_DATE);
$data['sug_end']['date'] = $end->get(IL_CAL_FKT_DATE,'Y-m-d','UTC');
$start = new ilDate(date('Y-m-d',$item_data['earliest_start']),IL_CAL_DATE);
$data['early_start']['date'] = $start->get(IL_CAL_FKT_DATE,'Y-m-d','UTC');
$end = new ilDate(date('Y-m-d',$item_data['latest_end']),IL_CAL_DATE);
$data['late_end']['date'] = $end->get(IL_CAL_FKT_DATE,'Y-m-d','UTC');
$this->form->setValuesByArray($data);
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseItemAdministrationGUI::ilCourseItemAdministrationGUI ( $container_obj,
  $a_item_id 
)

Constructor public.

Definition at line 47 of file class.ilCourseItemAdministrationGUI.php.

References $container_obj, $ilCtrl, $ilErr, $lng, $tpl, and __initItem().

{
global $tpl,$ilCtrl,$lng,$ilObjDataCache,$ilErr,$ilTabs;
$this->tpl =& $tpl;
$this->ctrl =& $ilCtrl;
$this->lng =& $lng;
$this->lng->loadLanguageModule('crs');
$this->err =& $ilErr;
$this->tabs_gui =& $ilTabs;
$this->container_obj =& $container_obj;
$this->item_id = $a_item_id;
$this->ctrl->saveParameter($this,'item_id');
$this->__initItem();
}

+ Here is the call graph for this function:

ilCourseItemAdministrationGUI::ilObjCourseItemAdministrationGUI ( $container_obj,
  $a_item_id 
)

Constructor public.

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

References $container_obj, $ilCtrl, $lng, and $tpl.

{
global $tpl,$ilCtrl,$lng,$ilObjDataCache;
$this->tpl =& $tpl;
$this->ctrl =& $ilCtrl;
$this->lng =& $lng;
$this->container_obj =& $container_obj;
$this->item_id = $a_item_id;
$this->ctrl->saveParameter($this,'item_id');
}
ilCourseItemAdministrationGUI::initFormEdit ( )
protected

init form edit

protected

Returns

Definition at line 143 of file class.ilCourseItemAdministrationGUI.php.

References $start, $title, ilObject\_lookupTitle(), ilSubEnabledFormPropertyGUI\addSubItem(), ilRadioOption\addSubItem(), ilUtil\getImagePath(), getItemId(), IL_CRS_TIMINGS_ACTIVATION, IL_CRS_TIMINGS_DEACTIVATED, IL_CRS_TIMINGS_PRESETTING, ilRadioOption\setInfo(), ilFormPropertyGUI\setInfo(), and ilDateTimeInputGUI\setShowTime().

Referenced by edit(), and update().

{
$item_data = $this->items_obj->getItem($this->getItemId());
include_once('./Services/Form/classes/class.ilPropertyFormGUI.php');
$this->form = new ilPropertyFormGUI();
$this->form->setFormAction($this->ctrl->getFormAction($this));
$title = ilObject::_lookupTitle($item_data['obj_id']);
$this->form->setTitle($title.': '.$this->lng->txt('crs_edit_timings'));
$this->form->setTitleIcon(ilUtil::getImagePath("icon_".$item_data['type']."_s.gif"));
$timings = new ilRadioGroupInputGUI($this->lng->txt('timings'),'timing_type');
// opt deactivated
$dea = new ilRadioOption($this->lng->txt('crs_timings_disabled'),IL_CRS_TIMINGS_DEACTIVATED);
$dea->setInfo($this->lng->txt('crs_timings_disabled_info'));
$timings->addOption($dea);
// Visiblity
$vis = new ilRadioOption($this->lng->txt('crs_timings_availability_enabled'),IL_CRS_TIMINGS_ACTIVATION);
#$vis->setInfo($this->lng->txt('crs_timings_visibility'));
$start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_start'),'timing_start');
$start->setShowTime(true);
#$start->setMinuteStepSize(5);
$vis->addSubItem($start);
$end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_end'),'timing_end');
$end->setShowTime(true);
#$end->setMinuteStepSize(5);
$vis->addSubItem($end);
$isv = new ilCheckboxInputGUI($this->lng->txt('crs_timings_visibility_short'),'visible');
$isv->setInfo($this->lng->txt('crs_timings_visibility'));
$isv->setValue(1);
$vis->addSubItem($isv);
$timings->addOption($vis);
// Timings
$tim = new ilRadioOption($this->lng->txt('crs_timings_presetting'),IL_CRS_TIMINGS_PRESETTING);
$tim->setInfo($this->lng->txt('crs_item_presetting_info'));
$start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_begin'),'sug_start');
$tim->addSubItem($start);
$end = new ilDateTimeInputGUI($this->lng->txt('crs_timings_sug_end'),'sug_end');
$tim->addSubItem($end);
$cha = new ilCheckboxInputGUI($this->lng->txt('crs_timings_changeable'),'changeable');
$tim->addSubItem($cha);
$start = new ilDateTimeInputGUI($this->lng->txt('crs_timings_early_begin'),'early_start');
$cha->addSubItem($start);
$late = new ilDateTimeInputGUI($this->lng->txt('crs_timings_short_limit_start_end'),'late_end');
$cha->addSubItem($late);
$timings->addOption($tim);
$this->form->addItem($timings);
$this->form->addCommandButton('update',$this->lng->txt('save'));
$this->form->addCommandButton('cancel',$this->lng->txt('cancel'));
}

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

ilCourseItemAdministrationGUI::moveDown ( )

Definition at line 336 of file class.ilCourseItemAdministrationGUI.php.

References $ilErr, getItemId(), and ilUtil\sendSuccess().

{
global $ilErr,$ilAccess,$ilObjDataCache;
if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
}
$this->items_obj->moveDown((int) $this->getItemId());
ilUtil::sendSuccess($this->lng->txt("crs_moved_item"),true);
$this->ctrl->returnToParent($this);
return true;
}

+ Here is the call graph for this function:

ilCourseItemAdministrationGUI::moveUp ( )

Definition at line 320 of file class.ilCourseItemAdministrationGUI.php.

References $ilErr, getItemId(), and ilUtil\sendSuccess().

{
global $ilErr,$ilAccess,$ilObjDataCache;
if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
}
$this->items_obj->moveUp((int) $this->getItemId());
ilUtil::sendSuccess($this->lng->txt("crs_moved_item"),true);
$this->ctrl->returnToParent($this);
return true;
}

+ Here is the call graph for this function:

ilCourseItemAdministrationGUI::update ( )

update

public

Returns

Definition at line 256 of file class.ilCourseItemAdministrationGUI.php.

References $ilErr, $tpl, edit(), getItemId(), IL_CAL_DATE, IL_CAL_DATETIME, IL_CAL_UNIX, initFormEdit(), ilUtil\sendFailure(), and ilUtil\sendSuccess().

{
global $ilErr,$ilAccess,$ilObjDataCache,$tpl,$ilUser;
if(!$ilAccess->checkAccess('write','',$this->container_obj->getRefId()))
{
$ilErr->raiseError($this->lng->txt('permission_denied'),$ilErr->MESSAGE);
}
$this->initFormEdit();
if($this->form->checkInput())
{
$this->items_obj->setTimingType($this->form->getInput('timing_type'));
$date = $this->form->getInput('timing_start');
$date = new ilDateTime($date['date'].' '.$date['time'],IL_CAL_DATETIME,$ilUser->getTimeZone());
$this->items_obj->setTimingStart($date->get(IL_CAL_UNIX));
$date = $this->form->getInput('timing_end');
$date = new ilDateTime($date['date'].' '.$date['time'],IL_CAL_DATETIME,$ilUser->getTimeZone());
$this->items_obj->setTimingEnd($date->get(IL_CAL_UNIX));
$date = $this->form->getInput('sug_start');
$date = new ilDate($date['date'],IL_CAL_DATE);
$this->items_obj->setSuggestionStart($date->get(IL_CAL_UNIX));
$date = $this->form->getInput('sug_end');
$date = new ilDate($date['date'],IL_CAL_DATE);
$this->items_obj->setSuggestionEnd($date->get(IL_CAL_UNIX));
$date = $this->form->getInput('early_start');
$date = new ilDate($date['date'],IL_CAL_DATE);
$this->items_obj->setEarliestStart($date->get(IL_CAL_UNIX));
$date = $this->form->getInput('late_end');
$date = new ilDate($date['date'],IL_CAL_DATE);
$this->items_obj->setLatestEnd($date->get(IL_CAL_UNIX));
$this->items_obj->toggleVisible((bool) $this->form->getInput('visible'));
$this->items_obj->toggleChangeable((bool) $this->form->getInput('changeable'));
if(!$this->items_obj->validateActivation())
{
ilUtil::sendFailure($ilErr->getMessage());
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHTML());
return false;
}
else
{
$this->items_obj->update($this->getItemId());
ilUtil::sendSuccess($this->lng->txt('settings_saved'));
$this->edit();
}
}
else
{
$this->form->setValuesByPost();
$tpl->setContent($this->form->getHTML());
}
}

+ Here is the call graph for this function:

Field Documentation

ilCourseItemAdministrationGUI::$container_obj
ilCourseItemAdministrationGUI::$ctrl

Definition at line 37 of file class.ilCourseAvailabilityGUI.php.

ilCourseItemAdministrationGUI::$lng
ilCourseItemAdministrationGUI::$tpl

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