ILIAS  release_5-0 Revision 5.0.0-1144-gc4397b1f870
All Data Structures Namespaces Files Functions Variables Modules Pages
ilOrgUnitTypeGUI Class Reference

Class ilOrgUnitTypeGUI. More...

+ Collaboration diagram for ilOrgUnitTypeGUI:

Public Member Functions

 __construct (ilObjOrgUnitGUI $parent_gui)
 
 executeCommand ()
 

Data Fields

 $ctrl
 
 $tpl
 
 $tabs
 

Protected Member Functions

 checkAccess ()
 Check if user can edit types. More...
 
 setSubTabsEdit ($active_tab_id)
 Add subtabs for editing type. More...
 
 editCustomIcons ()
 Display form for editing custom icons. More...
 
 updateCustomIcons ()
 Save icon. More...
 
 editAMD ()
 
 updateAMD ()
 
 listTypes ()
 Display all types in a table with actions to edit/delete. More...
 
 add ()
 Display form to create a new OrgUnit type. More...
 
 edit ()
 Display form to edit an existing OrgUnit type. More...
 
 create ()
 Create (save) type. More...
 
 update ()
 Update (save) type. More...
 
 delete ()
 Delete a type. More...
 

Protected Attributes

 $access
 
 $toolbar
 
 $locator
 
 $log
 
 $ilias
 
 $lng
 
 $parent_gui
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilOrgUnitTypeGUI::__construct ( ilObjOrgUnitGUI  $parent_gui)
Parameters
ilObjOrgUnitGUI$parent_gui

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

References $ilCtrl, $ilias, $ilLog, $lng, $parent_gui, $tpl, and checkAccess().

60  {
61  global $tpl, $ilCtrl, $ilAccess, $ilToolbar, $ilLocator, $tree, $lng, $ilLog, $ilias, $ilTabs;
62  $this->tpl = $tpl;
63  $this->ctrl = $ilCtrl;
64  $this->access = $ilAccess;
65  $this->locator = $ilLocator;
66  $this->toolbar = $ilToolbar;
67  $this->tabs = $ilTabs;
68  $this->log = $ilLog;
69  $this->lng = $lng;
70  $this->ilias = $ilias;
71  $this->parent_gui = $parent_gui;
72  $this->lng->loadLanguageModule('orgu');
73  $this->ctrl->saveParameter($this, 'type_id');
74  $this->lng->loadLanguageModule('meta');
75  $this->checkAccess();
76  }
checkAccess()
Check if user can edit types.
global $ilCtrl
Definition: ilias.php:18
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the call graph for this function:

Member Function Documentation

◆ add()

ilOrgUnitTypeGUI::add ( )
protected

Display form to create a new OrgUnit type.

Definition at line 211 of file class.ilOrgUnitTypeGUI.php.

Referenced by executeCommand().

211  {
212  $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
213  $this->tpl->setContent($form->getHTML());
214  }
Class ilOrgUnitType.
Class ilOrgUnitTypeFormGUI.
+ Here is the caller graph for this function:

◆ checkAccess()

ilOrgUnitTypeGUI::checkAccess ( )
protected

Check if user can edit types.

Definition at line 131 of file class.ilOrgUnitTypeGUI.php.

References ilUtil\sendFailure().

Referenced by __construct().

131  {
132  if (!$this->access->checkAccess("write", "", $this->parent_gui->object->getRefId())) {
133  ilUtil::sendFailure($this->lng->txt("permission_denied"), true);
134  $this->ctrl->redirect($this->parent_gui);
135  }
136  }
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ create()

ilOrgUnitTypeGUI::create ( )
protected

Create (save) type.

Definition at line 230 of file class.ilOrgUnitTypeGUI.php.

References ilUtil\sendSuccess().

Referenced by executeCommand().

230  {
231  $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType());
232  if ($form->saveObject()) {
233  ilUtil::sendSuccess($this->lng->txt('msg_obj_created'), true);
234  $this->ctrl->redirect($this);
235  } else {
236  $this->tpl->setContent($form->getHTML());
237  }
238  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilOrgUnitType.
Class ilOrgUnitTypeFormGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ delete()

ilOrgUnitTypeGUI::delete ( )
protected

Delete a type.

Definition at line 258 of file class.ilOrgUnitTypeGUI.php.

References $_GET, ilUtil\sendFailure(), and ilUtil\sendSuccess().

