4 use \ILIAS\BackgroundTasks\Implementation\Values\ScalarValues\StringValue;
55 $this->logger = $DIC->logger()->cal();
56 $this->user_id = $a_usr_id;
57 $this->task_factory = $DIC->backgroundTasks()->taskFactory();
58 $this->lng = $DIC->language();
67 $this->events = $a_events;
85 $this->bucket_title = $a_title;
97 if (substr($this->bucket_title, 0, 1) ===
"-") {
98 $this->bucket_title = ltrim($this->bucket_title,
"-");
112 $definition->setTempDir($normalized_name);
116 if (!$this->has_files) {
122 $bucket->setUserId($this->user_id);
125 $copy_job = $this->task_factory->createTask(ilCalendarCopyFilesToTempDirectoryJob::class, [$definition]);
126 $zip_job = $this->task_factory->createTask(ilCalendarZipJob::class, [$copy_job]);
130 $this->logger->debug(
"Normalized name = " . $normalized_name);
131 $download_name->setValue($normalized_name .
'.zip');
133 $download_interaction = $this->task_factory->createTask(ilCalendarDownloadZipInteraction::class, [$zip_job, $download_name]);
136 $bucket->setTask($download_interaction);
140 $task_manager =
$GLOBALS[
'DIC']->backgroundTasks()->taskManager();
141 $task_manager->run($bucket);
151 $object_ids =
array();
154 $obj_id = $cat->getObjId();
157 if (!in_array($obj_id, $object_ids) || $cat->getObjType() ==
"exc") {
158 $object_ids[] = $obj_id;
159 $folder_date = $event[
'event']->getStart()->get(
IL_CAL_FKT_DATE,
'Y-m-d');
161 if ($event[
'fullday']) {
166 if (
$time != $end_time) {
167 $time .=
" - " . $end_time;
172 $this->logger->debug(
"collecting files...event title = " . $folder_app);
176 if (
$files = $file_handler->getFiles()) {
177 $this->has_files =
true;
181 foreach (
$files as $file_system_path => $file_with_absolut_path) {
182 #22198 check if the key is a string defined by ILIAS or a number set by PHP as a sequential key 185 if (is_string($file_system_path)) {
186 $file_with_absolut_path = $file_system_path;
187 $file_id = (int) basename($file_system_path);
193 $file_with_absolut_path,
194 $folder_date .
'/' . $folder_app .
'/' . $basename
197 $this->logger->debug(
'Added new copy definition: ' . $folder_date .
'/' . $folder_app .
'/' . $basename .
' -> ' . $file_with_absolut_path);
213 $cat_type = $cat->getType();
214 $obj_id = $cat->getObjId();
static _lookupCategory($a_cal_id)
Lookup category id.
Model for a calendar entry.
getEventFileNameFromId(ilCalendarEntry $a_event, $a_file_id)
Only courses store the files using the id for naming.
$GLOBALS['loaded']
Global hash that tracks already loaded includes.
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
Description of class class.
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.
addCopyDefinition($a_source, $a_target)
Add copy definition.
collectFiles(ilCalendarCopyDefinition $def)
Collect files.
static getInstanceByCategoryId($a_cat_id)
Get instance by category id.
Create styles array
The data for the language used.
static _lookupType($a_id, $a_reference=false)
lookup object type
setEvents(array $a_events)
Set events.
static getInstance($a_appointment)
getBucketTitle()
return bucket title.
$events
Array of calendar event.
Description of class class.
__construct($a_usr_id)
Constructor.
setBucketTitle($a_title)
set bucket title.