19 declare(strict_types=1);
63 $refId = $this->
http->wrapper()->query()->retrieve(
69 $DIC->language()->loadLanguageModule(
'mst');
70 $DIC->language()->loadLanguageModule(
'trac');
71 $DIC->language()->loadLanguageModule(
'etal');
72 $DIC->language()->loadLanguageModule(
'dateplaner');
73 $this->
lng = $DIC->language();
74 $this->ui_factory = $DIC->ui()->factory();
79 $DIC->ui()->mainTemplate()->setTitle($this->
lng->txt(
'mst_my_staff'));
88 if (!$this->talkAccess->canRead($this->object->getRefId())) {
89 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
90 $this->
ctrl->redirectByClass(ilDashboardGUI::class,
"");
96 $this->link_to_parent = $link;
101 if (isset($this->link_to_parent)) {
102 $this->
ctrl->redirectToURL($this->link_to_parent);
104 $this->
ctrl->redirectByClass(strtolower(ilEmployeeTalkMyStaffListGUI::class));
110 $this->isReadonly = !$this->talkAccess->canEdit($this->
object->getRefId());
113 $next_class = $this->
ctrl->getNextClass($this);
115 switch ($next_class) {
116 case 'ilpermissiongui':
117 parent::prepareOutput();
118 $this->tabs_gui->activateTab(
'perm_settings');
120 $this->
ctrl->forwardCommand($ilPermissionGUI);
122 case 'ilinfoscreengui':
123 parent::prepareOutput();
124 $this->tabs_gui->activateTab(
'info_short');
126 $this->
ctrl->forwardCommand($ilInfoScreenGUI);
128 case strtolower(ilRepositorySearchGUI::class):
136 $this->
ctrl->forwardCommand($repo);
138 case strtolower(ilEmployeeTalkAppointmentGUI::class):
146 $this->notif_handler,
149 $this->
ctrl->forwardCommand($appointmentGUI);
151 case strtolower(ilPropertyFormGUI::class):
157 $form = $this->getMetadataForm()->getFormGUI();
158 $this->
ctrl->forwardCommand($form);
161 parent::executeCommand();
167 $this->tabs_gui->activateTab(
'settings');
176 $this->tpl->setContent($form->
getHTML());
181 $refId = $this->
object->getRefId();
183 $oldLockSettings =
$settings->isLockedEditing();
184 $lockEdititngForOthers = boolval(
185 intval($form->
getInput(
'etal_settings_locked_for_others'))
187 if ($oldLockSettings === $lockEdititngForOthers) {
191 return $this->talkAccess->canEditTalkLockStatus(
$refId);
201 $this->
object->setTitle($form->
getInput(
"title"));
202 $this->
object->setDescription($form->
getInput(
"desc"));
204 $this->
object->update();
211 $this->tabs_gui->activateTab(
"settings");
214 $this->tpl->setContent($form->getHtml());
219 if (!$this->talkAccess->canDelete($this->ref_id)) {
221 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
227 if ($this->post_wrapper->has(
"interruptive_items")) {
228 $ref_id = $this->post_wrapper->retrieve(
229 "interruptive_items",
240 foreach ($ref_ids as
$refId) {
246 $ru->deleteObjects($this->requested_ref_id, $ref_ids);
247 $trashEnabled = boolval($this->
settings->get(
'enable_trash'));
265 $this->notif_handler->send(NotificationType::UPDATE, ...$talks);
275 $data = $this->
object->getData();
286 $generalSection->setTitle($this->
lng->txt($this->object->getType() .
"_edit"));
290 $ti->setInfo($this->
lng->txt(
'will_update_series_info_title'));
293 $ti->setRequired(
true);
294 $ti->setDisabled($this->isReadonly);
298 $superior->setDisabled(
true);
302 $login->setDisabled(
true);
305 $writeLockForOthers =
new ilCheckboxInputGUI($this->
lng->txt(
"lock_edititng_for_others"),
"etal_settings_locked_for_others");
306 $writeLockForOthers->setInfo($this->
lng->txt(
'will_update_series_info_lock'));
307 $writeLockForOthers->setDisabled(
309 !$this->talkAccess->canEditTalkLockStatus($this->object->getRefId())
311 $form->
addItem($writeLockForOthers);
313 $form->
addItem($generalSection);
319 $ta->setDisabled($this->isReadonly);
324 $location->setDisabled($this->isReadonly);
328 $completed->setDisabled($this->isReadonly);
333 if (!$this->isReadonly) {
342 if ($this->isReadonly) {
345 $appointment_class = strtolower(ilEmployeeTalkAppointmentGUI::class);
346 $this->
ctrl->setParameterByClass($appointment_class,
'ref_id', $this->ref_id);
348 $this->
ctrl->setParameterByClass(
353 $link_single = $this->
ctrl->getLinkTargetByClass(
355 ControlFlowCommand::UPDATE_INDEX
357 $button_single = $this->ui_factory->button()->standard(
358 $this->
lng->txt(
'change_date_of_talk'),
362 $this->
ctrl->setParameterByClass(
367 $link_all = $this->
ctrl->getLinkTargetByClass(
369 ControlFlowCommand::UPDATE_INDEX
371 $button_all = $this->ui_factory->button()->standard(
372 $this->
lng->txt(
'change_date_of_series'),
376 $this->
ctrl->clearParametersByClass($appointment_class);
378 $this->
toolbar->addComponent($button_single);
379 $this->
toolbar->addComponent($button_all);
387 $data = $this->
object->getData();
388 $parent = $this->
object->getParent();
393 $a_values[
'etal_settings_locked_for_others'] =
$settings->isLockedEditing();
394 $a_values[
'etal_location'] =
$data->getLocation();
395 $a_values[
'etal_completed'] =
$data->isCompleted();
403 $series = $this->
object->getParent();
404 $updated_series =
false;
407 $completed = boolval(
408 intval($form->
getInput(
'etal_completed'))
410 $lockEdititngForOthers = boolval(
411 intval($form->
getInput(
'etal_settings_locked_for_others'))
415 if ($lockEdititngForOthers !==
$settings->isLockedEditing()) {
416 $settings->setLockedEditing($lockEdititngForOthers);
418 $updated_series =
true;
425 $data = $this->
object->getData();
426 $data->setCompleted($completed);
428 $this->
object->setData(
$data);
433 $parent = $this->
object->getParent();
437 $subTree = $parent->getSubItems()[
'_all'];
443 if ($parent->getTitle() !== $this->
object->getTitle()) {
448 foreach ($subTree as $treeNode) {
449 if (boolval($treeNode[
'deleted']) ===
true) {
453 if ($talk->getId() === $this->
object->getId()) {
456 if ($talk->getTitle() !== $this->
object->getTitle()) {
457 $talk->setTitle($this->
object->getTitle());
460 } elseif ($updated_series) {
465 parent::updateCustom($form);
472 $this->tabs_gui->activateTab(
'view_content');
473 $form = $this->getMetadataForm();
474 $this->tpl->setContent($form->render());
477 public function updateMetadataObject():
void 483 $series = $talk_object->getParent();
485 $form = $this->getMetadataForm();
487 if ($form->importFromPostAndValidate()) {
488 $form->updateMetadata();
489 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_obj_modified"),
true);
491 $this->
ctrl->redirect($this, ControlFlowCommand::INDEX);
494 $this->tabs_gui->activateTab(
'view_content');
495 $this->tpl->setContent($form->render());
500 $this->tabs_gui->addTab(
502 $this->
lng->txt(
"content"),
503 $this->
ctrl->getLinkTarget($this, ControlFlowCommand::INDEX)
505 $this->tabs_gui->addTab(
508 $this->
ctrl->getLinkTargetByClass(strtolower(ilInfoScreenGUI::class),
"showSummary")
510 $this->tabs_gui->addTab(
512 $this->
lng->txt(
"settings"),
513 $this->
ctrl->getLinkTarget($this, ControlFlowCommand::UPDATE)
525 $this->tabs_gui->addTab(
527 $this->
lng->txt(
'perm_settings'),
528 $this->
ctrl->getLinkTargetByClass(
544 $series = $this->
object->getParent();
546 if ($this->isReadonly) {
547 return $this->md_handler->getDisabledEditForm(
550 $this->
object->getType(),
551 $this->
object->getId()
555 return $this->md_handler->getEditForm(
558 $this->
object->getType(),
559 $this->
object->getId(),
560 $this->
ctrl->getFormAction($this,
'updateMetadata'),
562 $this->
lng->txt(
'save')
566 public static function _goto(
string $refId):
void 575 $container->language()->txt(
"permission_denied"),
578 $container->ctrl()->redirectByClass(ilDashboardGUI::class,
"");
580 $container->ctrl()->setParameterByClass(strtolower(self::class),
'ref_id', $refId);
582 strtolower(ilDashboardGUI::class),
583 strtolower(ilMyStaffGUI::class),
584 strtolower(ilEmployeeTalkMyStaffListGUI::class),
585 strtolower(self::class),
586 ], ControlFlowCommand::INDEX);
static get(string $a_var)
omitLocator(bool $omit=true)
validateCustom(ilPropertyFormGUI $form)
sendNotification(ilObjEmployeeTalk ... $talks)
repository()
description: > Example for rendering a repository card
MetadataHandlerInterface $md_handler
addChangeDateButtonsToToolbar()
setLinkToParentGUI(string $link)
loadLanguageModule(string $a_module)
Load language module.
const string EDIT_MODE_APPOINTMENT
NotificationHandlerInterface $notif_handler
addExternalEditFormCustom(ilPropertyFormGUI $form)
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
static http()
Fetches the global http state from ILIAS.
Class ilObjEmployeeTalkGUI.
Class ilObjectGUI Basic methods of all Output classes.
const string EDIT_MODE_SERIES
Repository GUI Utilities.
sendUpdateNotification(ilObjEmployeeTalk ... $talks)
IliasDBEmployeeTalkSeriesRepository $repository
static removeObjectsFromSystem(array $a_ref_ids, bool $a_from_recovery_folder=false)
remove objects from trash bin and all entries therefore every object needs a specific deleteObject() ...
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
__construct(Container $dic, ilPlugin $plugin)
This class represents a text area property in a property form.
Class ilEmployeeTalkAppointmentGUI.
const PRIVACY_MODE_IGNORE_USER_SETTING
afterUpdate()
Post (successful) object update hook.
updateCustom(ilPropertyFormGUI $form)
Insert custom update form values into object.
static clear(string $a_var)
ilObjEmployeeTalkAccess $talkAccess
static set(string $a_var, $a_val)
Set a value.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
static _lookupLogin(int $a_user_id)