258  {
259  $type = new ilOrgUnitType((int)$_GET['type_id']);
260  try {
261  $type->delete();
262  ilUtil::sendSuccess($this->lng->txt('orgu_type_msg_deleted'), true);
263  $this->ctrl->redirect($this);
264  } catch (ilException $e) {
265  ilUtil::sendFailure($e->getMessage(), true);
266  $this->ctrl->redirect($this);
267  }
268  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Base class for ILIAS Exception handling.
Class ilOrgUnitType.
$_GET["client_id"]
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
+ Here is the call graph for this function:

◆ edit()

ilOrgUnitTypeGUI::edit ( )
protected

Display form to edit an existing OrgUnit type.

Definition at line 220 of file class.ilOrgUnitTypeGUI.php.

References $_GET.

Referenced by executeCommand().

220  {
221  $type = new ilOrgUnitType((int)$_GET['type_id']);
222  $form = new ilOrgUnitTypeFormGUI($this, $type);
223  $this->tpl->setContent($form->getHTML());
224  }
Class ilOrgUnitType.
$_GET["client_id"]
Class ilOrgUnitTypeFormGUI.
+ Here is the caller graph for this function:

◆ editAMD()

ilOrgUnitTypeGUI::editAMD ( )
protected

Definition at line 177 of file class.ilOrgUnitTypeGUI.php.

References $_GET.

Referenced by executeCommand().

177  {
178  $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
179  $this->tpl->setContent($form->getHTML());
180  }
Class ilOrgUnitType.
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ editCustomIcons()

ilOrgUnitTypeGUI::editCustomIcons ( )
protected

Display form for editing custom icons.

Definition at line 157 of file class.ilOrgUnitTypeGUI.php.

References $_GET.

Referenced by executeCommand().

157  {
158  $form = new ilOrgUnitTypeCustomIconsFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
159  $this->tpl->setContent($form->getHTML());
160  }
Class ilOrgUnitType.
$_GET["client_id"]
+ Here is the caller graph for this function:

◆ executeCommand()

ilOrgUnitTypeGUI::executeCommand ( )

Definition at line 79 of file class.ilOrgUnitTypeGUI.php.

References $cmd, add(), create(), edit(), editAMD(), editCustomIcons(), listTypes(), setSubTabsEdit(), update(), updateAMD(), and updateCustomIcons().

79  {
80  $cmd = $this->ctrl->getCmd();
81  $next_class = $this->ctrl->getNextClass($this);
82  switch ($next_class) {
83  case '':
84  switch ($cmd) {
85  case '':
86  case 'listTypes':
87  $this->listTypes();
88  break;
89  case 'add':
90  $this->add();
91  break;
92  case 'edit':
93  $this->setSubTabsEdit('general');
94  $this->edit();
95  break;
96  case 'editCustomIcons':
97  $this->setSubTabsEdit('custom_icons');
98  $this->editCustomIcons();
99  break;
100  case 'editAMD':
101  $this->setSubTabsEdit('amd');
102  $this->editAMD();
103  break;
104  case 'updateAMD':
105  $this->setSubTabsEdit('amd');
106  $this->updateAMD();
107  break;
108  case 'updateCustomIcons':
109  $this->setSubTabsEdit('custom_icons');
110  $this->updateCustomIcons();
111  break;
112  case 'create':
113  $this->create();
114  break;
115  case 'update':
116  $this->setSubTabsEdit('general');
117  $this->update();
118  break;
119  case 'delete':
120  $this->delete();
121  break;
122  }
123  break;
124  }
125  }
update()
Update (save) type.
edit()
Display form to edit an existing OrgUnit type.
create()
Create (save) type.
$cmd
Definition: sahs_server.php:35
setSubTabsEdit($active_tab_id)
Add subtabs for editing type.
editCustomIcons()
Display form for editing custom icons.
listTypes()
Display all types in a table with actions to edit/delete.
add()
Display form to create a new OrgUnit type.
+ Here is the call graph for this function:

◆ listTypes()

ilOrgUnitTypeGUI::listTypes ( )
protected

Display all types in a table with actions to edit/delete.

Definition at line 197 of file class.ilOrgUnitTypeGUI.php.

References ilLinkButton\getInstance().

Referenced by executeCommand().

197  {
198  $button = ilLinkButton::getInstance();
199  $button->setCaption('orgu_type_add');
200  $button->setUrl($this->ctrl->getLinkTarget($this, 'add'));
201  $this->toolbar->addButtonInstance($button);
202 
203  $table = new ilOrgUnitTypeTableGUI($this, 'listTypes');
204  $this->tpl->setContent($table->getHTML());
205  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setSubTabsEdit()

ilOrgUnitTypeGUI::setSubTabsEdit (   $active_tab_id)
protected

Add subtabs for editing type.

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

Referenced by executeCommand().

142  {
143  $this->tabs->addSubTab('general', $this->lng->txt('meta_general'), $this->ctrl->getLinkTarget($this, 'edit'));
144  if ($this->ilias->getSetting('custom_icons')) {
145  $this->tabs->addSubTab('custom_icons', $this->lng->txt('icon_settings'), $this->ctrl->getLinkTarget($this, 'editCustomIcons'));
146  }
147  if (count(ilOrgUnitType::getAvailableAdvancedMDRecordIds())) {
148  $this->tabs->addSubTab('amd', $this->lng->txt('md_advanced'), $this->ctrl->getLinkTarget($this, 'editAMD'));
149  }
150  $this->tabs->setSubTabActive($active_tab_id);
151  }
redirection script todo: (a better solution should control the processing via a xml file) ...
+ Here is the caller graph for this function:

◆ update()

ilOrgUnitTypeGUI::update ( )
protected

Update (save) type.

Definition at line 244 of file class.ilOrgUnitTypeGUI.php.

References $_GET, and ilUtil\sendSuccess().

Referenced by executeCommand().

244  {
245  $form = new ilOrgUnitTypeFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
246  if ($form->saveObject()) {
247  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
248  $this->ctrl->redirect($this);
249  } else {
250  $this->tpl->setContent($form->getHTML());
251  }
252  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilOrgUnitType.
$_GET["client_id"]
Class ilOrgUnitTypeFormGUI.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateAMD()

ilOrgUnitTypeGUI::updateAMD ( )
protected

Definition at line 183 of file class.ilOrgUnitTypeGUI.php.

References $_GET, and ilUtil\sendSuccess().

Referenced by executeCommand().

183  {
184  $form = new ilOrgUnitTypeAdvancedMetaDataFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
185  if ($form->saveObject()) {
186  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
187  $this->ctrl->redirect($this);
188  } else {
189  $this->tpl->setContent($form->getHTML());
190  }
191  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilOrgUnitType.
$_GET["client_id"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ updateCustomIcons()

ilOrgUnitTypeGUI::updateCustomIcons ( )
protected

Save icon.

Definition at line 166 of file class.ilOrgUnitTypeGUI.php.

References $_GET, and ilUtil\sendSuccess().

Referenced by executeCommand().

166  {
167  $form = new ilOrgUnitTypeCustomIconsFormGUI($this, new ilOrgUnitType((int)$_GET['type_id']));
168  if ($form->saveObject()) {
169  ilUtil::sendSuccess($this->lng->txt('msg_obj_modified'), true);
170  $this->ctrl->redirect($this);
171  } else {
172  $this->tpl->setContent($form->getHTML());
173  }
174  }
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
Class ilOrgUnitType.
$_GET["client_id"]
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

Field Documentation

◆ $access

ilOrgUnitTypeGUI::$access
protected

Definition at line 30 of file class.ilOrgUnitTypeGUI.php.

◆ $ctrl

ilOrgUnitTypeGUI::$ctrl

Definition at line 18 of file class.ilOrgUnitTypeGUI.php.

◆ $ilias

ilOrgUnitTypeGUI::$ilias
protected

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

Referenced by __construct().

◆ $lng

ilOrgUnitTypeGUI::$lng
protected

Definition at line 50 of file class.ilOrgUnitTypeGUI.php.

Referenced by __construct().

◆ $locator

ilOrgUnitTypeGUI::$locator
protected

Definition at line 38 of file class.ilOrgUnitTypeGUI.php.

◆ $log

ilOrgUnitTypeGUI::$log
protected

Definition at line 42 of file class.ilOrgUnitTypeGUI.php.

◆ $parent_gui

ilOrgUnitTypeGUI::$parent_gui
protected

Definition at line 54 of file class.ilOrgUnitTypeGUI.php.

Referenced by __construct().

◆ $tabs

ilOrgUnitTypeGUI::$tabs

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

◆ $toolbar

ilOrgUnitTypeGUI::$toolbar
protected

Definition at line 34 of file class.ilOrgUnitTypeGUI.php.

◆ $tpl

ilOrgUnitTypeGUI::$tpl

Definition at line 22 of file class.ilOrgUnitTypeGUI.php.

Referenced by __construct().


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