ILIAS  release_5-2 Revision v5.2.25-18-g3f80b828510
ilIndividualAssessmentSettingsGUI Class Reference
+ Collaboration diagram for ilIndividualAssessmentSettingsGUI:

Public Member Functions

 __construct ($a_parent_gui, $a_ref_id)
 
 executeCommand ()
 

Data Fields

const PROP_CONTENT = "content"
 
const PROP_RECORD_TEMPLATE = "record_template"
 
const PROP_TITLE = "title"
 
const PROP_DESCRIPTION = "description"
 
const PROP_INFO_CONTACT = "contact"
 
const PROP_INFO_RESPONSIBILITY = "responsibility"
 
const PROP_INFO_PHONE = "phone"
 
const PROP_INFO_MAILS = "mails"
 
const PROP_INFO_CONSULTATION = "consultatilon"
 
const TAB_EDIT = 'settings'
 
const TAB_EDIT_INFO = 'infoSettings'
 

Protected Member Functions

 getSubTabs (ilTabsGUI $tabs)
 
 cancel ()
 
 edit ()
 
 editInfo ()
 
 updateInfo ()
 
 renderForm (ilPropertyFormGUI $a_form)
 
 update ()
 
 initSettingsForm ()
 
 initInfoSettingsForm ()
 
 fillInfoForm (ilPropertyFormGUI $a_form, ilIndividualAssessmentInfoSettings $settings)
 
 fillForm (ilPropertyFormGUI $a_form, ilObjIndividualAssessment $iass, ilIndividualAssessmentSettings $settings)
 

Detailed Description

Definition at line 3 of file class.ilIndividualAssessmentSettingsGUI.php.

Constructor & Destructor Documentation

◆ __construct()

ilIndividualAssessmentSettingsGUI::__construct (   $a_parent_gui,
  $a_ref_id 
)

Definition at line 19 of file class.ilIndividualAssessmentSettingsGUI.php.

References $DIC, and getSubTabs().

19  {
20  global $DIC;
21  $this->ctrl = $DIC['ilCtrl'];
22  $this->parent_gui = $a_parent_gui;
23  $this->object = $a_parent_gui->object;
24  $this->ref_id = $a_ref_id;
25  $this->tpl = $DIC['tpl'];
26  $this->lng = $DIC['lng'];
27  $this->tabs_gui = $a_parent_gui->tabsGUI();
28  $this->getSubTabs($this->tabs_gui);
29  }
global $DIC
+ Here is the call graph for this function:

Member Function Documentation

◆ cancel()

ilIndividualAssessmentSettingsGUI::cancel ( )
protected

Definition at line 57 of file class.ilIndividualAssessmentSettingsGUI.php.

57  {
58  $this->ctrl->redirect($this->parent_gui);
59  }

◆ edit()

ilIndividualAssessmentSettingsGUI::edit ( )
protected

Definition at line 61 of file class.ilIndividualAssessmentSettingsGUI.php.

References fillForm(), initSettingsForm(), object, and renderForm().

61  {
62  $this->tabs_gui->setSubTabActive(self::TAB_EDIT);
63  $form = $this->fillForm($this->initSettingsForm()
64  ,$this->object
65  ,$this->object->getSettings());
66  $this->renderForm($form);
67  }
fillForm(ilPropertyFormGUI $a_form, ilObjIndividualAssessment $iass, ilIndividualAssessmentSettings $settings)
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ editInfo()

ilIndividualAssessmentSettingsGUI::editInfo ( )
protected

Definition at line 69 of file class.ilIndividualAssessmentSettingsGUI.php.

References fillInfoForm(), initInfoSettingsForm(), object, and renderForm().

69  {
70  $this->tabs_gui->setSubTabActive(self::TAB_EDIT_INFO);
71  $form = $this->fillInfoForm($this->initInfoSettingsForm()
72  ,$this->object->getInfoSettings());
73  $this->renderForm($form);
74  }
fillInfoForm(ilPropertyFormGUI $a_form, ilIndividualAssessmentInfoSettings $settings)
Create new PHPExcel object
obj_idprivate
+ Here is the call graph for this function:

◆ executeCommand()

ilIndividualAssessmentSettingsGUI::executeCommand ( )

Definition at line 40 of file class.ilIndividualAssessmentSettingsGUI.php.

References $cmd, and object.

40  {
41  $cmd = $this->ctrl->getCmd();
42  switch($cmd) {
43  case 'edit':
44  case 'update':
45  case 'cancel':
46  case 'editInfo':
47  case 'updateInfo':
48  if(!$this->object->accessHandler()->checkAccessToObj($this->object,'write')) {
49  $this->parent_gui->handleAccessViolation();
50  }
51  $this->$cmd();
52  break;
53  }
54  }
$cmd
Definition: sahs_server.php:35
Create new PHPExcel object
obj_idprivate

◆ fillForm()

ilIndividualAssessmentSettingsGUI::fillForm ( ilPropertyFormGUI  $a_form,
ilObjIndividualAssessment  $iass,
ilIndividualAssessmentSettings  $settings 
)
protected

Definition at line 187 of file class.ilIndividualAssessmentSettingsGUI.php.

References array, ilIndividualAssessmentSettings\content(), ilObject\getDescription(), ilObject\getTitle(), ilIndividualAssessmentSettings\recordTemplate(), and ilPropertyFormGUI\setValuesByArray().

Referenced by edit().

187  {
188  $a_form->setValuesByArray(array(
189  self::PROP_TITLE => $iass->getTitle()
190  , self::PROP_DESCRIPTION => $iass->getDescription()
191  , self::PROP_CONTENT => $settings->content()
192  , self::PROP_RECORD_TEMPLATE => $settings->recordTemplate()
193  ));
194  return $a_form;
195  }
recordTemplate()
Get the record template to be used as default record with corresponding object.
content()
Get the content of this assessment, e.g.
getTitle()
get object title public
getDescription()
get object description
Create styles array
The data for the language used.
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ fillInfoForm()

ilIndividualAssessmentSettingsGUI::fillInfoForm ( ilPropertyFormGUI  $a_form,
ilIndividualAssessmentInfoSettings  $settings 
)
protected

Definition at line 176 of file class.ilIndividualAssessmentSettingsGUI.php.

References array, ilIndividualAssessmentInfoSettings\consultationHours(), ilIndividualAssessmentInfoSettings\contact(), ilIndividualAssessmentInfoSettings\mails(), ilIndividualAssessmentInfoSettings\phone(), ilIndividualAssessmentInfoSettings\responsibility(), and ilPropertyFormGUI\setValuesByArray().

Referenced by editInfo().

176  {
177  $a_form->setValuesByArray(array(
178  self::PROP_INFO_CONTACT => $settings->contact()
179  , self::PROP_INFO_RESPONSIBILITY => $settings->responsibility()
180  , self::PROP_INFO_PHONE => $settings->phone()
181  , self::PROP_INFO_MAILS => $settings->mails()
182  , self::PROP_INFO_CONSULTATION => $settings->consultationHours()
183  ));
184  return $a_form;
185  }
Create styles array
The data for the language used.
setValuesByArray($a_values, $a_restrict_to_value_keys=false)
Set form values from an array.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ getSubTabs()

ilIndividualAssessmentSettingsGUI::getSubTabs ( ilTabsGUI  $tabs)
protected

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

References ilTabsGUI\addSubTab().

Referenced by __construct().

31  {
32  $tabs->addSubTab(self::TAB_EDIT,
33  $this->lng->txt("edit"),
34  $this->ctrl->getLinkTarget($this,'edit'));
35  $tabs->addSubTab(self::TAB_EDIT_INFO,
36  $this->lng->txt("iass_edit_info"),
37  $this->ctrl->getLinkTarget($this,'editInfo'));
38  }
addSubTab($a_id, $a_text, $a_link, $a_frame="")
Add a Subtab.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initInfoSettingsForm()

ilIndividualAssessmentSettingsGUI::initInfoSettingsForm ( )
protected

