ILIAS  trunk Revision v11.0_alpha-3011-gc6b235a2e85
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 30 of file class.ilPersonalSkillsFilterGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilPersonalSkillsFilterGUI::__construct ( )

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

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

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 48 of file class.ilPersonalSkillsFilterGUI.php.

48 : void
49 {
51
52 // type of formation
53 $options = array(
54 0 => $lng->txt("skmg_all"),
55 Personal\SkillEval::TYPE_APPRAISAL => $lng->txt("skmg_eval_type_1"),
56 Personal\SkillEval::TYPE_MEASUREMENT => $lng->txt("skmg_eval_type_2"),
57 Personal\SkillEval::TYPE_SELF_EVAL => $lng->txt("skmg_eval_type_3"),
58 );
59 $si = new ilSelectInputGUI($lng->txt("skmg_type_of_formation"), "type_of_formation");
60 $si->setOptions($options);
61 $si->setValue(ilSession::get("skmg_pf_type_of_formation"));
62 $toolbar->addInputItem($si, true);
63
64 if ($a_include_target) {
65 // target level
66 $options = array(
67 0 => $lng->txt("show"),
68 1 => $lng->txt("hide")
69 );
70 $si = new ilSelectInputGUI($lng->txt("skmg_target_level"), "target_level");
71 $si->setOptions($options);
72 $si->setValue(ilSession::get("skmg_pf_target_level"));
73 $toolbar->addInputItem($si, true);
74 }
75
76 // materials/ressources
77 $options = array(
78 0 => $lng->txt("show"),
79 1 => $lng->txt("hide")
80 );
81 $si = new ilSelectInputGUI($lng->txt("skmg_materials_resources"), "mat_res");
82 $si->setOptions($options);
83 $si->setValue(ilSession::get("skmg_pf_mat_res"));
84 $toolbar->addInputItem($si, true);
85
86 // from
87 $from = new ilDateTimeInputGUI($lng->txt("from"), "from");
88 if (ilSession::get("skmg_pf_from") != "") {
89 $from->setDate(new ilDateTime(ilSession::get("skmg_pf_from"), IL_CAL_DATETIME));
90 }
91 $toolbar->addInputItem($from, true);
92
93 // to
94 $to = new ilDateTimeInputGUI($lng->txt("to"), "to");
95 if (ilSession::get("skmg_pf_to") != "") {
96 $to->setDate(new ilDateTime(ilSession::get("skmg_pf_to"), IL_CAL_DATETIME));
97 }
98 $toolbar->addInputItem($to, true);
99 }
const IL_CAL_DATETIME
This class represents a date/time property in a property form.
@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, and ilLanguage\txt().

+ Here is the call graph for this function:

◆ clear()

ilPersonalSkillsFilterGUI::clear ( )

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

124 : void
125 {
126 ilSession::clear("skmg_pf_type_of_formation");
127 ilSession::clear("skmg_pf_target_level");
128 ilSession::clear("skmg_pf_mat_res");
129 ilSession::clear("skmg_pf_from");
130 ilSession::clear("skmg_pf_to");
131 }
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 133 of file class.ilPersonalSkillsFilterGUI.php.

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

References ilSession\get(), IL_CAL_DATETIME, and IL_CAL_DAY.

+ Here is the call graph for this function:

◆ save()

ilPersonalSkillsFilterGUI::save ( )

Save filter values to session.

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

104 : void
105 {
106 $from = new ilDateTimeInputGUI("", "from");
107 $from->checkInput();
108 $f = (is_null($from->getDate()))
109 ? ""
110 : $from->getDate()->get(IL_CAL_DATETIME);
111 $to = new ilDateTimeInputGUI("", "to");
112 $to->checkInput();
113 $t = (is_null($to->getDate()))
114 ? ""
115 : $to->getDate()->get(IL_CAL_DATETIME);
116 ilSession::set("skmg_pf_type_of_formation", $this->requested_formation_type);
117 ilSession::set("skmg_pf_target_level", $this->requested_target_level);
118 ilSession::set("skmg_pf_mat_res", $this->requested_materials_resources);
119 ilSession::set("skmg_pf_from", $f);
120 ilSession::set("skmg_pf_to", $t);
121 }
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 171 of file class.ilPersonalSkillsFilterGUI.php.

171 : bool
172 {
173 return !ilSession::get("skmg_pf_mat_res");
174 }

References ilSession\get().

+ Here is the call graph for this function:

◆ showTargetLevel()

ilPersonalSkillsFilterGUI::showTargetLevel ( )

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

166 : bool
167 {
168 return !ilSession::get("skmg_pf_target_level");
169 }

References ilSession\get().

+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilPersonalSkillsFilterGUI::$lng
protected

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

Referenced by addToToolbar().

◆ $personal_gui_request

SkillPersonalGUIRequest ilPersonalSkillsFilterGUI::$personal_gui_request
protected

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

◆ $requested_formation_type

int ilPersonalSkillsFilterGUI::$requested_formation_type = 0
protected

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

◆ $requested_materials_resources

bool ilPersonalSkillsFilterGUI::$requested_materials_resources = false
protected

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

◆ $requested_target_level

bool ilPersonalSkillsFilterGUI::$requested_target_level = false
protected

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


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