ILIAS  release_8 Revision v8.24
ilPersonalSkillsFilterGUI Class Reference

Filter for personal skills. More...

+ Collaboration diagram for ilPersonalSkillsFilterGUI:

Public Member Functions

 __construct ()
 
 addToToolbar (ilToolbarGUI $toolbar, bool $a_include_target=true)
 
 save ()
 Save filter values to session. More...
 
 clear ()
 
 isInRange (array $level_entry)
 
 showTargetLevel ()
 
 showMaterialsRessources ()
 

Protected Attributes

ilLanguage $lng
 
SkillPersonalGUIRequest $personal_gui_request
 
int $requested_formation_type = 0
 
bool $requested_target_level = false
 
bool $requested_materials_resources = false
 

Detailed Description

Filter for personal skills.

Author
@leifos.de

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

Constructor & Destructor Documentation

◆ __construct()

ilPersonalSkillsFilterGUI::__construct ( )

Definition at line 36 of file class.ilPersonalSkillsFilterGUI.php.

37 {
38 global $DIC;
39 $this->lng = $DIC->language();
40 $this->personal_gui_request = $DIC->skills()->internal()->gui()->personal_request();
41 $this->requested_formation_type = $this->personal_gui_request->getTypeOfFormation();
42 $this->requested_target_level = $this->personal_gui_request->getShowTargetLevel();
43 $this->requested_materials_resources = $this->personal_gui_request->getShowMaterialsResources();
44 }
global $DIC
Definition: feed.php:28

References $DIC, and ILIAS\Repository\lng().

+ Here is the call graph for this function:

Member Function Documentation

◆ addToToolbar()

ilPersonalSkillsFilterGUI::addToToolbar ( ilToolbarGUI  $toolbar,
bool  $a_include_target = true 
)

Definition at line 46 of file class.ilPersonalSkillsFilterGUI.php.

46 : void
47 {
49
50 // type of formation
51 $options = array(
52 0 => $lng->txt("skmg_all"),
53 ilSkillEval::TYPE_APPRAISAL => $lng->txt("skmg_eval_type_1"),
54 ilSkillEval::TYPE_MEASUREMENT => $lng->txt("skmg_eval_type_2"),
55 ilSkillEval::TYPE_SELF_EVAL => $lng->txt("skmg_eval_type_3"),
56 );
57 $si = new ilSelectInputGUI($lng->txt("skmg_type_of_formation"), "type_of_formation");
58 $si->setOptions($options);
59 $si->setValue(ilSession::get("skmg_pf_type_of_formation"));
60 $toolbar->addInputItem($si, true);
61
62 if ($a_include_target) {
63 // target level
64 $options = array(
65 0 => $lng->txt("show"),
66 1 => $lng->txt("hide")
67 );
68 $si = new ilSelectInputGUI($lng->txt("skmg_target_level"), "target_level");
69 $si->setOptions($options);
70 $si->setValue(ilSession::get("skmg_pf_target_level"));
71 $toolbar->addInputItem($si, true);
72 }
73
74 // materials/ressources
75 $options = array(
76 0 => $lng->txt("show"),
77 1 => $lng->txt("hide")
78 );
79 $si = new ilSelectInputGUI($lng->txt("skmg_materials_resources"), "mat_res");
80 $si->setOptions($options);
81 $si->setValue(ilSession::get("skmg_pf_mat_res"));
82 $toolbar->addInputItem($si, true);
83
84 // from
85 $from = new ilDateTimeInputGUI($lng->txt("from"), "from");
86 if (ilSession::get("skmg_pf_from") != "") {
87 $from->setDate(new ilDateTime(ilSession::get("skmg_pf_from"), IL_CAL_DATETIME));
88 }
89 $toolbar->addInputItem($from, true);
90
91 // to
92 $to = new ilDateTimeInputGUI($lng->txt("to"), "to");
93 if (ilSession::get("skmg_pf_to") != "") {
94 $to->setDate(new ilDateTime(ilSession::get("skmg_pf_to"), IL_CAL_DATETIME));
95 }
96 $toolbar->addInputItem($to, true);
97 }
const IL_CAL_DATETIME
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
@classDescription Date and time handling
txt(string $a_topic, string $a_default_lang_fallback_mod="")
gets the text for a given topic if the topic is not in the list, the topic itself with "-" will be re...
This class represents a selection list property in a property form.
static get(string $a_var)
addInputItem(ilToolbarItem $a_item, bool $a_output_label=false)

References $lng, ilToolbarGUI\addInputItem(), ilSession\get(), IL_CAL_DATETIME, ilLanguage\txt(), ilSkillEval\TYPE_APPRAISAL, ilSkillEval\TYPE_MEASUREMENT, and ilSkillEval\TYPE_SELF_EVAL.