Definition at line 145 of file class.ilIndividualAssessmentSettingsGUI.php.

References ilFormPropertyGUI\setInfo(), and ilTextInputGUI\setSize().

Referenced by editInfo(), and updateInfo().

145  {
146  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
147  $form = new ilPropertyFormGUI();
148  $form->setFormAction($this->ctrl->getFormAction($this));
149  $form->setTitle($this->lng->txt('iass_edit_info'));
150 
151  $ti = new ilTextInputGUI($this->lng->txt('iass_contact'), self::PROP_INFO_CONTACT);
152  $ti->setSize(40);
153  $form->addItem($ti);
154 
155  $ti = new ilTextInputGUI($this->lng->txt('iass_responsibility'), self::PROP_INFO_RESPONSIBILITY);
156  $ti->setSize(40);
157  $form->addItem($ti);
158 
159  $ti = new ilTextInputGUI($this->lng->txt('iass_phone'), self::PROP_INFO_PHONE);
160  $ti->setSize(40);
161  $form->addItem($ti);
162 
163  $ti = new ilTextInputGUI($this->lng->txt('iass_mails'), self::PROP_INFO_MAILS);
164  $ti->setInfo($this->lng->txt('iass_info_emails_expl'));
165  $ti->setSize(300);
166  $form->addItem($ti);
167 
168  $item = new ilTextAreaInputGUI($this->lng->txt('iass_consultation_hours'), self::PROP_INFO_CONSULTATION);
169  $form->addItem($item);
170 
171  $form->addCommandButton('updateInfo', $this->lng->txt('save'));
172  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
173  return $form;
174  }
This class represents a property form user interface.
setInfo($a_info)
Set Information Text.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initSettingsForm()

ilIndividualAssessmentSettingsGUI::initSettingsForm ( )
protected

Definition at line 113 of file class.ilIndividualAssessmentSettingsGUI.php.

References ilTextAreaInputGUI\setCols(), ilFormPropertyGUI\setInfo(), and ilTextInputGUI\setSize().

Referenced by edit(), and update().

113  {
114  include_once("Services/Form/classes/class.ilPropertyFormGUI.php");
115  $form = new ilPropertyFormGUI();
116  $form->setFormAction($this->ctrl->getFormAction($this));
117  $form->setTitle($this->lng->txt('iass_edit'));
118 
119  // title
120  $ti = new ilTextInputGUI($this->lng->txt('title'), self::PROP_TITLE);
121  $ti->setSize(40);
122  $ti->setRequired(true);
123  $form->addItem($ti);
124 
125  // description
126  $ta = new ilTextAreaInputGUI($this->lng->txt('description'), self::PROP_DESCRIPTION);
127  $ta->setCols(40);
128  $ta->setRows(2);
129  $form->addItem($ta);
130 
131 
132  $item = new ilTextAreaInputGUI($this->lng->txt('iass_content'), self::PROP_CONTENT);
133  $item->setInfo($this->lng->txt('iass_content_explanation'));
134  $form->addItem($item);
135 
136  $item = new ilTextAreaInputGUI($this->lng->txt('iass_record_template'), self::PROP_RECORD_TEMPLATE);
137  $item->setInfo($this->lng->txt('iass_record_template_explanation'));
138  $form->addItem($item);
139 
140  $form->addCommandButton('update', $this->lng->txt('save'));
141  $form->addCommandButton('cancel', $this->lng->txt('cancel'));
142  return $form;
143  }
This class represents a property form user interface.
setInfo($a_info)
Set Information Text.
setSize($a_size)
Set Size.
This class represents a text property in a property form.
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ renderForm()

ilIndividualAssessmentSettingsGUI::renderForm ( ilPropertyFormGUI  $a_form)
protected

Definition at line 93 of file class.ilIndividualAssessmentSettingsGUI.php.

References ilPropertyFormGUI\getHTML().

Referenced by edit(), editInfo(), update(), and updateInfo().

