ILIAS  release_5-4 Revision v5.4.26-12-gabc799a52e6
ilPersonalSkillsFilterGUI Class Reference

Filter for personal skills. More...

+ Collaboration diagram for ilPersonalSkillsFilterGUI:

Public Member Functions

 __construct ()
 Constructor. More...
 
 addToToolbar (ilToolbarGUI $toolbar, $a_include_target=true)
 Add to toolbar. More...
 
 save ()
 Save filter values to session. More...
 
 isInRange ($level_data, $level_entry)
 Is entry in range? More...
 
 showTargetLevel ()
 Show target level? More...
 
 showMaterialsRessources ()
 Show materials and ressources? More...
 

Detailed Description

Filter for personal skills.

Author
.de

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

Constructor & Destructor Documentation

◆ __construct()

ilPersonalSkillsFilterGUI::__construct ( )

Constructor.

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

References $DIC.

17  {
18  global $DIC;
19  $this->lng = $DIC->language();
20  }
global $DIC
Definition: saml.php:7

Member Function Documentation

◆ addToToolbar()

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

Add to toolbar.

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

References $from, $lng, PHPMailer\PHPMailer\$options, $si, ilToolbarGUI\addInputItem(), ilSession\get(), IL_CAL_DATETIME, ilDateTimeInputGUI\setDate(), ilSelectInputGUI\setOptions(), ilSkillEval\TYPE_APPRAISAL, ilSkillEval\TYPE_MEASUREMENT, and ilSkillEval\TYPE_SELF_EVAL.

26  {
27  $lng = $this->lng;
28 
29  // type of formation
30  $options = array(
31  0 => $lng->txt("skmg_all"),
32  ilSkillEval::TYPE_APPRAISAL => $lng->txt("skmg_eval_type_1"),
33  ilSkillEval::TYPE_MEASUREMENT => $lng->txt("skmg_eval_type_2"),
34  ilSkillEval::TYPE_SELF_EVAL => $lng->txt("skmg_eval_type_3"),
35  );
36  $si = new ilSelectInputGUI($lng->txt("skmg_type_of_formation"), "type_of_formation");
37  $si->setOptions($options);
38  $si->setValue(ilSession::get("skmg_pf_type_of_formation"));
39  $toolbar->addInputItem($si, true);
40 
41  if ($a_include_target) {
42  // target level
43  $options = array(
44  0 => $lng->txt("show"),
45  1 => $lng->txt("hide")
46  );
47  $si = new ilSelectInputGUI($lng->txt("skmg_target_level"), "target_level");
48  $si->setOptions($options);
49  $si->setValue(ilSession::get("skmg_pf_target_level"));
50  $toolbar->addInputItem($si, true);
51  }
52 
53  // materials/ressources
54  $options = array(
55  0 => $lng->txt("show"),
56  1 => $lng->txt("hide")
57  );
58  $si = new ilSelectInputGUI($lng->txt("skmg_materials_ressources"), "mat_res");
59  $si->setOptions($options);
60  $si->setValue(ilSession::get("skmg_pf_mat_res"));
61  $toolbar->addInputItem($si, true);
62 
63  // from
64  $from = new ilDateTimeInputGUI($lng->txt("from"), "from");
65  if (ilSession::get("skmg_pf_from") != "") {
66  $from->setDate(new ilDateTime(ilSession::get("skmg_pf_from"), IL_CAL_DATETIME));
67  }
68  $toolbar->addInputItem($from, true);
69 
70  // to
71  $to = new ilDateTimeInputGUI($lng->txt("to"), "to");
72  if (ilSession::get("skmg_pf_to") != "") {
73  $to->setDate(new ilDateTime(ilSession::get("skmg_pf_to"), IL_CAL_DATETIME));
74  }
75  $toolbar->addInputItem($to, true);
76  }
const IL_CAL_DATETIME
This class represents a selection list property in a property form.
static get($a_var)
Get a value.
$from
This class represents a date/time property in a property form.
addInputItem(ilToolbarItem $a_item, $a_output_label=false)
Add input item.
$lng
setDate(ilDateTime $a_date=null)
set date E.g $dt_form->setDate(new ilDateTime(time(),IL_CAL_UTC)); or $dt_form->setDate(new ilDateTim...
Date and time handling
setOptions($a_options)
Set Options.
+ Here is the call graph for this function:

◆ isInRange()

ilPersonalSkillsFilterGUI::isInRange (   $level_data,
  $level_entry 
)

Is entry in range?

Parameters
array$level_data
array$level_entry
Returns
bool

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

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

107  {
108  // from
109  if (ilSession::get("skmg_pf_from") != "") {
110  if ($level_entry["status_date"] < ilSession::get("skmg_pf_from")) {
111  return false;
112  }
113  }
114 
115  // to
116  if (ilSession::get("skmg_pf_to") != "") {
117  if ($level_entry["status_date"] > ilSession::get("skmg_pf_to")) {
118  return false;
119  }
120  }
121 
122  // type
124  if ($level_entry["self_eval"] == 1) {
126  }
127  if ($level_entry["trigger_obj_type"] == "tst") {
129  }
130  if (ilSession::get("skmg_pf_type_of_formation") > 0 && ilSession::get("skmg_pf_type_of_formation") != $type) {
131  return false;
132  }
133 
134 
135  //var_dump($level_data);
136  //var_dump($level_entry); exit;
137  return true;
138  }
$type
static get($a_var)
Get a value.
+ Here is the call graph for this function:

◆ save()

ilPersonalSkillsFilterGUI::save ( )

Save filter values to session.

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

References $_POST, $f, $from, $t, IL_CAL_DATETIME, ilSession\set(), and ilUtil\stripSlashes().

82  {
83  $from = new ilDateTimeInputGUI("", "from");
84  $from->checkInput();
85  $f = (is_null($from->getDate()))
86  ? ""
87  : $from->getDate()->get(IL_CAL_DATETIME);
88  $to = new ilDateTimeInputGUI("", "to");
89  $to->checkInput();
90  $t = (is_null($to->getDate()))
91  ? ""
92  : $to->getDate()->get(IL_CAL_DATETIME);
93  ilSession::set("skmg_pf_type_of_formation", ilUtil::stripSlashes($_POST["type_of_formation"]));
94  ilSession::set("skmg_pf_target_level", ilUtil::stripSlashes($_POST["target_level"]));
95  ilSession::set("skmg_pf_mat_res", ilUtil::stripSlashes($_POST["mat_res"]));
96  ilSession::set("skmg_pf_from", $f);
97  ilSession::set("skmg_pf_to", $t);
98  }
const IL_CAL_DATETIME
static set($a_var, $a_val)
Set a value.
$from
This class represents a date/time property in a property form.
static stripSlashes($a_str, $a_strip_html=true, $a_allow="")
strip slashes if magic qoutes is enabled
$_POST["username"]
+ Here is the call graph for this function:

◆ showMaterialsRessources()

ilPersonalSkillsFilterGUI::showMaterialsRessources ( )

Show materials and ressources?

Returns
bool

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

References ilSession\get().

154  {
155  return (int) !ilSession::get("skmg_pf_mat_res");
156  }
static get($a_var)
Get a value.
+ Here is the call graph for this function:

◆ showTargetLevel()

ilPersonalSkillsFilterGUI::showTargetLevel ( )

Show target level?

Returns
bool

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

References ilSession\get().

145  {
146  return (int) !ilSession::get("skmg_pf_target_level");
147  }
static get($a_var)
Get a value.
+ Here is the call graph for this function:

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