19 declare(strict_types=1);
41 protected int $prg_ref_id,
42 protected int $prg_obj_id,
53 case self::EXPORT_CSV:
57 case self::EXPORT_EXCEL:
60 $this->writer->writeToFile($filename);
63 throw new Exception(
'Unknown type for export' . $this->export_type);
70 $writer->addSheet($this->
lng->txt(
"assignments"));
82 return $this->writer->getCSVString();
87 protected function write(): void
89 foreach ($this->prg_user_table->getColumns($this->prg_obj_id,
true) as $user_table_field) {
90 [$f_id, $f_title] = $user_table_field;
91 if ($this->
settings->enabled($f_id)) {
92 $fields[$f_id] = $f_title;
95 $this->
writeRow(array_values($fields));
97 $order = $this->data_factory->order(
'login',
'ASC');
98 $data = $this->prg_user_table->fetchData($this->prg_obj_id,
null, $order);
108 foreach ($data as $usr_row) {
112 foreach ($fields as $f_id) {
115 $row[] = $usr_row->getFirstname() . $usr_row->getLastname();
118 $row[] = $usr_row->getLogin();
121 $row[] = $usr_row->getOrgUs();
124 $row[] = $usr_row->getStatus();
126 case 'prg_completion_date':
127 $row[] = $usr_row->getCompletionDate();
129 case 'prg_completion_by':
130 $row[] = $usr_row->getCompletionBy();
133 $row[] = $usr_row->getPointsReachable();
135 case 'points_required':
136 $row[] = $usr_row->getPointsRequired();
138 case 'points_current':
139 $row[] = $usr_row->getPointsCurrent();
141 case 'prg_custom_plan':
142 $row[] = $usr_row->getCustomPlan();
144 case 'prg_belongs_to':
145 $row[] = $usr_row->getBelongsTo();
147 case 'prg_assign_date':
148 $row[] = $usr_row->getAssignmentDate();
150 case 'prg_assigned_by':
151 $row[] = $usr_row->getAssignmentBy();
154 $row[] = $usr_row->getDeadline();
156 case 'prg_expiry_date':
157 $row[] = $usr_row->getExpiryDate();
160 $row[] = $usr_row->getValidity();
163 $row[] = $usr_row->getUserActive();
166 $row[] = $usr_row->getUserData($f_id);
182 if ($this->writer instanceof
ilExcel) {
189 foreach ($values as $val) {
190 $this->writer->addColumn($val);
192 $this->writer->addRow();
197 $this->current_row++;
199 foreach ($values as $val) {
200 $this->writer->setCell($this->current_row, $current_col, $val);
writeData(array $fields, array $data)
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
writeCSVRow(array $values)
while($session_entry=$r->fetchRow(ilDBConstants::FETCHMODE_ASSOC)) return null
This file is part of ILIAS, a powerful learning management system published by ILIAS open source e-Le...
create(int $type, string $filename)
__construct(protected int $prg_ref_id, protected int $prg_obj_id, protected ilStudyProgrammeUserTable $prg_user_table, protected ilUserFormSettings $settings, protected ilLanguage $lng, protected DataFactory $data_factory)
export assignments of PRG
ilStudyProgrammeUserTable provides a flattened list of progresses at a programme-node.
writeExcelRow(array $values)