19 declare(strict_types=1);
63 $this->
http = $DIC->http();
65 $refId = $this->
http->wrapper()->query()->retrieve(
71 $DIC->language()->loadLanguageModule(
'mst');
72 $DIC->language()->loadLanguageModule(
'trac');
73 $DIC->language()->loadLanguageModule(
'etal');
74 $DIC->language()->loadLanguageModule(
'dateplaner');
75 $this->
lng = $DIC->language();
76 $this->ui_factory = $DIC->ui()->factory();
81 $DIC->ui()->mainTemplate()->setTitle($this->
lng->txt(
'mst_my_staff'));
90 if (!$this->talkAccess->canRead($this->object->getRefId())) {
91 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
92 $this->
ctrl->redirectByClass(ilDashboardGUI::class,
"");
98 $this->link_to_parent = $link;
103 if (isset($this->link_to_parent)) {
104 $this->
ctrl->redirectToURL($this->link_to_parent);
106 $this->
ctrl->redirectByClass(strtolower(ilEmployeeTalkMyStaffListGUI::class));
112 $this->isReadonly = !$this->talkAccess->canEdit($this->
object->getRefId());
115 $next_class = $this->
ctrl->getNextClass($this);
117 switch ($next_class) {
118 case 'ilpermissiongui':
119 parent::prepareOutput();
120 $this->tabs_gui->activateTab(
'perm_settings');
122 $this->
ctrl->forwardCommand($ilPermissionGUI);
124 case 'ilinfoscreengui':
125 parent::prepareOutput();
126 $this->tabs_gui->activateTab(
'info_short');
128 $this->
ctrl->forwardCommand($ilInfoScreenGUI);
130 case strtolower(ilRepositorySearchGUI::class):
138 $this->
ctrl->forwardCommand($repo);
140 case strtolower(ilEmployeeTalkAppointmentGUI::class):
148 $this->notif_handler,
151 $this->
ctrl->forwardCommand($appointmentGUI);
153 case strtolower(ilPropertyFormGUI::class):
159 $form = $this->getMetadataForm()->getFormGUI();
160 $this->
ctrl->forwardCommand($form);
163 parent::executeCommand();
169 $this->tabs_gui->activateTab(
'settings');
178 $this->tpl->setContent($form->
getHTML());
183 $refId = $this->
object->getRefId();
185 $oldLockSettings =
$settings->isLockedEditing();
186 $lockEdititngForOthers = boolval(
187 intval($form->
getInput(
'etal_settings_locked_for_others'))
189 if ($oldLockSettings === $lockEdititngForOthers) {
193 return $this->talkAccess->canEditTalkLockStatus(
$refId);
203 $this->
object->setTitle($form->
getInput(
"title"));
204 $this->
object->setDescription($form->
getInput(
"desc"));
206 $this->
object->update();
213 $this->tabs_gui->activateTab(
"settings");
216 $this->tpl->setContent($form->getHtml());
221 if (!$this->talkAccess->canDelete($this->ref_id)) {
223 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
229 if ($this->post_wrapper->has(
"interruptive_items")) {
230 $ref_id = $this->post_wrapper->retrieve(
231 "interruptive_items",
242 foreach ($ref_ids as
$refId) {
248 $ru->deleteObjects($this->requested_ref_id, $ref_ids);
249 $trashEnabled = boolval($this->
settings->get(
'enable_trash'));
267 $this->notif_handler->send(NotificationType::UPDATE, ...$talks);
277 $data = $this->
object->getData();
288 $generalSection->setTitle($this->
lng->txt($this->object->getType() .
"_edit"));
292 $ti->setInfo($this->
lng->txt(
'will_update_series_info_title'));
295 $ti->setRequired(
true);
296 $ti->setDisabled($this->isReadonly);
300 $superior->setDisabled(
true);
304 $login->setDisabled(
true);
307 $writeLockForOthers =
new ilCheckboxInputGUI($this->
lng->txt(
"lock_edititng_for_others"),
"etal_settings_locked_for_others");
308 $writeLockForOthers->setInfo($this->
lng->txt(
'will_update_series_info_lock'));
309 $writeLockForOthers->setDisabled(
311 !$this->talkAccess->canEditTalkLockStatus($this->object->getRefId())
313 $form->
addItem($writeLockForOthers);
315 $form->
addItem($generalSection);
321 $ta->setDisabled($this->isReadonly);
326 $location->setDisabled($this->isReadonly);
330 $completed->setDisabled($this->isReadonly);
335 if (!$this->isReadonly) {
344 if ($this->isReadonly) {
347 $appointment_class = strtolower(ilEmployeeTalkAppointmentGUI::class);
348 $this->
ctrl->setParameterByClass($appointment_class,
'ref_id', $this->ref_id);
350 $this->
ctrl->setParameterByClass(
355 $link_single = $this->
ctrl->getLinkTargetByClass(
357 ControlFlowCommand::UPDATE_INDEX
359 $button_single = $this->ui_factory->button()->standard(
360 $this->
lng->txt(
'change_date_of_talk'),
364 $this->
ctrl->setParameterByClass(
369 $link_all = $this->
ctrl->getLinkTargetByClass(
371 ControlFlowCommand::UPDATE_INDEX
373 $button_all = $this->ui_factory->button()->standard(
374 $this->
lng->txt(
'change_date_of_series'),
378 $this->
ctrl->clearParametersByClass($appointment_class);
380 $this->
toolbar->addComponent($button_single);
381 $this->
toolbar->addComponent($button_all);
389 $data = $this->
object->getData();
390 $parent = $this->
object->getParent();
395 $a_values[
'etal_settings_locked_for_others'] =
$settings->isLockedEditing();
396 $a_values[
'etal_location'] =
$data->getLocation();
397 $a_values[
'etal_completed'] =
$data->isCompleted();
405 $series = $this->
object->getParent();
406 $updated_series =
false;
409 $completed = boolval(
410 intval($form->
getInput(
'etal_completed'))
412 $lockEdititngForOthers = boolval(
413 intval($form->
getInput(
'etal_settings_locked_for_others'))
417 if ($lockEdititngForOthers !==
$settings->isLockedEditing()) {
418 $settings->setLockedEditing($lockEdititngForOthers);
420 $updated_series =
true;
427 $data = $this->
object->getData();
428 $data->setCompleted($completed);
430 $this->
object->setData(
$data);
435 $parent = $this->
object->getParent();
439 $subTree = $parent->getSubItems()[
'_all'];
445 if ($parent->getTitle() !== $this->
object->getTitle()) {
450 foreach ($subTree as $treeNode) {
451 if (boolval($treeNode[
'deleted']) ===
true) {
455 if ($talk->getId() === $this->
object->getId()) {
458 if ($talk->getTitle() !== $this->
object->getTitle()) {
459 $talk->setTitle($this->
object->getTitle());
462 } elseif ($updated_series) {
467 parent::updateCustom($form);
474 $this->tabs_gui->activateTab(
'view_content');
475 $form = $this->getMetadataForm();
476 $this->tpl->setContent($form->render());
479 public function updateMetadataObject():
void 485 $series = $talk_object->getParent();
487 $form = $this->getMetadataForm();
489 if ($form->importFromPostAndValidate()) {
490 $form->updateMetadata();
491 $this->tpl->setOnScreenMessage(
"success", $this->
lng->txt(
"msg_obj_modified"),
true);
493 $this->
ctrl->redirect($this, ControlFlowCommand::INDEX);
496 $this->tabs_gui->activateTab(
'view_content');
497 $this->tpl->setContent($form->render());
502 $this->tabs_gui->addTab(
504 $this->
lng->txt(
"content"),
505 $this->
ctrl->getLinkTarget($this, ControlFlowCommand::INDEX)
507 $this->tabs_gui->addTab(
510 $this->
ctrl->getLinkTargetByClass(strtolower(ilInfoScreenGUI::class),
"showSummary")
512 $this->tabs_gui->addTab(
514 $this->
lng->txt(
"settings"),
515 $this->
ctrl->getLinkTarget($this, ControlFlowCommand::UPDATE)
527 $this->tabs_gui->addTab(
529 $this->
lng->txt(
'perm_settings'),
530 $this->
ctrl->getLinkTargetByClass(
546 $series = $this->
object->getParent();
548 if ($this->isReadonly) {
549 return $this->md_handler->getDisabledEditForm(
552 $this->
object->getType(),
553 $this->
object->getId()
557 return $this->md_handler->getEditForm(
560 $this->
object->getType(),
561 $this->
object->getId(),
562 $this->
ctrl->getFormAction($this,
'updateMetadata'),
564 $this->
lng->txt(
'save')
568 public static function _goto(
string $refId):
void 577 $container->language()->txt(
"permission_denied"),
580 $container->ctrl()->redirectByClass(ilDashboardGUI::class,
"");
582 $container->ctrl()->setParameterByClass(strtolower(self::class),
'ref_id', $refId);
584 strtolower(ilDashboardGUI::class),
585 strtolower(ilMyStaffGUI::class),
586 strtolower(ilEmployeeTalkMyStaffListGUI::class),
587 strtolower(self::class),
588 ], 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)