3declare(strict_types=1);
55 ->retrieve(
"ref_id", $this->container->refinery()->kindlyTo()->int());
58 $this->container->language()->loadLanguageModule(
'mst');
59 $this->container->language()->loadLanguageModule(
'trac');
60 $this->container->language()->loadLanguageModule(
'etal');
61 $this->container->language()->loadLanguageModule(
'dateplaner');
65 $this->
setReturnLocation(
"save", strtolower(ilEmployeeTalkMyStaffListGUI::class));
68 $this->container->ui()->mainTemplate()->setTitle($this->container->language()->txt(
'mst_my_staff'));
75 if (!$this->talkAccess->canRead(intval($this->
object->getRefId()))) {
76 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
77 $this->
ctrl->redirectByClass(ilDashboardGUI::class,
"");
84 $this->isReadonly = !$this->talkAccess->canEdit(intval($this->
object->getRefId()));
87 $next_class = $this->container->ctrl()->getNextClass($this);
89 switch ($next_class) {
90 case 'ilpermissiongui':
91 parent::prepareOutput();
92 $this->tabs_gui->activateTab(
'perm_settings');
94 $this->
ctrl->forwardCommand($ilPermissionGUI);
96 case 'ilinfoscreengui':
97 parent::prepareOutput();
98 $this->tabs_gui->activateTab(
'info_short');
100 $this->
ctrl->forwardCommand($ilInfoScreenGUI);
102 case strtolower(ilRepositorySearchGUI::class):
110 $this->container->ctrl()->forwardCommand($repo);
112 case strtolower(ilEmployeeTalkAppointmentGUI::class):
117 $this->container->http(),
118 $this->container->refinery(),
119 $this->container->tabs(),
122 $this->container->ctrl()->forwardCommand($appointmentGUI);
125 parent::executeCommand();
131 $this->tabs_gui->activateTab(
'view_content');
148 $oldLockSettings =
$settings->isLockedEditing();
149 $lockEdititngForOthers = boolval(
150 intval($a_form->
getInput(
'etal_settings_locked_for_others'))
152 if ($oldLockSettings === $lockEdititngForOthers) {
156 return $this->talkAccess->canEditTalkLockStatus(
$refId);
164 $this->validateCustom(
$form) &&
165 !$this->isReadonly) {
166 $this->
object->setTitle($form->
getInput(
"title"));
167 $this->
object->setDescription($form->
getInput(
"desc"));
169 $this->
object->update();
176 $this->tabs_gui->activateTab(
"view_content");
178 $this->tpl->setContent(
$form->getHtml());
183 if (!$this->talkAccess->canDelete($this->ref_id)) {
185 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
186 $this->
ctrl->redirectByClass(strtolower(ilEmployeeTalkMyStaffListGUI::class), ControlFlowCommand::DEFAULT,
"",
false);
191 if ($this->post_wrapper->has(
"mref_id")) {
192 $mref_id = $this->post_wrapper->retrieve(
194 $this->
refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
196 $saved_post = array_unique(array_merge(
ilSession::get(
'saved_post'), $mref_id));
204 foreach ($refIds as
$refId) {
208 $ru->deleteObjects($this->requested_ref_id, $refIds);
209 $trashEnabled = boolval($this->container->settings()->get(
'enable_trash'));
213 foreach ($talks as $talk) {
220 $this->
ctrl->redirectByClass(strtolower(ilEmployeeTalkMyStaffListGUI::class), ControlFlowCommand::DEFAULT,
"",
false);
228 $firstTalk = $talks[0];
229 $talk_title = $firstTalk->getTitle();
230 $superior =
new ilObjUser($firstTalk->getOwner());
231 $employee =
new ilObjUser($firstTalk->getData()->getEmployee());
232 $superiorName = $superior->getFullname();
233 $series = $firstTalk->getParent();
240 $a =
$a->getUnixTime();
241 $b =
$b->getUnixTime();
245 return $a <
$b ? -1 : 1;
248 $add_time = $firstTalk->getData()->isAllDay() ? 0 : 1;
250 $timezone = $employee->getTimeZone();
256 $firstTalk->getRefId(),
258 $firstTalk->getDescription(),
259 $firstTalk->getData()->getLocation(),
260 'notification_talks_subject_update',
261 'notification_talks_removed',
269 if ($series->hasChildren()) {
275 VCalendarFactory::getInstanceFromTalks($series)
283 VCalendarFactory::getEmptyInstance($series, $talk_title)
295 if (count($talks) === 0) {
299 $firstTalk = $talks[0];
300 $talk_title = $firstTalk->getTitle();
301 $superior =
new ilObjUser($firstTalk->getOwner());
302 $employee =
new ilObjUser($firstTalk->getData()->getEmployee());
303 $superiorName = $superior->getFullname();
310 $a =
$a->getUnixTime();
311 $b =
$b->getUnixTime();
315 return $a <
$b ? -1 : 1;
318 $add_time = $firstTalk->getData()->isAllDay() ? 0 : 1;
320 $timezone = $employee->getTimeZone();
326 $firstTalk->getRefId(),
328 $firstTalk->getDescription(),
329 $firstTalk->getData()->getLocation(),
330 'notification_talks_subject_update',
331 'notification_talks_updated',
341 VCalendarFactory::getInstanceFromTalks($firstTalk->getParent())
351 $this->
ctrl->redirectByClass(strtolower(ilEmployeeTalkMyStaffListGUI::class), ControlFlowCommand::DEFAULT,
"",
false);
361 $data = $this->
object->getData();
372 $generalSection->setTitle($this->
lng->txt($this->object->getType() .
"_edit"));
376 $ti->setInfo($this->
lng->txt(
'will_update_series_info_title'));
379 $ti->setRequired(
true);
380 $ti->setDisabled($this->isReadonly);
384 $superior->setDisabled(
true);
388 $login->setDisabled(
true);
391 $writeLockForOthers =
new ilCheckboxInputGUI($this->
lng->txt(
"lock_edititng_for_others"),
"etal_settings_locked_for_others");
392 $writeLockForOthers->setInfo($this->
lng->txt(
'will_update_series_info_lock'));
393 $writeLockForOthers->setDisabled($this->isReadonly || !$this->talkAccess->canEditTalkLockStatus(intval($this->
object->getRefId())));
394 $form->
addItem($writeLockForOthers);
402 $ta->setDisabled($this->isReadonly);
407 if (!$this->isReadonly) {
420 $data = $this->
object->getData();
425 $location->setDisabled($this->isReadonly);
429 $completed->setChecked(
$data->isCompleted());
430 $completed->setDisabled($this->isReadonly);
433 $this->container->ctrl()->setParameterByClass(strtolower(ilEmployeeTalkAppointmentGUI::class),
'ref_id', $this->ref_id);
435 if (!$this->isReadonly) {
437 $btnChangeThis->setCaption(
"change_date_of_talk");
439 $btnChangeThis->setUrl($this->
ctrl->getLinkTargetByClass(strtolower(ilEmployeeTalkAppointmentGUI::class), ControlFlowCommand::UPDATE_INDEX) . $editMode);
440 $this->
toolbar->addButtonInstance($btnChangeThis);
443 $btnChangeAll->setCaption(
"change_date_of_series");
445 $btnChangeAll->setUrl($this->
ctrl->getLinkTargetByClass(strtolower(ilEmployeeTalkAppointmentGUI::class), ControlFlowCommand::UPDATE_INDEX) . $editMode);
446 $this->
toolbar->addButtonInstance($btnChangeAll);
449 $md = $this->initMetaDataForm($a_form);
453 if ($this->isReadonly) {
456 $item->__call(
'setValue', [
'']);
457 $item->__call(
'setDisabled', [
true]);
459 if (method_exists($item,
'setDisabled')) {
461 $item->setDisabled(
true);
466 parent::addExternalEditFormCustom($a_form);
474 $data = $this->
object->getData();
475 $parent = $this->
object->getParent();
480 $a_values[
'etal_settings_locked_for_others'] =
$settings->isLockedEditing();
488 $series = $this->
object->getParent();
489 $updated_series =
false;
491 $md = $this->initMetaDataForm($a_form);
493 $md->importEditFormPostValues();
494 $md->writeEditForm($series->getId(), $this->object->getId());
497 $completed = boolval(
498 intval($a_form->
getInput(
'etal_completed'))
500 $lockEdititngForOthers = boolval(
501 intval($a_form->
getInput(
'etal_settings_locked_for_others'))
505 if ($lockEdititngForOthers !==
$settings->isLockedEditing()) {
506 $settings->setLockedEditing($lockEdititngForOthers);
508 $updated_series =
true;
515 $data = $this->
object->getData();
516 $data->setCompleted($completed);
518 $this->
object->setData(
$data);
523 $parent = $this->
object->getParent();
527 $subTree = $parent->getSubItems()[
'_all'];
533 if ($parent->getTitle() !== $this->object->getTitle()) {
538 foreach ($subTree as $treeNode) {
539 if (boolval($treeNode[
'deleted']) ===
true) {
543 if ($talk->getId() === $this->object->getId()) {
546 if ($talk->getTitle() !== $this->object->getTitle()) {
547 $talk->setTitle($this->
object->getTitle());
550 } elseif ($updated_series) {
555 parent::updateCustom($a_form);
562 $this->tabs_gui->activateTab(
'view_content');
568 $this->tabs_gui->addTab(
'view_content', $this->
lng->txt(
"content"), $this->ctrl->getLinkTarget($this, ControlFlowCommand::UPDATE));
569 $this->tabs_gui->addTab(
"info_short",
"Info", $this->
ctrl->getLinkTargetByClass(strtolower(ilInfoScreenGUI::class),
"showSummary"));
581 $this->tabs_gui->addTab(
583 $this->
lng->txt(
'perm_settings'),
584 $this->ctrl->getLinkTargetByClass(
600 $series = $this->
object->getParent();
605 $this->object->getType(),
606 $this->object->getId(),
609 $md->setPropertyForm(
$form);
613 public static function _goto(
string $refId): void
622 $container->language()->txt(
"permission_denied"),
625 $container->ctrl()->redirectByClass(ilDashboardGUI::class,
"");
627 $container->ctrl()->setParameterByClass(strtolower(self::class),
'ref_id',
$refId);
629 strtolower(ilDashboardGUI::class),
630 strtolower(ilMyStaffGUI::class),
631 strtolower(ilEmployeeTalkMyStaffListGUI::class),
632 strtolower(self::class),
633 ], ControlFlowCommand::INDEX);
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static getUserDateFormat(int $a_add_time=0, bool $a_for_parsing=false)
Parse current user setting into date/time format.
@classDescription Date and time handling
Class ilEmployeeTalkAppointmentGUI.
const EDIT_MODE_APPOINTMENT
loadLanguageModule(string $a_module)
Load language module.
Class ilObjEmployeeTalkGUI.
ilObjEmployeeTalkAccess $talkAccess
cancelDeleteObject()
cancel deletion of object
ILIAS DI Container $container
viewObject()
viewObject container presentation for "administration -> repository, trash, permissions"
sendUpdateNotification(array $talks)
confirmedDeleteObject()
confirmed deletion of object -> objects are moved to trash or deleted immediately,...
validateCustom(ilPropertyFormGUI $a_form)
Validate custom values (if not possible with checkInput())
IliasDBEmployeeTalkSeriesRepository $repository
sendNotification(array $talks)
getTabs()
@abstract overwrite in derived GUI class of your object type
updateObject()
updates object entry in object_data
static _lookupLogin(int $a_user_id)
Class ilObjectGUI Basic methods of all Output classes.
setReturnLocation(string $cmd, string $location)
set specific return location for command
addExternalEditFormCustom(ilPropertyFormGUI $form)
afterUpdate()
Post (successful) object update hook.
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
updateCustom(ilPropertyFormGUI $form)
Insert custom update form values into object.
omitLocator(bool $omit=true)
getEditFormCustomValues(array &$a_values)
Add values to custom edit fields.
initEditCustomForm(ilPropertyFormGUI $a_form)
Add custom fields to update form.
static _exists(int $id, bool $reference=false, ?string $type=null)
checks if an object exists in object_data
New PermissionGUI (extends from old ilPermission2GUI) RBAC related output.
Repository GUI Utilities.
static get(string $a_var)
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
This class represents a text area property in a property form.
This class represents a text property in a property form.
const PRIVACY_MODE_IGNORE_USER_SETTING
for( $i=6;$i< 13;$i++) for($i=1; $i< 13; $i++) $d
__construct(Container $dic, ilPlugin $plugin)
@inheritDoc
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples