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) {
311 self::_goto((
string) $this->ref_id);
324 $this->notif_handler->send(NotificationType::INVITATION, ...$talks);
337 switch ($this->
form->getInput(
'frequence')) {
339 $rec->setFrequenceType($this->
form->getInput(
'frequence'));
340 $rec->setInterval((
int) $this->
form->getInput(
'count_DAILY'));
344 $rec->setFrequenceType($this->
form->getInput(
'frequence'));
345 $rec->setInterval((
int) $this->
form->getInput(
'count_WEEKLY'));
346 if (is_array($this->
form->getInput(
'byday_WEEKLY'))) {
352 $rec->setFrequenceType($this->
form->getInput(
'frequence'));
353 $rec->setInterval((
int) $this->
form->getInput(
'count_MONTHLY'));
354 switch ((
int) $this->
form->getInput(
'subtype_MONTHLY')) {
360 switch ((
int) $this->
form->getInput(
'monthly_byday_day')) {
363 $rec->setBYSETPOS($this->
form->getInput(
'monthly_byday_num'));
364 $rec->setBYDAY(
'MO,TU,WE,TH,FR');
369 $rec->setBYMONTHDAY($this->
form->getInput(
'monthly_byday_num'));
373 $rec->setBYDAY(($this->
form->getInput(
'monthly_byday_num') . $this->
form->getInput(
'monthly_byday_day')));
379 $rec->setBYMONTHDAY($this->
form->getInput(
'monthly_bymonthday'));
385 $rec->setFrequenceType($this->
form->getInput(
'frequence'));
386 $rec->setInterval((
int) $this->
form->getInput(
'count_YEARLY'));
387 switch ((
int) $this->
form->getInput(
'subtype_YEARLY')) {
393 $rec->setBYMONTH($this->
form->getInput(
'yearly_bymonth_byday'));
394 $rec->setBYDAY(($this->
form->getInput(
'yearly_byday_num') . $this->
form->getInput(
'yearly_byday')));
398 $rec->setBYMONTH($this->
form->getInput(
'yearly_bymonth_by_monthday'));
399 $rec->setBYMONTHDAY($this->
form->getInput(
'yearly_bymonthday'));
406 switch ((
int) $this->
form->getInput(
'until_type')) {
408 $rec->setFrequenceUntilDate(
null);
413 $rec->setFrequenceUntilDate(
null);
414 $rec->setFrequenceUntilCount((
int) $this->
form->getInput(
'count'));
418 $frequence = $this->
form->getItemByPostVar(
'frequence');
419 $end = $frequence->getRecurrence()->getFrequenceUntilDate();
420 $rec->setFrequenceUntilCount(0);
421 $rec->setFrequenceUntilDate($end);
433 $employee = $this->
form->getInput(
'etal_employee');
434 [
'fullday' => $tgl] = $this->
form->getInput(
'etal_event');
439 $dateTimeInput = $this->
form->getItemByPostVar(
'etal_event');
440 [
'start' => $start,
'end' => $end] = $dateTimeInput->getValue();
453 boolval(intval($tgl)),
474 $this->md_handler->copyValues(
475 $template->getType(),
492 $data = $this->loadEtalkData();
495 $data->getStartDate(),
501 $periodStart = clone
$data->getStartDate();
503 $periodEnd = clone
$data->getStartDate();
505 $dateIterator = $calc->calculateDateList($periodStart, $periodEnd);
511 $talkSession->setTitle($this->
form->getInput(
'title'));
512 $talkSession->setDescription($this->
form->getInput(
'desc'));
514 $talkSession->create();
516 $talkSession->createReference();
517 $talkSession->putInTree($talk->
getRefId());
519 $data->setObjectId($talkSession->getId());
520 $talkSession->setData(
$data);
521 $talkSession->update();
523 $talks[] = $talkSession;
531 $dateIterator->removeByDAY($periodStart);
532 $dateIterator->rewind();
537 foreach ($dateIterator as $date) {
538 $cloneObject = $talkSession->cloneObject($talk->
getRefId());
539 $cloneData = $cloneObject->getData();
541 $cloneData->setStartDate($date);
543 if ($cloneData->isAllDay()) {
548 $cloneObject->setData($cloneData);
549 $cloneObject->update();
550 $talks[] = $cloneObject;
560 $children = $DIC->repositoryTree()->getChildIds((
int) $refId);
567 if (empty($children)) {
568 $DIC->ui()->mainTemplate()->setOnScreenMessage(
570 $DIC->language()->txt(
"permission_denied"),
573 $DIC->ctrl()->redirectByClass(ilDashboardGUI::class,
"");
575 ilObjEmployeeTalkGUI::_goto((
string) $children[0]);
581 if ($this->container->http()->wrapper()->query()->has(
'template')) {
582 $refId = $this->container->http()->wrapper()->query()->retrieve(
584 $this->container->refinery()->kindlyTo()->int()
591 $this->tpl->setOnScreenMessage(
'failure', $this->
lng->txt(
'etal_create_invalid_template_ref'),
true);
omitLocator(bool $omit=true)
static stripSlashes(string $a_str, bool $a_strip_html=true, string $a_allow="")
Model of calendar entry recurrcences based on iCalendar-RFC-5545.
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.
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
static getUserIdByLogin(string $a_login)
static _exists(int $id, bool $reference=false, ?string $type=null)
Calculates an ilDateList for a given calendar entry and recurrence rule.
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.
putObjectInTree(ilObject $obj, ?int $parent_node_id=null)
Add object to tree at given position.
static _goto(string $refId)
form( $class_path, string $cmd, string $submit_caption="")
NotificationHandlerInterface $notif_handler
__construct(Container $dic, ilPlugin $plugin)
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.