93  {
94  $this->tpl->setContent($a_form->getHTML());
95  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ update()

ilIndividualAssessmentSettingsGUI::update ( )
protected

Definition at line 97 of file class.ilIndividualAssessmentSettingsGUI.php.

References $_POST, initSettingsForm(), renderForm(), and ilUtil\sendSuccess().

97  {
98  $this->tabs_gui->setSubTabActive(self::TAB_EDIT);
99  $form = $this->initSettingsForm();
100  $form->setValuesByArray($_POST);
101  if($form->checkInput()) {
102  $this->object->setTitle($_POST[self::PROP_TITLE]);
103  $this->object->setDescription($_POST[self::PROP_DESCRIPTION]);
104  $this->object->getSettings()->setContent($_POST[self::PROP_CONTENT])
105  ->setRecordTemplate($_POST[self::PROP_RECORD_TEMPLATE]);
106  $this->object->update();
107  ilUtil::sendSuccess($this->lng->txt('iass_settings_saved'));
108  }
109  $this->renderForm($form);
110  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

◆ updateInfo()

ilIndividualAssessmentSettingsGUI::updateInfo ( )
protected

Definition at line 76 of file class.ilIndividualAssessmentSettingsGUI.php.

References $_POST, initInfoSettingsForm(), renderForm(), and ilUtil\sendSuccess().

76  {
77  $this->tabs_gui->setSubTabActive(self::TAB_EDIT_INFO);
78  $form = $this->initInfoSettingsForm();
79  $form->setValuesByArray($_POST);
80  if($form->checkInput()) {
81  $this->object->getInfoSettings()
82  ->setContact($_POST[self::PROP_INFO_CONTACT])
83  ->setResponsibility($_POST[self::PROP_INFO_RESPONSIBILITY])
84  ->setPhone($_POST[self::PROP_INFO_PHONE])
85  ->setMails($_POST[self::PROP_INFO_MAILS])
86  ->setConsultationHours($_POST[self::PROP_INFO_CONSULTATION]);
87  $this->object->updateInfo();
88  ilUtil::sendSuccess($this->lng->txt('iass_settings_saved'));
89  }
90  $this->renderForm($form);
91  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
$_POST["username"]
+ Here is the call graph for this function:

Field Documentation

◆ PROP_CONTENT

const ilIndividualAssessmentSettingsGUI::PROP_CONTENT = "content"

Definition at line 5 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ PROP_DESCRIPTION

const ilIndividualAssessmentSettingsGUI::PROP_DESCRIPTION = "description"

Definition at line 8 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ PROP_INFO_CONSULTATION

const ilIndividualAssessmentSettingsGUI::PROP_INFO_CONSULTATION = "consultatilon"

Definition at line 14 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ PROP_INFO_CONTACT

const ilIndividualAssessmentSettingsGUI::PROP_INFO_CONTACT = "contact"

Definition at line 10 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ PROP_INFO_MAILS

const ilIndividualAssessmentSettingsGUI::PROP_INFO_MAILS = "mails"

Definition at line 13 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ PROP_INFO_PHONE

const ilIndividualAssessmentSettingsGUI::PROP_INFO_PHONE = "phone"

Definition at line 12 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ PROP_INFO_RESPONSIBILITY

const ilIndividualAssessmentSettingsGUI::PROP_INFO_RESPONSIBILITY = "responsibility"

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

◆ PROP_RECORD_TEMPLATE

const ilIndividualAssessmentSettingsGUI::PROP_RECORD_TEMPLATE = "record_template"

Definition at line 6 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ PROP_TITLE

const ilIndividualAssessmentSettingsGUI::PROP_TITLE = "title"

Definition at line 7 of file class.ilIndividualAssessmentSettingsGUI.php.

◆ TAB_EDIT

const ilIndividualAssessmentSettingsGUI::TAB_EDIT = 'settings'

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

◆ TAB_EDIT_INFO

const ilIndividualAssessmentSettingsGUI::TAB_EDIT_INFO = 'infoSettings'

Definition at line 17 of file class.ilIndividualAssessmentSettingsGUI.php.


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