4 use \ILIAS\BackgroundTasks\Implementation\Values\ScalarValues\StringValue;
61 $this->logger = $DIC->logger()->cal();
62 $this->user_id = $a_usr_id;
63 $this->task_factory = $DIC->backgroundTasks()->taskFactory();
64 $this->lng = $DIC->language();
75 $this->events = $a_events;
93 $this->bucket_title = $a_title;
105 if (substr($this->bucket_title, 0, 1) ===
"-") {
106 $this->bucket_title = ltrim($this->bucket_title,
"-");
120 $definition->setTempDir($normalized_name);
124 if (!$this->has_files) {
130 $bucket->setUserId($this->user_id);
133 $copy_job = $this->task_factory->createTask(ilCalendarCopyFilesToTempDirectoryJob::class, [$definition]);
134 $zip_job = $this->task_factory->createTask(ilCalendarZipJob::class, [$copy_job]);
138 $this->logger->debug(
"Normalized name = " . $normalized_name);
139 $download_name->setValue($normalized_name .
'.zip');
141 $download_interaction = $this->task_factory->createTask(ilCalendarDownloadZipInteraction::class, [$zip_job, $download_name]);
144 $bucket->setTask($download_interaction);
148 $task_manager =
$GLOBALS[
'DIC']->backgroundTasks()->taskManager();
149 $task_manager->run($bucket);
159 $object_ids = array();
163 $obj_id = $cat->getObjId();
166 if (!in_array($obj_id, $object_ids) || $cat->getObjType() ==
"exc") {
167 $object_ids[] = $obj_id;
172 if ($event[
'fullday']) {
180 if ($start_time != $end_time) {
181 $start_time .= (
' - ' . $end_time);
183 $folder_app = $start_time .
' ' .
187 $this->logger->debug(
"collecting files...event title = " . $folder_app);
191 if (
$files = $file_handler->getFiles()) {
192 $this->has_files =
true;
196 foreach (
$files as $file_system_path => $file_with_absolut_path) {
197 #22198 check if the key is a string defined by ILIAS or a number set by PHP as a sequential key 200 if (is_string($file_system_path)) {
201 $file_with_absolut_path = $file_system_path;
202 $file_id = (int) basename($file_system_path);
208 $file_with_absolut_path,
209 $folder_date .
'/' . $folder_app .
'/' . $basename
212 $this->logger->debug(
'Added new copy definition: ' . $folder_date .
'/' . $folder_app .
'/' . $basename .
' -> ' . $file_with_absolut_path);
228 $cat_type = $cat->getType();
229 $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.
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.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
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.
$GLOBALS['JPEG_Segment_Names']
Global Variable: XMP_tag_captions.
setBucketTitle($a_title)
set bucket title.