+ Here is the call graph for this function:

◆ clear()

ilPersonalSkillsFilterGUI::clear ( )

Definition at line 121 of file class.ilPersonalSkillsFilterGUI.php.

121 : void
122 {
123 ilSession::clear("skmg_pf_type_of_formation");
124 ilSession::clear("skmg_pf_target_level");
125 ilSession::clear("skmg_pf_mat_res");
126 ilSession::clear("skmg_pf_from");
127 ilSession::clear("skmg_pf_to");
128 }
static clear(string $a_var)

References ilSession\clear().

+ Here is the call graph for this function:

◆ isInRange()

ilPersonalSkillsFilterGUI::isInRange ( array  $level_entry)

Definition at line 130 of file class.ilPersonalSkillsFilterGUI.php.

130 : bool
131 {
132 // from
133 if (ilSession::get("skmg_pf_from") != "") {
134 if ($level_entry["status_date"] < ilSession::get("skmg_pf_from")) {
135 return false;
136 }
137 }
138
139 // to
140 if (ilSession::get("skmg_pf_to") != "") {
141 $to = new ilDateTime(ilSession::get("skmg_pf_to"), IL_CAL_DATETIME);
142 $to->increment(IL_CAL_DAY, 1);
143 if ($level_entry["status_date"] > $to) {
144 return false;
145 }
146 }
147
148 // type
150 if ($level_entry["self_eval"] == 1) {
152 }
153 if ($level_entry["trigger_obj_type"] == "tst") {
155 }
156 if (ilSession::get("skmg_pf_type_of_formation") > 0 && ilSession::get("skmg_pf_type_of_formation") != $type) {
157 return false;
158 }
159
160 return true;
161 }
const IL_CAL_DAY
$type

References $type, ilSession\get(), IL_CAL_DATETIME, IL_CAL_DAY, ilSkillEval\TYPE_APPRAISAL, ilSkillEval\TYPE_MEASUREMENT, and ilSkillEval\TYPE_SELF_EVAL.

+ Here is the call graph for this function:

◆ save()

ilPersonalSkillsFilterGUI::save ( )

Save filter values to session.

Definition at line 102 of file class.ilPersonalSkillsFilterGUI.php.

102 : void
103 {
104 $from = new ilDateTimeInputGUI("", "from");
105 $from->checkInput();
106 $f = (is_null($from->getDate()))
107 ? ""
108 : $from->getDate()->get(IL_CAL_DATETIME);
109 $to = new ilDateTimeInputGUI("", "to");
110 $to->checkInput();
111 $t = (is_null($to->getDate()))
112 ? ""
113 : $to->getDate()->get(IL_CAL_DATETIME);
114 ilSession::set("skmg_pf_type_of_formation", $this->requested_formation_type);
115 ilSession::set("skmg_pf_target_level", $this->requested_target_level);
116 ilSession::set("skmg_pf_mat_res", $this->requested_materials_resources);
117 ilSession::set("skmg_pf_from", $f);
118 ilSession::set("skmg_pf_to", $t);
119 }
static set(string $a_var, $a_val)
Set a value.

References Vendor\Package\$f, IL_CAL_DATETIME, and ilSession\set().

+ Here is the call graph for this function:

◆ showMaterialsRessources()

ilPersonalSkillsFilterGUI::showMaterialsRessources ( )

Definition at line 168 of file class.ilPersonalSkillsFilterGUI.php.

168 : bool
169 {
170 return !ilSession::get("skmg_pf_mat_res");
171 }

References ilSession\get().

+ Here is the call graph for this function:

◆ showTargetLevel()

ilPersonalSkillsFilterGUI::showTargetLevel ( )

Definition at line 163 of file class.ilPersonalSkillsFilterGUI.php.

163 : bool
164 {
165 return !ilSession::get("skmg_pf_target_level");
166 }

References ilSession\get().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilPersonalSkillsFilterGUI::$lng
protected

Definition at line 30 of file class.ilPersonalSkillsFilterGUI.php.

Referenced by addToToolbar().

◆ $personal_gui_request

SkillPersonalGUIRequest ilPersonalSkillsFilterGUI::$personal_gui_request
protected

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

◆ $requested_formation_type

int ilPersonalSkillsFilterGUI::$requested_formation_type = 0
protected

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

◆ $requested_materials_resources

bool ilPersonalSkillsFilterGUI::$requested_materials_resources = false
protected

Definition at line 34 of file class.ilPersonalSkillsFilterGUI.php.

◆ $requested_target_level

bool ilPersonalSkillsFilterGUI::$requested_target_level = false
protected

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


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