ILIAS  release_10 Revision v10.1-43-ga1241a92c2f
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
.de

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

Constructor & Destructor Documentation

◆ __construct()

ilPersonalSkillsFilterGUI::__construct ( )

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

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

40  {
41  global $DIC;
42  $this->lng = $DIC->language();
43  $this->personal_gui_request = $DIC->skills()->internal()->gui()->personal_request();
44  $this->requested_formation_type = $this->personal_gui_request->getTypeOfFormation();
45  $this->requested_target_level = $this->personal_gui_request->getShowTargetLevel();
46  $this->requested_materials_resources = $this->personal_gui_request->getShowMaterialsResources();
47  }
global $DIC
Definition: shib_login.php:25
+ Here is the call graph for this function:

Member Function Documentation

◆ addToToolbar()

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

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

References $lng, ilToolbarGUI\addInputItem(), ilSession\get(), IL_CAL_DATETIME, ilDateTimeInputGUI\setDate(), ilSelectInputGUI\setOptions(), and ilLanguage\txt().

49  : void
50  {
51  $lng = $this->lng;
52 
53  // type of formation
54  $options = array(
55  0 => $lng->txt("skmg_all"),
56  Personal\SkillEval::TYPE_APPRAISAL => $lng->txt("skmg_eval_type_1"),
57  Personal\SkillEval::TYPE_MEASUREMENT => $lng->txt("skmg_eval_type_2"),
58  Personal\SkillEval::TYPE_SELF_EVAL => $lng->txt("skmg_eval_type_3"),
59  );
60  $si = new ilSelectInputGUI($lng->txt("skmg_type_of_formation"), "type_of_formation");
61  $si->setOptions($options);
62  $si->setValue(ilSession::get("skmg_pf_type_of_formation"));
63  $toolbar->addInputItem($si, true);
64 
65  if ($a_include_target) {
66  // target level
67  $options = array(
68  0 => $lng->txt("show"),
69  1 => $lng->txt("hide")
70  );
71  $si = new ilSelectInputGUI($lng->txt("skmg_target_level"), "target_level");
72  $si->setOptions($options);
73  $si->setValue(ilSession::get("skmg_pf_target_level"));
74  $toolbar->addInputItem($si, true);
75  }
76 
77  // materials/ressources
78  $options = array(
79  0 => $lng->txt("show"),
80  1 => $lng->txt("hide")
81  );
82  $si = new ilSelectInputGUI($lng->txt("skmg_materials_resources"), "mat_res");
83  $si->setOptions($options);
84  $si->setValue(ilSession::get("skmg_pf_mat_res"));
85  $toolbar->addInputItem($si, true);
86 
87  // from
88  $from = new ilDateTimeInputGUI($lng->txt("from"), "from");
89  if (ilSession::get("skmg_pf_from") != "") {
90  $from->setDate(new ilDateTime(ilSession::get("skmg_pf_from"), IL_CAL_DATETIME));
91  }
92  $toolbar->addInputItem($from, true);
93 
94  // to
95  $to = new ilDateTimeInputGUI($lng->txt("to"), "to");
96  if (ilSession::get("skmg_pf_to") != "") {
97  $to->setDate(new ilDateTime(ilSession::get("skmg_pf_to"), IL_CAL_DATETIME));
98  }
99  $toolbar->addInputItem($to, true);
100  }
static get(string $a_var)
const IL_CAL_DATETIME
This class represents a selection list property in a property form.
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...
setOptions(array $a_options)
This class represents a date/time property in a property form.
setDate(ilDateTime $a_date=null)
set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTim...
addInputItem(ilToolbarItem $a_item, bool $a_output_label=false)
+ Here is the call graph for this function:

◆ clear()

ilPersonalSkillsFilterGUI::clear ( )

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

References ilSession\clear().

125  : void
126  {
127  ilSession::clear("skmg_pf_type_of_formation");
128  ilSession::clear("skmg_pf_target_level");
129  ilSession::clear("skmg_pf_mat_res");
130  ilSession::clear("skmg_pf_from");
131  ilSession::clear("skmg_pf_to");
132  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ isInRange()

ilPersonalSkillsFilterGUI::isInRange ( array  $level_entry)

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

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

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

◆ save()

ilPersonalSkillsFilterGUI::save ( )

Save filter values to session.

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

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

105  : void
106  {
107  $from = new ilDateTimeInputGUI("", "from");
108  $from->checkInput();
109  $f = (is_null($from->getDate()))
110  ? ""
111  : $from->getDate()->get(IL_CAL_DATETIME);
112  $to = new ilDateTimeInputGUI("", "to");
113  $to->checkInput();
114  $t = (is_null($to->getDate()))
115  ? ""
116  : $to->getDate()->get(IL_CAL_DATETIME);
117  ilSession::set("skmg_pf_type_of_formation", $this->requested_formation_type);
118  ilSession::set("skmg_pf_target_level", $this->requested_target_level);
119  ilSession::set("skmg_pf_mat_res", $this->requested_materials_resources);
120  ilSession::set("skmg_pf_from", $f);
121  ilSession::set("skmg_pf_to", $t);
122  }
const IL_CAL_DATETIME
This class represents a date/time property in a property form.
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ showMaterialsRessources()

ilPersonalSkillsFilterGUI::showMaterialsRessources ( )

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

References ilSession\get().

172  : bool
173  {
174  return !ilSession::get("skmg_pf_mat_res");
175  }
static get(string $a_var)
+ Here is the call graph for this function:

◆ showTargetLevel()

ilPersonalSkillsFilterGUI::showTargetLevel ( )

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

References ilSession\get().

167  : bool
168  {
169  return !ilSession::get("skmg_pf_target_level");
170  }
static get(string $a_var)
+ Here is the call graph for this function:

Field Documentation

◆ $lng

ilLanguage ilPersonalSkillsFilterGUI::$lng
protected

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

Referenced by addToToolbar().

◆ $personal_gui_request

SkillPersonalGUIRequest ilPersonalSkillsFilterGUI::$personal_gui_request
protected

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

◆ $requested_formation_type

int ilPersonalSkillsFilterGUI::$requested_formation_type = 0
protected

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

◆ $requested_materials_resources

bool ilPersonalSkillsFilterGUI::$requested_materials_resources = false
protected

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

◆ $requested_target_level

bool ilPersonalSkillsFilterGUI::$requested_target_level = false
protected

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


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