Index: webform.install
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.install,v
retrieving revision 1.60
diff -u -p -r1.60 webform.install
--- webform.install	17 Oct 2010 21:12:21 -0000	1.60
+++ webform.install	29 Nov 2010 22:33:34 -0000
@@ -85,6 +85,13 @@ function webform_schema() {
         'not null' => TRUE,
         'default' => -1,
       ),
+      'storage_model' => array(
+        'description' => 'The method for storing submissions. Defaults to "database".',
+        'type' => 'varchar',
+        'length' => 255,
+        'not null' => TRUE,
+        'default' => 'database',
+      ),
     ),
     'primary key' => array('nid'),
   );
@@ -456,3 +463,12 @@ function webform_update_7305() {
     db_change_field('webform', 'additional_submit', 'additional_submit', array('type' => 'text', 'not null' => FALSE));
   }
 }
+
+/**
+ * Add a new field for the storage model if one doesn't exist already.
+ */
+function webform_update_7306() {
+  if (!db_field_exists('webform', 'storage_model')) {
+    db_add_field('webform', 'storage_model', array('type' => 'varchar', 'length' => '255', 'not null' => TRUE, 'default' => 'database', 'initial' => 'database'));
+  }
+}
Index: webform.module
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/webform.module,v
retrieving revision 1.269
diff -u -p -r1.269 webform.module
--- webform.module	5 Nov 2010 01:05:53 -0000	1.269
+++ webform.module	29 Nov 2010 22:33:34 -0000
@@ -1012,6 +1012,7 @@ function webform_node_defaults() {
     'confirmation' => '',
     'confirmation_format' => filter_default_format(),
     'redirect_url' => '<confirmation>',
+    'storage_model' => 'database',
     'teaser' => 0,
     'block' => 0,
     'allow_draft' => 0,
@@ -2069,38 +2070,47 @@ function webform_client_form_submit($for
     'data' => webform_submission_data($node, $form_state['values']['submitted']),
   );
 
-  // Save the submission to the database.
-  if (empty($form_state['values']['details']['sid'])) {
-    // No sid was found thus insert it in the dataabase.
-    $form_state['values']['details']['sid'] = webform_submission_insert($node, $submission);
-    $form_state['values']['details']['is_new'] = TRUE;
-
-    // Set a cookie including the server's submission time.
-    // The cookie expires in the length of the interval plus a day to compensate for different timezones.
-    if (variable_get('webform_use_cookies', 0)) {
-      $cookie_name = 'webform-' . $node->nid;
-      $time = time();
-      setcookie($cookie_name . '[' . $time . ']', $time, $time + $node->webform['submit_interval'] + 86400);
-    }
-
-    // Save session information about this submission for anonymous users,
-    // allowing them to access or edit their submissions.
-    if (!$user->uid && user_access('access own webform submissions')) {
-      $_SESSION['webform_submission'][$form_state['values']['details']['sid']] = $node->nid;
+  // Check the storage_model
+  if ('database' == $node->webform['storage_model']) {
+    // Save the submission to the database.
+    if (empty($form_state['values']['details']['sid'])) {
+      // No sid was found thus insert it in the dataabase.
+      $form_state['values']['details']['sid'] = webform_submission_insert($node, $submission);
+      $form_state['values']['details']['is_new'] = TRUE;
+
+      // Set a cookie including the server's submission time.
+      // The cookie expires in the length of the interval plus a day to compensate for different timezones.
+      if (variable_get('webform_use_cookies', 0)) {
+        $cookie_name = 'webform-' . $node->nid;
+        $time = time();
+        setcookie($cookie_name . '[' . $time . ']', $time, $time + $node->webform['submit_interval'] + 86400);
+      }
+
+      // Save session information about this submission for anonymous users,
+      // allowing them to access or edit their submissions.
+      if (!$user->uid && user_access('access own webform submissions')) {
+        $_SESSION['webform_submission'][$form_state['values']['details']['sid']] = $node->nid;
+      }
+    }
+    else {
+      // Sid was found thus update the existing sid in the database.
+      $submission->sid = $form_state['values']['details']['sid'];
+      webform_submission_update($node, $submission);
+      $form_state['values']['details']['is_new'] = FALSE;
     }
-  }
-  else {
-    // Sid was found thus update the existing sid in the database.
-    $submission->sid = $form_state['values']['details']['sid'];
-    webform_submission_update($node, $submission);
-    $form_state['values']['details']['is_new'] = FALSE;
-  }
 
-  $sid = $form_state['values']['details']['sid'];
+    $sid = $form_state['values']['details']['sid'];
+  } else {
+  	$sid = NULL;
+  }
 
   // Check if this form is sending an email.
   if (!$is_draft && !$form_state['values']['details']['finished']) {
-    $submission = webform_get_submission($node->nid, $sid, TRUE);
+    // If we're storing the submission in the database, add it to the submissions static cache.
+    // Otherwise, the existing $submissions object will be used.
+    if ('database' == $node->webform['storage_model']) {
+      $submission = webform_get_submission($node->nid, $sid, TRUE);
+    }
 
     // Create a themed message for mailing.
     foreach ($node->webform['emails'] as $eid => $email) {
Index: includes/webform.pages.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/includes/webform.pages.inc,v
retrieving revision 1.18
diff -u -p -r1.18 webform.pages.inc
--- includes/webform.pages.inc	17 Oct 2010 18:53:13 -0000	1.18
+++ includes/webform.pages.inc	29 Nov 2010 22:33:34 -0000
@@ -115,6 +115,23 @@ function webform_configure_form($form, &
     '#parents' => array('submit_interval'),
   );
 
+  // Storage option settings.
+  $form['submission']['storage'] = array(
+    '#type' => 'item',
+    '#title' => t('Storage Model'),
+    '#theme' => 'webform_advanced_storage_form',
+    '#description' => t('Chose the storage model for this webform.  Default is to store the submissions in the main Drupal database. Choose "None" if you do not want to store submissions.'),
+  );
+  $form['submission']['storage']['storage_model'] = array(
+    '#type' => 'select',
+    '#options' => array(
+      'database' => t('Database'),
+      'none' => t('None')
+    ),
+    '#default_value' => $node->webform['storage_model'],
+    '#parents' => array('storage_model'),
+  );
+
   /* End Edit Form */
 
   /* Start per-role submission control */
@@ -263,6 +280,9 @@ function webform_configure_form_submit($
     $node->webform['submit_limit'] = $form_state['values']['submit_limit'];
     $node->webform['submit_interval'] = $form_state['values']['submit_interval'];
   }
+  
+  // Set the storage model.
+  $node->webform['storage_model'] = $form_state['values']['storage_model'];
 
   // Set submit notice.
   $node->webform['submit_notice'] = $form_state['values']['submit_notice'];
Index: includes/webform.report.inc
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/includes/webform.report.inc,v
retrieving revision 1.27
diff -u -p -r1.27 webform.report.inc
--- includes/webform.report.inc	29 Sep 2010 18:38:16 -0000	1.27
+++ includes/webform.report.inc	29 Nov 2010 22:33:34 -0000
@@ -167,7 +167,9 @@ function theme_webform_results_submissio
  * Preprocess function for webform-results-submissions.tpl.php
  */
 function template_preprocess_webform_results_submissions(&$vars) {
-  $vars['node'] = $vars['element']['#node'];
+  $node = $vars['element']['#node'];
+  $vars['node'] = $node;
+  $vars['storage_model'] = $node->webform['storage_model'];
   $vars['submissions'] = $vars['element']['#submissions'];
   $vars['table'] = $vars['element']['table'];
   $vars['total_count'] = $vars['element']['#total_count'];
Index: templates/webform-results-submissions.tpl.php
===================================================================
RCS file: /cvs/drupal-contrib/contributions/modules/webform/templates/webform-results-submissions.tpl.php,v
retrieving revision 1.2
diff -u -p -r1.2 webform-results-submissions.tpl.php
--- templates/webform-results-submissions.tpl.php	4 Sep 2010 21:18:06 -0000	1.2
+++ templates/webform-results-submissions.tpl.php	29 Nov 2010 22:33:34 -0000
@@ -22,7 +22,13 @@
   <?php print theme('webform_results_per_page', array('total_count' => $total_count, 'pager_count' => $pager_count)); ?>
   <?php print render($table); ?>
 <?php else: ?>
-  <?php print t('There are no submissions for this form. <a href="!url">View this form</a>.', array('!url' => url('node/' . $node->nid))); ?>
+  <?php if ($storage_model == 'database'): ?>
+    <?php print t('There are no submissions for this form. <a href="!url">View this form</a>.', array('!url' => url('node/' . $node->nid))); ?>
+  <?php elseif ($storage_model == 'none'): ?>
+    <?php print t('This form does not store results. <a href="!url">View this form</a>.', array('!url' => url('node/' . $node->nid))); ?>
+  <?php else: ?>
+    <?php print t('This form does not store results locally. <a href="!url">View this form</a>.', array('!url' => url('node/' . $node->nid))); ?>
+  <?php endif; ?>
 <?php endif; ?>
 
 
