24include_once(
'Services/PrivacySecurity/classes/class.ilExportFieldsInfo.php');
25include_once(
'./Services/Membership/classes/Export/class.ilMemberExport.php');
26include_once(
'Modules/Course/classes/class.ilFSStorageCourse.php');
27include_once(
'Modules/Group/classes/class.ilFSStorageGroup.php');
28include_once(
'Modules/Course/classes/Export/class.ilCourseDefinedFieldDefinition.php');
29include_once(
'Services/User/classes/class.ilUserDefinedFields.php');
30include_once(
'Services/User/classes/class.ilUserFormSettings.php');
67 $this->lng->loadLanguageModule(
'ps');
68 $this->ref_id = $a_ref_id;
69 $this->obj_id = $ilObjDataCache->lookupObjId($this->ref_id);
85 global $ilAccess,$rbacsystem;
87 include_once(
'Services/PrivacySecurity/classes/class.ilPrivacySettings.php');
91 $this->ctrl->returnToParent($this);
94 $next_class = $this->ctrl->getNextClass($this);
95 $cmd = $this->ctrl->getCmd();
119 include_once
'Services/Form/classes/class.ilPropertyFormGUI.php';
121 $form->setFormAction($this->ctrl->getFormAction($this));
122 $form->setTitle($this->lng->txt(
'ps_export_settings'));
124 if((
bool)$a_is_excel)
126 $form->addCommandButton(
'exportExcel', $this->lng->txt(
'ps_export_excel'));
130 $form->addCommandButton(
'export', $this->lng->txt(
'ps_perform_export'));
132 $form->addCommandButton(
'show', $this->lng->txt(
'cancel'));
136 $roles->addOption(
new ilCheckboxOption($this->lng->txt(
'ps_export_admin'),
'admin'));
137 if($this->type ==
'crs')
139 $roles->addOption(
new ilCheckboxOption($this->lng->txt(
'ps_export_tutor'),
'tutor'));
141 $roles->addOption(
new ilCheckboxOption($this->lng->txt(
'ps_export_member'),
'member'));
142 $roles->addOption(
new ilCheckboxOption($this->lng->txt(
'ps_export_sub'),
'subscribers'));
143 $roles->addOption(
new ilCheckboxOption($this->lng->txt(
'ps_export_wait'),
'waiting_list'));
144 $form->addItem($roles);
146 $current_roles = array();
147 foreach(array(
'admin',
'tutor',
'member',
'subscribers',
'waiting_list') as $role)
149 if($this->exportSettings->enabled($role))
151 $current_roles[] = $role;
154 $roles->setValue($current_roles);
157 $current_udata = array();
159 $form->addItem($udata);
162 $this->fields_info->sortExportFields();
163 foreach($this->fields_info->getFieldsInfo() as $field => $exportable)
170 if($this->exportSettings->enabled($field))
172 $current_udata[] = $field;
179 $field =
'udf_'.$field_id;
181 if($this->exportSettings->enabled($field))
183 $current_udata[] = $field;
187 $udata->setValue($current_udata);
191 if(count($cdf_fields))
194 $form->addItem($cdf);
196 $current_cdf = array();
197 foreach($cdf_fields as $field_obj)
199 $field =
'cdf_'.$field_obj->getId();
201 if($this->exportSettings->enabled($field))
203 $current_cdf[] = $field;
207 $cdf->setValue($current_cdf);
211 include_once
'./Services/Booking/classes/class.ilBookingEntry.php';
214 $this->lng->loadLanguageModule(
'dateplaner');
215 $chours =
new ilCheckboxInputGUI($this->lng->txt(
'cal_ch_field_ch'),
'export_members[]');
216 $chours->setValue(
'consultation_hour');
217 $chours->setChecked($this->exportSettings->enabled(
'consultation_hour'));
218 $form->addItem($chours);
230 $this->tpl->setContent($a_form->getHTML());
239 $this->tpl->setContent($a_form->getHTML());
252 $ilToolbar->addButton($this->lng->txt(
'ps_perform_export'),
253 $this->ctrl->getLinkTarget($this,
"initCSV"));
254 $ilToolbar->addButton($this->lng->txt(
'ps_export_excel'),
255 $this->ctrl->getLinkTarget($this,
"initExcel"));
263 $incoming =
$_POST[
'export_members'];
264 if(is_array($incoming))
266 foreach($incoming as $id)
268 $settings[$id] =
true;
274 $this->exportSettings->set($settings);
275 $this->exportSettings->store();
291 $filename = time().
'_participant_export_csv_'.$this->obj_id.
'.csv';
292 $this->fss_export->addMemberExportFile($this->
export->getCSVString(),
$filename);
294 $this->ctrl->redirect($this,
'show');
301 $filename = time().
'_participant_export_xls_'.$this->obj_id.
'.xls';
302 $this->fss_export->initMemberExportDirectory();
303 $filepath = $this->fss_export->getMemberExportDirectory().DIRECTORY_SEPARATOR.$filename;
306 $this->
export->setFilename($filepath);
309 $this->ctrl->redirect($this,
'show');
321 foreach($this->fss_export->getMemberExportFiles() as
$file)
325 $content = $this->fss_export->getMemberExportFile(
$_SESSION[
'member_export_filename']);
342 include_once
'Services/Membership/classes/Export/class.ilMemberExportFileTableGUI.php';
344 $this->tpl->setContent(
$tbl->getHTML());
356 $hash = trim(
$_GET[
'fl']);
359 $this->ctrl->redirect($this,
'show');
362 foreach($this->fss_export->getMemberExportFiles() as
$file)
364 if(md5(
$file[
'name']) == $hash)
366 $contents = $this->fss_export->getMemberExportFile(
$file[
'timest'].
'_participant_export_'.
367 $file[
'type'].
'_'.$this->obj_id.
'.'.
$file[
'type']);
369 switch(
$file[
'type'])
374 date(
'Y_m_d_H-i'.
$file[
'timest']).
'_member_export_'.$this->obj_id.
'.xls',
375 'application/vnd.ms-excel'
403 $this->ctrl->redirect($this,
'show');
406 include_once(
'./Services/Utilities/classes/class.ilConfirmationGUI.php');
408 $confirmation_gui->setFormAction($this->ctrl->getFormAction($this));
409 $confirmation_gui->setHeaderText($this->lng->txt(
'info_delete_sure') );
410 $confirmation_gui->setCancel($this->lng->txt(
'cancel'),
'show');
411 $confirmation_gui->setConfirm($this->lng->txt(
'delete'),
'deleteExportFile');
414 foreach($this->fss_export->getMemberExportFiles() as
$file)
421 $confirmation_gui->addItem(
"id[]", md5(
$file[
'name']),
422 strtoupper(
$file[
'type']).
' - '.
426 $this->tpl->setContent($confirmation_gui->getHTML());
440 $this->ctrl->redirect($this,
'show');
444 foreach($this->fss_export->getMemberExportFiles() as
$file)
451 $this->fss_export->deleteMemberExportFile(
$file[
'timest'].
'_participant_export_'.
$file[
'type'].
'_'.$this->obj_id.
'.'.
$file[
'type']);
455 $this->ctrl->redirect($this,
'show');
465 if($this->type ==
'crs')
469 if($this->type ==
'grp')
static hasObjectBookingEntries($a_obj_id, $a_usr_id)
Check if object has assigned consultation hour appointments.
This class represents an option in a checkbox group.
Confirmation screen class.
static _getFields($a_container_id, $a_sort=IL_CDF_SORT_NAME)
Get all fields of a container.
static formatDate(ilDateTime $date)
Format a date @access public.
@classDescription Date and time handling
static _getInstanceByType($a_type)
Get Singleton Instance.
Table presentation of membership export files.
deliverData()
Deliver Data.
downloadExportFile()
Download export file.
deleteExportFile()
Delete member export files.
show()
Show list of export files.
export()
Export Create member export file and store it in data directory.
showFileList()
Show file list of available export files.
initSettingsForm($a_is_excel=false)
initExcel(ilPropertyFormGUI $a_form=null)
confirmDeleteExportFile()
Confirm deletion of export files.
initCSV(ilPropertyFormGUI $a_form=null)
initFileSystemStorage()
Init file object.
__construct($a_ref_id)
Constructor.
executeCommand()
Execute Command.
Class for generation of member export files.
static _lookupType($a_id, $a_reference=false)
lookup object type
static _getInstance()
Get instance of ilPrivacySettings.
static _getInstance()
Get instance.
static sendSuccess($a_info="", $a_keep=false)
Send Success Message to Screen.
static sendFailure($a_info="", $a_keep=false)
Send Failure Message to Screen.
static deliverData($a_data, $a_filename, $mime="application/octet-stream", $charset="")
deliver data for download via browser.
$GLOBALS['PHPCAS_CLIENT']
This global variable is used by the interface class phpCAS.