ILIAS  release_5-1 Revision 5.0.0-5477-g43f3e3fab5f
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.

60 {
61 global $tpl, $ilCtrl, $ilAccess, $ilToolbar, $ilLocator, $tree, $lng, $ilLog, $ilias, $ilUser;
62
63 $this->ref_id = $a_ref_id;
64 $this->parent_gui = $a_parent_gui;
65 $this->tpl = $tpl;
66 $this->ctrl = $ilCtrl;
67 $this->ilAccess = $ilAccess;
68 $this->ilLocator = $ilLocator;
69 $this->tree = $tree;
70 $this->toolbar = $ilToolbar;
71 $this->ilLog = $ilLog;
72 $this->ilias = $ilias;
73 $this->lng = $lng;
74 $this->user = $ilUser;
75 $this->assignment_object = null;
76
77 $this->object = null;
78
79 $lng->loadLanguageModule("prg");
80
81 $this->tpl->addCss("Modules/StudyProgramme/templates/css/ilStudyProgramme.css");
82 }
logging
Definition: class.ilLog.php:19
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file)
global $ilUser
Definition: imgupload.php:15

References $ilAccess, $ilCtrl, $ilias, $ilLog, $ilUser, $lng, and $tpl.

Member Function Documentation

◆ appendIndividualPlanActions()

ilObjStudyProgrammeIndividualPlanGUI::appendIndividualPlanActions ( ilTable2GUI  $a_table)

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

266 {
267 $a_table->setFormAction($this->ctrl->getFormAction($this));
268 $a_table->addCommandButton("updateFromCurrentPlan", $this->lng->txt("prg_update_from_current_plan"));
269 $a_table->addCommandButton("updateFromInput", $this->lng->txt("save"));
270 }
setFormAction($a_form_action, $a_multipart=false)
Set Form action parameter.
addCommandButton($a_cmd, $a_text, $a_onclick='', $a_id="", $a_class=null)
Add Command button.

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

+ Here is the call graph for this function:

◆ buildFrame()

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

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

242 {
243 $tpl = new ilTemplate("tpl.indivdual_plan_frame.html", true, true, "Modules/StudyProgramme");
244 $ass = $this->getAssignmentObject();
245
246 $tpl->setVariable("USERNAME", ilObjUser::_lookupFullname($ass->getUserId()));
247 foreach (array("view", "manage") as $_tab) {
248 $tpl->setCurrentBlock("sub_tab");
249 $tpl->setVariable("CLASS", $_tab == $tab ? "active" : "");
250 $tpl->setVariable("LINK", $this->getLinkTargetForSubTab($_tab, $ass->getId()));
251 $tpl->setVariable("TITLE", $this->lng->txt("prg_$_tab"));
252 $tpl->parseCurrentBlock();
253 }
254 $tpl->setVariable("CONTENT", $content);
255
256 return $tpl->get();
257 }
_lookupFullname($a_user_id)
Lookup Full Name.
special template class to simplify handling of ITX/PEAR

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

Referenced by manage(), and view().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjStudyProgrammeIndividualPlanGUI::executeCommand ( )

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

84 {
85 $cmd = $this->ctrl->getCmd();
86
87 if ($cmd == "") {
88 $cmd = "view";
89 }
90
91 switch ($cmd) {
92 case "view":
93 case "manage":
94 case "updateFromCurrentPlan":
95 case "updateFromInput":
96 $cont = $this->$cmd();
97 break;
98 default:
99 throw new ilException("ilObjStudyProgrammeMembersGUI: ".
100 "Command not supported: $cmd");
101 }
102
103 $this->tpl->setContent($cont);
104 }
Base class for ILIAS Exception handling.
$cmd
Definition: sahs_server.php:35

References $cmd.

◆ getAssignmentId()

ilObjStudyProgrammeIndividualPlanGUI::getAssignmentId ( )
protected

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

106 {
107 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserAssignment.php");
108 if (!is_numeric($_GET["ass_id"])) {
109 throw new ilException("Expected integer 'ass_id'");
110 }
111 return (int)$_GET["ass_id"];
112 }
$_GET["client_id"]

References $_GET.

Referenced by getAssignmentObject(), and updateFromInput().

+ Here is the caller graph for this function:

◆ getAssignmentObject()

