ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilObjStudyProgrammeIndividualPlanGUI Class Reference

Class ilObjStudyProgrammeIndividualPlanGUI. More...

+ Collaboration diagram for ilObjStudyProgrammeIndividualPlanGUI:

Public Member Functions

 __construct ($a_parent_gui, $a_ref_id)
 
 executeCommand ()
 
 appendIndividualPlanActions (ilTable2GUI $a_table)
 
 getManualStatusPostVarTitle ()
 
 getRequiredPointsPostVarTitle ()
 
 getManualStatusNone ()
 
 getManualStatusNotRelevant ()
 
 getManualStatusAccredited ()
 

Static Public Member Functions

static getLinkTargetView ($ctrl, $a_ass_id)
 

Data Fields

 $ctrl
 
 $tpl
 
 $object
 
 $ilias
 
 $lng
 
 $toolbar
 
 $user
 
const MANUAL_STATUS_NONE = 0
 
const MANUAL_STATUS_NOT_RELEVANT = 1
 
const MANUAL_STATUS_ACCREDITED = 2
 

Protected Member Functions

 getAssignmentId ()
 
 getAssignmentObject ()
 
 view ()
 
 manage ()
 
 updateFromCurrentPlan ()
 
 updateFromInput ()
 
 updateStatus ()
 
 updateRequiredPoints ($prgrs_id)
 
 showSuccessMessage ($a_lng_var)
 
 getManualStatusUpdates ()
 
 getRequiredPointsUpdates ($prgrs_id)
 
 buildFrame ($tab, $content)
 
 getLinkTargetForSubTab ($a_tab, $a_ass_id)
 

Protected Attributes

 $ilAccess
 
 $ilLog
 
 $parent_gui
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjStudyProgrammeIndividualPlanGUI::__construct (   $a_parent_gui,
  $a_ref_id 
)

Definition at line 60 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $DIC, $ilAccess, $ilCtrl, $ilias, $ilLog, $ilUser, $lng, $tpl, and user().

60  {
61  global $DIC;
62  $tpl = $DIC['tpl'];
63  $ilCtrl = $DIC['ilCtrl'];
64  $ilAccess = $DIC['ilAccess'];
65  $ilToolbar = $DIC['ilToolbar'];
66  $ilLocator = $DIC['ilLocator'];
67  $tree = $DIC['tree'];
68  $lng = $DIC['lng'];
69  $ilLog = $DIC['ilLog'];
70  $ilias = $DIC['ilias'];
71  $ilUser = $DIC['ilUser'];
72 
73  $this->ref_id = $a_ref_id;
74  $this->parent_gui = $a_parent_gui;
75  $this->tpl = $tpl;
76  $this->ctrl = $ilCtrl;
77  $this->ilAccess = $ilAccess;
78  $this->ilLocator = $ilLocator;
79  $this->tree = $tree;
80  $this->toolbar = $ilToolbar;
81  $this->ilLog = $ilLog;
82  $this->ilias = $ilias;
83  $this->lng = $lng;
84  $this->user = $ilUser;
85  $this->assignment_object = null;
86 
87  $this->object = null;
88 
89  $lng->loadLanguageModule("prg");
90 
91  $this->tpl->addCss("Modules/StudyProgramme/templates/css/ilStudyProgramme.css");
92  }
logging
Definition: class.ilLog.php:18
user()
Definition: user.php:4
global $ilCtrl
Definition: ilias.php:18
$ilUser
Definition: imgupload.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
global $DIC
+ Here is the call graph for this function:

Member Function Documentation

◆ appendIndividualPlanActions()

ilObjStudyProgrammeIndividualPlanGUI::appendIndividualPlanActions ( ilTable2GUI  $a_table)

Definition at line 276 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References ilTable2GUI\addCommandButton(), and ilTable2GUI\setFormAction().

276  {
277  $a_table->setFormAction($this->ctrl->getFormAction($this));
278  $a_table->addCommandButton("updateFromCurrentPlan", $this->lng->txt("prg_update_from_current_plan"));
279  $a_table->addCommandButton("updateFromInput", $this->lng->txt("save"));
280  }
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
+ Here is the call graph for this function:

◆ buildFrame()

ilObjStudyProgrammeIndividualPlanGUI::buildFrame (   $tab,
  $content 
)
protected

Definition at line 252 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $tab, $tpl, ilObjUser\_lookupFullname(), array, getAssignmentObject(), and getLinkTargetForSubTab().

Referenced by manage(), and view().

