ILIAS  release_8 Revision v8.19-1-g4e8f2f9140c
All Data Structures Namespaces Files Functions Variables Modules Pages
ilObjEmployeeTalkSeriesGUI Class Reference

Class ilObjEmployeeTalkGUI. More...

+ Inheritance diagram for ilObjEmployeeTalkSeriesGUI:
+ Collaboration diagram for ilObjEmployeeTalkSeriesGUI:

Public Member Functions

 __construct ()
 
 executeCommand ()
 
 confirmedDeleteObject ()
 
 cancelDeleteObject ()
 
 cancelObject ()
 
 saveObject ()
 
 viewObject ()
 
 getTabs ()
 
 getAdminTabs ()
 
- Public Member Functions inherited from ilContainerGUI
 executeCommand ()
 
 forwardToPageObject ()
 
 addPageTabs ()
 
 getContainerPageHTML ()
 
 prepareOutput (bool $show_subobjects=true)
 
 getContentGUI ()
 
 renderObject ()
 
 renderBlockAsynchObject ()
 render the object More...
 
 setContentSubTabs ()
 
 showAdministrationPanel ()
 
 showPermanentLink ()
 
 editPageFrameObject ()
 
 cancelPageContentObject ()
 
 showLinkListObject ()
 
 clearAdminCommandsDetermination ()
 
 addHeaderRow (ilTemplate $a_tpl, string $a_type, bool $a_show_image=true)
 
 addMessageRow (ilTemplate $a_tpl, string $a_message, string $a_type)
 
 setPageEditorTabs ()
 
 addStandardContainerSubTabs (bool $a_include_view=true)
 Add standard container subtabs for view, manage, oderdering and text/media editor link. More...
 
 enableAdministrationPanelObject ()
 
 disableAdministrationPanelObject ()
 
 editOrderObject ()
 
 isActiveOrdering ()
 
 isActiveItemOrdering ()
 
 enableMultiDownloadObject ()
 
 isMultiDownloadEnabled ()
 
 cutObject ()
 cut object(s) out from a container and write the information to clipboard public More...
 
 copyObject ()
 Copy object(s) out from a container and write the information to clipboard It is not possible to copy multiple objects at once. More...
 
 downloadObject ()
 
 getBucketTitle ()
 
 linkObject ()
 create an new reference of an object in tree it's like a hard link of unix More...
 
 clearObject ()
 clear clipboard and go back to last object More...
 
 performPasteIntoMultipleObjectsObject ()
 
 initAndDisplayLinkIntoMultipleObjectsObject ()
 
 showPasteTreeObject ()
 
 cancelMoveLinkObject ()
 Cancel move|link empty clipboard and return to parent. More...
 
 keepObjectsInClipboardObject ()
 
 initAndDisplayCopyIntoMultipleObjectsObject ()
 
 initAndDisplayMoveIntoObjectObject ()
 
 pasteObject ()
 paste object from clipboard to current place Depending on the chosen command the object(s) are linked, copied or moved More...
 
 clipboardObject ()
 
 isActiveAdministrationPanel ()
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 allowBlocksMoving ()
 Standard is to allow blocks moving. More...
 
 allowBlocksConfigure ()
 Standard is to allow blocks configuration. More...
 
 cloneAllObject ()
 Clone all object Overwritten method for copying container objects. More...
 
 saveSortingObject ()
 
 cloneNodes (int $srcRef, int $dstRef, array &$mapping, string $newName=null)
 Recursively clones all nodes of the RBAC tree. More...
 
 modifyItemGUI (ilObjectListGUI $a_item_list_gui, array $a_item_data)
 
 editStylePropertiesObject ()
 
 getAsynchItemListObject ()
 
 redrawListItemObject ()
 Redraw a list item (ajax) More...
 
 trashObject ()
 Show trash content of object. More...
 
 trashApplyFilterObject ()
 
 trashResetFilterObject ()
 
 removeFromSystemObject ()
 
 undeleteObject ()
 Get objects back from trash. More...
 
 confirmRemoveFromSystemObject ()
 
 setSideColumnReturn ()
 
 getAdminTabs ()
 
 competencesObject ()
 