ilObjStudyProgrammeIndividualPlanGUI::getAssignmentObject ( )
protected

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

114 {
115 if ($this->assignment_object === null) {
116 $id = $this->getAssignmentId();
117 $this->assignment_object = ilStudyProgrammeUserAssignment::getInstance($id);
118 }
119 return $this->assignment_object;
120 }

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

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

+ 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 259 of file class.ilObjStudyProgrammeIndividualPlanGUI.php.

259 {
260 $this->ctrl->setParameter($this, "ass_id", $a_ass_id);
261 $lnk = $this->ctrl->getLinkTarget($this, $a_tab);
262 $this->ctrl->setParameter($this, "ass_id", null);
263 return $lnk;
264 }

Referenced by buildFrame().

+ Here is the caller graph for this function:

◆ getLinkTargetView()

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

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

296 {
297 $cl = "ilObjStudyProgrammeIndividualPlanGUI";
298 $ctrl->setParameterByClass($cl, "ass_id", $a_ass_id);
299 $link = $ctrl->getLinkTargetByClass($cl, "view");
300 $ctrl->setParameterByClass($cl, "ass_id", null);
301 return $link;
302 }

References $ctrl.

Referenced by ilObjStudyProgrammeMembersGUI\getLinkTargetForAction().

+ Here is the caller graph for this function:

◆ getManualStatusAccredited()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusAccredited ( )

◆ getManualStatusNone()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusNone ( )

◆ getManualStatusNotRelevant()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusNotRelevant ( )

◆ getManualStatusPostVarTitle()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusPostVarTitle ( )

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

276 {
277 return "status";
278 }

Referenced by getManualStatusUpdates().

+ Here is the caller graph for this function:

◆ getManualStatusUpdates()

ilObjStudyProgrammeIndividualPlanGUI::getManualStatusUpdates ( )
protected

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

223 {
224 $post_var = $this->getManualStatusPostVarTitle();
225 if (!array_key_exists($post_var, $_POST)) {
226 throw new ilException("Expected array $post_var in POST");
227 }
228 return $_POST[$post_var];
229 }
$_POST['username']
Definition: cron.php:12

References $_POST, and getManualStatusPostVarTitle().

Referenced by updateStatus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getRequiredPointsPostVarTitle()

ilObjStudyProgrammeIndividualPlanGUI::getRequiredPointsPostVarTitle ( )

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

280 {
281 return "required_points";
282 }

Referenced by getRequiredPointsUpdates().

+ Here is the caller graph for this function:

◆ getRequiredPointsUpdates()

ilObjStudyProgrammeIndividualPlanGUI::getRequiredPointsUpdates (   $prgrs_id)
protected

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

231 {
232 $post_var = $this->getRequiredPointsPostVarTitle();
233 if (!array_key_exists($post_var, $_POST)) {
234 throw new ilException("Expected array $post_var in POST");
235 }
236
237 $post_value = $_POST[$post_var];
238 return (int)$post_value[$prgrs_id];
239 }

References $_POST, and getRequiredPointsPostVarTitle().

Referenced by updateRequiredPoints().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ manage()

ilObjStudyProgrammeIndividualPlanGUI::manage ( )
protected

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

132 {
133 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeIndividualPlanTableGUI.php");
134 $ass = $this->getAssignmentObject();
135 $this->ctrl->setParameter($this, "ass_id", $ass->getId());
136 $this->ctrl->setParameter($this, "cmd", "manage");
137 $table = new ilStudyProgrammeIndividualPlanTableGUI($this, $ass);
138 $frame = $this->buildFrame("manage", $table->getHTML());
139 $this->ctrl->setParameter($this, "ass_id", null);
140 return $frame;
141 }

References buildFrame(), and getAssignmentObject().

+ Here is the call graph for this function:

◆ showSuccessMessage()

ilObjStudyProgrammeIndividualPlanGUI::showSuccessMessage (   $a_lng_var)
protected

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

218 {
219 require_once("Services/Utilities/classes/class.ilUtil.php");
220 ilUtil::sendSuccess($this->lng->txt("prg_$a_lng_var"), true);
221 }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.

References ilUtil\sendSuccess().

Referenced by updateFromCurrentPlan(), and updateFromInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateFromCurrentPlan()

ilObjStudyProgrammeIndividualPlanGUI::updateFromCurrentPlan ( )
protected

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

143 {
144 $ass = $this->getAssignmentObject();
145 $ass->updateFromProgram();
146 $this->ctrl->setParameter($this, "ass_id", $ass->getId());
147 $this->showSuccessMessage("update_from_plan_successful");
148 $this->ctrl->redirect($this, "manage");
149 }

References getAssignmentObject(), and showSuccessMessage().

+ Here is the call graph for this function:

◆ updateFromInput()

ilObjStudyProgrammeIndividualPlanGUI::updateFromInput ( )
protected

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

151 {
152 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeUserProgress.php");
153
154 $changed = false;
155
156 $changed = $this->updateStatus();
157
158 $this->ctrl->setParameter($this, "ass_id", $this->getAssignmentId());
159 if ($changed) {
160 $this->showSuccessMessage("update_successful");
161 }
162 $this->ctrl->redirect($this, "manage");
163 }

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

+ Here is the call graph for this function:

◆ updateRequiredPoints()

ilObjStudyProgrammeIndividualPlanGUI::updateRequiredPoints (   $prgrs_id)
protected

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

195 {
196 $required_points = $this->getRequiredPointsUpdates($prgrs_id);
197 $changed = false;
198
200 $cur_status = $prgrs->getStatus();
202 return false;
203 }
204
205 if ($required_points < 0) {
206 $required_points = 0;
207 }
208
209 if ($required_points == $prgrs->getAmountOfPoints()) {
210 return false;
211 }
212
213 $prgrs->setRequiredAmountOfPoints($required_points, $this->user->getId());
214 return true;
215
216 }
static getInstanceById($a_prgrs_id)
Get an instance by progress id.

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

Referenced by updateStatus().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateStatus()

ilObjStudyProgrammeIndividualPlanGUI::updateStatus ( )
protected

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

165 {
166 $status_updates = $this->getManualStatusUpdates();
167 $changed = false;
168 foreach ($status_updates as $prgrs_id => $status) {
170 $cur_status = $prgrs->getStatus();
171 if ($status == self::MANUAL_STATUS_NONE && $cur_status == ilStudyProgrammeProgress::STATUS_ACCREDITED) {
172 $prgrs->unmarkAccredited($this->user->getId());
173 $changed = true;
174 }
175 else if ($status == self::MANUAL_STATUS_NONE && $cur_status == ilStudyProgrammeProgress::STATUS_NOT_RELEVANT) {
176 $prgrs->markRelevant($this->user->getId());
177 $changed = true;
178 }
179 else if($status == self::MANUAL_STATUS_NOT_RELEVANT && $cur_status != ilStudyProgrammeProgress::STATUS_NOT_RELEVANT) {
180 $prgrs->markNotRelevant($this->user->getId());
181 $changed = true;
182 }
183 else if($status == self::MANUAL_STATUS_ACCREDITED && $cur_status != ilStudyProgrammeProgress::STATUS_ACCREDITED) {
184 $prgrs->markAccredited($this->user->getId());
185 $changed = true;
186 }
187
189 $changed = $this->updateRequiredPoints($prgrs_id) || $changed;
190 }
191 }
192 return $changed;
193 }

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

Referenced by updateFromInput().

+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ view()

ilObjStudyProgrammeIndividualPlanGUI::view ( )
protected

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

122 {
123 require_once("Modules/StudyProgramme/classes/class.ilStudyProgrammeIndividualPlanProgressListGUI.php");
124 $gui = new ilStudyProgrammeIndividualPlanProgressListGUI($this->getAssignmentObject()->getRootProgress());
125 $gui->setOnlyRelevant(true);
126 // Wrap a frame around the original gui element to correct rendering.
127 $tpl = new ilTemplate("tpl.individual_plan_tree_frame.html", false, false, "Modules/StudyProgramme");
128 $tpl->setVariable("CONTENT", $gui->getHTML());
129 return $this->buildFrame("view", $tpl->get());
130 }

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

+ 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

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

Referenced by getManualStatusNone().

◆ MANUAL_STATUS_NOT_RELEVANT

const ilObjStudyProgrammeIndividualPlanGUI::MANUAL_STATUS_NOT_RELEVANT = 1

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