19 declare(strict_types=1);
60 $this->container =
$DIC;
66 ->retrieve(
"ref_id", $this->container->refinery()->kindlyTo()->int());
69 $this->container->language()->loadLanguageModule(
'mst');
70 $this->container->language()->loadLanguageModule(
'trac');
71 $this->container->language()->loadLanguageModule(
'etal');
72 $this->container->language()->loadLanguageModule(
'dateplaner');
76 $wrapper = $this->container->http()->wrapper()->query();
78 if ($wrapper->has(
'usr_id')) {
79 $this->userId = $wrapper->retrieve(
'usr_id', $this->container->refinery()->kindlyTo()->int());
91 if (!$talkAccess->canCreate()) {
92 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
"permission_denied"),
true);
93 $this->
ctrl->redirectByClass(ilDashboardGUI::class,
"");
99 $this->link_to_parent = $link;
104 if (isset($this->link_to_parent)) {
105 $this->
ctrl->redirectToURL($this->link_to_parent);
107 $this->
ctrl->redirectByClass(strtolower(ilEmployeeTalkMyStaffListGUI::class));
115 $next_class = $this->container->ctrl()->getNextClass($this);
117 switch ($next_class) {
118 case strtolower(ilRepositorySearchGUI::class):
120 $repo->addUserAccessFilterCallable(
function ($user_ids) {
143 $this->container->ctrl()->forwardCommand($repo);
146 parent::executeCommand();
156 $this->tabs_gui->clearTargets();
157 $this->tpl->resetHeaderBlock();
166 if ($perm ===
'create') {
187 $newObject = $new_object;
192 $this->createRecurringTalks($newObject, $event);
194 $this->tpl->setOnScreenMessage(
'success', $this->
lng->txt(
"object_added"),
true);
200 $this->
ctrl->setParameter($this,
"new_type", $this->requested_new_type);
204 $userName = (string) $form->
getInput(
'etal_employee');
209 !$talkAccess->canCreate(
new ilObjUser($userId))
212 ->setAlert($this->
lng->txt(
'etal_invalid_user'));
213 $this->tpl->setOnScreenMessage(
215 $this->
lng->txt(
'form_input_not_valid')
218 $this->tpl->setContent($form->
getHTML());
222 $this->
ctrl->setParameter($this,
"new_type",
"");
224 $class_name =
"ilObj" . $this->obj_definition->getClassName($this->requested_new_type);
225 $newObj =
new $class_name();
226 $newObj->setType($this->requested_new_type);
227 $newObj->setTitle($form->
getInput(
"title"));
228 $newObj->setDescription($form->
getInput(
"desc"));
237 $this->tpl->setContent($form->
getHTML());
245 $form->
setTitle($this->
lng->txt($new_type .
"_new"));
251 $ti->setRequired(
true);
262 $dur->setRequired(
true);
263 $dur->enableToggleFullTime(
264 $this->
lng->txt(
'cal_fullday_title'),
267 $dur->setShowTime(
true);
275 $cal->allowUnlimitedRecurrences(
false);
276 $cal->setRecurrence($event);
286 $login->setRequired(
true);
287 $login->setDataSource($this->
ctrl->getLinkTargetByClass([
288 strtolower(self::class),
289 strtolower(ilRepositorySearchGUI::class)
290 ],
'doUserAutoComplete',
'',
true));
292 if ($this->userId !== -1) {
318 self::_goto((
string) $this->ref_id);
331 $this->notif_handler->send(NotificationType::INVITATION, ...$talks);
344 switch ($this->
form->getInput(
'frequence')) {
346 $rec->setFrequenceType($this->
form->getInput(
'frequence'));
347 $rec->setInterval((
int) $this->
form->getInput(
'count_DAILY'));
351 $rec->setFrequenceType($this->
form->getInput(
'frequence'));
352 $rec->setInterval((
int) $this->
form->getInput(
'count_WEEKLY'));
353 if (is_array($this->
form->getInput(
'byday_WEEKLY'))) {
359 $rec->setFrequenceType($this->
form->getInput(
'frequence'));
360 $rec->setInterval((
int) $this->
form->getInput(
'count_MONTHLY'));
361 switch ((
int) $this->
form->getInput(
'subtype_MONTHLY')) {
367 switch ((
int) $this->
form->getInput(
'monthly_byday_day')) {
370 $rec->setBYSETPOS($this->
form->getInput(
'monthly_byday_num'));
371 $rec->setBYDAY(
'MO,TU,WE,TH,FR');
376 $rec->setBYMONTHDAY($this->
form->getInput(
'monthly_byday_num'));
380 $rec->setBYDAY(($this->
form->getInput(
'monthly_byday_num') . $this->
form->getInput(
'monthly_byday_day')));
386 $rec->setBYMONTHDAY($this->
form->getInput(
'monthly_bymonthday'));
392 $rec->setFrequenceType($this->
form->getInput(
'frequence'));
393 $rec->setInterval((
int) $this->
form->getInput(
'count_YEARLY'));
394 switch ((
int) $this->
form->getInput(
'subtype_YEARLY')) {
400 $rec->setBYMONTH($this->
form->getInput(
'yearly_bymonth_byday'));
401 $rec->setBYDAY(($this->
form->getInput(
'yearly_byday_num') . $this->
form->getInput(
'yearly_byday')));
405 $rec->setBYMONTH($this->
form->getInput(
'yearly_bymonth_by_monthday'));
406 $rec->setBYMONTHDAY($this->
form->getInput(
'yearly_bymonthday'));
413 switch ((
int) $this->
form->getInput(
'until_type')) {
415 $rec->setFrequenceUntilDate(null);
420 $rec->setFrequenceUntilDate(null);
421 $rec->setFrequenceUntilCount((
int) $this->
form->getInput(
'count'));
425 $frequence = $this->
form->getItemByPostVar(
'frequence');
426 $end = $frequence->getRecurrence()->getFrequenceUntilDate();
427 $rec->setFrequenceUntilCount(0);
428 $rec->setFrequenceUntilDate($end);
440 $employee = $this->
form->getInput(
'etal_employee');
441 [
'fullday' => $tgl] = $this->
form->getInput(
'etal_event');
446 $dateTimeInput = $this->
form->getItemByPostVar(
'etal_event');
447 [
'start' => $start,
'end' => $end] = $dateTimeInput->getValue();
460 boolval(intval($tgl)),
481 $this->md_handler->copyValues(
482 $template->getType(),
499 $data = $this->loadEtalkData();
502 $data->getStartDate(),
508 $periodStart = clone
$data->getStartDate();
510 $periodEnd = clone
$data->getStartDate();
512 $dateIterator = $calc->calculateDateList($periodStart, $periodEnd);
518 $talkSession->setTitle($this->
form->getInput(
'title'));
519 $talkSession->setDescription($this->
form->getInput(
'desc'));
521 $talkSession->create();
523 $talkSession->createReference();
524 $talkSession->putInTree($talk->
getRefId());
526 $data->setObjectId($talkSession->getId());
527 $talkSession->setData(
$data);
528 $talkSession->update();
530 $talks[] = $talkSession;
538 $dateIterator->removeByDAY($periodStart);
539 $dateIterator->rewind();
544 foreach ($dateIterator as $date) {
545 $cloneObject = $talkSession->cloneObject($talk->
getRefId());
546 $cloneData = $cloneObject->getData();
548 $cloneData->setStartDate($date);
550 if ($cloneData->isAllDay()) {
555 $cloneObject->setData($cloneData);
556 $cloneObject->update();
557 $talks[] = $cloneObject;
569 $children = $DIC->repositoryTree()->getChildIds((
int) $refId);
576 if (empty($children)) {
577 $DIC->ui()->mainTemplate()->setOnScreenMessage(
579 $DIC->language()->txt(
"permission_denied"),
582 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class,
"");
584 ilObjEmployeeTalkGUI::_goto((
string) $children[0]);
590 if ($this->container->http()->wrapper()->query()->has(
'template')) {
591 $refId = $this->container->http()->wrapper()->query()->retrieve(
593 $this->container->refinery()->kindlyTo()->int()
600 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'etal_create_invalid_template_ref'),
true);
omitLocator(bool $omit=true)
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
static _lookupId($a_user_str)
checkPermissionBool(string $perm, string $cmd="", string $type="", ?int $ref_id=null)
Talk Series does not use RBAC and therefore does not require the usual permission checks...
ILIAS DI Container $container
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
getFrequenceType()
Get Frequence type of recurrence.
static getUserIdByLogin(string $a_login)
static _exists(int $id, bool $reference=false, ?string $type=null)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
initDidacticTemplate(ilPropertyFormGUI $form)
static _loginExists(string $a_login, int $a_user_id=0)
check if a login name already exists You may exclude a user from the check by giving his user id as 2...
loadRecurrenceSettings()
load recurrence settings
sendNotification(ilObjEmployeeTalk ... $talks)
static _lookupObjectId(int $ref_id)
setLinkToParentGUI(string $link)
afterSave(ilObject $new_object)
Post (successful) object creation hook.
initCreationForms($new_type)
static _goto(string $refId)
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position.
form( $class_path, string $cmd, string $submit_caption="")
NotificationHandlerInterface $notif_handler
This class represents a text area property in a property form.
Class ilContainerGUI This is a base GUI class for all container objects in ILIAS: root folder...
setTitleAndDescription()
This GUI is only called when creating a talk (series).
initCreateForm(string $new_type)
MetadataHandlerInterface $md_handler
setDescription(string $description)
copyTemplateValues(ilObjEmployeeTalkSeries $talk)
Copy the template values, into the talk series object.
Class ilObjEmployeeTalkGUI.