--- components/captcha.inc	Sun Jun 17 13:57:59 2007
+++ components/captcha.inc	Tue May 29 05:00:32 2007
@@ -142,7 +142,7 @@
  * @param $component An array of information describing the component, directly correlating to the webform_component database schema
  * @returns Textual output formatted for human reading.
  **/
-function _webform_submission_display_captcha($component, $data, $enabled) {
+function _webform_submission_display_captcha($component, $data) {
   $form_item = array();
   return $form_item;
 }
--- components/date.inc	Sun Jun 17 13:58:39 2007
+++ components/date.inc	Wed Jun 13 02:47:20 2007
@@ -158,14 +158,14 @@
  * @param $component An array of information describing the component, directly correlating to the webform_component database schema
  * @returns Textual output formatted for human reading.
  **/
-function _webform_submission_display_date($data, $component, $enabled) {
+function _webform_submission_display_date($data, $component) {
   $form_item = _webform_render_date($component);
   $form_item['month']['#default_value'] = $data['value']['0'];
   $form_item['day']['#default_value']   = $data['value']['1'];
   $form_item['year']['#default_value']  = $data['value']['2'];
-  $form_item['month']['#disabled'] = !$enabled;
-  $form_item['day']['#disabled'] = !$enabled;
-  $form_item['year']['#disabled'] = !$enabled;
+  $form_item['month']['#attributes']    = array("disabled" => "disabled");
+  $form_item['day']['#attributes']      = array("disabled" => "disabled");
+  $form_item['year']['#attributes']     = array("disabled" => "disabled");
   return $form_item;
 }
 
--- components/email.inc	Sun Jun 17 13:56:09 2007
+++ components/email.inc	Wed Jun 13 04:27:38 2007
@@ -96,10 +96,10 @@
  * @param $component An array of information describing the component, directly correlating to the webform_component database schema
  * @returns Textual output formatted for human reading.
  **/
-function _webform_submission_display_email($data, $component, $enabled) {
+function _webform_submission_display_email($data, $component) {
   $form_item = _webform_render_email($component);
   $form_item['#default_value'] = $data['value']['0'];
-  $form_item['#disabled'] = !$enabled;
+  $form_item['#attributes']    = array("disabled" => "disabled");
   return $form_item;
 }
 
--- components/file.inc	Sun Jun 17 13:54:30 2007
+++ components/file.inc	Wed Jun 13 01:58:36 2007
@@ -290,7 +290,7 @@
  * @param $component An array of information describing the component, directly correlating to the webform_component database schema
  * @returns Textual output formatted for human reading.
  **/
-function _webform_submission_display_file($data, $component, $enabled) {
+function _webform_submission_display_file($data, $component) {
   $filedata = unserialize($data['value'][0]);
   $form_item = _webform_render_file($component);
   $form_item['#type'] = 'textfield';
@@ -298,7 +298,7 @@
   if ($filedata['filename']) {
     $form_item['#suffix'] = ' <a href="'. base_path() . $filedata['filepath'] .'">Download '. $filedata['filename'] .'</a><br /><br />';
   }
-  $form_item['#disabled'] = !$enabled;
+  $form_item['#attributes'] = array("disabled" => "disabled");
   return $form_item;
 }
 
--- components/hidden.inc	Sun Jun 17 13:53:59 2007
+++ components/hidden.inc	Mon May 28 00:45:20 2007
@@ -50,12 +50,12 @@
  * @param $component An array of information describing the component, directly correlating to the webform_component database schema
  * @returns Textual output formatted for human reading.
  **/
-function _webform_submission_display_hidden($data, $component, $enabled) {
+function _webform_submission_display_hidden($data, $component) {
   $form_item = _webform_render_hidden($component);
   $form_item['#value']         = $data['value']['0'];
   $form_item['#type']          = 'textfield';
   $form_item['#title']         = htmlspecialchars($component['name'], ENT_QUOTES) ." (hidden)";
-  $form_item['#disabled'] = !$enabled;
+  $form_item['#attributes']    = array("disabled" => "disabled");
   return $form_item;
 }
 
--- components/select.inc	Sun Jun 17 13:51:00 2007
+++ components/select.inc	Mon Jun 11 15:07:12 2007
@@ -163,7 +163,7 @@
  * @param $component An array of information describing the component, directly correlating to the webform_component database schema
  * @returns Textual output formatted for human reading.
  **/
-function _webform_submission_display_select($data, $component, $enabled) {
+function _webform_submission_display_select($data, $component) {
   $form_item = _webform_render_select($component);
   if ($component['extra']['multiple'] == 'Y') {
     // Set the value as an array
@@ -190,7 +190,7 @@
       }
     }
   }
-  $form_item['#disabled'] = !$enabled;
+  $form_item['#attributes'] = array("disabled" => "disabled");
   return $form_item;
 }
 
--- components/textarea.inc	Sun Jun 17 13:50:21 2007
+++ components/textarea.inc	Tue May 29 05:00:32 2007
@@ -83,10 +83,10 @@
  * @param $component An array of information describing the component, directly correlating to the webform_component database schema
  * @returns Textual output formatted for human reading.
  **/
-function _webform_submission_display_textarea($data, $component, $enabled) {
+function _webform_submission_display_textarea($data, $component) {
   $form_item = _webform_render_textarea($component);
   $form_item['#default_value'] = $data['value']['0'];
-  $form_item['#disabled'] = !$enabled;
+  $form_item['#attributes']    = array("disabled" => "disabled");
   return $form_item;
 }
 
--- components/textfield.inc	Sun Jun 17 13:46:23 2007
+++ components/textfield.inc	Wed Jun 13 04:25:58 2007
@@ -84,10 +84,10 @@
  * @param $component An array of information describing the component, directly correlating to the webform_component database schema
  * @returns Textual output formatted for human reading.
  **/
-function _webform_submission_display_textfield($data, $component, $enabled) {
+function _webform_submission_display_textfield($data, $component) {
   $form_item = _webform_render_textfield($component);
   $form_item['#default_value'] = $data['value']['0'];
-  $form_item['#disabled'] = !$enabled;
+  $form_item['#disabled'] = TRUE;
   return $form_item;
 }
 
--- components/time.inc	Sun Jun 17 14:00:14 2007
+++ components/time.inc	Tue May 29 05:00:32 2007
@@ -149,12 +149,12 @@
  * @param $component An array of information describing the component, directly correlating to the webform_component database schema
  * @returns Textual output formatted for human reading.
  **/
-function _webform_submission_display_time($data, $component, $enabled) {
+function _webform_submission_display_time($data, $component) {
   $form_item = _webform_render_time($component);
   $form_item['minute']['#default_value']   = $data['value']['1'];
-  $form_item['minute']['#disabled'] = !$enabled;
-  $form_item['hour']['#disabled'] = !$enabled;
-  $form_item['ampm']['#disabled'] = !$enabled;
+  $form_item['minute']['#attributes']      = array("disabled" => "disabled");
+  $form_item['hour']['#attributes']        = array("disabled" => "disabled");
+  $form_item['ampm']['#attributes']        = array("disabled" => "disabled");
 
    // Match the hourly data to the hour format
   $timestamp = strtotime($data['value']['0'] .":". $data['value']['1'] . $data['value']['2']);
--- webform.inc	Sun Jun 17 02:47:11 2007
+++ webform.inc	Tue Jun 12 05:02:44 2007
@@ -143,7 +143,7 @@
 
   $submission = array();
 
-  $query = 'SELECT sd.nid, sd.sid, s.submitted, s.uid, sd.cid, sd.no, sd.data '.
+  $query = 'SELECT sd.nid, sd.sid, s.submitted, sd.cid, sd.no, sd.data '. 
            'FROM {webform_submitted_data} as sd '.
            'LEFT JOIN {webform_submissions} as s on (sd.sid = s.sid) '.
            'WHERE sd.sid = %d AND s.nid = %d';
@@ -154,7 +154,6 @@
     $row = db_fetch_array($res);
     $submission['nid'] = $row['nid'];
     $submission['sid'] = $row['sid'];
-    $submission['uid'] = $row['uid'];
     $submission['submitted'] = $row['submitted'];
 
     while ($row) {
--- webform.module	Sun Jun 17 23:12:01 2007
+++ webform.module	Wed Jun 13 02:47:20 2007
@@ -4,7 +4,7 @@
 
 /**
  * This module provides a simple way to create forms and questionnaires.
- * The development of this module was sponsered by ?F Industri AB, Open
+ * The development of this module was sponsered by F Industri AB, Open
  * Source City and Karlstad University Library.
  *
  * @author Pontus Ullgren <ullgren@user.sourceforge.net>
@@ -63,7 +63,7 @@
 }
 
 function webform_perm() {
-  return array("create webforms", "edit own webforms", "edit webforms", "access webform results", "clear webform results", "edit own webform submissions", "edit webform submissions", "use PHP for additional processing");
+  return array("create webforms", "edit own webforms", "edit webforms", "access webform results", "clear webform results", "use PHP for additional processing");
 }
 
 /**
@@ -85,8 +85,6 @@
   switch ($op) {
     case "create":
       return user_access("create webforms");
-    case "edit":
-    	return user_access("edit webform submissions") || (user_access("edit own webform submissions") && ($user->uid == $node->uid));
     case "update":
     case "delete":
       return user_access("edit webforms") || (user_access("edit own webforms") && ($user->uid == $node->uid));
@@ -317,12 +315,6 @@
                        'access' => user_access('clear webform results'),
                        'weight' => 8,
                        'type' => MENU_LOCAL_TASK);
-      $items[]= array('path' => 'node/'. $node->nid .'/results/edit', 'title' => t('webform'),
-                       'callback' => 'webform_results',
-                       //access checking is done in the function called by the webform_results function,
-                       //so just grant access here to avoid redundant code...
-                       'access' => true,
-                       'type' => MENU_CALLBACK);
       $items[]= array('path' => 'node/'. $node->nid .'/results/delete', 'title' => t('webform'),
                        'callback' => 'webform_results',
                        'access' => user_access('clear webform results'),
@@ -1089,41 +1081,12 @@
   return $node;
 } // end webform_view
 
-// Display the webform for editing existing submission data.
-function webform_submission_edit(&$node, $sid) {
-  global $user;
-
-  include_once (drupal_get_path('module', 'webform')."/webform.inc");
-
-  $submission = array();
-  $node->webformcomponents = _webform_components_decode($node->webformcomponents);
-  $submission = _webform_fetch_submission($sid, $node->nid);
-  if ($sid && is_numeric($sid)) {
-    if (user_access("edit webform submissions") || (user_access("edit own webform submissions") && ($user->uid == $submission['uid']))) {
-      drupal_set_title('Submission #'.$sid);
-      $node->body = "";
-
-      global $_webform_form_list;
-      $_webform_form_list[] = $node->nid;
-      return drupal_get_form('webform_client_form_'. $node->nid, $node, $submission, null, true);
-    } else {
-      $sid = NULL; // This user is not allowed to access a submitted node. Deny the attempt without alert.
-      watchdog('webform', t('Unauthorized webform access attempt', array ('%name' => "<em>$user->name</em>")), WATCHDOG_WARNING); // and log the attempt
-      return drupal_access_denied();
-    }
-  }
-
-
-//  return drupal_get_form('webform_client_form', $node, $submission, null, true);
-} // end webform_submission_edit
-
-
 /**
  * Client form generation function. If this is displaying an existing
  * submission, pass in the $submission variable with the contents of the
  * submission to be displayed.
  */
-function webform_client_form(&$node, $submission = array(), $form_values = NULL, $enabled = false) {
+function webform_client_form(&$node, $submission = array(), $form_values = NULL) {
   global $user;
 
   _webform_load_components(); // Load all the components
@@ -1160,7 +1123,7 @@
     $page_count = 1;
     _webform_components_tree_build($node->webformcomponents, $component_tree, 0, $page_count);
 
-    if ((!$preview && empty($submission)) || ($enabled)) {
+    if (!$preview && empty($submission)) {
       if ($page_count > 1) {
         $next_page = t('Next Page >');
         $prev_page = t('< Previous Page');
@@ -1220,10 +1183,10 @@
 
     // Recursively add components to the form
     foreach ($component_tree['children'] as $cid => $component) {
-      _webform_client_form_add_component($cid, $component, $form['submitted'], $form, $submission, $page_num, $enabled);
+      _webform_client_form_add_component($cid, $component, $form['submitted'], $form, $submission, $page_num);
     }
     // Do not display the submit button if this is a preview or submission view
-    if ((!$preview && empty($submission)) || ($enabled)) {
+    if (!$preview && empty($submission)) {
       // Additional hidden elements
       // Email subject and sender
       $form['details']['email_subject'] = array(
@@ -1242,26 +1205,20 @@
         '#type'      => 'value',
         '#value'     => $node->nid,
       );
-      // set this flag to be able to determine if the displayed submission
-      // is a new one or an exisiting one being updated
-      $form['details']['sid'] = array(
-        '#type'      => 'value',
-        '#value'     => $submission['sid'],
-      );
     }
   }
 
   return $form;
 }
 
-function _webform_client_form_add_component($cid, $component, &$parent_fieldset, &$form, $submission, $page_num, $enabled) {
+function _webform_client_form_add_component($cid, $component, &$parent_fieldset, &$form, $submission, $page_num) {
   // Load with submission information if necessary
   if (!empty($submission)) {
     // This component is display only, with the value set according information
     // previously submitted in the submission numbered $sid_to_display
     $display_function = "_webform_submission_display_". $component['type'];
     if (function_exists($display_function)) {
-      $parent_fieldset[$component['form_key']] = $display_function($submission['data'][$cid], $component, $enabled);
+      $parent_fieldset[$component['form_key']] = $display_function($submission['data'][$cid], $component);
     }
   }
   else if ($component['page_num'] == $page_num) {
@@ -1277,7 +1234,7 @@
 
   if (is_array($component['children'])) {
     foreach ($component['children'] as $scid => $subcomponent) {
-      _webform_client_form_add_component($scid, $subcomponent, $parent_fieldset[$component['form_key']], $form, $submission, $page_num, $enabled);
+      _webform_client_form_add_component($scid, $subcomponent, $parent_fieldset[$component['form_key']], $form, $submission, $page_num);
     }
   }
 }
@@ -1374,13 +1331,8 @@
   }
 
   // Save the submission to the database
-  if (!$form_values['details']['sid']) {
-  	// no sid was found thus insert it in the datatabase
     $sid = _webform_save_submission($node, $form_values['submitted']);
-  } else {
-  	// sid was found thus update the existing sid in the datatbase
-    $sid = _webform_update_submission($node, $form_values['details']['sid'], $form_values['submitted']);
-  }
+  
   // Check if this form is sending an email
   if (isset ($node->email)) {
     $node->email = strip_tags($node->email);
@@ -1610,32 +1562,6 @@
   return $sid;
 }
 
-function _webform_update_submission($node, $sid, $submitted) {
-  global $user;
-
-  //update submission by first deleting and then readding it to the database
-  db_query("DELETE FROM {webform_submissions} WHERE sid = %d", $sid);
-  db_query("INSERT INTO {webform_submissions} (nid, sid, uid, submitted, remote_addr) "." VALUES (%d, %d, %d, %d, '%s')", $node->nid, $sid, $user->uid, time(), $_SERVER['REMOTE_ADDR']);
-
-  // update the submission data by first removing all this submissions data
-  db_query("DELETE FROM {webform_submitted_data} WHERE sid = %d", $sid);
-  // and then re-ad it to the database
-  foreach ($submitted as $cid => $value) {
-    if (is_array($value)) {
-      $delta = 0;
-      foreach ($value as $k => $v) {
-        db_query("INSERT INTO {webform_submitted_data} (nid, sid, cid, no, data) "."VALUES (%d, %d, %d, %d, '%s')", $node->nid, $sid, $cid, $delta, $v);
-        $delta++;
-      }
-    }
-    else {
-      db_query("INSERT INTO {webform_submitted_data} (nid, sid, cid, no, data) "."VALUES (%d, %d, %d, %d, '%s')", $node->nid, $sid, $cid, 0, $value);
-    }
-  }
-
-  return $sid;
-}
-
 function webform_page() {
   include_once (drupal_get_path('module', 'webform')."/webform.inc");
   return _webform_page();
@@ -1669,10 +1595,6 @@
         $sid= arg(4);
         $content= drupal_get_form('_webform_submission_delete', $nid, $sid);
         break;
-      case 'edit' :
-      	$sid= arg(4);
-      	$content= webform_submission_edit($node, $sid);
-      	break;
       case 'table' :
         $content= _webform_results_table($nid);
         break;
--- webform_report.inc	Sun Jun 17 02:00:31 2007
+++ webform_report.inc	Mon May 28 21:40:54 2007
@@ -42,7 +42,6 @@
  *   An array of all submissions for this webform.
  */
 function theme_webform_results_submissions($nid, $submissions) {
-global $user;
 
   // This header has to be generated seperately so we can add the SQL necessary
   // to sort the results.
@@ -58,12 +57,6 @@
       l(t('View'), "node/$nid", NULL, "sid=". $submission->sid, NULL, FALSE),
     );
 
-    if ((user_access("edit own webform submissions") && ($user->uid == $submission->uid)) || user_access("edit webform submissions")) {
-	  $row[] = l(t('Edit'),"node/$nid/results/edit/".$submission->sid, NULL, NULL, NULL, FALSE);
-	} else {
-	  $row[] = t('Edit');
-	}
-
     if (user_access('clear webform results')) {
       $row[] = l(t('Delete'), "node/$nid/results/delete/". $submission->sid, NULL, NULL, NULL, FALSE);
     }
