19 declare(strict_types=1);
    50         $this->main_tpl = $DIC->ui()->mainTemplate();
    52         $this->
logger = $DIC->logger()->cal();
    53         $this->user_id = $a_usr_id;
    54         $this->task_factory = $DIC->backgroundTasks()->taskFactory();
    55         $this->
lng = $DIC->language();
    59             throw new DomainException(
'Invalid or deleted user id given: ' . $this->user_id);
    66         $this->events = $a_events;
    76         $this->bucket_title = $a_title;
    88         if (substr($this->bucket_title, 0, 1) === 
"-") {
    89             $this->bucket_title = ltrim($this->bucket_title, 
"-");
    94     public function run(): bool
    98         $definition->setTempDir($normalized_name);
   102         if (!$this->has_files) {
   103             $this->main_tpl->setOnScreenMessage(
'info', $this->
lng->txt(
"cal_down_no_files"), 
true);
   108         $bucket->setUserId($this->user_id);
   111         $copy_job = $this->task_factory->createTask(ilCalendarCopyFilesToTempDirectoryJob::class, [$definition]);
   112         $zip_job = $this->task_factory->createTask(ilCalendarZipJob::class, [$copy_job]);
   116         $this->
logger->debug(
"Normalized name = " . $normalized_name);
   117         $download_name->setValue($normalized_name . 
'.zip');
   119         $download_interaction = $this->task_factory->createTask(
   120             ilCalendarDownloadZipInteraction::class,
   121             [$zip_job, $download_name]
   125         $bucket->setTask($download_interaction);
   129         $task_manager = 
$GLOBALS[
'DIC']->backgroundTasks()->taskManager();
   130         $task_manager->run($bucket);
   141             $obj_id = $cat->getObjId();
   143             $this->
logger->debug(
'Handling event: ' . $event[
'event']->getPresentationTitle());
   147                 $cat->getObjType() == 
'exc' ||
   148                 !in_array($obj_id, $object_ids)
   150                 $this->
logger->debug(
'New obj_id..');
   151                 $object_ids[] = $obj_id;
   155                 if ($event[
'fullday']) {
   163                     if ($start_time != $end_time) {
   164                         $start_time .= (
' - ' . $end_time);
   166                     $folder_app = $start_time . 
' ' .
   170                 $this->
logger->debug(
"collecting files...event title = " . $folder_app);
   172                 $this->
logger->debug(
'Current file handler: ' . get_class($file_handler));
   174                 if ($files = $file_handler->getFiles()) {
   175                     $this->has_files = 
true;
   178                 $this->
logger->dump($files);
   179                 foreach ($files as $idx => $file_property) {
   180                     $this->
logger->debug(
'Filename:' . $file_property->getFileName());
   182                     $target = $folder_date . 
'/' . $folder_app . 
'/' . $file_property->getFileName();
   183                     if (!is_null($file_property->getFileRId())) {
   184                         $this->
logger->debug(
'Ressource Id: ' . $file_property->getFileRId());
   185                         $ressource = $file_property->getFileRId();
   188                         $this->
logger->debug(
'Absolute Path: ' . $file_property->getAbsolutePath());
   189                         $ressource = $file_property->getAbsolutePath();
   193                         'Added new copy definition: ' .
   194                         $folder_date . 
'/' . $folder_app . 
'/' . $file_property->getFileName() . 
' => ' .
   199                 $this->
logger->info(
'Ignoring obj_id: ' . $obj_id . 
' already processed.');
 
TaskFactory $task_factory
 
addCopyDefinition(string $a_path, string $a_target)
Add copy definition. 
 
setBucketTitle(string $a_title)
 
Description of class class. 
 
addCopyDefinitionRId(string $a_ressource_id, string $a_target)
 
static getASCIIFilename(string $a_filename)
 
ilGlobalTemplateInterface $main_tpl
 
static getInstanceByObjId(?int $obj_id, bool $stop_on_error=true)
get an instance of an Ilias object by object id 
 
setEvents(array $a_events)
 
collectFiles(ilCalendarRessourceStorageCopyDefinition $def)
 
static getInstanceByCategoryId(int $a_cat_id)
 
__construct($a_usr_id)
ilDownloadFilesBackgroundTask constructor. 
 
static getInstance(array $a_appointment)