ILIAS  release_7 Revision v7.30-3-g800a261c036
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...
 
 clear ()
 
 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: goto.php:24

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 $lng, $si, ilToolbarGUI\addInputItem(), ilSession\get(), IL_CAL_DATETIME, ilDateTimeInputGUI\setDate(), 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
static get($a_var)
Get a value.
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...
+ Here is the call graph for this function:

◆ clear()

ilPersonalSkillsFilterGUI::clear ( )

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

References ilSession\clear().

101  {
102  ilSession::clear("skmg_pf_type_of_formation");
103  ilSession::clear("skmg_pf_target_level");
104  ilSession::clear("skmg_pf_mat_res");
105  ilSession::clear("skmg_pf_from");
106  ilSession::clear("skmg_pf_to");
107  }
static clear($a_var)
Unset a value.
+ 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 115 of file class.ilPersonalSkillsFilterGUI.php.

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

116  {
117  // from
118  if (ilSession::get("skmg_pf_from") != "") {
119  if ($level_entry["status_date"] < ilSession::get("skmg_pf_from")) {
120  return false;
121  }
122  }
123 
124  // to
125  if (ilSession::get("skmg_pf_to") != "") {
126  $to = new ilDateTime(ilSession::get("skmg_pf_to"), IL_CAL_DATETIME);
127  $to->increment(IL_CAL_DAY, 1);
128  if ($level_entry["status_date"] > $to) {
129  return false;
130  }
131  }
132 
133  // type
135  if ($level_entry["self_eval"] == 1) {
137  }
138  if ($level_entry["trigger_obj_type"] == "tst") {
140  }
141  if (ilSession::get("skmg_pf_type_of_formation") > 0 && ilSession::get("skmg_pf_type_of_formation") != $type) {
142  return false;
143  }
144 
145 
146  //var_dump($level_data);
147  //var_dump($level_entry); exit;
148  return true;
149  }
const IL_CAL_DATETIME
$type
static get($a_var)
Get a value.
const IL_CAL_DAY
+ 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, Vendor\Package\$f, 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.
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 164 of file class.ilPersonalSkillsFilterGUI.php.

References ilSession\get().

165  {
166  return (int) !ilSession::get("skmg_pf_mat_res");
167  }
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 155 of file class.ilPersonalSkillsFilterGUI.php.

References ilSession\get().

156  {
157  return (int) !ilSession::get("skmg_pf_target_level");
158  }
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: