diff --git a/includes/webform.export.inc b/includes/webform.export.inc index efd6b4d..91204a7 100644 --- a/includes/webform.export.inc +++ b/includes/webform.export.inc @@ -102,9 +102,6 @@ class webform_exporter_delimited extends webform_exporter { if ($this->delimiter == '\t') { $this->delimiter = "\t"; } - if ($options['compress'] == 1) { - $this->compress = 1; - } } function bof(&$file_handle) { @@ -138,11 +135,8 @@ class webform_exporter_delimited extends webform_exporter { function set_headers($filename) { parent::set_headers($filename); - if ($this->compress == 1) { - $extension = 'zip'; - $content_type = 'application/octet-stream'; - } - elseif ($this->delimiter == "\t") { + // Convert tabs. + if ($this->delimiter == "\t") { $extension = 'tsv'; $content_type = 'text/tab-separated-values'; } @@ -168,14 +162,9 @@ class webform_exporter_excel extends webform_exporter_delimited { } function set_headers($filename) { - if ($this->compress == 1) { - parent::set_headers($filename); - } - else { - drupal_set_header("Content-Type: application/x-msexcel"); - drupal_set_header("Content-Disposition: attachment; filename=$filename.xls"); - drupal_set_header("Pragma: public"); - drupal_set_header("Cache-Control: max-age=0"); - } + drupal_set_header('Content-Type: application/x-msexcel'); + drupal_set_header("Content-Disposition: attachment; filename=$filename.xls"); + drupal_set_header('Pragma: public'); + drupal_set_header('Cache-Control: max-age=0'); } } diff --git a/includes/webform.report.inc b/includes/webform.report.inc index 29f3486..be2bf8c 100644 --- a/includes/webform.report.inc +++ b/includes/webform.report.inc @@ -330,17 +330,6 @@ function webform_results_download_form(&$form_state, $node) { ), ); - $form['compress'] = array( - '#type' => 'checkbox', - '#title' => t('Include files'), - '#description' => t('All files in the webform results will be bundled in a .zip archive along with the exported results.'), - ); - - if (!class_exists('ZipArchive')) { - $form['compress']['#description'] = t('Unable to load ZipArchive class. This usually happens because the PHP interpreter is not compiled with zlib.'); - $form['compress']['#disabled'] = TRUE; - } - $form['select_options'] = array( '#type' => 'fieldset', '#title' => t('Select list options'), @@ -507,7 +496,6 @@ function webform_results_download_form_submit(&$form, &$form_state) { 'components' => array_keys(array_filter($form_state['values']['components'])), 'select_keys' => $form_state['values']['select_keys'], 'select_format' => $form_state['values']['select_format'], - 'compress' => $form_state['values']['compress'], 'range_type' => $form_state['values']['range_type'], 'sids' => $sids, ); @@ -718,9 +706,6 @@ function webform_results_download($node, $format = 'delimited', $options = array $raw_data = isset($submission->data[$cid]['value']) ? $submission->data[$cid]['value'] : NULL; if (webform_component_feature($component['type'], 'csv')) { $data = webform_component_invoke($component['type'], 'csv_data', $component, $options, $raw_data); - if ($component['type'] == 'file') { - $attached_files[] = webform_get_file($raw_data[0])->filepath; - } if (is_array($data)) { $row = array_merge($row, array_values($data)); } @@ -743,28 +728,7 @@ function webform_results_download($node, $format = 'delimited', $options = array $export_name = _webform_safe_name($node->title); $exporter->set_headers($export_name); - - if ($options['compress'] == 1) { - $zh = new ZipArchive(); - $zipfile = variable_get('file_directory_temp', file_directory_temp()) . '/webform' . time() . '.zip'; - $zh->open($zipfile, ZIPARCHIVE::CREATE); - foreach ($attached_files as $file) { - if (!empty($file)) { - $zh->addFile(realpath($base_path . $file), basename($file)); - } - } - $extension = '.csv'; - if ($exporter->delimiter == "\t") { - $extension = '.tsv'; - } - $zh->addFile(realpath($file_name), $export_name . $extension); - $zh->close(); - @readfile($zipfile); - @unlink($zipfile); - } - else { - @readfile($file_name); // The @ makes it silent. - } + @readfile($file_name); // The @ makes it silent. @unlink($file_name); // Clean up, the @ makes it silent. // Update user last downloaded sid if required.