Project

General

Profile

Revision 01f36513

Added by Assos Assos about 6 years ago

Weekly update of contrib modules

View differences:

drupal7/sites/all/modules/webform/includes/webform.report.inc
138 138
 * @return string
139 139
 *   Pager.
140 140
 */
141
function theme_webform_results_per_page($variables) {
141
function theme_webform_results_per_page(array $variables) {
142 142
  $total_count = $variables['total_count'];
143 143
  $pager_count = $variables['pager_count'];
144 144
  $output = '';
......
338 338
 * @param $batch_size
339 339
 *   The number of submissions to be processed. NULL means all submissions.
340 340
 *
341
 * @return
341
 * @return int
342 342
 *   The number of submissions processed.
343 343
 */
344 344
function webform_results_clear($nid, $batch_size = NULL) {
......
700 700
          form_error($element['end_date'], t('End date range is not in a valid format.'));
701 701
        }
702 702
        elseif ($start_date !== FALSE && $start_date > $end_date) {
703
          form_error($element['end_date'], t('End date range must not be before the Start date..'));
703
          form_error($element['end_date'], t('End date range must not be before the Start date.'));
704 704
        }
705 705
      }
706 706
      break;
......
898 898
 * Returns a temporary export filename.
899 899
 */
900 900
function _webform_export_tempname() {
901
  return drupal_tempnam(variable_get('webform_export_path', 'temporary://'), 'webform_');
901
  $webform_export_path = variable_get('webform_export_path', 'temporary://');
902

  
903
  // If the directory does not exist, create it.
904
  file_prepare_directory($webform_export_path, FILE_CREATE_DIRECTORY | FILE_MODIFY_PERMISSIONS);
905
  return drupal_tempnam($webform_export_path, 'webform_');
902 906
}
903 907

  
904 908
/**
......
992 996
 * @return array
993 997
 *   A Batch API array suitable to pass to batch_set().
994 998
 */
995
function webform_results_export_batch($node, $format = 'delimited', $options = array()) {
999
function webform_results_export_batch($node, $format = 'delimited', array $options = array()) {
996 1000
  $defaults = webform_results_download_default_options($node, $format);
997 1001
  $options += $defaults;
998 1002
  $options['range'] += $defaults['range'];
......
1023 1027
 *   A list of options that define the output format. These are generally passed
1024 1028
 *   through from the GUI interface.
1025 1029
 */
1026
function webform_results_download_headers($node, $options) {
1030
function webform_results_download_headers($node, array $options) {
1027 1031
  module_load_include('inc', 'webform', 'includes/webform.components');
1028 1032
  $submission_information = webform_results_download_submission_information($node, $options);
1029 1033

  
......
1070 1074
/**
1071 1075
 * Returns rows of downloadable webform data.
1072 1076
 *
1073
 * @deprecated This function is scheduled to be removed in webform 7.x-5.x.
1074
 *
1075 1077
 * @param $node
1076 1078
 *   The webform node on which to generate the analysis.
1077 1079
 * @param array $options
......
1086 1088
 *   An array of rows built according to the provided $serial_start and
1087 1089
 *   $pager_count variables. Note that the current page number is determined
1088 1090
 *   by the super-global $_GET['page'] variable.
1091
 *
1092
 * @deprecated This function is scheduled to be removed in webform 7.x-5.x.
1089 1093
 */
1090
function webform_results_download_rows($node, $options, $serial_start = 0, &$last_sid = NULL) {
1094
function webform_results_download_rows($node, array $options, $serial_start = 0, &$last_sid = NULL) {
1091 1095
  // Get all the required submissions for the download.
1092 1096
  $filters['nid'] = $node->nid;
1093 1097
  if (isset($options['sids'])) {
......
1126 1130
 *   $pager_count variables. Note that the current page number is determined
1127 1131
 *   by the super-global $_GET['page'] variable.
1128 1132
 */
1129
function webform_results_download_rows_process($node, $options, $serial_start, $submissions) {
1133
function webform_results_download_rows_process($node, array $options, $serial_start, array $submissions) {
1130 1134
  module_load_include('inc', 'webform', 'includes/webform.components');
1131 1135

  
1132 1136
  $submission_information = webform_results_download_submission_information($node, $options);
......
1279 1283
 *   The webform node on which to generate the analysis.
1280 1284
 * @param string $format
1281 1285
 *   The export format being used.
1282
 * @param array $options
1283
 *   A list of options that define the output format. These are generally passed
1284
 *   through from the GUI interface.
1285 1286
 *
1286 1287
 * @return array
1287 1288
 *   Option for creating downloadable version of the webform data.
......
1406 1407
/**
1407 1408
 * Batch API callback; Write the opening byte in the export file.
1408 1409
 */
1409
function webform_results_batch_bof($node, $format = 'delimited', $options = array(), &$context) {
1410
function webform_results_batch_bof($node, $format = 'delimited', $options = array(), &$context = NULL) {
1410 1411
  module_load_include('inc', 'webform', 'includes/webform.export');
1411 1412

  
1412 1413
  $exporter = webform_export_create_handler($format, $options);
......
1421 1422
/**
1422 1423
 * Batch API callback; Write the headers of the export to the export file.
1423 1424
 */
1424
function webform_results_batch_headers($node, $format = 'delimited', $options = array(), &$context) {
1425
function webform_results_batch_headers($node, $format = 'delimited', $options = array(), &$context = NULL) {
1425 1426
  module_load_include('inc', 'webform', 'includes/webform.export');
1426 1427

  
1427 1428
  $exporter = webform_export_create_handler($format, $options);
......
1448 1449
/**
1449 1450
 * Batch API callback; Write the rows of the export to the export file.
1450 1451
 */
1451
function webform_results_batch_rows($node, $format = 'delimited', $options = array(), &$context) {
1452
function webform_results_batch_rows($node, $format = 'delimited', $options = array(), &$context = NULL) {
1452 1453
  module_load_include('inc', 'webform', 'includes/webform.export');
1453 1454

  
1454 1455
  // Initialize the sandbox if this is the first execution of the batch
......
1508 1509
/**
1509 1510
 * Batch API callback; Write the closing bytes in the export file.
1510 1511
 */
1511
function webform_results_batch_eof($node, $format = 'delimited', $options = array(), &$context) {
1512
function webform_results_batch_eof($node, $format = 'delimited', $options = array(), &$context = NULL) {
1512 1513
  module_load_include('inc', 'webform', 'includes/webform.export');
1513 1514

  
1514 1515
  $exporter = webform_export_create_handler($format, $options);
......
1529 1530
/**
1530 1531
 * Batch API callback; Do any last processing on the finished export.
1531 1532
 */
1532
function webform_results_batch_post_process($node, $format = 'delimited', $options = array(), &$context) {
1533
function webform_results_batch_post_process($node, $format = 'delimited', $options = array(), &$context = NULL) {
1533 1534
  module_load_include('inc', 'webform', 'includes/webform.export');
1534 1535

  
1535 1536
  $context['results']['node'] = $node;
......
1715 1716
 *       array of values
1716 1717
 *
1717 1718
 * @return string
1719
 *   The rendered table.
1718 1720
 */
1719 1721
function theme_webform_analysis_component_basic($variables) {
1720 1722
  $data = $variables['data'];
......
1915 1917
 *   the submissions.
1916 1918
 *
1917 1919
 * @return QueryAlterableInterface
1920
 *   The query object.
1918 1921
 */
1919
function webform_download_sids_query($nid, $range_options, $uid = NULL) {
1922
function webform_download_sids_query($nid, array $range_options, $uid = NULL) {
1920 1923
  $query = db_select('webform_submissions', 'ws')
1921 1924
    ->condition('nid', $nid)
1922 1925
    ->addTag('webform_download_sids');
......
1970 1973
          $end_time += 86399;
1971 1974
        }
1972 1975
        $query->condition($date_field, $end_time, '<=');
1973
      };
1976
      }
1974 1977
      $query->orderBy($date_field, 'ASC');
1975 1978
      break;
1976 1979
  }
......
2000 2003
 * @param $uid
2001 2004
 *   The user account ID for which to retrieve download information.
2002 2005
 *
2003
 * @return
2006
 * @return array|false
2004 2007
 *   An array of download information or FALSE if this user has never downloaded
2005 2008
 *   results for this particular node.
2006 2009
 */
......
2030 2033
 * @param string $completion_type
2031 2034
 *   The completion type, either "finished", "draft", or "all".
2032 2035
 *
2033
 * @return
2036
 * @return int
2034 2037
 *   The submission ID that starts the latest sequence of submissions.
2035 2038
 */
2036 2039
function webform_download_latest_start_sid($nid, $latest_count, $completion_type = 'all') {
2037
  // TODO: Find a more efficient DBTNG query to retrieve this number.
2040
  // @todo: Find a more efficient DBTNG query to retrieve this number.
2038 2041
  $query = db_select('webform_submissions', 'ws')
2039 2042
    ->fields('ws', array('sid'))
2040 2043
    ->condition('nid', $nid)

Also available in: Unified diff