252  {
253  $tpl = new ilTemplate("tpl.indivdual_plan_frame.html", true, true, "Modules/StudyProgramme");
254  $ass = $this->getAssignmentObject();
255 
256  $tpl->setVariable("USERNAME", ilObjUser::_lookupFullname($ass->getUserId()));
257  foreach (array("view", "manage") as $_tab) {
258  $tpl->setCurrentBlock("sub_tab");
259  $tpl->setVariable("CLASS", $_tab == $tab ? "active" : "");
260  $tpl->setVariable("LINK", $this->getLinkTargetForSubTab($_tab, $ass->getId()));
261  $tpl->setVariable("TITLE", $this->lng->txt("prg_$_tab"));
262  $tpl->parseCurrentBlock();
263  }
264  $tpl->setVariable("CONTENT", $content);
265 
266  return $tpl->get();
267  }
static _lookupFullname($a_user_id)
Lookup Full Name.
special template class to simplify handling of ITX/PEAR
Create styles array
The data for the language used.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjStudyProgrammeIndividualPlanGUI::executeCommand ( )

Definition at line 94 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $cmd.

94  {
95  $cmd = $this->ctrl->getCmd();
96 
97  if ($cmd == "") {
98  $cmd = "view";
99  }
100 
101  switch ($cmd) {
102  case "view":
103  case "manage":
104  case "updateFromCurrentPlan":
105  case "updateFromInput":
106  $cont = $this->$cmd();
107  break;
108  default:
109  throw new ilException("ilObjStudyProgrammeMembersGUI: ".
110  "Command not supported: $cmd");
111  }
112 
113  $this->tpl->setContent($cont);
114  }
Base class for ILIAS Exception handling.
$cmd
Definition: sahs_server.php:35

◆ getAssignmentId()

ilObjStudyProgrammeIndividualPlanGUI::getAssignmentId ( )
protected

Definition at line 116 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $_GET.

Referenced by getAssignmentObject(), and updateFromInput().

116  {
117  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserAssignment.php");
118  if (!is_numeric($_GET["ass_id"])) {
119  throw new ilException("Expected integer 'ass_id'");
120  }
121  return (int)$_GET["ass_id"];
122  }
Base class for ILIAS Exception handling.
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ getAssignmentObject()

ilObjStudyProgrammeIndividualPlanGUI::getAssignmentObject ( )
protected

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

References getAssignmentId(), and ilStudyProgrammeUserAssignment\getInstance().

Referenced by buildFrame(), manage(), updateFromCurrentPlan(), and view().

124  {
125  if ($this->assignment_object === null) {
126  $id = $this->getAssignmentId();
127  $this->assignment_object = ilStudyProgrammeUserAssignment::getInstance($id);
128  }
129  return $this->assignment_object;
130  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getLinkTargetForSubTab()

ilObjStudyProgrammeIndividualPlanGUI::getLinkTargetForSubTab (   $a_tab,
  $a_ass_id 
)
protected

Definition at line 269 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

Referenced by buildFrame().

269  {
270  $this->ctrl->setParameter($this, "ass_id", $a_ass_id);
271  $lnk = $this->ctrl->getLinkTarget($this, $a_tab);
272  $this->ctrl->setParameter($this, "ass_id", null);
273  return $lnk;
274  }
+ Here is the caller graph for this function:

◆ getLinkTargetView()

static ilObjStudyProgrammeIndividualPlanGUI::getLinkTargetView (   $ctrl,
  $a_ass_id 
)
static

Definition at line 306 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $ctrl.

Referenced by ilObjStudyProgrammeMembersGUI\getLinkTargetForAction().

306  {
307  $cl = "ilObjStudyProgrammeIndividualPlanGUI";
308  $ctrl->setParameterByClass($cl, "ass_id", $a_ass_id);
309  $link = $ctrl->getLinkTargetByClass($cl, "view");
310  $ctrl->setParameterByClass($cl, "ass_id", null);
311  return $link;
312  }
+ Here is the caller graph for this function:

◆ getManualStatusAccredited()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusAccredited ( )

Definition at line 302 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

302  {
303  return self::MANUAL_STATUS_ACCREDITED;
304  }

◆ getManualStatusNone()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusNone ( )

Definition at line 294 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

294  {
295  return self::MANUAL_STATUS_NONE;
296  }

◆ getManualStatusNotRelevant()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusNotRelevant ( )

Definition at line 298 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

298  {
299  return self::MANUAL_STATUS_NOT_RELEVANT;
300  }

◆ getManualStatusPostVarTitle()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusPostVarTitle ( )

Definition at line 286 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

Referenced by getManualStatusUpdates().

286  {
287  return "status";
288  }
+ Here is the caller graph for this function:

◆ getManualStatusUpdates()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusUpdates ( )
protected

Definition at line 233 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $_POST, and getManualStatusPostVarTitle().

Referenced by updateStatus().

233  {
234  $post_var = $this->getManualStatusPostVarTitle();
235  if (!array_key_exists($post_var, $_POST)) {
236  throw new ilException("Expected array $post_var in POST");
237  }
238  return $_POST[$post_var];
239  }
Base class for ILIAS Exception handling.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRequiredPointsPostVarTitle()

ilObjStudyProgrammeIndividualPlanGUI::getRequiredPointsPostVarTitle ( )

Definition at line 290 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

Referenced by getRequiredPointsUpdates().

290  {
291  return "required_points";
292  }
+ Here is the caller graph for this function:

◆ getRequiredPointsUpdates()

ilObjStudyProgrammeIndividualPlanGUI::getRequiredPointsUpdates (   $prgrs_id)
protected

Definition at line 241 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $_POST, and getRequiredPointsPostVarTitle().

Referenced by updateRequiredPoints().

241  {
242  $post_var = $this->getRequiredPointsPostVarTitle();
243  if (!array_key_exists($post_var, $_POST)) {
244  throw new ilException("Expected array $post_var in POST");
245  }
246 
247  $post_value = $_POST[$post_var];
248  return (int)$post_value[$prgrs_id];
249  }
Base class for ILIAS Exception handling.
$_POST["username"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ manage()

ilObjStudyProgrammeIndividualPlanGUI::manage ( )
protected

Definition at line 142 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References buildFrame(), and getAssignmentObject().

142  {
143  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeIndividualPlanTableGUI.php");
144  $ass = $this->getAssignmentObject();
145  $this->ctrl->setParameter($this, "ass_id", $ass->getId());
146  $this->ctrl->setParameter($this, "cmd", "manage");
147  $table = new ilStudyProgrammeIndividualPlanTableGUI($this, $ass);
148  $frame = $this->buildFrame("manage", $table->getHTML());
149  $this->ctrl->setParameter($this, "ass_id", null);
150  return $frame;
151  }
+ Here is the call graph for this function:

◆ showSuccessMessage()

ilObjStudyProgrammeIndividualPlanGUI::showSuccessMessage (   $a_lng_var)
protected

Definition at line 228 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References ilUtil\sendSuccess().

Referenced by updateFromCurrentPlan(), and updateFromInput().

228  {
229  require_once("Services/Utilities/classes/class.ilUtil.php");
230  ilUtil::sendSuccess($this->lng->txt("prg_$a_lng_var"), true);
231  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateFromCurrentPlan()

ilObjStudyProgrammeIndividualPlanGUI::updateFromCurrentPlan ( )
protected

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

References getAssignmentObject(), and showSuccessMessage().

153  {
154  $ass = $this->getAssignmentObject();
155  $ass->updateFromProgram();
156  $this->ctrl->setParameter($this, "ass_id", $ass->getId());
157  $this->showSuccessMessage("update_from_plan_successful");
158  $this->ctrl->redirect($this, "manage");
159  }
+ Here is the call graph for this function:

◆ updateFromInput()

ilObjStudyProgrammeIndividualPlanGUI::updateFromInput ( )
protected

Definition at line 161 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $changed, getAssignmentId(), showSuccessMessage(), and updateStatus().

161  {
162  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
163 
164  $changed = false;
165 
166  $changed = $this->updateStatus();
167 
168  $this->ctrl->setParameter($this, "ass_id", $this->getAssignmentId());
169  if ($changed) {
170  $this->showSuccessMessage("update_successful");
171  }
172  $this->ctrl->redirect($this, "manage");
173  }
+ Here is the call graph for this function:

◆ updateRequiredPoints()

ilObjStudyProgrammeIndividualPlanGUI::updateRequiredPoints (   $prgrs_id)
protected

Definition at line 205 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $changed, ilStudyProgrammeUserProgress\getInstanceById(), getRequiredPointsUpdates(), ilStudyProgrammeProgress\STATUS_IN_PROGRESS, and user().

Referenced by updateStatus().

205  {
206  $required_points = $this->getRequiredPointsUpdates($prgrs_id);
207  $changed = false;
208 
210  $cur_status = $prgrs->getStatus();
212  return false;
213  }
214 
215  if ($required_points < 0) {
216  $required_points = 0;
217  }
218 
219  if ($required_points == $prgrs->getAmountOfPoints()) {
220  return false;
221  }
222 
223  $prgrs->setRequiredAmountOfPoints($required_points, $this->user->getId());
224  return true;
225 
226  }
user()
Definition: user.php:4
static getInstanceById($a_prgrs_id)
Get an instance by progress id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStatus()

ilObjStudyProgrammeIndividualPlanGUI::updateStatus ( )
protected

Definition at line 175 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $changed, ilStudyProgrammeUserProgress\getInstanceById(), getManualStatusUpdates(), ilStudyProgrammeProgress\STATUS_ACCREDITED, ilStudyProgrammeProgress\STATUS_IN_PROGRESS, ilStudyProgrammeProgress\STATUS_NOT_RELEVANT, updateRequiredPoints(), and user().

Referenced by updateFromInput().

175  {
176  $status_updates = $this->getManualStatusUpdates();
177  $changed = false;
178  foreach ($status_updates as $prgrs_id => $status) {
180  $cur_status = $prgrs->getStatus();
181  if ($status == self::MANUAL_STATUS_NONE && $cur_status == ilStudyProgrammeProgress::STATUS_ACCREDITED) {
182  $prgrs->unmarkAccredited($this->user->getId());
183  $changed = true;
184  }
185  else if ($status == self::MANUAL_STATUS_NONE && $cur_status == ilStudyProgrammeProgress::STATUS_NOT_RELEVANT) {
186  $prgrs->markRelevant($this->user->getId());
187  $changed = true;
188  }
189  else if($status == self::MANUAL_STATUS_NOT_RELEVANT && $cur_status != ilStudyProgrammeProgress::STATUS_NOT_RELEVANT) {
190  $prgrs->markNotRelevant($this->user->getId());
191  $changed = true;
192  }
193  else if($status == self::MANUAL_STATUS_ACCREDITED && $cur_status != ilStudyProgrammeProgress::STATUS_ACCREDITED) {
194  $prgrs->markAccredited($this->user->getId());
195  $changed = true;
196  }
197 
199  $changed = $this->updateRequiredPoints($prgrs_id) || $changed;
200  }
201  }
202  return $changed;
203  }
user()
Definition: user.php:4
static getInstanceById($a_prgrs_id)
Get an instance by progress id.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilObjStudyProgrammeIndividualPlanGUI::view ( )
protected

Definition at line 132 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

References $tpl, buildFrame(), and getAssignmentObject().

132  {
133  require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeIndividualPlanProgressListGUI.php");
134  $gui = new ilStudyProgrammeIndividualPlanProgressListGUI($this->getAssignmentObject()->getRootProgress());
135  $gui->setOnlyRelevant(true);
136  // Wrap a frame around the original gui element to correct rendering.
137  $tpl = new ilTemplate("tpl.individual_plan_tree_frame.html", false, false, "Modules/StudyProgramme");
138  $tpl->setVariable("CONTENT", $gui->getHTML());
139  return $this->buildFrame("view", $tpl->get());
140  }
special template class to simplify handling of ITX/PEAR
+ Here is the call graph for this function:

Field Documentation

◆ $ctrl

ilObjStudyProgrammeIndividualPlanGUI::$ctrl

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

Referenced by getLinkTargetView().

◆ $ilAccess

ilObjStudyProgrammeIndividualPlanGUI::$ilAccess
protected

Definition at line 26 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

Referenced by __construct().

◆ $ilias

ilObjStudyProgrammeIndividualPlanGUI::$ilias

Definition at line 41 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

Referenced by __construct().

◆ $ilLog

ilObjStudyProgrammeIndividualPlanGUI::$ilLog
protected

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

Referenced by __construct().

◆ $lng

ilObjStudyProgrammeIndividualPlanGUI::$lng

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

Referenced by __construct().

◆ $object

ilObjStudyProgrammeIndividualPlanGUI::$object

◆ $parent_gui

ilObjStudyProgrammeIndividualPlanGUI::$parent_gui
protected

◆ $toolbar

ilObjStudyProgrammeIndividualPlanGUI::$toolbar

◆ $tpl

ilObjStudyProgrammeIndividualPlanGUI::$tpl

Definition at line 21 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

Referenced by __construct(), buildFrame(), and view().

◆ $user

ilObjStudyProgrammeIndividualPlanGUI::$user

◆ MANUAL_STATUS_ACCREDITED

const ilObjStudyProgrammeIndividualPlanGUI::MANUAL_STATUS_ACCREDITED = 2

◆ MANUAL_STATUS_NONE

const ilObjStudyProgrammeIndividualPlanGUI::MANUAL_STATUS_NONE = 0

◆ MANUAL_STATUS_NOT_RELEVANT

const ilObjStudyProgrammeIndividualPlanGUI::MANUAL_STATUS_NOT_RELEVANT = 1

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