- Public Member Functions inherited from ilObjectGUI
 __construct ($data, int $id=0, bool $call_by_reference=true, bool $prepare_output=true)
 
 getRefId ()
 
 setAdminMode (string $mode)
 
 getAdminMode ()
 
 getObject ()
 
 executeCommand ()
 
 withReferences ()
 determines whether objects are referenced or not (got ref ids or not) More...
 
 setCreationMode (bool $mode=true)
 if true, a creation screen is displayed the current [ref_id] don't belong to the current class! The mode is determined in ilRepositoryGUI More...
 
 getCreationMode ()
 
 prepareOutput (bool $show_sub_objects=true)
 
 getAdminTabs ()
 administration tabs show only permissions and trash folder More...
 
 getHTML ()
 
 confirmedDeleteObject ()
 confirmed deletion of object -> objects are moved to trash or deleted immediately, if trash is disabled More...
 
 cancelDeleteObject ()
 cancel deletion of object More...
 
 cancelObject ()
 cancel action and go back to previous page More...
 
 createObject ()
 create new object form More...
 
 cancelCreation ()
 cancel create action and go back to repository parent More...
 
 saveObject ()
 
 getDidacticTemplateVar (string $type)
 Get didactic template setting from creation screen. More...
 
 putObjectInTree (ilObject $obj, int $parent_node_id=null)
 Add object to tree at given position. More...
 
 editObject ()
 
 addExternalEditFormCustom (ilPropertyFormGUI $form)
 
 updateObject ()
 updates object entry in object_data More...
 
 getFormAction (string $cmd, string $default_form_action="")
 Get form action for command (command is method name without "Object", e.g. More...
 
 isVisible (int $ref_id, string $type)
 
 viewObject ()
 viewObject container presentation for "administration -> repository, trash, permissions" More...
 
 deleteObject (bool $error=false)
 Display deletion confirmation screen. More...
 
 setColumnSettings (ilColumnGUI $column_gui)
 
 redirectAfterCreation ()
 Redirect after creation, see https://docu.ilias.de/goto_docu_wiki_wpage_5035_1357.html Should be overwritten and redirect to settings screen. More...
 
 addToDeskObject ()
 
 removeFromDeskObject ()
 
- Public Member Functions inherited from ILIAS\Object\ImplementsCreationCallback
 callCreationCallback (\ilObject $object, \ilObjectDefinition $obj_definition, int $requested_crtcb)
 
- Public Member Functions inherited from ilDesktopItemHandling
 addToDeskObject ()
 Add desktop item public. More...
 
 removeFromDeskObject ()
 Remove from desktop public. More...
 

Static Public Member Functions

static _goto (string $refId)
 
- Static Public Member Functions inherited from ilContainerGUI
static _buildPath (int $a_ref_id, int $a_course_ref_id)
 build path More...
 
- Static Public Member Functions inherited from ilObjectGUI
static _gotoRepositoryRoot (bool $raise_error=false)
 Goto repository root. More...
 
static _gotoRepositoryNode (int $ref_id, string $cmd="")
 
static _gotoSharedWorkspaceNode (int $wsp_id)
 

Protected Member Functions

 setTitleAndDescription ()
 This GUI is only called when creating a talk (series). More...
 
 checkPermissionBool (string $a_perm, string $a_cmd="", string $a_type="", ?int $a_ref_id=null)
 Talk Series does not use RBAC and therefore does not require the usual permission checks. More...
 
 initCreateForm (string $new_type)
 
 initCreationForms ($new_type)
 
 loadRecurrenceSettings ()
 load recurrence settings More...
 
- Protected Member Functions inherited from ilContainerGUI
 getEditFormValues ()
 
 afterUpdate ()
 
 setTitleAndDescription ()
 
 showPossibleSubObjects ()
 
 supportsPageEditor ()
 
 getTabs ()
 
 showContainerPageTabs ()
 
 showPasswordInstructionObject (bool $a_init=true)
 
 initFormPasswordInstruction ()
 Init password form. More...
 
 savePasswordObject ()
 
 initEditForm ()
 
 initSortingForm (ilPropertyFormGUI $form, array $a_sorting_settings)
 Append sorting settings to property form. More...
 
 initListPresentationForm (ilPropertyFormGUI $form)
 Add list presentation settings to form. More...
 
 saveListPresentation (ilPropertyFormGUI $form)
 
 initSortingDirectionForm (ilContainerSortingSettings $sorting_settings, ilRadioOption $element, string $a_prefix)
 Add sorting direction. More...
 
 initManualSortingOptionForm (ilContainerSortingSettings $settings, ilRadioOption $element, string $a_prefix, array $a_sorting_settings)
 Add manual sorting options. More...
 
 saveSortingSettings (ilPropertyFormGUI $form)
 
 trashHandleFilter (bool $action_apply, bool $action_reset)
 
 restoreToNewLocationObject (ilPropertyFormGUI $form=null)
 
 getTreeSelectorGUI (string $cmd)
 
 initFilter ()
 
 showContainerFilter ()
 
- Protected Member Functions inherited from ilObjectGUI
 getObjectService ()
 
 assignObject ()
 
 setTitleAndDescription ()
 
 initHeaderAction (?string $sub_type=null, ?int $sub_id=null)
 Add header action menu. More...
 
 insertHeaderAction (?ilObjectListGUI $list_gui=null)
 Insert header action into main template. More...
 
 addHeaderAction ()
 Add header action menu. More...
 
 redrawHeaderActionObject ()
 Ajax call: redraw action header only. More...
 
 setTabs ()
 set admin tabs More...
 
 setAdminTabs ()
 set admin tabs More...
 
 setLocator ()
 
 addLocatorItems ()
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 omitLocator (bool $omit=true)
 
 addAdminLocatorItems (bool $do_not_add_object=false)
 should be overwritten to add object specific items (repository items are preloaded) More...
 
 initCreationForms (string $new_type)
 Init creation forms. More...
 
 getCreationFormsHTML (array $forms)
 Get HTML for creation forms (accordion) More...
 
 initCreateForm (string $new_type)
 
 initDidacticTemplate (ilPropertyFormGUI $form)
 
 addDidacticTemplateOptions (array &$a_options)
 Add custom templates. More...
 
 afterSave (ilObject $new_object)
 Post (successful) object creation hook. More...
 
 initEditForm ()
 
 initEditCustomForm (ilPropertyFormGUI $a_form)
 Add custom fields to update form. More...
 
 getEditFormValues ()
 
 getEditFormCustomValues (array &$a_values)
 Add values to custom edit fields. More...
 
 validateCustom (ilPropertyFormGUI $form)
 Validate custom values (if not possible with checkInput()) More...
 
 updateCustom (ilPropertyFormGUI $form)
 Insert custom update form values into object. More...
 
 afterUpdate ()
 Post (successful) object update hook. More...
 
 initImportForm (string $new_type)
 
 importFileObject (int $parent_id=null)
 
 afterImport (ilObject $new_object)
 Post (successful) object import hook. More...
 
 setFormAction (string $cmd, string $form_action)
 
 getReturnLocation (string $cmd, string $default_location="")
 Get return location for command (command is method name without "Object", e.g. More...
 
 setReturnLocation (string $cmd, string $location)
 set specific return location for command More...
 
 getTargetFrame (string $cmd, string $default_target_frame="")
 get target frame for command (command is method name without "Object", e.g. More...
 
 setTargetFrame (string $cmd, string $target_frame)
 Set specific target frame for command. More...
 
 showPossibleSubObjects ()
 show possible sub objects (pull down menu) More...
 
 getTabs ()
 overwrite in derived GUI class of your object type More...
 
 redirectToRefId (int $ref_id, string $cmd="")
 redirects to (repository) view per ref id usually to a container and usually used at the end of a save/import method where the object gui type (of the new object) doesn't match with the type of the current ["ref_id"] value of the request More...
 
 fillCloneTemplate (?string $tpl_name, string $type)
 Fill object clone template This method can be called from any object GUI class that wants to offer object cloning. More...
 
 getCenterColumnHTML ()
 Get center column. More...
 
 getRightColumnHTML ()
 Display right column. More...
 
 checkPermission (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 checkPermissionBool (string $perm, string $cmd="", string $type="", ?int $ref_id=null)
 
 enableDragDropFileUpload ()
 Enables the file upload into this object by dropping files. More...
 
 showCustomIconsEditing ( $input_colspan=1, ilPropertyFormGUI $form=null, $as_section=true)
 show edit section of custom icons for container More...
 

Protected Attributes

ilPropertyFormGUI $form
 
- Protected Attributes inherited from ilContainerGUI
ILIAS Style Content GUIService $content_style_gui
 
ilRbacSystem $rbacsystem
 
ilRbacReview $rbacreview
 
ilTabsGUI $tabs
 
ilErrorHandling $error
 
ilObjectDefinition $obj_definition
 
ilRbacAdmin $rbacadmin
 
ilPropertyFormGUI $form
 
ilLogger $log
 
ilObjectDataCache $obj_data_cache
 
Services $global_screen
 
ilAppEventHandler $app_event_handler
 
UIServices $ui
 
ilContainerFilterService $container_filter_service
 
ilContainerUserFilter $container_user_filter = null
 
Standard $ui_filter = null
 
bool $edit_order = false
 
bool $adminCommands = false
 
string $requested_redirectSource = ""
 
int $current_position = 0
 
ClipboardManager $clipboard
 
StandardGUIRequest $std_request
 
ViewManager $view_manager
 
ilComponentFactory $component_factory
 
ILIAS Style Content DomainService $content_style_domain
 
- Protected Attributes inherited from ilObjectGUI
ILIAS Notes Service $notes_service
 
ServerRequestInterface $request
 
ilLocatorGUI $locator
 
ilObjUser $user
 
ilAccessHandler $access
 
ilSetting $settings
 
ilToolbarGUI $toolbar
 
ilRbacAdmin $rbac_admin
 
ilRbacSystem $rbac_system
 
ilRbacReview $rbac_review
 
ilObjectService $object_service
 
ilObjectDefinition $obj_definition
 
ilGlobalTemplateInterface $tpl
 
ilTree $tree
 
ilCtrl $ctrl
 
ilErrorHandling $error
 
ilLanguage $lng
 
ilTabsGUI $tabs_gui
 
ILIAS $ilias
 
ArrayBasedRequestWrapper $post_wrapper
 
RequestWrapper $request_wrapper
 
Factory $refinery
 
ilFavouritesManager $favourites
 
ilObjectCustomIconFactory $custom_icon_factory
 
ilObject $object = null
 
bool $creation_mode = false
 
 $data
 
int $id
 
bool $call_by_reference = false
 
bool $prepare_output
 
int $ref_id
 
int $obj_id
 
int $maxcount
 
array $form_action = []
 
array $return_location = []
 
array $target_frame = []
 
string $tmp_import_dir
 
string $sub_objects = ""
 
bool $omit_locator = false
 
string $type = ""
 
string $admin_mode = self::ADMIN_MODE_NONE
 
int $requested_ref_id = 0
 
int $requested_crtptrefid = 0
 
int $requested_crtcb = 0
 
string $requested_new_type = ""
 
string $link_params
 
string $html = ""
 

Private Member Functions

 checkAccessOrFail ()
 
 sendNotification (array $talks)
 
 copyTemplateValues (ilObjEmployeeTalkSeries $talk)
 Copy the template values, into the talk series object. More...
 
 getTemplateRefId ()
 

Private Attributes

ILIAS DI Container $container
 
int $userId = -1
 

Additional Inherited Members

- Data Fields inherited from ilContainerGUI
int $bl_cnt = 1
 
bool $multi_download_enabled = false
 
- Data Fields inherited from ilObjectGUI
const ALLOWED_TAGS_IN_TITLE_AND_DESCRIPTION
 
const ADMIN_MODE_NONE = ""
 
const ADMIN_MODE_SETTINGS = "settings"
 
const ADMIN_MODE_REPOSITORY = "repository"
 
const UPLOAD_TYPE_LOCAL = 1
 
const UPLOAD_TYPE_UPLOAD_DIRECTORY = 2
 
const CFORM_NEW = 1
 
const CFORM_IMPORT = 2
 
const CFORM_CLONE = 3
 

Detailed Description

Constructor & Destructor Documentation

◆ __construct()

ilObjEmployeeTalkSeriesGUI::__construct ( )

Definition at line 50 of file class.ilObjEmployeeTalkSeriesGUI.php.

References $GLOBALS, $refId, ILIAS\GlobalScreen\Provider\__construct(), ilObjectGUI\omitLocator(), ilObjectGUI\setReturnLocation(), and ilObjEmployeeTalkSeries\TYPE.

51  {
52  $this->container = $GLOBALS["DIC"];
53 
54  $refId = $this->container
55  ->http()
56  ->wrapper()
57  ->query()
58  ->retrieve("ref_id", $this->container->refinery()->kindlyTo()->int());
59 
60  parent::__construct([], $refId, true, false);
61  $this->container->language()->loadLanguageModule('mst');
62  $this->container->language()->loadLanguageModule('trac');
63  $this->container->language()->loadLanguageModule('etal');
64  $this->container->language()->loadLanguageModule('dateplaner');
65 
66  $this->type = ilObjEmployeeTalkSeries::TYPE;
67 
68  $this->setReturnLocation("save", strtolower(ilEmployeeTalkMyStaffListGUI::class));
69  $wrapper = $this->container->http()->wrapper()->query();
70 
71  if ($wrapper->has('usr_id')) {
72  $this->userId = $wrapper->retrieve('usr_id', $this->container->refinery()->kindlyTo()->int());
73  }
74 
75  $this->omitLocator();
76  }
omitLocator(bool $omit=true)
$refId
Definition: xapitoken.php:58
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
Definition: PEAR.php:64
__construct(Container $dic, ilPlugin $plugin)
setReturnLocation(string $cmd, string $location)
set specific return location for command
+ Here is the call graph for this function:

Member Function Documentation

◆ _goto()

static ilObjEmployeeTalkSeriesGUI::_goto ( string  $refId)
static

Definition at line 646 of file class.ilObjEmployeeTalkSeriesGUI.php.

References $DIC.

646  : void
647  {
648  global $DIC;
649 
650  $children = $DIC->repositoryTree()->getChildIds((int) $refId);
651 
652  /*
653  * If the series contains talks, redirect to first talk,
654  * if not (which should only happen if someone messes with
655  * the URL) redirect to dashboard.
656  */
657  if (empty($children)) {
658  $DIC->ui()->mainTemplate()->setOnScreenMessage(
659  'failure',
660  $DIC->language()->txt("permission_denied"),
661  true
662  );
663  $DIC->ctrl()->redirectByClass(ilDashboardGUI::class, "");
664  }
665  ilObjEmployeeTalkGUI::_goto((string) $children[0]);
666  }
$refId
Definition: xapitoken.php:58
global $DIC
Definition: feed.php:28

◆ cancelDeleteObject()

ilObjEmployeeTalkSeriesGUI::cancelDeleteObject ( )

Definition at line 172 of file class.ilObjEmployeeTalkSeriesGUI.php.

References ilSession\clear(), and ILIAS\Repository\ctrl().

172  : void
173  {
174  ilSession::clear("saved_post");
175 
176  $this->ctrl->redirectByClass(strtolower(ilEmployeeTalkMyStaffListGUI::class), ControlFlowCommand::DEFAULT, "", false);
177  }
static clear(string $a_var)
+ Here is the call graph for this function:

◆ cancelObject()

ilObjEmployeeTalkSeriesGUI::cancelObject ( )

Definition at line 179 of file class.ilObjEmployeeTalkSeriesGUI.php.

References ilObjectGUI\afterSave(), copyTemplateValues(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and loadRecurrenceSettings().

179  : void
180  {
181  $this->ctrl->redirectByClass(strtolower(ilEmployeeTalkMyStaffListGUI::class), ControlFlowCommand::DEFAULT, "", false);
182  }
+ Here is the call graph for this function:

◆ checkAccessOrFail()

ilObjEmployeeTalkSeriesGUI::checkAccessOrFail ( )
private

Definition at line 78 of file class.ilObjEmployeeTalkSeriesGUI.php.

References ILIAS\Repository\ctrl(), and ILIAS\Repository\lng().

Referenced by executeCommand().

78  : void
79  {
80  $talkAccess = new ilObjEmployeeTalkAccess();
81  if (!$talkAccess->canCreate()) {
82  $this->tpl->setOnScreenMessage('failure', $this->lng->txt("permission_denied"), true);
83  $this->ctrl->redirectByClass(ilDashboardGUI::class, "");
84  }
85  }
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ checkPermissionBool()

ilObjEmployeeTalkSeriesGUI::checkPermissionBool ( string  $a_perm,
string  $a_cmd = "",
string  $a_type = "",
?int  $a_ref_id = null 
)
protected

Talk Series does not use RBAC and therefore does not require the usual permission checks.

Talk series it self can no longer be edited after creation.

Parameters
string$a_perm
string$a_cmd
string$a_type
null$a_ref_id
Returns
bool

Definition at line 146 of file class.ilObjEmployeeTalkSeriesGUI.php.

146  : bool
147  {
148  if ($a_perm === 'create') {
149  return true;
150  }
151  return false;
152  }

◆ confirmedDeleteObject()

ilObjEmployeeTalkSeriesGUI::confirmedDeleteObject ( )

Definition at line 154 of file class.ilObjEmployeeTalkSeriesGUI.php.

References ilSession\clear(), ILIAS\Repository\ctrl(), ilSession\get(), ILIAS\Repository\refinery(), and ilSession\set().

154  : void
155  {
156  if ($this->post_wrapper->has("mref_id")) {
157  $mref_id = $this->post_wrapper->retrieve(
158  "mref_id",
159  $this->refinery->kindlyTo()->listOf($this->refinery->kindlyTo()->int())
160  );
161  $saved_post = array_unique(array_merge(ilSession::get('saved_post'), $mref_id));
162  ilSession::set('saved_post', $saved_post);
163  }
164 
165  $ru = new ilRepositoryTrashGUI($this);
166  $ru->deleteObjects($this->requested_ref_id, ilSession::get("saved_post"));
167  ilSession::clear("saved_post");
168 
169  $this->ctrl->redirectByClass(strtolower(ilEmployeeTalkMyStaffListGUI::class), ControlFlowCommand::DEFAULT, "", false);
170  }
static get(string $a_var)
Repository GUI Utilities.
static clear(string $a_var)
static set(string $a_var, $a_val)
Set a value.
+ Here is the call graph for this function:

◆ copyTemplateValues()

ilObjEmployeeTalkSeriesGUI::copyTemplateValues ( ilObjEmployeeTalkSeries  $talk)
private

Copy the template values, into the talk series object.

Parameters
ilObjEmployeeTalkSeries$talk

Definition at line 534 of file class.ilObjEmployeeTalkSeriesGUI.php.

References ilObjectGUI\$data, ilAdvancedMDValues\_cloneValues(), ilAdvancedMDRecord\_getSelectedRecordsByObject(), ILIAS\Repository\form(), ilCalendarRecurrence\getFrequenceType(), ilObject\getId(), ilAdvancedMDRecord\getObjRecSelection(), ilObject\getRefId(), getTemplateRefId(), ilObject\getType(), IL_CAL_UNIX, IL_CAL_YEAR, ilAdvancedMDRecord\saveObjRecSelection(), sendNotification(), ilObject\setDescription(), ilObjEmployeeTalk\TYPE, ilContainer\update(), and ilTimeZone\UTC.

Referenced by cancelObject().

535  {
536  $template = new ilObjTalkTemplate($this->getTemplateRefId(), true);
537  $talk->setDescription($template->getTitle());
538  $talk->update();
539 
540  // assign talk series type to adv md records of the template
542  $template->getType(),
543  $template->getId(),
544  'etal',
545  false
546  ) as $rec) {
547  if (!$rec->isAssignedObjectType($talk->getType(), 'etal')) {
548  $rec->appendAssignedObjectType(
549  $talk->getType(),
550  'etal',
551  true
552  );
553  $rec->update();
554  }
555  }
556 
558  $talk->getId(),
559  'etal',
560  ilAdvancedMDRecord::getObjRecSelection($template->getId(), 'etal')
561  );
562 
564  0,
565  $template->getId(),
566  $talk->getId(),
568  );
569  }
static saveObjRecSelection(int $a_obj_id, string $a_sub_type="", array $a_records=null, bool $a_delete_before=true)
Save repository object record selection.
static _getSelectedRecordsByObject(string $a_obj_type, int $a_id, string $a_sub_type="", bool $is_ref_id=true)
setDescription(string $desc)
static getObjRecSelection(int $a_obj_id, string $a_sub_type="")
Get repository object record selection.
static _cloneValues(int $copy_id, int $a_source_id, int $a_target_id, ?string $a_sub_type=null, ?int $a_source_sub_id=null, ?int $a_target_sub_id=null)
Clone Advanced Meta Data.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ executeCommand()

ilObjEmployeeTalkSeriesGUI::executeCommand ( )

If the performance of the autocomplete tanks, it's definitely because of calling canCreate separately for each user. It would be better to use: $DIC->access()->filterUserIdsByPositionOfCurrentUser( ilOrgUnitOperation::OP_CREATE_EMPLOYEE_TALK, Insert talk ref id here, $userIds ); but that function gets its context exclusively from the ref_id of an object, and at this point there might not even exist an object with type etal at all...

Definition at line 87 of file class.ilObjEmployeeTalkSeriesGUI.php.

References ilObjectGUI\$access, ilObjectGUI\$id, and checkAccessOrFail().

87  : void
88  {
89  $this->checkAccessOrFail();
90 
91  // determine next class in the call structure
92  $next_class = $this->container->ctrl()->getNextClass($this);
93 
94  switch ($next_class) {
95  case strtolower(ilRepositorySearchGUI::class):
96  $repo = new ilRepositorySearchGUI();
97  $repo->addUserAccessFilterCallable(function ($user_ids) {
113  return array_filter(
114  $user_ids,
115  function (int $id) use ($access) {
116  return $access->canCreate(new ilObjUser($id));
117  }
118  );
119  });
120  $this->container->ctrl()->forwardCommand($repo);
121  break;
122  default:
123  parent::executeCommand();
124  }
125  }
addUserAccessFilterCallable(callable $user_filter)
Closure for filtering users e.g $rep_search_gui->addUserAccessFilterCallable(function($user_ids) use(...
ilAccessHandler $access
+ Here is the call graph for this function:

◆ getAdminTabs()

ilObjEmployeeTalkSeriesGUI::getAdminTabs ( )

Definition at line 332 of file class.ilObjEmployeeTalkSeriesGUI.php.

332  : void
333  {
334  }

◆ getTabs()

ilObjEmployeeTalkSeriesGUI::getTabs ( )

Definition at line 328 of file class.ilObjEmployeeTalkSeriesGUI.php.

328  : void
329  {
330  }

◆ getTemplateRefId()

ilObjEmployeeTalkSeriesGUI::getTemplateRefId ( )
private

Definition at line 668 of file class.ilObjEmployeeTalkSeriesGUI.php.

References $refId, ilObjTalkTemplate\_exists(), ilObject\_lookupObjectId(), ILIAS\Repository\ctrl(), ILIAS\Repository\lng(), and ilObject\lookupOfflineStatus().

Referenced by copyTemplateValues(), initCreateForm(), and loadRecurrenceSettings().

668  : int
669  {
670  $refId = 0;
671  if ($this->container->http()->wrapper()->query()->has('template')) {
672  $refId = $this->container->http()->wrapper()->query()->retrieve(
673  'template',
674  $this->container->refinery()->kindlyTo()->int()
675  );
676  }
677  if (
680  ) {
681  $this->tpl->setOnScreenMessage('failure', $this->lng->txt('etal_create_invalid_template_ref'), true);
682  $this->ctrl->redirectByClass([
683  strtolower(ilDashboardGUI::class),
684  strtolower(ilMyStaffGUI::class),
685  strtolower(ilEmployeeTalkMyStaffListGUI::class)
686  ], ControlFlowCommand::INDEX);
687  }
688 
689  return $refId;
690  }
$refId
Definition: xapitoken.php:58
static lookupOfflineStatus(int $obj_id)
Lookup offline status using objectDataCache.
static _exists(int $id, bool $reference=false, ?string $type=null)
static _lookupObjectId(int $ref_id)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreateForm()

ilObjEmployeeTalkSeriesGUI::initCreateForm ( string  $new_type)
protected

Definition at line 247 of file class.ilObjEmployeeTalkSeriesGUI.php.

References $form, $location, ilObjectGUI\$user, ilPropertyFormGUI\addCommandButton(), ilPropertyFormGUI\addItem(), ILIAS\Repository\ctrl(), ILIAS\Repository\form(), ilObjUser\getLogin(), getTemplateRefId(), ilObjectGUI\initDidacticTemplate(), ILIAS\Repository\lng(), ilTextAreaInputGUI\setCols(), ilFormGUI\setFormAction(), ilFormPropertyGUI\setRequired(), ilFormGUI\setTarget(), ilPropertyFormGUI\setTitle(), and ilObject\TITLE_LENGTH.

Referenced by initCreationForms(), and saveObject().

248  {
249  $form = new ilPropertyFormGUI();
250  $form->setTarget("_top");
251  $form->setFormAction($this->ctrl->getFormAction($this, "save") . '&template=' . $this->getTemplateRefId());
252  $form->setTitle($this->lng->txt($new_type . "_new"));
253 
254  // title
255  $ti = new ilTextInputGUI($this->lng->txt("title"), "title");
256  $ti->setSize(min(40, ilObject::TITLE_LENGTH));
257  $ti->setMaxLength(ilObject::TITLE_LENGTH);
258  $ti->setRequired(true);
259  $form->addItem($ti);
260 
261  // description
262  $ta = new ilTextAreaInputGUI($this->lng->txt("description"), "desc");
263  $ta->setCols(40);
264  $ta->setRows(2);
265  $form->addItem($ta);
266 
267  // Start & End Date
268  $dur = new ilDateDurationInputGUI($this->lng->txt('cal_fullday'), 'etal_event');
269  $dur->setRequired(true);
270  $dur->enableToggleFullTime(
271  $this->lng->txt('cal_fullday_title'),
272  false
273  );
274  $dur->setShowTime(true);
275  $form->addItem($dur);
276 
277  // Recurrence
278  $cal = new ilRecurrenceInputGUI("Calender", "frequence");
279  $event = new ilCalendarRecurrence();
280  //$event->setRecurrence(ilEventRecurrence::REC_EXCLUSION);
281  //$event->setFrequenceType(ilEventRecurrence::FREQ_DAILY);
282  $cal->allowUnlimitedRecurrences(false);
283  $cal->setRecurrence($event);
284  $form->addItem($cal);
285 
286  //Location
287  $location = new ilTextInputGUI("Location", "etal_location");
288  $location->setMaxLength(200);
290 
291  //Employee
292  $login = new ilTextInputGUI($this->lng->txt("employee"), "etal_employee");
293  $login->setRequired(true);
294  $login->setDataSource($this->ctrl->getLinkTargetByClass([
295  strtolower(self::class),
296  strtolower(ilRepositorySearchGUI::class)
297  ], 'doUserAutoComplete', '', true));
298 
299  if ($this->userId !== -1) {
300  $user = new ilObjUser($this->userId);
301  $login->setValue($user->getLogin());
302  }
303 
304  $form->addItem($login);
305 
306  $form = $this->initDidacticTemplate($form);
307 
308  $form->addCommandButton("save", $this->lng->txt($new_type . "_add"));
309  $form->addCommandButton("cancel", $this->lng->txt("cancel"));
310 
311  $this->form = $form;
312 
313  return $form;
314  }
const TITLE_LENGTH
$location
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
Definition: buildRTE.php:22
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...
setTarget(string $a_target)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
setFormAction(string $a_formaction)
initDidacticTemplate(ilPropertyFormGUI $form)
setRequired(bool $a_required)
form( $class_path, string $cmd)
addCommandButton(string $a_cmd, string $a_text, string $a_id="")
This class represents a text area property in a property form.
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ initCreationForms()

ilObjEmployeeTalkSeriesGUI::initCreationForms (   $new_type)
protected

Definition at line 316 of file class.ilObjEmployeeTalkSeriesGUI.php.

References initCreateForm().

316  : array
317  {
318  return [
319  self::CFORM_NEW => $this->initCreateForm($new_type)
320  ];
321  }
+ Here is the call graph for this function:

◆ loadRecurrenceSettings()

ilObjEmployeeTalkSeriesGUI::loadRecurrenceSettings ( )
protected

load recurrence settings

protected

Returns

Definition at line 399 of file class.ilObjEmployeeTalkSeriesGUI.php.

References $location, ilObject\_lookupObjectId(), ILIAS\Repository\form(), ilCalendarRecurrence\FREQ_DAILY, ilCalendarRecurrence\FREQ_MONTHLY, ilCalendarRecurrence\FREQ_WEEKLY, ilCalendarRecurrence\FREQ_YEARLY, getTemplateRefId(), ilObjUser\getUserIdByLogin(), IL_CAL_UNIX, ilUtil\stripSlashes(), and ilTimeZone\UTC.

Referenced by cancelObject().

400  {
401  $rec = new ilCalendarRecurrence();
402 
403  switch ($this->form->getInput('frequence')) {
405  $rec->setFrequenceType($this->form->getInput('frequence'));
406  $rec->setInterval((int) $this->form->getInput('count_DAILY'));
407  break;
408 
410  $rec->setFrequenceType($this->form->getInput('frequence'));
411  $rec->setInterval((int) $this->form->getInput('count_WEEKLY'));
412  if (is_array($this->form->getInput('byday_WEEKLY'))) {
413  $rec->setBYDAY(ilUtil::stripSlashes(implode(',', $this->form->getInput('byday_WEEKLY'))));
414  }
415  break;
416 
418  $rec->setFrequenceType($this->form->getInput('frequence'));
419  $rec->setInterval((int) $this->form->getInput('count_MONTHLY'));
420  switch ((int) $this->form->getInput('subtype_MONTHLY')) {
421  case 0:
422  // nothing to do;
423  break;
424 
425  case 1:
426  switch ((int) $this->form->getInput('monthly_byday_day')) {
427  case 8:
428  // Weekday
429  $rec->setBYSETPOS($this->form->getInput('monthly_byday_num'));
430  $rec->setBYDAY('MO,TU,WE,TH,FR');
431  break;
432 
433  case 9:
434  // Day of month
435  $rec->setBYMONTHDAY($this->form->getInput('monthly_byday_num'));
436  break;
437 
438  default:
439  $rec->setBYDAY(($this->form->getInput('monthly_byday_num') . $this->form->getInput('monthly_byday_day')));
440  break;
441  }
442  break;
443 
444  case 2:
445  $rec->setBYMONTHDAY($this->form->getInput('monthly_bymonthday'));
446  break;
447  }
448  break;
449 
451  $rec->setFrequenceType($this->form->getInput('frequence'));
452  $rec->setInterval((int) $this->form->getInput('count_YEARLY'));
453  switch ((int) $this->form->getInput('subtype_YEARLY')) {
454  case 0:
455  // nothing to do;
456  break;
457 
458  case 1:
459  $rec->setBYMONTH($this->form->getInput('yearly_bymonth_byday'));
460  $rec->setBYDAY(($this->form->getInput('yearly_byday_num') . $this->form->getInput('yearly_byday')));
461  break;
462 
463  case 2:
464  $rec->setBYMONTH($this->form->getInput('yearly_bymonth_by_monthday'));
465  $rec->setBYMONTHDAY($this->form->getInput('yearly_bymonthday'));
466  break;
467  }
468  break;
469  }
470 
471  // UNTIL
472  switch ((int) $this->form->getInput('until_type')) {
473  case 1:
474  $rec->setFrequenceUntilDate(null);
475  // nothing to do
476  break;
477 
478  case 2:
479  $rec->setFrequenceUntilDate(null);
480  $rec->setFrequenceUntilCount((int) $this->form->getInput('count'));
481  break;
482 
483  case 3:
484  $frequence = $this->form->getItemByPostVar('frequence');
485  $end = $frequence->getRecurrence()->getFrequenceUntilDate();
486  $rec->setFrequenceUntilCount(0);
487  $rec->setFrequenceUntilDate($end);
488  break;
489  }
490 
491  return $rec;
492  }
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...
form( $class_path, string $cmd)
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ saveObject()

ilObjEmployeeTalkSeriesGUI::saveObject ( )

Definition at line 205 of file class.ilObjEmployeeTalkSeriesGUI.php.

References ilObjUser\_loginExists(), ilObjUser\_lookupId(), ilObjectGUI\afterSave(), ilPropertyFormGUI\checkInput(), ILIAS\Repository\ctrl(), ilPropertyFormGUI\getHTML(), ilPropertyFormGUI\getInput(), ilPropertyFormGUI\getItemByPostVar(), initCreateForm(), ILIAS\Repository\int(), ILIAS\Repository\lng(), ilObjectGUI\putObjectInTree(), and ilPropertyFormGUI\setValuesByPost().

205  : void
206  {
207  $this->ctrl->setParameter($this, "new_type", $this->requested_new_type);
208 
209  $form = $this->initCreateForm($this->requested_new_type);
210  if ($form->checkInput()) {
211  $userName = (string) $form->getInput('etal_employee');
212  $userId = (int) ilObjUser::_lookupId($userName);
213  $talkAccess = new ilObjEmployeeTalkAccess();
214  if (
215  !ilObjUser::_loginExists($userName) ||
216  !$talkAccess->canCreate(new ilObjUser($userId))
217  ) {
218  $form->getItemByPostVar('etal_employee')
219  ->setAlert($this->lng->txt('etal_invalid_user'));
220  $this->tpl->setOnScreenMessage(
221  'failure',
222  $this->lng->txt('form_input_not_valid')
223  );
225  $this->tpl->setContent($form->getHTML());
226  return;
227  }
228 
229  $this->ctrl->setParameter($this, "new_type", "");
230 
231  $class_name = "ilObj" . $this->obj_definition->getClassName($this->requested_new_type);
232  $newObj = new $class_name();
233  $newObj->setType($this->requested_new_type);
234  $newObj->setTitle($form->getInput("title"));
235  $newObj->setDescription($form->getInput("desc"));
236  $newObj->create();
237 
238  $this->putObjectInTree($newObj);
239 
240  $this->afterSave($newObj);
241  }
242 
244  $this->tpl->setContent($form->getHTML());
245  }
getItemByPostVar(string $a_post_var)
static _lookupId($a_user_str)
getInput(string $a_post_var, bool $ensureValidation=true)
Returns the input of an item, if item provides getInput method and as fallback the value of the HTTP-...
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...
afterSave(ilObject $new_object)
Post (successful) object creation hook.
putObjectInTree(ilObject $obj, int $parent_node_id=null)
Add object to tree at given position.
+ Here is the call graph for this function:

◆ sendNotification()

ilObjEmployeeTalkSeriesGUI::sendNotification ( array  $talks)
private
Parameters
ilObjEmployeeTalk[]$talks

Definition at line 339 of file class.ilObjEmployeeTalkSeriesGUI.php.

References Vendor\Package\$a, Vendor\Package\$b, $d, $format, $message, ilDateTime\get(), ilObjEmployeeTalk\getData(), ilObjUser\getTimeZone(), ilDateTime\getUnixTime(), ilCalendarUtil\getUserDateFormat(), and IL_CAL_FKT_DATE.

Referenced by copyTemplateValues().

339  : void
340  {
341  if (count($talks) === 0) {
342  return;
343  }
344 
345  $firstTalk = $talks[0];
346  $talk_title = $firstTalk->getTitle();
347  $superior = new ilObjUser($firstTalk->getOwner());
348  $employee = new ilObjUser($firstTalk->getData()->getEmployee());
349  $superiorName = $superior->getFullname();
350 
351  $dates = array_map(
352  fn (ilObjEmployeeTalk $t) => $t->getData()->getStartDate(),
353  $talks
354  );
355  usort($dates, function (ilDateTime $a, ilDateTime $b) {
356  $a = $a->getUnixTime();
357  $b = $b->getUnixTime();
358  if ($a === $b) {
359  return 0;
360  }
361  return $a < $b ? -1 : 1;
362  });
363 
364  $add_time = $firstTalk->getData()->isAllDay() ? 0 : 1;
365  $format = ilCalendarUtil::getUserDateFormat($add_time, true);
366  $timezone = $employee->getTimeZone();
367  $dates = array_map(function (ilDateTime $d) use ($add_time, $format, $timezone) {
368  return $d->get(IL_CAL_FKT_DATE, $format, $timezone);
369  }, $dates);
370 
372  $firstTalk->getRefId(),
373  $talk_title,
374  $firstTalk->getDescription(),
375  $firstTalk->getData()->getLocation(),
376  'notification_talks_subject',
377  'notification_talks_created',
378  $superiorName,
379  $dates
380  );
381 
382  $vCalSender = new EmployeeTalkEmailNotificationService(
383  $message,
384  $talk_title,
385  $employee,
386  $superior,
387  VCalendarFactory::getInstanceFromTalks($firstTalk->getParent())
388  );
389 
390  $vCalSender->send();
391  }
get(int $a_format, string $a_format_str='', string $a_tz='')
get formatted date
static getUserDateFormat(int $a_add_time=0, bool $a_for_parsing=false)
Parse current user setting into date/time format.
const IL_CAL_FKT_DATE
$format
Definition: metadata.php:235
$a
thx to https://mlocati.github.io/php-cs-fixer-configurator for the examples
$message
Definition: xapiexit.php:32
for($i=6; $i< 13; $i++) for($i=1; $i< 13; $i++) $d
Definition: date.php:296
+ Here is the call graph for this function:
+ Here is the caller graph for this function:

◆ setTitleAndDescription()

ilObjEmployeeTalkSeriesGUI::setTitleAndDescription ( )
protected

This GUI is only called when creating a talk (series).

In the creation dialog, there should not be a header.

Definition at line 131 of file class.ilObjEmployeeTalkSeriesGUI.php.

131  : void
132  {
133  $this->tpl->resetHeaderBlock();
134  }

◆ viewObject()

ilObjEmployeeTalkSeriesGUI::viewObject ( )

Definition at line 323 of file class.ilObjEmployeeTalkSeriesGUI.php.

323  : void
324  {
325  self::_goto((string) $this->ref_id);
326  }

Field Documentation

◆ $container

ILIAS DI Container ilObjEmployeeTalkSeriesGUI::$container
private

Definition at line 46 of file class.ilObjEmployeeTalkSeriesGUI.php.

◆ $form

ilPropertyFormGUI ilObjEmployeeTalkSeriesGUI::$form
protected

Definition at line 47 of file class.ilObjEmployeeTalkSeriesGUI.php.

Referenced by initCreateForm().

◆ $userId

int ilObjEmployeeTalkSeriesGUI::$userId = -1
private

Definition at line 48 of file class.ilObjEmployeeTalkSeriesGUI.php.


The documentation for this class was generated from the following file: