4use \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);
 
  163            $obj_id = $cat->getObjId();
 
  165            $this->logger->debug(
'Handling event: ' . $event[
'event']->getPresentationTitle());
 
  169                $cat->getObjType() == 
'exc' ||
 
  170                !in_array($obj_id, $object_ids)
 
  173                $this->logger->debug(
'New obj_id..');
 
  174                $object_ids[] = $obj_id;
 
  179                if ($event[
'fullday']) {
 
  187                    if ($start_time != $end_time) {
 
  188                        $start_time .= (
' - ' . $end_time);
 
  190                    $folder_app = $start_time . 
' ' .
 
  194                $this->logger->debug(
"collecting files...event title = " . $folder_app);
 
  196                $this->logger->debug(
'Current file handler: ' . get_class($file_handler));
 
  198                if ($files = $file_handler->getFiles()) {
 
  199                    $this->has_files = 
true;
 
  202                $this->logger->dump($files);
 
  203                foreach ($files as $idx => $file_property) {
 
  204                    $this->logger->debug(
'Filename:' . $file_property->getFileName());
 
  205                    $this->logger->debug(
'Absolute path: ' . $file_property->getAbsolutePath());
 
  208                        $file_property->getAbsolutePath(),
 
  209                        $folder_date . 
'/' . $folder_app . 
'/' . $file_property->getFileName()
 
  211                    $this->logger->debug(
'Added new copy definition: ' .
 
  212                        $folder_date .  
'/' . $folder_app . 
'/' . $file_property->getFileName() . 
' => ' .
 
  213                        $file_property->getAbsolutePath()
 
  218                $this->logger->info(
'Ignoring obj_id: ' . $obj_id . 
' already processed.');
 
if(!defined('PATH_SEPARATOR')) $GLOBALS['_PEAR_default_error_mode']
An exception for terminatinating execution or to throw for unit testing.
static getInstance($a_appointment)
static getInstanceByCategoryId($a_cat_id)
Get instance by category id.
Description of class class.
addCopyDefinition($a_source, $a_target)
Add copy definition.
@classDescription Date and time handling
Description of class class.
setBucketTitle($a_title)
set bucket title.
collectFiles(ilCalendarCopyDefinition $def)
Collect files.
getBucketTitle()
return bucket title.
__construct($a_usr_id)
Constructor.
setEvents(array $a_events)
Set events.
$events
Array of calendar event.
static getInstanceByObjId($a_obj_id, $stop_on_error=true)
get an instance of an Ilias object by object id
static getASCIIFilename($a_filename)
convert utf8 to ascii filename
static sendInfo($a_info="", $a_keep=false)
Send Info Message to Screen.